2
0

601-net-support-layerscape.patch 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365
  1. From 2ed7bff3d1f2fa6c5f6eff0b2bd98deaa3dc18b0 Mon Sep 17 00:00:00 2001
  2. From: Yangbo Lu <[email protected]>
  3. Date: Mon, 25 Sep 2017 10:57:14 +0800
  4. Subject: [PATCH] net: support layerscape
  5. This is a integrated patch for layerscape net support.
  6. Signed-off-by: Madalin Bucur <[email protected]>
  7. Signed-off-by: Zhao Qiang <[email protected]>
  8. Signed-off-by: Camelia Groza <[email protected]>
  9. Signed-off-by: Madalin Bucur <[email protected]>
  10. Signed-off-by: Zhang Ying-22455 <[email protected]>
  11. Signed-off-by: Ramneek Mehresh <[email protected]>
  12. Signed-off-by: Jarod Wilson <[email protected]>
  13. Signed-off-by: Nikhil Badola <[email protected]>
  14. Signed-off-by: stephen hemminger <[email protected]>
  15. Signed-off-by: Arnd Bergmann <[email protected]>
  16. Signed-off-by: Yangbo Lu <[email protected]>
  17. ---
  18. drivers/base/devres.c | 66 +++++++++++++++
  19. drivers/base/soc.c | 66 +++++++++++++++
  20. drivers/net/bonding/bond_main.c | 10 +--
  21. drivers/net/dummy.c | 5 +-
  22. drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +--
  23. drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 6 +-
  24. drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 4 +-
  25. drivers/net/ethernet/atheros/alx/main.c | 6 +-
  26. drivers/net/ethernet/broadcom/b44.c | 5 +-
  27. drivers/net/ethernet/broadcom/bnx2.c | 5 +-
  28. drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +-
  29. drivers/net/ethernet/broadcom/tg3.c | 8 +-
  30. drivers/net/ethernet/brocade/bna/bnad.c | 6 +-
  31. drivers/net/ethernet/calxeda/xgmac.c | 5 +-
  32. drivers/net/ethernet/cavium/thunder/nicvf_main.c | 5 +-
  33. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 7 +-
  34. drivers/net/ethernet/cisco/enic/enic_main.c | 8 +-
  35. drivers/net/ethernet/ec_bhf.c | 4 +-
  36. drivers/net/ethernet/emulex/benet/be_main.c | 5 +-
  37. drivers/net/ethernet/hisilicon/hns/hns_enet.c | 6 +-
  38. drivers/net/ethernet/ibm/ehea/ehea_main.c | 5 +-
  39. drivers/net/ethernet/intel/e1000e/e1000.h | 4 +-
  40. drivers/net/ethernet/intel/e1000e/netdev.c | 5 +-
  41. drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +-
  42. drivers/net/ethernet/intel/i40e/i40e.h | 5 +-
  43. drivers/net/ethernet/intel/i40e/i40e_main.c | 18 ++--
  44. drivers/net/ethernet/intel/igb/igb_main.c | 10 +--
  45. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 +-
  46. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 +-
  47. drivers/net/ethernet/marvell/mvneta.c | 4 +-
  48. drivers/net/ethernet/marvell/mvpp2.c | 4 +-
  49. drivers/net/ethernet/marvell/sky2.c | 6 +-
  50. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 +-
  51. drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 +-
  52. drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +-
  53. drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +-
  54. drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 3 +-
  55. drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 9 +-
  56. drivers/net/ethernet/neterion/vxge/vxge-main.c | 4 +-
  57. .../net/ethernet/netronome/nfp/nfp_net_common.c | 6 +-
  58. drivers/net/ethernet/nvidia/forcedeth.c | 4 +-
  59. .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 10 +--
  60. drivers/net/ethernet/qlogic/qede/qede_main.c | 7 +-
  61. drivers/net/ethernet/qualcomm/emac/emac.c | 6 +-
  62. drivers/net/ethernet/realtek/8139too.c | 9 +-
  63. drivers/net/ethernet/realtek/r8169.c | 4 +-
  64. drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 8 +-
  65. drivers/net/ethernet/sfc/efx.c | 6 +-
  66. drivers/net/ethernet/sun/niu.c | 6 +-
  67. drivers/net/ethernet/synopsys/dwc_eth_qos.c | 4 +-
  68. drivers/net/ethernet/tile/tilepro.c | 4 +-
  69. drivers/net/ethernet/via/via-rhine.c | 8 +-
  70. drivers/net/fjes/fjes_main.c | 7 +-
  71. drivers/net/hyperv/netvsc_drv.c | 6 +-
  72. drivers/net/ifb.c | 6 +-
  73. drivers/net/ipvlan/ipvlan_main.c | 5 +-
  74. drivers/net/loopback.c | 5 +-
  75. drivers/net/macsec.c | 8 +-
  76. drivers/net/macvlan.c | 5 +-
  77. drivers/net/nlmon.c | 4 +-
  78. drivers/net/ppp/ppp_generic.c | 4 +-
  79. drivers/net/slip/slip.c | 3 +-
  80. drivers/net/team/team.c | 3 +-
  81. drivers/net/tun.c | 3 +-
  82. drivers/net/veth.c | 6 +-
  83. drivers/net/virtio_net.c | 6 +-
  84. drivers/net/vmxnet3/vmxnet3_ethtool.c | 4 +-
  85. drivers/net/vmxnet3/vmxnet3_int.h | 4 +-
  86. drivers/net/vrf.c | 5 +-
  87. drivers/net/xen-netfront.c | 6 +-
  88. drivers/staging/netlogic/xlr_net.c | 10 +--
  89. include/linux/device.h | 19 +++++
  90. include/linux/fsl/svr.h | 97 ++++++++++++++++++++++
  91. include/linux/fsl_devices.h | 3 +
  92. include/linux/netdev_features.h | 2 +
  93. include/linux/netdevice.h | 12 ++-
  94. include/linux/skbuff.h | 2 +
  95. include/linux/sys_soc.h | 3 +
  96. include/net/ip_tunnels.h | 4 +-
  97. include/uapi/linux/if_ether.h | 1 +
  98. net/8021q/vlan_dev.c | 5 +-
  99. net/bridge/br_device.c | 6 +-
  100. net/core/dev.c | 13 ++-
  101. net/core/skbuff.c | 29 ++++++-
  102. net/ipv4/ip_tunnel_core.c | 6 +-
  103. net/l2tp/l2tp_eth.c | 6 +-
  104. net/mac80211/iface.c | 4 +-
  105. net/openvswitch/vport-internal_dev.c | 4 +-
  106. net/sched/sch_generic.c | 7 ++
  107. net/sched/sch_teql.c | 5 +-
  108. 90 files changed, 468 insertions(+), 298 deletions(-)
  109. create mode 100644 include/linux/fsl/svr.h
  110. --- a/drivers/base/devres.c
  111. +++ b/drivers/base/devres.c
  112. @@ -10,6 +10,7 @@
  113. #include <linux/device.h>
  114. #include <linux/module.h>
  115. #include <linux/slab.h>
  116. +#include <linux/percpu.h>
  117. #include "base.h"
  118. @@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev,
  119. &devres));
  120. }
  121. EXPORT_SYMBOL_GPL(devm_free_pages);
  122. +
  123. +static void devm_percpu_release(struct device *dev, void *pdata)
  124. +{
  125. + void __percpu *p;
  126. +
  127. + p = *(void __percpu **)pdata;
  128. + free_percpu(p);
  129. +}
  130. +
  131. +static int devm_percpu_match(struct device *dev, void *data, void *p)
  132. +{
  133. + struct devres *devr = container_of(data, struct devres, data);
  134. +
  135. + return *(void **)devr->data == p;
  136. +}
  137. +
  138. +/**
  139. + * __devm_alloc_percpu - Resource-managed alloc_percpu
  140. + * @dev: Device to allocate per-cpu memory for
  141. + * @size: Size of per-cpu memory to allocate
  142. + * @align: Alignment of per-cpu memory to allocate
  143. + *
  144. + * Managed alloc_percpu. Per-cpu memory allocated with this function is
  145. + * automatically freed on driver detach.
  146. + *
  147. + * RETURNS:
  148. + * Pointer to allocated memory on success, NULL on failure.
  149. + */
  150. +void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
  151. + size_t align)
  152. +{
  153. + void *p;
  154. + void __percpu *pcpu;
  155. +
  156. + pcpu = __alloc_percpu(size, align);
  157. + if (!pcpu)
  158. + return NULL;
  159. +
  160. + p = devres_alloc(devm_percpu_release, sizeof(void *), GFP_KERNEL);
  161. + if (!p) {
  162. + free_percpu(pcpu);
  163. + return NULL;
  164. + }
  165. +
  166. + *(void __percpu **)p = pcpu;
  167. +
  168. + devres_add(dev, p);
  169. +
  170. + return pcpu;
  171. +}
  172. +EXPORT_SYMBOL_GPL(__devm_alloc_percpu);
  173. +
  174. +/**
  175. + * devm_free_percpu - Resource-managed free_percpu
  176. + * @dev: Device this memory belongs to
  177. + * @pdata: Per-cpu memory to free
  178. + *
  179. + * Free memory allocated with devm_alloc_percpu().
  180. + */
  181. +void devm_free_percpu(struct device *dev, void __percpu *pdata)
  182. +{
  183. + WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match,
  184. + (void *)pdata));
  185. +}
  186. +EXPORT_SYMBOL_GPL(devm_free_percpu);
  187. --- a/drivers/base/soc.c
  188. +++ b/drivers/base/soc.c
  189. @@ -13,6 +13,7 @@
  190. #include <linux/spinlock.h>
  191. #include <linux/sys_soc.h>
  192. #include <linux/err.h>
  193. +#include <linux/glob.h>
  194. static DEFINE_IDA(soc_ida);
  195. @@ -159,3 +160,68 @@ static int __init soc_bus_register(void)
  196. return bus_register(&soc_bus_type);
  197. }
  198. core_initcall(soc_bus_register);
  199. +
  200. +static int soc_device_match_one(struct device *dev, void *arg)
  201. +{
  202. + struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
  203. + const struct soc_device_attribute *match = arg;
  204. +
  205. + if (match->machine &&
  206. + !glob_match(match->machine, soc_dev->attr->machine))
  207. + return 0;
  208. +
  209. + if (match->family &&
  210. + !glob_match(match->family, soc_dev->attr->family))
  211. + return 0;
  212. +
  213. + if (match->revision &&
  214. + !glob_match(match->revision, soc_dev->attr->revision))
  215. + return 0;
  216. +
  217. + if (match->soc_id &&
  218. + !glob_match(match->soc_id, soc_dev->attr->soc_id))
  219. + return 0;
  220. +
  221. + return 1;
  222. +}
  223. +
  224. +/*
  225. + * soc_device_match - identify the SoC in the machine
  226. + * @matches: zero-terminated array of possible matches
  227. + *
  228. + * returns the first matching entry of the argument array, or NULL
  229. + * if none of them match.
  230. + *
  231. + * This function is meant as a helper in place of of_match_node()
  232. + * in cases where either no device tree is available or the information
  233. + * in a device node is insufficient to identify a particular variant
  234. + * by its compatible strings or other properties. For new devices,
  235. + * the DT binding should always provide unique compatible strings
  236. + * that allow the use of of_match_node() instead.
  237. + *
  238. + * The calling function can use the .data entry of the
  239. + * soc_device_attribute to pass a structure or function pointer for
  240. + * each entry.
  241. + */
  242. +const struct soc_device_attribute *soc_device_match(
  243. + const struct soc_device_attribute *matches)
  244. +{
  245. + int ret = 0;
  246. +
  247. + if (!matches)
  248. + return NULL;
  249. +
  250. + while (!ret) {
  251. + if (!(matches->machine || matches->family ||
  252. + matches->revision || matches->soc_id))
  253. + break;
  254. + ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches,
  255. + soc_device_match_one);
  256. + if (!ret)
  257. + matches++;
  258. + else
  259. + return matches;
  260. + }
  261. + return NULL;
  262. +}
  263. +EXPORT_SYMBOL_GPL(soc_device_match);
  264. --- a/drivers/net/bonding/bond_main.c
  265. +++ b/drivers/net/bonding/bond_main.c
  266. @@ -211,8 +211,8 @@ static int lacp_fast;
  267. static int bond_init(struct net_device *bond_dev);
  268. static void bond_uninit(struct net_device *bond_dev);
  269. -static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
  270. - struct rtnl_link_stats64 *stats);
  271. +static void bond_get_stats(struct net_device *bond_dev,
  272. + struct rtnl_link_stats64 *stats);
  273. static void bond_slave_arr_handler(struct work_struct *work);
  274. static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
  275. int mod);
  276. @@ -3336,8 +3336,8 @@ static void bond_fold_stats(struct rtnl_
  277. }
  278. }
  279. -static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
  280. - struct rtnl_link_stats64 *stats)
  281. +static void bond_get_stats(struct net_device *bond_dev,
  282. + struct rtnl_link_stats64 *stats)
  283. {
  284. struct bonding *bond = netdev_priv(bond_dev);
  285. struct rtnl_link_stats64 temp;
  286. @@ -3361,8 +3361,6 @@ static struct rtnl_link_stats64 *bond_ge
  287. memcpy(&bond->bond_stats, stats, sizeof(*stats));
  288. spin_unlock(&bond->stats_lock);
  289. -
  290. - return stats;
  291. }
  292. static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
  293. --- a/drivers/net/dummy.c
  294. +++ b/drivers/net/dummy.c
  295. @@ -54,8 +54,8 @@ struct pcpu_dstats {
  296. struct u64_stats_sync syncp;
  297. };
  298. -static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
  299. - struct rtnl_link_stats64 *stats)
  300. +static void dummy_get_stats64(struct net_device *dev,
  301. + struct rtnl_link_stats64 *stats)
  302. {
  303. int i;
  304. @@ -73,7 +73,6 @@ static struct rtnl_link_stats64 *dummy_g
  305. stats->tx_bytes += tbytes;
  306. stats->tx_packets += tpackets;
  307. }
  308. - return stats;
  309. }
  310. static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev)
  311. --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
  312. +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
  313. @@ -2172,19 +2172,19 @@ err:
  314. ena_com_delete_debug_area(adapter->ena_dev);
  315. }
  316. -static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev,
  317. - struct rtnl_link_stats64 *stats)
  318. +static void ena_get_stats64(struct net_device *netdev,
  319. + struct rtnl_link_stats64 *stats)
  320. {
  321. struct ena_adapter *adapter = netdev_priv(netdev);
  322. struct ena_admin_basic_stats ena_stats;
  323. int rc;
  324. if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
  325. - return NULL;
  326. + return;
  327. rc = ena_com_get_dev_basic_stats(adapter->ena_dev, &ena_stats);
  328. if (rc)
  329. - return NULL;
  330. + return;
  331. stats->tx_bytes = ((u64)ena_stats.tx_bytes_high << 32) |
  332. ena_stats.tx_bytes_low;
  333. @@ -2211,8 +2211,6 @@ static struct rtnl_link_stats64 *ena_get
  334. stats->rx_errors = 0;
  335. stats->tx_errors = 0;
  336. -
  337. - return stats;
  338. }
  339. static const struct net_device_ops ena_netdev_ops = {
  340. --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
  341. +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
  342. @@ -1542,8 +1542,8 @@ static void xgbe_tx_timeout(struct net_d
  343. schedule_work(&pdata->restart_work);
  344. }
  345. -static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
  346. - struct rtnl_link_stats64 *s)
  347. +static void xgbe_get_stats64(struct net_device *netdev,
  348. + struct rtnl_link_stats64 *s)
  349. {
  350. struct xgbe_prv_data *pdata = netdev_priv(netdev);
  351. struct xgbe_mmc_stats *pstats = &pdata->mmc_stats;
  352. @@ -1569,8 +1569,6 @@ static struct rtnl_link_stats64 *xgbe_ge
  353. s->tx_dropped = netdev->stats.tx_dropped;
  354. DBGPR("<--%s\n", __func__);
  355. -
  356. - return s;
  357. }
  358. static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
  359. --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
  360. +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
  361. @@ -1199,7 +1199,7 @@ err:
  362. return ret;
  363. }
  364. -static struct rtnl_link_stats64 *xgene_enet_get_stats64(
  365. +static void xgene_enet_get_stats64(
  366. struct net_device *ndev,
  367. struct rtnl_link_stats64 *storage)
  368. {
  369. @@ -1230,8 +1230,6 @@ static struct rtnl_link_stats64 *xgene_e
  370. }
  371. }
  372. memcpy(storage, stats, sizeof(struct rtnl_link_stats64));
  373. -
  374. - return storage;
  375. }
  376. static int xgene_enet_set_mac_address(struct net_device *ndev, void *addr)
  377. --- a/drivers/net/ethernet/atheros/alx/main.c
  378. +++ b/drivers/net/ethernet/atheros/alx/main.c
  379. @@ -1424,8 +1424,8 @@ static void alx_poll_controller(struct n
  380. }
  381. #endif
  382. -static struct rtnl_link_stats64 *alx_get_stats64(struct net_device *dev,
  383. - struct rtnl_link_stats64 *net_stats)
  384. +static void alx_get_stats64(struct net_device *dev,
  385. + struct rtnl_link_stats64 *net_stats)
  386. {
  387. struct alx_priv *alx = netdev_priv(dev);
  388. struct alx_hw_stats *hw_stats = &alx->hw.stats;
  389. @@ -1469,8 +1469,6 @@ static struct rtnl_link_stats64 *alx_get
  390. net_stats->rx_packets = hw_stats->rx_ok + net_stats->rx_errors;
  391. spin_unlock(&alx->stats_lock);
  392. -
  393. - return net_stats;
  394. }
  395. static const struct net_device_ops alx_netdev_ops = {
  396. --- a/drivers/net/ethernet/broadcom/b44.c
  397. +++ b/drivers/net/ethernet/broadcom/b44.c
  398. @@ -1677,8 +1677,8 @@ static int b44_close(struct net_device *
  399. return 0;
  400. }
  401. -static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev,
  402. - struct rtnl_link_stats64 *nstat)
  403. +static void b44_get_stats64(struct net_device *dev,
  404. + struct rtnl_link_stats64 *nstat)
  405. {
  406. struct b44 *bp = netdev_priv(dev);
  407. struct b44_hw_stats *hwstat = &bp->hw_stats;
  408. @@ -1721,7 +1721,6 @@ static struct rtnl_link_stats64 *b44_get
  409. #endif
  410. } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start));
  411. - return nstat;
  412. }
  413. static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
  414. --- a/drivers/net/ethernet/broadcom/bnx2.c
  415. +++ b/drivers/net/ethernet/broadcom/bnx2.c
  416. @@ -6828,13 +6828,13 @@ bnx2_save_stats(struct bnx2 *bp)
  417. (unsigned long) (bp->stats_blk->ctr + \
  418. bp->temp_stats_blk->ctr)
  419. -static struct rtnl_link_stats64 *
  420. +static void
  421. bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
  422. {
  423. struct bnx2 *bp = netdev_priv(dev);
  424. if (bp->stats_blk == NULL)
  425. - return net_stats;
  426. + return;
  427. net_stats->rx_packets =
  428. GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) +
  429. @@ -6898,7 +6898,6 @@ bnx2_get_stats64(struct net_device *dev,
  430. GET_32BIT_NET_STATS(stat_IfInMBUFDiscards) +
  431. GET_32BIT_NET_STATS(stat_FwRxDrop);
  432. - return net_stats;
  433. }
  434. /* All ethtool functions called with rtnl_lock */
  435. --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
  436. +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
  437. @@ -5664,7 +5664,7 @@ static int bnxt_ioctl(struct net_device
  438. return -EOPNOTSUPP;
  439. }
  440. -static struct rtnl_link_stats64 *
  441. +static void
  442. bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  443. {
  444. u32 i;
  445. @@ -5673,7 +5673,7 @@ bnxt_get_stats64(struct net_device *dev,
  446. memset(stats, 0, sizeof(struct rtnl_link_stats64));
  447. if (!bp->bnapi)
  448. - return stats;
  449. + return;
  450. /* TODO check if we need to synchronize with bnxt_close path */
  451. for (i = 0; i < bp->cp_nr_rings; i++) {
  452. @@ -5720,8 +5720,6 @@ bnxt_get_stats64(struct net_device *dev,
  453. stats->tx_fifo_errors = le64_to_cpu(tx->tx_fifo_underruns);
  454. stats->tx_errors = le64_to_cpu(tx->tx_err);
  455. }
  456. -
  457. - return stats;
  458. }
  459. static bool bnxt_mc_list_updated(struct bnxt *bp, u32 *rx_mask)
  460. --- a/drivers/net/ethernet/broadcom/tg3.c
  461. +++ b/drivers/net/ethernet/broadcom/tg3.c
  462. @@ -14145,8 +14145,8 @@ static const struct ethtool_ops tg3_etht
  463. .set_link_ksettings = tg3_set_link_ksettings,
  464. };
  465. -static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
  466. - struct rtnl_link_stats64 *stats)
  467. +static void tg3_get_stats64(struct net_device *dev,
  468. + struct rtnl_link_stats64 *stats)
  469. {
  470. struct tg3 *tp = netdev_priv(dev);
  471. @@ -14154,13 +14154,11 @@ static struct rtnl_link_stats64 *tg3_get
  472. if (!tp->hw_stats) {
  473. *stats = tp->net_stats_prev;
  474. spin_unlock_bh(&tp->lock);
  475. - return stats;
  476. + return;
  477. }
  478. tg3_get_nstats(tp, stats);
  479. spin_unlock_bh(&tp->lock);
  480. -
  481. - return stats;
  482. }
  483. static void tg3_set_rx_mode(struct net_device *dev)
  484. --- a/drivers/net/ethernet/brocade/bna/bnad.c
  485. +++ b/drivers/net/ethernet/brocade/bna/bnad.c
  486. @@ -3111,7 +3111,7 @@ bnad_start_xmit(struct sk_buff *skb, str
  487. * Used spin_lock to synchronize reading of stats structures, which
  488. * is written by BNA under the same lock.
  489. */
  490. -static struct rtnl_link_stats64 *
  491. +static void
  492. bnad_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
  493. {
  494. struct bnad *bnad = netdev_priv(netdev);
  495. @@ -3123,8 +3123,6 @@ bnad_get_stats64(struct net_device *netd
  496. bnad_netdev_hwstats_fill(bnad, stats);
  497. spin_unlock_irqrestore(&bnad->bna_lock, flags);
  498. -
  499. - return stats;
  500. }
  501. static void
  502. @@ -3430,7 +3428,7 @@ static const struct net_device_ops bnad_
  503. .ndo_open = bnad_open,
  504. .ndo_stop = bnad_stop,
  505. .ndo_start_xmit = bnad_start_xmit,
  506. - .ndo_get_stats64 = bnad_get_stats64,
  507. + .ndo_get_stats64 = bnad_get_stats64,
  508. .ndo_set_rx_mode = bnad_set_rx_mode,
  509. .ndo_validate_addr = eth_validate_addr,
  510. .ndo_set_mac_address = bnad_set_mac_address,
  511. --- a/drivers/net/ethernet/calxeda/xgmac.c
  512. +++ b/drivers/net/ethernet/calxeda/xgmac.c
  513. @@ -1460,9 +1460,9 @@ static void xgmac_poll_controller(struct
  514. }
  515. #endif
  516. -static struct rtnl_link_stats64 *
  517. +static void
  518. xgmac_get_stats64(struct net_device *dev,
  519. - struct rtnl_link_stats64 *storage)
  520. + struct rtnl_link_stats64 *storage)
  521. {
  522. struct xgmac_priv *priv = netdev_priv(dev);
  523. void __iomem *base = priv->base;
  524. @@ -1490,7 +1490,6 @@ xgmac_get_stats64(struct net_device *dev
  525. writel(0, base + XGMAC_MMC_CTRL);
  526. spin_unlock_bh(&priv->stats_lock);
  527. - return storage;
  528. }
  529. static int xgmac_set_mac_address(struct net_device *dev, void *p)
  530. --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
  531. +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
  532. @@ -1423,8 +1423,8 @@ void nicvf_update_stats(struct nicvf *ni
  533. nicvf_update_sq_stats(nic, qidx);
  534. }
  535. -static struct rtnl_link_stats64 *nicvf_get_stats64(struct net_device *netdev,
  536. - struct rtnl_link_stats64 *stats)
  537. +static void nicvf_get_stats64(struct net_device *netdev,
  538. + struct rtnl_link_stats64 *stats)
  539. {
  540. struct nicvf *nic = netdev_priv(netdev);
  541. struct nicvf_hw_stats *hw_stats = &nic->hw_stats;
  542. @@ -1440,7 +1440,6 @@ static struct rtnl_link_stats64 *nicvf_g
  543. stats->tx_packets = hw_stats->tx_frames;
  544. stats->tx_dropped = hw_stats->tx_drops;
  545. - return stats;
  546. }
  547. static void nicvf_tx_timeout(struct net_device *dev)
  548. --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
  549. +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
  550. @@ -2383,8 +2383,8 @@ int cxgb4_remove_server_filter(const str
  551. }
  552. EXPORT_SYMBOL(cxgb4_remove_server_filter);
  553. -static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev,
  554. - struct rtnl_link_stats64 *ns)
  555. +static void cxgb_get_stats(struct net_device *dev,
  556. + struct rtnl_link_stats64 *ns)
  557. {
  558. struct port_stats stats;
  559. struct port_info *p = netdev_priv(dev);
  560. @@ -2397,7 +2397,7 @@ static struct rtnl_link_stats64 *cxgb_ge
  561. spin_lock(&adapter->stats_lock);
  562. if (!netif_device_present(dev)) {
  563. spin_unlock(&adapter->stats_lock);
  564. - return ns;
  565. + return;
  566. }
  567. t4_get_port_stats_offset(adapter, p->tx_chan, &stats,
  568. &p->stats_base);
  569. @@ -2431,7 +2431,6 @@ static struct rtnl_link_stats64 *cxgb_ge
  570. ns->tx_errors = stats.tx_error_frames;
  571. ns->rx_errors = stats.rx_symbol_err + stats.rx_fcs_err +
  572. ns->rx_length_errors + stats.rx_len_err + ns->rx_fifo_errors;
  573. - return ns;
  574. }
  575. static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
  576. --- a/drivers/net/ethernet/cisco/enic/enic_main.c
  577. +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
  578. @@ -680,8 +680,8 @@ static netdev_tx_t enic_hard_start_xmit(
  579. }
  580. /* dev_base_lock rwlock held, nominally process context */
  581. -static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev,
  582. - struct rtnl_link_stats64 *net_stats)
  583. +static void enic_get_stats(struct net_device *netdev,
  584. + struct rtnl_link_stats64 *net_stats)
  585. {
  586. struct enic *enic = netdev_priv(netdev);
  587. struct vnic_stats *stats;
  588. @@ -693,7 +693,7 @@ static struct rtnl_link_stats64 *enic_ge
  589. * recorded stats.
  590. */
  591. if (err == -ENOMEM)
  592. - return net_stats;
  593. + return;
  594. net_stats->tx_packets = stats->tx.tx_frames_ok;
  595. net_stats->tx_bytes = stats->tx.tx_bytes_ok;
  596. @@ -707,8 +707,6 @@ static struct rtnl_link_stats64 *enic_ge
  597. net_stats->rx_over_errors = enic->rq_truncated_pkts;
  598. net_stats->rx_crc_errors = enic->rq_bad_fcs;
  599. net_stats->rx_dropped = stats->rx.rx_no_bufs + stats->rx.rx_drop;
  600. -
  601. - return net_stats;
  602. }
  603. static int enic_mc_sync(struct net_device *netdev, const u8 *mc_addr)
  604. --- a/drivers/net/ethernet/ec_bhf.c
  605. +++ b/drivers/net/ethernet/ec_bhf.c
  606. @@ -458,7 +458,7 @@ static int ec_bhf_stop(struct net_device
  607. return 0;
  608. }
  609. -static struct rtnl_link_stats64 *
  610. +static void
  611. ec_bhf_get_stats(struct net_device *net_dev,
  612. struct rtnl_link_stats64 *stats)
  613. {
  614. @@ -473,8 +473,6 @@ ec_bhf_get_stats(struct net_device *net_
  615. stats->tx_bytes = priv->stat_tx_bytes;
  616. stats->rx_bytes = priv->stat_rx_bytes;
  617. -
  618. - return stats;
  619. }
  620. static const struct net_device_ops ec_bhf_netdev_ops = {
  621. --- a/drivers/net/ethernet/emulex/benet/be_main.c
  622. +++ b/drivers/net/ethernet/emulex/benet/be_main.c
  623. @@ -646,8 +646,8 @@ void be_parse_stats(struct be_adapter *a
  624. }
  625. }
  626. -static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
  627. - struct rtnl_link_stats64 *stats)
  628. +static void be_get_stats64(struct net_device *netdev,
  629. + struct rtnl_link_stats64 *stats)
  630. {
  631. struct be_adapter *adapter = netdev_priv(netdev);
  632. struct be_drv_stats *drvs = &adapter->drv_stats;
  633. @@ -711,7 +711,6 @@ static struct rtnl_link_stats64 *be_get_
  634. stats->rx_fifo_errors = drvs->rxpp_fifo_overflow_drop +
  635. drvs->rx_input_fifo_overflow_drop +
  636. drvs->rx_drops_no_pbuf;
  637. - return stats;
  638. }
  639. void be_link_status_update(struct be_adapter *adapter, u8 link_status)
  640. --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
  641. +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
  642. @@ -1536,8 +1536,8 @@ void hns_nic_set_rx_mode(struct net_devi
  643. hns_set_multicast_list(ndev);
  644. }
  645. -struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
  646. - struct rtnl_link_stats64 *stats)
  647. +static void hns_nic_get_stats64(struct net_device *ndev,
  648. + struct rtnl_link_stats64 *stats)
  649. {
  650. int idx = 0;
  651. u64 tx_bytes = 0;
  652. @@ -1579,8 +1579,6 @@ struct rtnl_link_stats64 *hns_nic_get_st
  653. stats->tx_window_errors = ndev->stats.tx_window_errors;
  654. stats->rx_compressed = ndev->stats.rx_compressed;
  655. stats->tx_compressed = ndev->stats.tx_compressed;
  656. -
  657. - return stats;
  658. }
  659. static u16
  660. --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
  661. +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
  662. @@ -328,8 +328,8 @@ out:
  663. spin_unlock_irqrestore(&ehea_bcmc_regs.lock, flags);
  664. }
  665. -static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev,
  666. - struct rtnl_link_stats64 *stats)
  667. +static void ehea_get_stats64(struct net_device *dev,
  668. + struct rtnl_link_stats64 *stats)
  669. {
  670. struct ehea_port *port = netdev_priv(dev);
  671. u64 rx_packets = 0, tx_packets = 0, rx_bytes = 0, tx_bytes = 0;
  672. @@ -352,7 +352,6 @@ static struct rtnl_link_stats64 *ehea_ge
  673. stats->multicast = port->stats.multicast;
  674. stats->rx_errors = port->stats.rx_errors;
  675. - return stats;
  676. }
  677. static void ehea_update_stats(struct work_struct *work)
  678. --- a/drivers/net/ethernet/intel/e1000e/e1000.h
  679. +++ b/drivers/net/ethernet/intel/e1000e/e1000.h
  680. @@ -493,8 +493,8 @@ int e1000e_setup_rx_resources(struct e10
  681. int e1000e_setup_tx_resources(struct e1000_ring *ring);
  682. void e1000e_free_rx_resources(struct e1000_ring *ring);
  683. void e1000e_free_tx_resources(struct e1000_ring *ring);
  684. -struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
  685. - struct rtnl_link_stats64 *stats);
  686. +void e1000e_get_stats64(struct net_device *netdev,
  687. + struct rtnl_link_stats64 *stats);
  688. void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
  689. void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
  690. void e1000e_get_hw_control(struct e1000_adapter *adapter);
  691. --- a/drivers/net/ethernet/intel/e1000e/netdev.c
  692. +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
  693. @@ -5939,8 +5939,8 @@ static void e1000_reset_task(struct work
  694. *
  695. * Returns the address of the device statistics structure.
  696. **/
  697. -struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
  698. - struct rtnl_link_stats64 *stats)
  699. +void e1000e_get_stats64(struct net_device *netdev,
  700. + struct rtnl_link_stats64 *stats)
  701. {
  702. struct e1000_adapter *adapter = netdev_priv(netdev);
  703. @@ -5977,7 +5977,6 @@ struct rtnl_link_stats64 *e1000e_get_sta
  704. /* Tx Dropped needs to be maintained elsewhere */
  705. spin_unlock(&adapter->stats64_lock);
  706. - return stats;
  707. }
  708. /**
  709. --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
  710. +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
  711. @@ -1128,8 +1128,8 @@ void fm10k_reset_rx_state(struct fm10k_i
  712. * Returns 64bit statistics, for use in the ndo_get_stats64 callback. This
  713. * function replaces fm10k_get_stats for kernels which support it.
  714. */
  715. -static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev,
  716. - struct rtnl_link_stats64 *stats)
  717. +static void fm10k_get_stats64(struct net_device *netdev,
  718. + struct rtnl_link_stats64 *stats)
  719. {
  720. struct fm10k_intfc *interface = netdev_priv(netdev);
  721. struct fm10k_ring *ring;
  722. @@ -1174,8 +1174,6 @@ static struct rtnl_link_stats64 *fm10k_g
  723. /* following stats updated by fm10k_service_task() */
  724. stats->rx_missed_errors = netdev->stats.rx_missed_errors;
  725. -
  726. - return stats;
  727. }
  728. int fm10k_setup_tc(struct net_device *dev, u8 tc)
  729. --- a/drivers/net/ethernet/intel/i40e/i40e.h
  730. +++ b/drivers/net/ethernet/intel/i40e/i40e.h
  731. @@ -797,9 +797,8 @@ static inline void i40e_irq_dynamic_enab
  732. void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf);
  733. void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf, bool clearpba);
  734. #ifdef I40E_FCOE
  735. -struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
  736. - struct net_device *netdev,
  737. - struct rtnl_link_stats64 *storage);
  738. +void i40e_get_netdev_stats_struct(struct net_device *netdev,
  739. + struct rtnl_link_stats64 *storage);
  740. int i40e_set_mac(struct net_device *netdev, void *p);
  741. void i40e_set_rx_mode(struct net_device *netdev);
  742. #endif
  743. --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
  744. +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
  745. @@ -408,15 +408,11 @@ struct rtnl_link_stats64 *i40e_get_vsi_s
  746. * Returns the address of the device statistics structure.
  747. * The statistics are actually updated from the service task.
  748. **/
  749. -#ifdef I40E_FCOE
  750. -struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
  751. - struct net_device *netdev,
  752. - struct rtnl_link_stats64 *stats)
  753. -#else
  754. -static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
  755. - struct net_device *netdev,
  756. - struct rtnl_link_stats64 *stats)
  757. +#ifndef I40E_FCOE
  758. +static
  759. #endif
  760. +void i40e_get_netdev_stats_struct(struct net_device *netdev,
  761. + struct rtnl_link_stats64 *stats)
  762. {
  763. struct i40e_netdev_priv *np = netdev_priv(netdev);
  764. struct i40e_ring *tx_ring, *rx_ring;
  765. @@ -425,10 +421,10 @@ static struct rtnl_link_stats64 *i40e_ge
  766. int i;
  767. if (test_bit(__I40E_DOWN, &vsi->state))
  768. - return stats;
  769. + return;
  770. if (!vsi->tx_rings)
  771. - return stats;
  772. + return;
  773. rcu_read_lock();
  774. for (i = 0; i < vsi->num_queue_pairs; i++) {
  775. @@ -468,8 +464,6 @@ static struct rtnl_link_stats64 *i40e_ge
  776. stats->rx_dropped = vsi_stats->rx_dropped;
  777. stats->rx_crc_errors = vsi_stats->rx_crc_errors;
  778. stats->rx_length_errors = vsi_stats->rx_length_errors;
  779. -
  780. - return stats;
  781. }
  782. /**
  783. --- a/drivers/net/ethernet/intel/igb/igb_main.c
  784. +++ b/drivers/net/ethernet/intel/igb/igb_main.c
  785. @@ -137,8 +137,8 @@ static void igb_update_phy_info(unsigned
  786. static void igb_watchdog(unsigned long);
  787. static void igb_watchdog_task(struct work_struct *);
  788. static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, struct net_device *);
  789. -static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *dev,
  790. - struct rtnl_link_stats64 *stats);
  791. +static void igb_get_stats64(struct net_device *dev,
  792. + struct rtnl_link_stats64 *stats);
  793. static int igb_change_mtu(struct net_device *, int);
  794. static int igb_set_mac(struct net_device *, void *);
  795. static void igb_set_uta(struct igb_adapter *adapter, bool set);
  796. @@ -5386,8 +5386,8 @@ static void igb_reset_task(struct work_s
  797. * @netdev: network interface device structure
  798. * @stats: rtnl_link_stats64 pointer
  799. **/
  800. -static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *netdev,
  801. - struct rtnl_link_stats64 *stats)
  802. +static void igb_get_stats64(struct net_device *netdev,
  803. + struct rtnl_link_stats64 *stats)
  804. {
  805. struct igb_adapter *adapter = netdev_priv(netdev);
  806. @@ -5395,8 +5395,6 @@ static struct rtnl_link_stats64 *igb_get
  807. igb_update_stats(adapter, &adapter->stats64);
  808. memcpy(stats, &adapter->stats64, sizeof(*stats));
  809. spin_unlock(&adapter->stats64_lock);
  810. -
  811. - return stats;
  812. }
  813. /**
  814. --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
  815. +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
  816. @@ -8085,8 +8085,9 @@ static void ixgbe_netpoll(struct net_dev
  817. }
  818. #endif
  819. -static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
  820. - struct rtnl_link_stats64 *stats)
  821. +
  822. +static void ixgbe_get_stats64(struct net_device *netdev,
  823. + struct rtnl_link_stats64 *stats)
  824. {
  825. struct ixgbe_adapter *adapter = netdev_priv(netdev);
  826. int i;
  827. @@ -8124,13 +8125,13 @@ static struct rtnl_link_stats64 *ixgbe_g
  828. }
  829. }
  830. rcu_read_unlock();
  831. +
  832. /* following stats updated by ixgbe_watchdog_task() */
  833. stats->multicast = netdev->stats.multicast;
  834. stats->rx_errors = netdev->stats.rx_errors;
  835. stats->rx_length_errors = netdev->stats.rx_length_errors;
  836. stats->rx_crc_errors = netdev->stats.rx_crc_errors;
  837. stats->rx_missed_errors = netdev->stats.rx_missed_errors;
  838. - return stats;
  839. }
  840. #ifdef CONFIG_IXGBE_DCB
  841. --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
  842. +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
  843. @@ -3880,8 +3880,8 @@ static void ixgbevf_shutdown(struct pci_
  844. ixgbevf_suspend(pdev, PMSG_SUSPEND);
  845. }
  846. -static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev,
  847. - struct rtnl_link_stats64 *stats)
  848. +static void ixgbevf_get_stats(struct net_device *netdev,
  849. + struct rtnl_link_stats64 *stats)
  850. {
  851. struct ixgbevf_adapter *adapter = netdev_priv(netdev);
  852. unsigned int start;
  853. @@ -3914,8 +3914,6 @@ static struct rtnl_link_stats64 *ixgbevf
  854. stats->tx_bytes += bytes;
  855. stats->tx_packets += packets;
  856. }
  857. -
  858. - return stats;
  859. }
  860. #define IXGBEVF_MAX_MAC_HDR_LEN 127
  861. --- a/drivers/net/ethernet/marvell/mvneta.c
  862. +++ b/drivers/net/ethernet/marvell/mvneta.c
  863. @@ -636,7 +636,7 @@ static void mvneta_mib_counters_clear(st
  864. }
  865. /* Get System Network Statistics */
  866. -static struct rtnl_link_stats64 *
  867. +static void
  868. mvneta_get_stats64(struct net_device *dev,
  869. struct rtnl_link_stats64 *stats)
  870. {
  871. @@ -670,8 +670,6 @@ mvneta_get_stats64(struct net_device *de
  872. stats->rx_dropped = dev->stats.rx_dropped;
  873. stats->tx_dropped = dev->stats.tx_dropped;
  874. -
  875. - return stats;
  876. }
  877. /* Rx descriptors helper methods */
  878. --- a/drivers/net/ethernet/marvell/mvpp2.c
  879. +++ b/drivers/net/ethernet/marvell/mvpp2.c
  880. @@ -5761,7 +5761,7 @@ error:
  881. return err;
  882. }
  883. -static struct rtnl_link_stats64 *
  884. +static void
  885. mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  886. {
  887. struct mvpp2_port *port = netdev_priv(dev);
  888. @@ -5793,8 +5793,6 @@ mvpp2_get_stats64(struct net_device *dev
  889. stats->rx_errors = dev->stats.rx_errors;
  890. stats->rx_dropped = dev->stats.rx_dropped;
  891. stats->tx_dropped = dev->stats.tx_dropped;
  892. -
  893. - return stats;
  894. }
  895. static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  896. --- a/drivers/net/ethernet/marvell/sky2.c
  897. +++ b/drivers/net/ethernet/marvell/sky2.c
  898. @@ -3898,8 +3898,8 @@ static void sky2_set_multicast(struct ne
  899. gma_write16(hw, port, GM_RX_CTRL, reg);
  900. }
  901. -static struct rtnl_link_stats64 *sky2_get_stats(struct net_device *dev,
  902. - struct rtnl_link_stats64 *stats)
  903. +static void sky2_get_stats(struct net_device *dev,
  904. + struct rtnl_link_stats64 *stats)
  905. {
  906. struct sky2_port *sky2 = netdev_priv(dev);
  907. struct sky2_hw *hw = sky2->hw;
  908. @@ -3939,8 +3939,6 @@ static struct rtnl_link_stats64 *sky2_ge
  909. stats->rx_dropped = dev->stats.rx_dropped;
  910. stats->rx_fifo_errors = dev->stats.rx_fifo_errors;
  911. stats->tx_fifo_errors = dev->stats.tx_fifo_errors;
  912. -
  913. - return stats;
  914. }
  915. /* Can have one global because blinking is controlled by
  916. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  917. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  918. @@ -462,8 +462,8 @@ static void mtk_stats_update(struct mtk_
  919. }
  920. }
  921. -static struct rtnl_link_stats64 *mtk_get_stats64(struct net_device *dev,
  922. - struct rtnl_link_stats64 *storage)
  923. +static void mtk_get_stats64(struct net_device *dev,
  924. + struct rtnl_link_stats64 *storage)
  925. {
  926. struct mtk_mac *mac = netdev_priv(dev);
  927. struct mtk_hw_stats *hw_stats = mac->hw_stats;
  928. @@ -494,8 +494,6 @@ static struct rtnl_link_stats64 *mtk_get
  929. storage->tx_errors = dev->stats.tx_errors;
  930. storage->rx_dropped = dev->stats.rx_dropped;
  931. storage->tx_dropped = dev->stats.tx_dropped;
  932. -
  933. - return storage;
  934. }
  935. static inline int mtk_max_frag_size(int mtu)
  936. --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
  937. +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
  938. @@ -1316,7 +1316,7 @@ static void mlx4_en_tx_timeout(struct ne
  939. }
  940. -static struct rtnl_link_stats64 *
  941. +static void
  942. mlx4_en_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  943. {
  944. struct mlx4_en_priv *priv = netdev_priv(dev);
  945. @@ -1324,8 +1324,6 @@ mlx4_en_get_stats64(struct net_device *d
  946. spin_lock_bh(&priv->stats_lock);
  947. netdev_stats_to_stats64(stats, &dev->stats);
  948. spin_unlock_bh(&priv->stats_lock);
  949. -
  950. - return stats;
  951. }
  952. static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv)
  953. --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
  954. +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
  955. @@ -2647,7 +2647,7 @@ mqprio:
  956. return mlx5e_setup_tc(dev, tc->tc);
  957. }
  958. -struct rtnl_link_stats64 *
  959. +static void
  960. mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
  961. {
  962. struct mlx5e_priv *priv = netdev_priv(dev);
  963. @@ -2681,7 +2681,6 @@ mlx5e_get_stats(struct net_device *dev,
  964. stats->multicast =
  965. VPORT_COUNTER_GET(vstats, received_eth_multicast.packets);
  966. - return stats;
  967. }
  968. static void mlx5e_set_rx_mode(struct net_device *dev)
  969. --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
  970. +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
  971. @@ -949,15 +949,13 @@ out:
  972. /* Return the stats from a cache that is updated periodically,
  973. * as this function might get called in an atomic context.
  974. */
  975. -static struct rtnl_link_stats64 *
  976. +static void
  977. mlxsw_sp_port_get_stats64(struct net_device *dev,
  978. struct rtnl_link_stats64 *stats)
  979. {
  980. struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
  981. memcpy(stats, mlxsw_sp_port->hw_stats.cache, sizeof(*stats));
  982. -
  983. - return stats;
  984. }
  985. int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,
  986. --- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
  987. +++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
  988. @@ -351,7 +351,7 @@ static int mlxsw_sx_port_change_mtu(stru
  989. return 0;
  990. }
  991. -static struct rtnl_link_stats64 *
  992. +static void
  993. mlxsw_sx_port_get_stats64(struct net_device *dev,
  994. struct rtnl_link_stats64 *stats)
  995. {
  996. @@ -380,7 +380,6 @@ mlxsw_sx_port_get_stats64(struct net_dev
  997. tx_dropped += p->tx_dropped;
  998. }
  999. stats->tx_dropped = tx_dropped;
  1000. - return stats;
  1001. }
  1002. static const struct net_device_ops mlxsw_sx_port_netdev_ops = {
  1003. --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
  1004. +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
  1005. @@ -378,8 +378,8 @@ static inline void put_be32(__be32 val,
  1006. __raw_writel((__force __u32) val, (__force void __iomem *)p);
  1007. }
  1008. -static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
  1009. - struct rtnl_link_stats64 *stats);
  1010. +static void myri10ge_get_stats(struct net_device *dev,
  1011. + struct rtnl_link_stats64 *stats);
  1012. static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated)
  1013. {
  1014. @@ -3119,8 +3119,8 @@ drop:
  1015. return NETDEV_TX_OK;
  1016. }
  1017. -static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
  1018. - struct rtnl_link_stats64 *stats)
  1019. +static void myri10ge_get_stats(struct net_device *dev,
  1020. + struct rtnl_link_stats64 *stats)
  1021. {
  1022. const struct myri10ge_priv *mgp = netdev_priv(dev);
  1023. const struct myri10ge_slice_netstats *slice_stats;
  1024. @@ -3135,7 +3135,6 @@ static struct rtnl_link_stats64 *myri10g
  1025. stats->rx_dropped += slice_stats->rx_dropped;
  1026. stats->tx_dropped += slice_stats->tx_dropped;
  1027. }
  1028. - return stats;
  1029. }
  1030. static void myri10ge_set_multicast_list(struct net_device *dev)
  1031. --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
  1032. +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
  1033. @@ -3116,7 +3116,7 @@ static int vxge_change_mtu(struct net_de
  1034. * @stats: pointer to struct rtnl_link_stats64
  1035. *
  1036. */
  1037. -static struct rtnl_link_stats64 *
  1038. +static void
  1039. vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
  1040. {
  1041. struct vxgedev *vdev = netdev_priv(dev);
  1042. @@ -3155,8 +3155,6 @@ vxge_get_stats64(struct net_device *dev,
  1043. net_stats->tx_bytes += bytes;
  1044. net_stats->tx_errors += txstats->tx_errors;
  1045. }
  1046. -
  1047. - return net_stats;
  1048. }
  1049. static enum vxge_hw_status vxge_timestamp_config(struct __vxge_hw_device *devh)
  1050. --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
  1051. +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
  1052. @@ -2400,8 +2400,8 @@ int nfp_net_set_ring_size(struct nfp_net
  1053. return err;
  1054. }
  1055. -static struct rtnl_link_stats64 *nfp_net_stat64(struct net_device *netdev,
  1056. - struct rtnl_link_stats64 *stats)
  1057. +static void nfp_net_stat64(struct net_device *netdev,
  1058. + struct rtnl_link_stats64 *stats)
  1059. {
  1060. struct nfp_net *nn = netdev_priv(netdev);
  1061. int r;
  1062. @@ -2431,8 +2431,6 @@ static struct rtnl_link_stats64 *nfp_net
  1063. stats->tx_bytes += data[1];
  1064. stats->tx_errors += data[2];
  1065. }
  1066. -
  1067. - return stats;
  1068. }
  1069. static bool nfp_net_ebpf_capable(struct nfp_net *nn)
  1070. --- a/drivers/net/ethernet/nvidia/forcedeth.c
  1071. +++ b/drivers/net/ethernet/nvidia/forcedeth.c
  1072. @@ -1733,7 +1733,7 @@ static void nv_update_stats(struct net_d
  1073. * Called with read_lock(&dev_base_lock) held for read -
  1074. * only synchronized against unregister_netdevice.
  1075. */
  1076. -static struct rtnl_link_stats64*
  1077. +static void
  1078. nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage)
  1079. __acquires(&netdev_priv(dev)->hwstats_lock)
  1080. __releases(&netdev_priv(dev)->hwstats_lock)
  1081. @@ -1793,8 +1793,6 @@ nv_get_stats64(struct net_device *dev, s
  1082. spin_unlock_bh(&np->hwstats_lock);
  1083. }
  1084. -
  1085. - return storage;
  1086. }
  1087. /*
  1088. --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
  1089. +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
  1090. @@ -90,8 +90,8 @@ static irqreturn_t netxen_msix_intr(int
  1091. static void netxen_free_ip_list(struct netxen_adapter *, bool);
  1092. static void netxen_restore_indev_addr(struct net_device *dev, unsigned long);
  1093. -static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *dev,
  1094. - struct rtnl_link_stats64 *stats);
  1095. +static void netxen_nic_get_stats(struct net_device *dev,
  1096. + struct rtnl_link_stats64 *stats);
  1097. static int netxen_nic_set_mac(struct net_device *netdev, void *p);
  1098. /* PCI Device ID Table */
  1099. @@ -2295,8 +2295,8 @@ request_reset:
  1100. clear_bit(__NX_RESETTING, &adapter->state);
  1101. }
  1102. -static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *netdev,
  1103. - struct rtnl_link_stats64 *stats)
  1104. +static void netxen_nic_get_stats(struct net_device *netdev,
  1105. + struct rtnl_link_stats64 *stats)
  1106. {
  1107. struct netxen_adapter *adapter = netdev_priv(netdev);
  1108. @@ -2306,8 +2306,6 @@ static struct rtnl_link_stats64 *netxen_
  1109. stats->tx_bytes = adapter->stats.txbytes;
  1110. stats->rx_dropped = adapter->stats.rxdropped;
  1111. stats->tx_dropped = adapter->stats.txdropped;
  1112. -
  1113. - return stats;
  1114. }
  1115. static irqreturn_t netxen_intr(int irq, void *data)
  1116. --- a/drivers/net/ethernet/qlogic/qede/qede_main.c
  1117. +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
  1118. @@ -1803,9 +1803,8 @@ void qede_fill_by_demand_stats(struct qe
  1119. edev->stats.tx_mac_ctrl_frames = stats.tx_mac_ctrl_frames;
  1120. }
  1121. -static
  1122. -struct rtnl_link_stats64 *qede_get_stats64(struct net_device *dev,
  1123. - struct rtnl_link_stats64 *stats)
  1124. +static void qede_get_stats64(struct net_device *dev,
  1125. + struct rtnl_link_stats64 *stats)
  1126. {
  1127. struct qede_dev *edev = netdev_priv(dev);
  1128. @@ -1835,8 +1834,6 @@ struct rtnl_link_stats64 *qede_get_stats
  1129. stats->collisions = edev->stats.tx_total_collisions;
  1130. stats->rx_crc_errors = edev->stats.rx_crc_errors;
  1131. stats->rx_frame_errors = edev->stats.rx_align_errors;
  1132. -
  1133. - return stats;
  1134. }
  1135. #ifdef CONFIG_QED_SRIOV
  1136. --- a/drivers/net/ethernet/qualcomm/emac/emac.c
  1137. +++ b/drivers/net/ethernet/qualcomm/emac/emac.c
  1138. @@ -319,8 +319,8 @@ static int emac_ioctl(struct net_device
  1139. }
  1140. /* Provide network statistics info for the interface */
  1141. -static struct rtnl_link_stats64 *emac_get_stats64(struct net_device *netdev,
  1142. - struct rtnl_link_stats64 *net_stats)
  1143. +static void emac_get_stats64(struct net_device *netdev,
  1144. + struct rtnl_link_stats64 *net_stats)
  1145. {
  1146. struct emac_adapter *adpt = netdev_priv(netdev);
  1147. unsigned int addr = REG_MAC_RX_STATUS_BIN;
  1148. @@ -384,8 +384,6 @@ static struct rtnl_link_stats64 *emac_ge
  1149. net_stats->tx_window_errors = stats->tx_late_col;
  1150. spin_unlock(&stats->lock);
  1151. -
  1152. - return net_stats;
  1153. }
  1154. static const struct net_device_ops emac_netdev_ops = {
  1155. --- a/drivers/net/ethernet/realtek/8139too.c
  1156. +++ b/drivers/net/ethernet/realtek/8139too.c
  1157. @@ -653,9 +653,8 @@ static int rtl8139_poll(struct napi_stru
  1158. static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance);
  1159. static int rtl8139_close (struct net_device *dev);
  1160. static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
  1161. -static struct rtnl_link_stats64 *rtl8139_get_stats64(struct net_device *dev,
  1162. - struct rtnl_link_stats64
  1163. - *stats);
  1164. +static void rtl8139_get_stats64(struct net_device *dev,
  1165. + struct rtnl_link_stats64 *stats);
  1166. static void rtl8139_set_rx_mode (struct net_device *dev);
  1167. static void __set_rx_mode (struct net_device *dev);
  1168. static void rtl8139_hw_start (struct net_device *dev);
  1169. @@ -2521,7 +2520,7 @@ static int netdev_ioctl(struct net_devic
  1170. }
  1171. -static struct rtnl_link_stats64 *
  1172. +static void
  1173. rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1174. {
  1175. struct rtl8139_private *tp = netdev_priv(dev);
  1176. @@ -2549,8 +2548,6 @@ rtl8139_get_stats64(struct net_device *d
  1177. stats->tx_packets = tp->tx_stats.packets;
  1178. stats->tx_bytes = tp->tx_stats.bytes;
  1179. } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start));
  1180. -
  1181. - return stats;
  1182. }
  1183. /* Set or clear the multicast filter for this adaptor.
  1184. --- a/drivers/net/ethernet/realtek/r8169.c
  1185. +++ b/drivers/net/ethernet/realtek/r8169.c
  1186. @@ -7751,7 +7751,7 @@ err_pm_runtime_put:
  1187. goto out;
  1188. }
  1189. -static struct rtnl_link_stats64 *
  1190. +static void
  1191. rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1192. {
  1193. struct rtl8169_private *tp = netdev_priv(dev);
  1194. @@ -7805,8 +7805,6 @@ rtl8169_get_stats64(struct net_device *d
  1195. le16_to_cpu(tp->tc_offset.tx_aborted);
  1196. pm_runtime_put_noidle(&pdev->dev);
  1197. -
  1198. - return stats;
  1199. }
  1200. static void rtl8169_net_suspend(struct net_device *dev)
  1201. --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
  1202. +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
  1203. @@ -1721,11 +1721,9 @@ static inline u64 sxgbe_get_stat64(void
  1204. * This function is a driver entry point whenever ifconfig command gets
  1205. * executed to see device statistics. Statistics are number of
  1206. * bytes sent or received, errors occurred etc.
  1207. - * Return value:
  1208. - * This function returns various statistical information of device.
  1209. */
  1210. -static struct rtnl_link_stats64 *sxgbe_get_stats64(struct net_device *dev,
  1211. - struct rtnl_link_stats64 *stats)
  1212. +static void sxgbe_get_stats64(struct net_device *dev,
  1213. + struct rtnl_link_stats64 *stats)
  1214. {
  1215. struct sxgbe_priv_data *priv = netdev_priv(dev);
  1216. void __iomem *ioaddr = priv->ioaddr;
  1217. @@ -1776,8 +1774,6 @@ static struct rtnl_link_stats64 *sxgbe_g
  1218. SXGBE_MMC_TXUFLWHI_GBCNT_REG);
  1219. writel(0, ioaddr + SXGBE_MMC_CTL_REG);
  1220. spin_unlock(&priv->stats_lock);
  1221. -
  1222. - return stats;
  1223. }
  1224. /* sxgbe_set_features - entry point to set offload features of the device.
  1225. --- a/drivers/net/ethernet/sfc/efx.c
  1226. +++ b/drivers/net/ethernet/sfc/efx.c
  1227. @@ -2232,16 +2232,14 @@ int efx_net_stop(struct net_device *net_
  1228. }
  1229. /* Context: process, dev_base_lock or RTNL held, non-blocking. */
  1230. -static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev,
  1231. - struct rtnl_link_stats64 *stats)
  1232. +static void efx_net_stats(struct net_device *net_dev,
  1233. + struct rtnl_link_stats64 *stats)
  1234. {
  1235. struct efx_nic *efx = netdev_priv(net_dev);
  1236. spin_lock_bh(&efx->stats_lock);
  1237. efx->type->update_stats(efx, NULL, stats);
  1238. spin_unlock_bh(&efx->stats_lock);
  1239. -
  1240. - return stats;
  1241. }
  1242. /* Context: netif_tx_lock held, BHs disabled. */
  1243. --- a/drivers/net/ethernet/sun/niu.c
  1244. +++ b/drivers/net/ethernet/sun/niu.c
  1245. @@ -6294,8 +6294,8 @@ no_rings:
  1246. stats->tx_errors = errors;
  1247. }
  1248. -static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev,
  1249. - struct rtnl_link_stats64 *stats)
  1250. +static void niu_get_stats(struct net_device *dev,
  1251. + struct rtnl_link_stats64 *stats)
  1252. {
  1253. struct niu *np = netdev_priv(dev);
  1254. @@ -6303,8 +6303,6 @@ static struct rtnl_link_stats64 *niu_get
  1255. niu_get_rx_stats(np, stats);
  1256. niu_get_tx_stats(np, stats);
  1257. }
  1258. -
  1259. - return stats;
  1260. }
  1261. static void niu_load_hash_xmac(struct niu *np, u16 *hash)
  1262. --- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c
  1263. +++ b/drivers/net/ethernet/synopsys/dwc_eth_qos.c
  1264. @@ -2490,7 +2490,7 @@ static void dwceqos_read_mmc_counters(st
  1265. dwceqos_read(lp, DWC_MMC_RXPACKETCOUNT_GB);
  1266. }
  1267. -static struct rtnl_link_stats64*
  1268. +static void
  1269. dwceqos_get_stats64(struct net_device *ndev, struct rtnl_link_stats64 *s)
  1270. {
  1271. unsigned long flags;
  1272. @@ -2522,8 +2522,6 @@ dwceqos_get_stats64(struct net_device *n
  1273. else
  1274. s->tx_errors = hwstats->txunderflowerror +
  1275. hwstats->txcarriererror;
  1276. -
  1277. - return s;
  1278. }
  1279. static void
  1280. --- a/drivers/net/ethernet/tile/tilepro.c
  1281. +++ b/drivers/net/ethernet/tile/tilepro.c
  1282. @@ -2047,8 +2047,8 @@ static int tile_net_ioctl(struct net_dev
  1283. *
  1284. * Returns the address of the device statistics structure.
  1285. */
  1286. -static struct rtnl_link_stats64 *tile_net_get_stats64(struct net_device *dev,
  1287. - struct rtnl_link_stats64 *stats)
  1288. +static void tile_net_get_stats64(struct net_device *dev,
  1289. + struct rtnl_link_stats64 *stats)
  1290. {
  1291. struct tile_net_priv *priv = netdev_priv(dev);
  1292. u64 rx_packets = 0, tx_packets = 0;
  1293. --- a/drivers/net/ethernet/via/via-rhine.c
  1294. +++ b/drivers/net/ethernet/via/via-rhine.c
  1295. @@ -513,8 +513,8 @@ static irqreturn_t rhine_interrupt(int i
  1296. static void rhine_tx(struct net_device *dev);
  1297. static int rhine_rx(struct net_device *dev, int limit);
  1298. static void rhine_set_rx_mode(struct net_device *dev);
  1299. -static struct rtnl_link_stats64 *rhine_get_stats64(struct net_device *dev,
  1300. - struct rtnl_link_stats64 *stats);
  1301. +static void rhine_get_stats64(struct net_device *dev,
  1302. + struct rtnl_link_stats64 *stats);
  1303. static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  1304. static const struct ethtool_ops netdev_ethtool_ops;
  1305. static int rhine_close(struct net_device *dev);
  1306. @@ -2222,7 +2222,7 @@ out_unlock:
  1307. mutex_unlock(&rp->task_lock);
  1308. }
  1309. -static struct rtnl_link_stats64 *
  1310. +static void
  1311. rhine_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1312. {
  1313. struct rhine_private *rp = netdev_priv(dev);
  1314. @@ -2245,8 +2245,6 @@ rhine_get_stats64(struct net_device *dev
  1315. stats->tx_packets = rp->tx_stats.packets;
  1316. stats->tx_bytes = rp->tx_stats.bytes;
  1317. } while (u64_stats_fetch_retry_irq(&rp->tx_stats.syncp, start));
  1318. -
  1319. - return stats;
  1320. }
  1321. static void rhine_set_rx_mode(struct net_device *dev)
  1322. --- a/drivers/net/fjes/fjes_main.c
  1323. +++ b/drivers/net/fjes/fjes_main.c
  1324. @@ -56,8 +56,7 @@ static void fjes_raise_intr_rxdata_task(
  1325. static void fjes_tx_stall_task(struct work_struct *);
  1326. static void fjes_force_close_task(struct work_struct *);
  1327. static irqreturn_t fjes_intr(int, void*);
  1328. -static struct rtnl_link_stats64 *
  1329. -fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *);
  1330. +static void fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *);
  1331. static int fjes_change_mtu(struct net_device *, int);
  1332. static int fjes_vlan_rx_add_vid(struct net_device *, __be16 proto, u16);
  1333. static int fjes_vlan_rx_kill_vid(struct net_device *, __be16 proto, u16);
  1334. @@ -762,14 +761,12 @@ static void fjes_tx_retry(struct net_dev
  1335. netif_tx_wake_queue(queue);
  1336. }
  1337. -static struct rtnl_link_stats64 *
  1338. +static void
  1339. fjes_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
  1340. {
  1341. struct fjes_adapter *adapter = netdev_priv(netdev);
  1342. memcpy(stats, &adapter->stats64, sizeof(struct rtnl_link_stats64));
  1343. -
  1344. - return stats;
  1345. }
  1346. static int fjes_change_mtu(struct net_device *netdev, int new_mtu)
  1347. --- a/drivers/net/hyperv/netvsc_drv.c
  1348. +++ b/drivers/net/hyperv/netvsc_drv.c
  1349. @@ -918,8 +918,8 @@ out:
  1350. return ret;
  1351. }
  1352. -static struct rtnl_link_stats64 *netvsc_get_stats64(struct net_device *net,
  1353. - struct rtnl_link_stats64 *t)
  1354. +static void netvsc_get_stats64(struct net_device *net,
  1355. + struct rtnl_link_stats64 *t)
  1356. {
  1357. struct net_device_context *ndev_ctx = netdev_priv(net);
  1358. int cpu;
  1359. @@ -957,8 +957,6 @@ static struct rtnl_link_stats64 *netvsc_
  1360. t->rx_dropped = net->stats.rx_dropped;
  1361. t->rx_errors = net->stats.rx_errors;
  1362. -
  1363. - return t;
  1364. }
  1365. static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
  1366. --- a/drivers/net/ifb.c
  1367. +++ b/drivers/net/ifb.c
  1368. @@ -129,8 +129,8 @@ resched:
  1369. }
  1370. -static struct rtnl_link_stats64 *ifb_stats64(struct net_device *dev,
  1371. - struct rtnl_link_stats64 *stats)
  1372. +static void ifb_stats64(struct net_device *dev,
  1373. + struct rtnl_link_stats64 *stats)
  1374. {
  1375. struct ifb_dev_private *dp = netdev_priv(dev);
  1376. struct ifb_q_private *txp = dp->tx_private;
  1377. @@ -157,8 +157,6 @@ static struct rtnl_link_stats64 *ifb_sta
  1378. }
  1379. stats->rx_dropped = dev->stats.rx_dropped;
  1380. stats->tx_dropped = dev->stats.tx_dropped;
  1381. -
  1382. - return stats;
  1383. }
  1384. static int ifb_dev_init(struct net_device *dev)
  1385. --- a/drivers/net/ipvlan/ipvlan_main.c
  1386. +++ b/drivers/net/ipvlan/ipvlan_main.c
  1387. @@ -296,8 +296,8 @@ static void ipvlan_set_multicast_mac_fil
  1388. dev_mc_sync(ipvlan->phy_dev, dev);
  1389. }
  1390. -static struct rtnl_link_stats64 *ipvlan_get_stats64(struct net_device *dev,
  1391. - struct rtnl_link_stats64 *s)
  1392. +static void ipvlan_get_stats64(struct net_device *dev,
  1393. + struct rtnl_link_stats64 *s)
  1394. {
  1395. struct ipvl_dev *ipvlan = netdev_priv(dev);
  1396. @@ -334,7 +334,6 @@ static struct rtnl_link_stats64 *ipvlan_
  1397. s->rx_dropped = rx_errs;
  1398. s->tx_dropped = tx_drps;
  1399. }
  1400. - return s;
  1401. }
  1402. static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
  1403. --- a/drivers/net/loopback.c
  1404. +++ b/drivers/net/loopback.c
  1405. @@ -97,8 +97,8 @@ static netdev_tx_t loopback_xmit(struct
  1406. return NETDEV_TX_OK;
  1407. }
  1408. -static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
  1409. - struct rtnl_link_stats64 *stats)
  1410. +static void loopback_get_stats64(struct net_device *dev,
  1411. + struct rtnl_link_stats64 *stats)
  1412. {
  1413. u64 bytes = 0;
  1414. u64 packets = 0;
  1415. @@ -122,7 +122,6 @@ static struct rtnl_link_stats64 *loopbac
  1416. stats->tx_packets = packets;
  1417. stats->rx_bytes = bytes;
  1418. stats->tx_bytes = bytes;
  1419. - return stats;
  1420. }
  1421. static u32 always_on(struct net_device *dev)
  1422. --- a/drivers/net/macsec.c
  1423. +++ b/drivers/net/macsec.c
  1424. @@ -2899,13 +2899,13 @@ static int macsec_change_mtu(struct net_
  1425. return 0;
  1426. }
  1427. -static struct rtnl_link_stats64 *macsec_get_stats64(struct net_device *dev,
  1428. - struct rtnl_link_stats64 *s)
  1429. +static void macsec_get_stats64(struct net_device *dev,
  1430. + struct rtnl_link_stats64 *s)
  1431. {
  1432. int cpu;
  1433. if (!dev->tstats)
  1434. - return s;
  1435. + return;
  1436. for_each_possible_cpu(cpu) {
  1437. struct pcpu_sw_netstats *stats;
  1438. @@ -2929,8 +2929,6 @@ static struct rtnl_link_stats64 *macsec_
  1439. s->rx_dropped = dev->stats.rx_dropped;
  1440. s->tx_dropped = dev->stats.tx_dropped;
  1441. -
  1442. - return s;
  1443. }
  1444. static int macsec_get_iflink(const struct net_device *dev)
  1445. --- a/drivers/net/macvlan.c
  1446. +++ b/drivers/net/macvlan.c
  1447. @@ -857,8 +857,8 @@ static void macvlan_uninit(struct net_de
  1448. macvlan_port_destroy(port->dev);
  1449. }
  1450. -static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
  1451. - struct rtnl_link_stats64 *stats)
  1452. +static void macvlan_dev_get_stats64(struct net_device *dev,
  1453. + struct rtnl_link_stats64 *stats)
  1454. {
  1455. struct macvlan_dev *vlan = netdev_priv(dev);
  1456. @@ -895,7 +895,6 @@ static struct rtnl_link_stats64 *macvlan
  1457. stats->rx_dropped = rx_errors;
  1458. stats->tx_dropped = tx_dropped;
  1459. }
  1460. - return stats;
  1461. }
  1462. static int macvlan_vlan_rx_add_vid(struct net_device *dev,
  1463. --- a/drivers/net/nlmon.c
  1464. +++ b/drivers/net/nlmon.c
  1465. @@ -76,7 +76,7 @@ static int nlmon_close(struct net_device
  1466. return netlink_remove_tap(&nlmon->nt);
  1467. }
  1468. -static struct rtnl_link_stats64 *
  1469. +static void
  1470. nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1471. {
  1472. int i;
  1473. @@ -104,8 +104,6 @@ nlmon_get_stats64(struct net_device *dev
  1474. stats->rx_bytes = bytes;
  1475. stats->tx_bytes = 0;
  1476. -
  1477. - return stats;
  1478. }
  1479. static u32 always_on(struct net_device *dev)
  1480. --- a/drivers/net/ppp/ppp_generic.c
  1481. +++ b/drivers/net/ppp/ppp_generic.c
  1482. @@ -1312,7 +1312,7 @@ ppp_net_ioctl(struct net_device *dev, st
  1483. return err;
  1484. }
  1485. -static struct rtnl_link_stats64*
  1486. +static void
  1487. ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64)
  1488. {
  1489. struct ppp *ppp = netdev_priv(dev);
  1490. @@ -1332,8 +1332,6 @@ ppp_get_stats64(struct net_device *dev,
  1491. stats64->rx_dropped = dev->stats.rx_dropped;
  1492. stats64->tx_dropped = dev->stats.tx_dropped;
  1493. stats64->rx_length_errors = dev->stats.rx_length_errors;
  1494. -
  1495. - return stats64;
  1496. }
  1497. static int ppp_dev_init(struct net_device *dev)
  1498. --- a/drivers/net/slip/slip.c
  1499. +++ b/drivers/net/slip/slip.c
  1500. @@ -571,7 +571,7 @@ static int sl_change_mtu(struct net_devi
  1501. /* Netdevice get statistics request */
  1502. -static struct rtnl_link_stats64 *
  1503. +static void
  1504. sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1505. {
  1506. struct net_device_stats *devstats = &dev->stats;
  1507. @@ -602,7 +602,6 @@ sl_get_stats64(struct net_device *dev, s
  1508. stats->collisions += comp->sls_o_misses;
  1509. }
  1510. #endif
  1511. - return stats;
  1512. }
  1513. /* Netdevice register callback */
  1514. --- a/drivers/net/team/team.c
  1515. +++ b/drivers/net/team/team.c
  1516. @@ -1798,7 +1798,7 @@ unwind:
  1517. return err;
  1518. }
  1519. -static struct rtnl_link_stats64 *
  1520. +static void
  1521. team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1522. {
  1523. struct team *team = netdev_priv(dev);
  1524. @@ -1835,7 +1835,6 @@ team_get_stats64(struct net_device *dev,
  1525. stats->rx_dropped = rx_dropped;
  1526. stats->tx_dropped = tx_dropped;
  1527. stats->rx_nohandler = rx_nohandler;
  1528. - return stats;
  1529. }
  1530. static int team_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
  1531. --- a/drivers/net/tun.c
  1532. +++ b/drivers/net/tun.c
  1533. @@ -983,7 +983,7 @@ static void tun_set_headroom(struct net_
  1534. tun->align = new_hr;
  1535. }
  1536. -static struct rtnl_link_stats64 *
  1537. +static void
  1538. tun_net_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1539. {
  1540. u32 rx_dropped = 0, tx_dropped = 0, rx_frame_errors = 0;
  1541. @@ -1017,7 +1017,6 @@ tun_net_get_stats64(struct net_device *d
  1542. stats->rx_dropped = rx_dropped;
  1543. stats->rx_frame_errors = rx_frame_errors;
  1544. stats->tx_dropped = tx_dropped;
  1545. - return stats;
  1546. }
  1547. static const struct net_device_ops tun_netdev_ops = {
  1548. --- a/drivers/net/veth.c
  1549. +++ b/drivers/net/veth.c
  1550. @@ -161,8 +161,8 @@ static u64 veth_stats_one(struct pcpu_vs
  1551. return atomic64_read(&priv->dropped);
  1552. }
  1553. -static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
  1554. - struct rtnl_link_stats64 *tot)
  1555. +static void veth_get_stats64(struct net_device *dev,
  1556. + struct rtnl_link_stats64 *tot)
  1557. {
  1558. struct veth_priv *priv = netdev_priv(dev);
  1559. struct net_device *peer;
  1560. @@ -180,8 +180,6 @@ static struct rtnl_link_stats64 *veth_ge
  1561. tot->rx_packets = one.packets;
  1562. }
  1563. rcu_read_unlock();
  1564. -
  1565. - return tot;
  1566. }
  1567. /* fake multicast ability */
  1568. --- a/drivers/net/virtio_net.c
  1569. +++ b/drivers/net/virtio_net.c
  1570. @@ -1017,8 +1017,8 @@ out:
  1571. return ret;
  1572. }
  1573. -static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
  1574. - struct rtnl_link_stats64 *tot)
  1575. +static void virtnet_stats(struct net_device *dev,
  1576. + struct rtnl_link_stats64 *tot)
  1577. {
  1578. struct virtnet_info *vi = netdev_priv(dev);
  1579. int cpu;
  1580. @@ -1051,8 +1051,6 @@ static struct rtnl_link_stats64 *virtnet
  1581. tot->rx_dropped = dev->stats.rx_dropped;
  1582. tot->rx_length_errors = dev->stats.rx_length_errors;
  1583. tot->rx_frame_errors = dev->stats.rx_frame_errors;
  1584. -
  1585. - return tot;
  1586. }
  1587. #ifdef CONFIG_NET_POLL_CONTROLLER
  1588. --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
  1589. +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
  1590. @@ -113,7 +113,7 @@ vmxnet3_global_stats[] = {
  1591. };
  1592. -struct rtnl_link_stats64 *
  1593. +void
  1594. vmxnet3_get_stats64(struct net_device *netdev,
  1595. struct rtnl_link_stats64 *stats)
  1596. {
  1597. @@ -160,8 +160,6 @@ vmxnet3_get_stats64(struct net_device *n
  1598. stats->rx_dropped += drvRxStats->drop_total;
  1599. stats->multicast += devRxStats->mcastPktsRxOK;
  1600. }
  1601. -
  1602. - return stats;
  1603. }
  1604. static int
  1605. --- a/drivers/net/vmxnet3/vmxnet3_int.h
  1606. +++ b/drivers/net/vmxnet3/vmxnet3_int.h
  1607. @@ -466,8 +466,8 @@ vmxnet3_create_queues(struct vmxnet3_ada
  1608. void vmxnet3_set_ethtool_ops(struct net_device *netdev);
  1609. -struct rtnl_link_stats64 *
  1610. -vmxnet3_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats);
  1611. +void vmxnet3_get_stats64(struct net_device *dev,
  1612. + struct rtnl_link_stats64 *stats);
  1613. extern char vmxnet3_driver_name[];
  1614. #endif
  1615. --- a/drivers/net/vrf.c
  1616. +++ b/drivers/net/vrf.c
  1617. @@ -79,8 +79,8 @@ static void vrf_tx_error(struct net_devi
  1618. kfree_skb(skb);
  1619. }
  1620. -static struct rtnl_link_stats64 *vrf_get_stats64(struct net_device *dev,
  1621. - struct rtnl_link_stats64 *stats)
  1622. +static void vrf_get_stats64(struct net_device *dev,
  1623. + struct rtnl_link_stats64 *stats)
  1624. {
  1625. int i;
  1626. @@ -104,7 +104,6 @@ static struct rtnl_link_stats64 *vrf_get
  1627. stats->rx_bytes += rbytes;
  1628. stats->rx_packets += rpkts;
  1629. }
  1630. - return stats;
  1631. }
  1632. /* Local traffic destined to local address. Reinsert the packet to rx
  1633. --- a/drivers/net/xen-netfront.c
  1634. +++ b/drivers/net/xen-netfront.c
  1635. @@ -1081,8 +1081,8 @@ static int xennet_change_mtu(struct net_
  1636. return 0;
  1637. }
  1638. -static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
  1639. - struct rtnl_link_stats64 *tot)
  1640. +static void xennet_get_stats64(struct net_device *dev,
  1641. + struct rtnl_link_stats64 *tot)
  1642. {
  1643. struct netfront_info *np = netdev_priv(dev);
  1644. int cpu;
  1645. @@ -1113,8 +1113,6 @@ static struct rtnl_link_stats64 *xennet_
  1646. tot->rx_errors = dev->stats.rx_errors;
  1647. tot->tx_dropped = dev->stats.tx_dropped;
  1648. -
  1649. - return tot;
  1650. }
  1651. static void xennet_release_tx_bufs(struct netfront_queue *queue)
  1652. --- a/drivers/staging/netlogic/xlr_net.c
  1653. +++ b/drivers/staging/netlogic/xlr_net.c
  1654. @@ -395,14 +395,6 @@ static void xlr_stats(struct net_device
  1655. TX_DROP_FRAME_COUNTER);
  1656. }
  1657. -static struct rtnl_link_stats64 *xlr_get_stats64(struct net_device *ndev,
  1658. - struct rtnl_link_stats64 *stats
  1659. - )
  1660. -{
  1661. - xlr_stats(ndev, stats);
  1662. - return stats;
  1663. -}
  1664. -
  1665. static const struct net_device_ops xlr_netdev_ops = {
  1666. .ndo_open = xlr_net_open,
  1667. .ndo_stop = xlr_net_stop,
  1668. @@ -410,7 +402,7 @@ static const struct net_device_ops xlr_n
  1669. .ndo_select_queue = xlr_net_select_queue,
  1670. .ndo_set_mac_address = xlr_net_set_mac_addr,
  1671. .ndo_set_rx_mode = xlr_set_rx_mode,
  1672. - .ndo_get_stats64 = xlr_get_stats64,
  1673. + .ndo_get_stats64 = xlr_stats,
  1674. };
  1675. /*
  1676. --- a/include/linux/device.h
  1677. +++ b/include/linux/device.h
  1678. @@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(stru
  1679. int devm_add_action(struct device *dev, void (*action)(void *), void *data);
  1680. void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
  1681. +/**
  1682. + * devm_alloc_percpu - Resource-managed alloc_percpu
  1683. + * @dev: Device to allocate per-cpu memory for
  1684. + * @type: Type to allocate per-cpu memory for
  1685. + *
  1686. + * Managed alloc_percpu. Per-cpu memory allocated with this function is
  1687. + * automatically freed on driver detach.
  1688. + *
  1689. + * RETURNS:
  1690. + * Pointer to allocated memory on success, NULL on failure.
  1691. + */
  1692. +#define devm_alloc_percpu(dev, type) \
  1693. + ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \
  1694. + __alignof__(type)))
  1695. +
  1696. +void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
  1697. + size_t align);
  1698. +void devm_free_percpu(struct device *dev, void __percpu *pdata);
  1699. +
  1700. static inline int devm_add_action_or_reset(struct device *dev,
  1701. void (*action)(void *), void *data)
  1702. {
  1703. --- /dev/null
  1704. +++ b/include/linux/fsl/svr.h
  1705. @@ -0,0 +1,97 @@
  1706. +/*
  1707. + * MPC85xx cpu type detection
  1708. + *
  1709. + * Copyright 2011-2012 Freescale Semiconductor, Inc.
  1710. + *
  1711. + * This is free software; you can redistribute it and/or modify
  1712. + * it under the terms of the GNU General Public License as published by
  1713. + * the Free Software Foundation; either version 2 of the License, or
  1714. + * (at your option) any later version.
  1715. + */
  1716. +
  1717. +#ifndef FSL_SVR_H
  1718. +#define FSL_SVR_H
  1719. +
  1720. +#define SVR_REV(svr) ((svr) & 0xFF) /* SOC design resision */
  1721. +#define SVR_MAJ(svr) (((svr) >> 4) & 0xF) /* Major revision field*/
  1722. +#define SVR_MIN(svr) (((svr) >> 0) & 0xF) /* Minor revision field*/
  1723. +
  1724. +/* Some parts define SVR[0:23] as the SOC version */
  1725. +#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF) /* SOC Version fields */
  1726. +
  1727. +#define SVR_8533 0x803400
  1728. +#define SVR_8535 0x803701
  1729. +#define SVR_8536 0x803700
  1730. +#define SVR_8540 0x803000
  1731. +#define SVR_8541 0x807200
  1732. +#define SVR_8543 0x803200
  1733. +#define SVR_8544 0x803401
  1734. +#define SVR_8545 0x803102
  1735. +#define SVR_8547 0x803101
  1736. +#define SVR_8548 0x803100
  1737. +#define SVR_8555 0x807100
  1738. +#define SVR_8560 0x807000
  1739. +#define SVR_8567 0x807501
  1740. +#define SVR_8568 0x807500
  1741. +#define SVR_8569 0x808000
  1742. +#define SVR_8572 0x80E000
  1743. +#define SVR_P1010 0x80F100
  1744. +#define SVR_P1011 0x80E500
  1745. +#define SVR_P1012 0x80E501
  1746. +#define SVR_P1013 0x80E700
  1747. +#define SVR_P1014 0x80F101
  1748. +#define SVR_P1017 0x80F700
  1749. +#define SVR_P1020 0x80E400
  1750. +#define SVR_P1021 0x80E401
  1751. +#define SVR_P1022 0x80E600
  1752. +#define SVR_P1023 0x80F600
  1753. +#define SVR_P1024 0x80E402
  1754. +#define SVR_P1025 0x80E403
  1755. +#define SVR_P2010 0x80E300
  1756. +#define SVR_P2020 0x80E200
  1757. +#define SVR_P2040 0x821000
  1758. +#define SVR_P2041 0x821001
  1759. +#define SVR_P3041 0x821103
  1760. +#define SVR_P4040 0x820100
  1761. +#define SVR_P4080 0x820000
  1762. +#define SVR_P5010 0x822100
  1763. +#define SVR_P5020 0x822000
  1764. +#define SVR_P5021 0X820500
  1765. +#define SVR_P5040 0x820400
  1766. +#define SVR_T4240 0x824000
  1767. +#define SVR_T4120 0x824001
  1768. +#define SVR_T4160 0x824100
  1769. +#define SVR_T4080 0x824102
  1770. +#define SVR_C291 0x850000
  1771. +#define SVR_C292 0x850020
  1772. +#define SVR_C293 0x850030
  1773. +#define SVR_B4860 0X868000
  1774. +#define SVR_G4860 0x868001
  1775. +#define SVR_G4060 0x868003
  1776. +#define SVR_B4440 0x868100
  1777. +#define SVR_G4440 0x868101
  1778. +#define SVR_B4420 0x868102
  1779. +#define SVR_B4220 0x868103
  1780. +#define SVR_T1040 0x852000
  1781. +#define SVR_T1041 0x852001
  1782. +#define SVR_T1042 0x852002
  1783. +#define SVR_T1020 0x852100
  1784. +#define SVR_T1021 0x852101
  1785. +#define SVR_T1022 0x852102
  1786. +#define SVR_T1023 0x854100
  1787. +#define SVR_T1024 0x854000
  1788. +#define SVR_T2080 0x853000
  1789. +#define SVR_T2081 0x853100
  1790. +
  1791. +#define SVR_8610 0x80A000
  1792. +#define SVR_8641 0x809000
  1793. +#define SVR_8641D 0x809001
  1794. +
  1795. +#define SVR_9130 0x860001
  1796. +#define SVR_9131 0x860000
  1797. +#define SVR_9132 0x861000
  1798. +#define SVR_9232 0x861400
  1799. +
  1800. +#define SVR_Unknown 0xFFFFFF
  1801. +
  1802. +#endif
  1803. --- a/include/linux/fsl_devices.h
  1804. +++ b/include/linux/fsl_devices.h
  1805. @@ -99,7 +99,10 @@ struct fsl_usb2_platform_data {
  1806. unsigned suspended:1;
  1807. unsigned already_suspended:1;
  1808. unsigned has_fsl_erratum_a007792:1;
  1809. + unsigned has_fsl_erratum_14:1;
  1810. unsigned has_fsl_erratum_a005275:1;
  1811. + unsigned has_fsl_erratum_a006918:1;
  1812. + unsigned has_fsl_erratum_a005697:1;
  1813. unsigned check_phy_clk_valid:1;
  1814. /* register save area for suspend/resume */
  1815. --- a/include/linux/netdev_features.h
  1816. +++ b/include/linux/netdev_features.h
  1817. @@ -74,6 +74,7 @@ enum {
  1818. NETIF_F_BUSY_POLL_BIT, /* Busy poll */
  1819. NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */
  1820. + NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */
  1821. /*
  1822. * Add your fresh new feature above and remember to update
  1823. @@ -136,6 +137,7 @@ enum {
  1824. #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
  1825. #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
  1826. #define NETIF_F_HW_TC __NETIF_F(HW_TC)
  1827. +#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ)
  1828. #define for_each_netdev_feature(mask_addr, bit) \
  1829. for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
  1830. --- a/include/linux/netdevice.h
  1831. +++ b/include/linux/netdevice.h
  1832. @@ -916,8 +916,8 @@ struct netdev_xdp {
  1833. * Callback used when the transmitter has not made any progress
  1834. * for dev->watchdog ticks.
  1835. *
  1836. - * struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
  1837. - * struct rtnl_link_stats64 *storage);
  1838. + * void (*ndo_get_stats64)(struct net_device *dev,
  1839. + * struct rtnl_link_stats64 *storage);
  1840. * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
  1841. * Called when a user wants to get the network device usage
  1842. * statistics. Drivers must do one of the following:
  1843. @@ -1165,8 +1165,8 @@ struct net_device_ops {
  1844. struct neigh_parms *);
  1845. void (*ndo_tx_timeout) (struct net_device *dev);
  1846. - struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
  1847. - struct rtnl_link_stats64 *storage);
  1848. + void (*ndo_get_stats64)(struct net_device *dev,
  1849. + struct rtnl_link_stats64 *storage);
  1850. bool (*ndo_has_offload_stats)(int attr_id);
  1851. int (*ndo_get_offload_stats)(int attr_id,
  1852. const struct net_device *dev,
  1853. @@ -1509,6 +1509,8 @@ enum netdev_priv_flags {
  1854. * @if_port: Selectable AUI, TP, ...
  1855. * @dma: DMA channel
  1856. * @mtu: Interface MTU value
  1857. + * @min_mtu: Interface Minimum MTU value
  1858. + * @max_mtu: Interface Maximum MTU value
  1859. * @type: Interface hardware type
  1860. * @hard_header_len: Maximum hardware header length.
  1861. * @min_header_len: Minimum hardware header length
  1862. @@ -1735,6 +1737,8 @@ struct net_device {
  1863. unsigned char dma;
  1864. unsigned int mtu;
  1865. + unsigned int min_mtu;
  1866. + unsigned int max_mtu;
  1867. unsigned short type;
  1868. unsigned short hard_header_len;
  1869. unsigned short min_header_len;
  1870. --- a/include/linux/skbuff.h
  1871. +++ b/include/linux/skbuff.h
  1872. @@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb);
  1873. void kfree_skb_list(struct sk_buff *segs);
  1874. void skb_tx_error(struct sk_buff *skb);
  1875. void consume_skb(struct sk_buff *skb);
  1876. +void skb_recycle(struct sk_buff *skb);
  1877. void __kfree_skb(struct sk_buff *skb);
  1878. extern struct kmem_cache *skbuff_head_cache;
  1879. @@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc
  1880. }
  1881. int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
  1882. int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
  1883. +void copy_skb_header(struct sk_buff *new, const struct sk_buff *old);
  1884. int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
  1885. __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
  1886. int len, __wsum csum);
  1887. --- a/include/linux/sys_soc.h
  1888. +++ b/include/linux/sys_soc.h
  1889. @@ -13,6 +13,7 @@ struct soc_device_attribute {
  1890. const char *family;
  1891. const char *revision;
  1892. const char *soc_id;
  1893. + const void *data;
  1894. };
  1895. /**
  1896. @@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_de
  1897. */
  1898. struct device *soc_device_to_device(struct soc_device *soc);
  1899. +const struct soc_device_attribute *soc_device_match(
  1900. + const struct soc_device_attribute *matches);
  1901. #endif /* __SOC_BUS_H */
  1902. --- a/include/net/ip_tunnels.h
  1903. +++ b/include/net/ip_tunnels.h
  1904. @@ -261,8 +261,8 @@ int ip_tunnel_ioctl(struct net_device *d
  1905. int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict);
  1906. int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
  1907. -struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
  1908. - struct rtnl_link_stats64 *tot);
  1909. +void ip_tunnel_get_stats64(struct net_device *dev,
  1910. + struct rtnl_link_stats64 *tot);
  1911. struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
  1912. int link, __be16 flags,
  1913. __be32 remote, __be32 local,
  1914. --- a/include/uapi/linux/if_ether.h
  1915. +++ b/include/uapi/linux/if_ether.h
  1916. @@ -35,6 +35,7 @@
  1917. #define ETH_DATA_LEN 1500 /* Max. octets in payload */
  1918. #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
  1919. #define ETH_FCS_LEN 4 /* Octets in the FCS */
  1920. +#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */
  1921. /*
  1922. * These are the defined Ethernet Protocol ID's.
  1923. --- a/net/8021q/vlan_dev.c
  1924. +++ b/net/8021q/vlan_dev.c
  1925. @@ -671,7 +671,8 @@ static int vlan_ethtool_get_ts_info(stru
  1926. return 0;
  1927. }
  1928. -static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  1929. +static void vlan_dev_get_stats64(struct net_device *dev,
  1930. + struct rtnl_link_stats64 *stats)
  1931. {
  1932. struct vlan_pcpu_stats *p;
  1933. u32 rx_errors = 0, tx_dropped = 0;
  1934. @@ -702,8 +703,6 @@ static struct rtnl_link_stats64 *vlan_de
  1935. }
  1936. stats->rx_errors = rx_errors;
  1937. stats->tx_dropped = tx_dropped;
  1938. -
  1939. - return stats;
  1940. }
  1941. #ifdef CONFIG_NET_POLL_CONTROLLER
  1942. --- a/net/bridge/br_device.c
  1943. +++ b/net/bridge/br_device.c
  1944. @@ -156,8 +156,8 @@ static int br_dev_stop(struct net_device
  1945. return 0;
  1946. }
  1947. -static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
  1948. - struct rtnl_link_stats64 *stats)
  1949. +static void br_get_stats64(struct net_device *dev,
  1950. + struct rtnl_link_stats64 *stats)
  1951. {
  1952. struct net_bridge *br = netdev_priv(dev);
  1953. struct pcpu_sw_netstats tmp, sum = { 0 };
  1954. @@ -181,8 +181,6 @@ static struct rtnl_link_stats64 *br_get_
  1955. stats->tx_packets = sum.tx_packets;
  1956. stats->rx_bytes = sum.rx_bytes;
  1957. stats->rx_packets = sum.rx_packets;
  1958. -
  1959. - return stats;
  1960. }
  1961. static int br_change_mtu(struct net_device *dev, int new_mtu)
  1962. --- a/net/core/dev.c
  1963. +++ b/net/core/dev.c
  1964. @@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev,
  1965. if (new_mtu == dev->mtu)
  1966. return 0;
  1967. - /* MTU must be positive. */
  1968. - if (new_mtu < 0)
  1969. + /* MTU must be positive, and in range */
  1970. + if (new_mtu < 0 || new_mtu < dev->min_mtu) {
  1971. + net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n",
  1972. + dev->name, new_mtu, dev->min_mtu);
  1973. return -EINVAL;
  1974. + }
  1975. +
  1976. + if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) {
  1977. + net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n",
  1978. + dev->name, new_mtu, dev->min_mtu);
  1979. + return -EINVAL;
  1980. + }
  1981. if (!netif_device_present(dev))
  1982. return -ENODEV;
  1983. --- a/net/core/skbuff.c
  1984. +++ b/net/core/skbuff.c
  1985. @@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *sk
  1986. }
  1987. EXPORT_SYMBOL(napi_consume_skb);
  1988. +/**
  1989. + * skb_recycle - clean up an skb for reuse
  1990. + * @skb: buffer
  1991. + *
  1992. + * Recycles the skb to be reused as a receive buffer. This
  1993. + * function does any necessary reference count dropping, and
  1994. + * cleans up the skbuff as if it just came from __alloc_skb().
  1995. + */
  1996. +void skb_recycle(struct sk_buff *skb)
  1997. +{
  1998. + struct skb_shared_info *shinfo;
  1999. + u8 head_frag = skb->head_frag;
  2000. +
  2001. + skb_release_head_state(skb);
  2002. +
  2003. + shinfo = skb_shinfo(skb);
  2004. + memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
  2005. + atomic_set(&shinfo->dataref, 1);
  2006. +
  2007. + memset(skb, 0, offsetof(struct sk_buff, tail));
  2008. + skb->data = skb->head + NET_SKB_PAD;
  2009. + skb->head_frag = head_frag;
  2010. + skb_reset_tail_pointer(skb);
  2011. +}
  2012. +EXPORT_SYMBOL(skb_recycle);
  2013. +
  2014. /* Make sure a field is enclosed inside headers_start/headers_end section */
  2015. #define CHECK_SKB_FIELD(field) \
  2016. BUILD_BUG_ON(offsetof(struct sk_buff, field) < \
  2017. @@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st
  2018. skb->inner_mac_header += off;
  2019. }
  2020. -static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
  2021. +void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
  2022. {
  2023. __copy_skb_header(new, old);
  2024. @@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu
  2025. skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
  2026. skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
  2027. }
  2028. +EXPORT_SYMBOL(copy_skb_header);
  2029. static inline int skb_alloc_rx_flag(const struct sk_buff *skb)
  2030. {
  2031. --- a/net/ipv4/ip_tunnel_core.c
  2032. +++ b/net/ipv4/ip_tunnel_core.c
  2033. @@ -188,8 +188,8 @@ int iptunnel_handle_offloads(struct sk_b
  2034. EXPORT_SYMBOL_GPL(iptunnel_handle_offloads);
  2035. /* Often modified stats are per cpu, other are shared (netdev->stats) */
  2036. -struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
  2037. - struct rtnl_link_stats64 *tot)
  2038. +void ip_tunnel_get_stats64(struct net_device *dev,
  2039. + struct rtnl_link_stats64 *tot)
  2040. {
  2041. int i;
  2042. @@ -214,8 +214,6 @@ struct rtnl_link_stats64 *ip_tunnel_get_
  2043. tot->rx_bytes += rx_bytes;
  2044. tot->tx_bytes += tx_bytes;
  2045. }
  2046. -
  2047. - return tot;
  2048. }
  2049. EXPORT_SYMBOL_GPL(ip_tunnel_get_stats64);
  2050. --- a/net/l2tp/l2tp_eth.c
  2051. +++ b/net/l2tp/l2tp_eth.c
  2052. @@ -106,8 +106,8 @@ static int l2tp_eth_dev_xmit(struct sk_b
  2053. return NETDEV_TX_OK;
  2054. }
  2055. -static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev,
  2056. - struct rtnl_link_stats64 *stats)
  2057. +static void l2tp_eth_get_stats64(struct net_device *dev,
  2058. + struct rtnl_link_stats64 *stats)
  2059. {
  2060. struct l2tp_eth *priv = netdev_priv(dev);
  2061. @@ -117,10 +117,8 @@ static struct rtnl_link_stats64 *l2tp_et
  2062. stats->rx_bytes = atomic_long_read(&priv->rx_bytes);
  2063. stats->rx_packets = atomic_long_read(&priv->rx_packets);
  2064. stats->rx_errors = atomic_long_read(&priv->rx_errors);
  2065. - return stats;
  2066. }
  2067. -
  2068. static const struct net_device_ops l2tp_eth_netdev_ops = {
  2069. .ndo_init = l2tp_eth_dev_init,
  2070. .ndo_uninit = l2tp_eth_dev_uninit,
  2071. --- a/net/mac80211/iface.c
  2072. +++ b/net/mac80211/iface.c
  2073. @@ -1146,7 +1146,7 @@ static u16 ieee80211_netdev_select_queue
  2074. return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb);
  2075. }
  2076. -static struct rtnl_link_stats64 *
  2077. +static void
  2078. ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
  2079. {
  2080. int i;
  2081. @@ -1171,8 +1171,6 @@ ieee80211_get_stats64(struct net_device
  2082. stats->rx_bytes += rx_bytes;
  2083. stats->tx_bytes += tx_bytes;
  2084. }
  2085. -
  2086. - return stats;
  2087. }
  2088. static const struct net_device_ops ieee80211_dataif_ops = {
  2089. --- a/net/openvswitch/vport-internal_dev.c
  2090. +++ b/net/openvswitch/vport-internal_dev.c
  2091. @@ -106,7 +106,7 @@ static void internal_dev_destructor(stru
  2092. free_netdev(dev);
  2093. }
  2094. -static struct rtnl_link_stats64 *
  2095. +static void
  2096. internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
  2097. {
  2098. int i;
  2099. @@ -134,8 +134,6 @@ internal_get_stats(struct net_device *de
  2100. stats->tx_bytes += local_stats.tx_bytes;
  2101. stats->tx_packets += local_stats.tx_packets;
  2102. }
  2103. -
  2104. - return stats;
  2105. }
  2106. static void internal_set_rx_headroom(struct net_device *dev, int new_hr)
  2107. --- a/net/sched/sch_generic.c
  2108. +++ b/net/sched/sch_generic.c
  2109. @@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long a
  2110. txq->trans_timeout++;
  2111. break;
  2112. }
  2113. +
  2114. + /* Devices with HW_ACCEL_MQ have multiple txqs
  2115. + * but update only the first one's transmission
  2116. + * timestamp so avoid checking the rest.
  2117. + */
  2118. + if (dev->features & NETIF_F_HW_ACCEL_MQ)
  2119. + break;
  2120. }
  2121. if (some_queue_timedout) {
  2122. --- a/net/sched/sch_teql.c
  2123. +++ b/net/sched/sch_teql.c
  2124. @@ -401,8 +401,8 @@ static int teql_master_close(struct net_
  2125. return 0;
  2126. }
  2127. -static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev,
  2128. - struct rtnl_link_stats64 *stats)
  2129. +static void teql_master_stats64(struct net_device *dev,
  2130. + struct rtnl_link_stats64 *stats)
  2131. {
  2132. struct teql_master *m = netdev_priv(dev);
  2133. @@ -410,7 +410,6 @@ static struct rtnl_link_stats64 *teql_ma
  2134. stats->tx_bytes = m->tx_bytes;
  2135. stats->tx_errors = m->tx_errors;
  2136. stats->tx_dropped = m->tx_dropped;
  2137. - return stats;
  2138. }
  2139. static int teql_master_mtu(struct net_device *dev, int new_mtu)