1 From 2ed7bff3d1f2fa6c5f6eff0b2bd98deaa3dc18b0 Mon Sep 17 00:00:00 2001
2 From: Yangbo Lu <yangbo.lu@nxp.com>
3 Date: Mon, 25 Sep 2017 10:57:14 +0800
4 Subject: [PATCH] net: support layerscape
6 This is a integrated patch for layerscape net support.
8 Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
9 Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
10 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
11 Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
12 Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
13 Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
14 Signed-off-by: Jarod Wilson <jarod@redhat.com>
15 Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
16 Signed-off-by: stephen hemminger <stephen@networkplumber.org>
17 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
18 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
20 drivers/base/devres.c | 66 +++++++++++++++
21 drivers/base/soc.c | 66 +++++++++++++++
22 drivers/net/bonding/bond_main.c | 10 +--
23 drivers/net/dummy.c | 5 +-
24 drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +--
25 drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 6 +-
26 drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 4 +-
27 drivers/net/ethernet/atheros/alx/main.c | 6 +-
28 drivers/net/ethernet/broadcom/b44.c | 5 +-
29 drivers/net/ethernet/broadcom/bnx2.c | 5 +-
30 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +-
31 drivers/net/ethernet/broadcom/tg3.c | 8 +-
32 drivers/net/ethernet/brocade/bna/bnad.c | 6 +-
33 drivers/net/ethernet/calxeda/xgmac.c | 5 +-
34 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 5 +-
35 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 7 +-
36 drivers/net/ethernet/cisco/enic/enic_main.c | 8 +-
37 drivers/net/ethernet/ec_bhf.c | 4 +-
38 drivers/net/ethernet/emulex/benet/be_main.c | 5 +-
39 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 6 +-
40 drivers/net/ethernet/ibm/ehea/ehea_main.c | 5 +-
41 drivers/net/ethernet/intel/e1000e/e1000.h | 4 +-
42 drivers/net/ethernet/intel/e1000e/netdev.c | 5 +-
43 drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +-
44 drivers/net/ethernet/intel/i40e/i40e.h | 5 +-
45 drivers/net/ethernet/intel/i40e/i40e_main.c | 18 ++--
46 drivers/net/ethernet/intel/igb/igb_main.c | 10 +--
47 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 +-
48 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 +-
49 drivers/net/ethernet/marvell/mvneta.c | 4 +-
50 drivers/net/ethernet/marvell/mvpp2.c | 4 +-
51 drivers/net/ethernet/marvell/sky2.c | 6 +-
52 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 +-
53 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 +-
54 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +-
55 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +-
56 drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 3 +-
57 drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 9 +-
58 drivers/net/ethernet/neterion/vxge/vxge-main.c | 4 +-
59 .../net/ethernet/netronome/nfp/nfp_net_common.c | 6 +-
60 drivers/net/ethernet/nvidia/forcedeth.c | 4 +-
61 .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 10 +--
62 drivers/net/ethernet/qlogic/qede/qede_main.c | 7 +-
63 drivers/net/ethernet/qualcomm/emac/emac.c | 6 +-
64 drivers/net/ethernet/realtek/8139too.c | 9 +-
65 drivers/net/ethernet/realtek/r8169.c | 4 +-
66 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 8 +-
67 drivers/net/ethernet/sfc/efx.c | 6 +-
68 drivers/net/ethernet/sun/niu.c | 6 +-
69 drivers/net/ethernet/synopsys/dwc_eth_qos.c | 4 +-
70 drivers/net/ethernet/tile/tilepro.c | 4 +-
71 drivers/net/ethernet/via/via-rhine.c | 8 +-
72 drivers/net/fjes/fjes_main.c | 7 +-
73 drivers/net/hyperv/netvsc_drv.c | 6 +-
74 drivers/net/ifb.c | 6 +-
75 drivers/net/ipvlan/ipvlan_main.c | 5 +-
76 drivers/net/loopback.c | 5 +-
77 drivers/net/macsec.c | 8 +-
78 drivers/net/macvlan.c | 5 +-
79 drivers/net/nlmon.c | 4 +-
80 drivers/net/ppp/ppp_generic.c | 4 +-
81 drivers/net/slip/slip.c | 3 +-
82 drivers/net/team/team.c | 3 +-
83 drivers/net/tun.c | 3 +-
84 drivers/net/veth.c | 6 +-
85 drivers/net/virtio_net.c | 6 +-
86 drivers/net/vmxnet3/vmxnet3_ethtool.c | 4 +-
87 drivers/net/vmxnet3/vmxnet3_int.h | 4 +-
88 drivers/net/vrf.c | 5 +-
89 drivers/net/xen-netfront.c | 6 +-
90 drivers/staging/netlogic/xlr_net.c | 10 +--
91 include/linux/device.h | 19 +++++
92 include/linux/fsl/svr.h | 97 ++++++++++++++++++++++
93 include/linux/fsl_devices.h | 3 +
94 include/linux/netdev_features.h | 2 +
95 include/linux/netdevice.h | 12 ++-
96 include/linux/skbuff.h | 2 +
97 include/linux/sys_soc.h | 3 +
98 include/net/ip_tunnels.h | 4 +-
99 include/uapi/linux/if_ether.h | 1 +
100 net/8021q/vlan_dev.c | 5 +-
101 net/bridge/br_device.c | 6 +-
102 net/core/dev.c | 13 ++-
103 net/core/skbuff.c | 29 ++++++-
104 net/ipv4/ip_tunnel_core.c | 6 +-
105 net/l2tp/l2tp_eth.c | 6 +-
106 net/mac80211/iface.c | 4 +-
107 net/openvswitch/vport-internal_dev.c | 4 +-
108 net/sched/sch_generic.c | 7 ++
109 net/sched/sch_teql.c | 5 +-
110 90 files changed, 468 insertions(+), 298 deletions(-)
111 create mode 100644 include/linux/fsl/svr.h
113 diff --git a/drivers/base/devres.c b/drivers/base/devres.c
114 index 8fc654f0..71d57702 100644
115 --- a/drivers/base/devres.c
116 +++ b/drivers/base/devres.c
118 #include <linux/device.h>
119 #include <linux/module.h>
120 #include <linux/slab.h>
121 +#include <linux/percpu.h>
125 @@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev, unsigned long addr)
128 EXPORT_SYMBOL_GPL(devm_free_pages);
130 +static void devm_percpu_release(struct device *dev, void *pdata)
134 + p = *(void __percpu **)pdata;
138 +static int devm_percpu_match(struct device *dev, void *data, void *p)
140 + struct devres *devr = container_of(data, struct devres, data);
142 + return *(void **)devr->data == p;
146 + * __devm_alloc_percpu - Resource-managed alloc_percpu
147 + * @dev: Device to allocate per-cpu memory for
148 + * @size: Size of per-cpu memory to allocate
149 + * @align: Alignment of per-cpu memory to allocate
151 + * Managed alloc_percpu. Per-cpu memory allocated with this function is
152 + * automatically freed on driver detach.
155 + * Pointer to allocated memory on success, NULL on failure.
157 +void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
161 + void __percpu *pcpu;
163 + pcpu = __alloc_percpu(size, align);
167 + p = devres_alloc(devm_percpu_release, sizeof(void *), GFP_KERNEL);
173 + *(void __percpu **)p = pcpu;
175 + devres_add(dev, p);
179 +EXPORT_SYMBOL_GPL(__devm_alloc_percpu);
182 + * devm_free_percpu - Resource-managed free_percpu
183 + * @dev: Device this memory belongs to
184 + * @pdata: Per-cpu memory to free
186 + * Free memory allocated with devm_alloc_percpu().
188 +void devm_free_percpu(struct device *dev, void __percpu *pdata)
190 + WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match,
193 +EXPORT_SYMBOL_GPL(devm_free_percpu);
194 diff --git a/drivers/base/soc.c b/drivers/base/soc.c
195 index b63f23e6..0c5cf872 100644
196 --- a/drivers/base/soc.c
197 +++ b/drivers/base/soc.c
199 #include <linux/spinlock.h>
200 #include <linux/sys_soc.h>
201 #include <linux/err.h>
202 +#include <linux/glob.h>
204 static DEFINE_IDA(soc_ida);
206 @@ -159,3 +160,68 @@ static int __init soc_bus_register(void)
207 return bus_register(&soc_bus_type);
209 core_initcall(soc_bus_register);
211 +static int soc_device_match_one(struct device *dev, void *arg)
213 + struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
214 + const struct soc_device_attribute *match = arg;
216 + if (match->machine &&
217 + !glob_match(match->machine, soc_dev->attr->machine))
220 + if (match->family &&
221 + !glob_match(match->family, soc_dev->attr->family))
224 + if (match->revision &&
225 + !glob_match(match->revision, soc_dev->attr->revision))
228 + if (match->soc_id &&
229 + !glob_match(match->soc_id, soc_dev->attr->soc_id))
236 + * soc_device_match - identify the SoC in the machine
237 + * @matches: zero-terminated array of possible matches
239 + * returns the first matching entry of the argument array, or NULL
240 + * if none of them match.
242 + * This function is meant as a helper in place of of_match_node()
243 + * in cases where either no device tree is available or the information
244 + * in a device node is insufficient to identify a particular variant
245 + * by its compatible strings or other properties. For new devices,
246 + * the DT binding should always provide unique compatible strings
247 + * that allow the use of of_match_node() instead.
249 + * The calling function can use the .data entry of the
250 + * soc_device_attribute to pass a structure or function pointer for
253 +const struct soc_device_attribute *soc_device_match(
254 + const struct soc_device_attribute *matches)
262 + if (!(matches->machine || matches->family ||
263 + matches->revision || matches->soc_id))
265 + ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches,
266 + soc_device_match_one);
274 +EXPORT_SYMBOL_GPL(soc_device_match);
275 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
276 index 5fa36ebc..75ff184a 100644
277 --- a/drivers/net/bonding/bond_main.c
278 +++ b/drivers/net/bonding/bond_main.c
279 @@ -211,8 +211,8 @@ static int lacp_fast;
281 static int bond_init(struct net_device *bond_dev);
282 static void bond_uninit(struct net_device *bond_dev);
283 -static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
284 - struct rtnl_link_stats64 *stats);
285 +static void bond_get_stats(struct net_device *bond_dev,
286 + struct rtnl_link_stats64 *stats);
287 static void bond_slave_arr_handler(struct work_struct *work);
288 static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
290 @@ -3336,8 +3336,8 @@ static void bond_fold_stats(struct rtnl_link_stats64 *_res,
294 -static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
295 - struct rtnl_link_stats64 *stats)
296 +static void bond_get_stats(struct net_device *bond_dev,
297 + struct rtnl_link_stats64 *stats)
299 struct bonding *bond = netdev_priv(bond_dev);
300 struct rtnl_link_stats64 temp;
301 @@ -3361,8 +3361,6 @@ static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
303 memcpy(&bond->bond_stats, stats, sizeof(*stats));
304 spin_unlock(&bond->stats_lock);
309 static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
310 diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
311 index 69fc8409..da5b10e0 100644
312 --- a/drivers/net/dummy.c
313 +++ b/drivers/net/dummy.c
314 @@ -54,8 +54,8 @@ struct pcpu_dstats {
315 struct u64_stats_sync syncp;
318 -static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
319 - struct rtnl_link_stats64 *stats)
320 +static void dummy_get_stats64(struct net_device *dev,
321 + struct rtnl_link_stats64 *stats)
325 @@ -73,7 +73,6 @@ static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
326 stats->tx_bytes += tbytes;
327 stats->tx_packets += tpackets;
332 static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev)
333 diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
334 index bfeaec5b..ddc281c4 100644
335 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
336 +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
337 @@ -2172,19 +2172,19 @@ static void ena_config_debug_area(struct ena_adapter *adapter)
338 ena_com_delete_debug_area(adapter->ena_dev);
341 -static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev,
342 - struct rtnl_link_stats64 *stats)
343 +static void ena_get_stats64(struct net_device *netdev,
344 + struct rtnl_link_stats64 *stats)
346 struct ena_adapter *adapter = netdev_priv(netdev);
347 struct ena_admin_basic_stats ena_stats;
350 if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
354 rc = ena_com_get_dev_basic_stats(adapter->ena_dev, &ena_stats);
359 stats->tx_bytes = ((u64)ena_stats.tx_bytes_high << 32) |
360 ena_stats.tx_bytes_low;
361 @@ -2211,8 +2211,6 @@ static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev,
363 stats->rx_errors = 0;
364 stats->tx_errors = 0;
369 static const struct net_device_ops ena_netdev_ops = {
370 diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
371 index 1e4e8b24..5b413ee7 100644
372 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
373 +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
374 @@ -1542,8 +1542,8 @@ static void xgbe_tx_timeout(struct net_device *netdev)
375 schedule_work(&pdata->restart_work);
378 -static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
379 - struct rtnl_link_stats64 *s)
380 +static void xgbe_get_stats64(struct net_device *netdev,
381 + struct rtnl_link_stats64 *s)
383 struct xgbe_prv_data *pdata = netdev_priv(netdev);
384 struct xgbe_mmc_stats *pstats = &pdata->mmc_stats;
385 @@ -1569,8 +1569,6 @@ static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
386 s->tx_dropped = netdev->stats.tx_dropped;
388 DBGPR("<--%s\n", __func__);
393 static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
394 diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
395 index 8158d469..e62ca66b 100644
396 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
397 +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
398 @@ -1199,7 +1199,7 @@ static int xgene_enet_create_desc_rings(struct net_device *ndev)
402 -static struct rtnl_link_stats64 *xgene_enet_get_stats64(
403 +static void xgene_enet_get_stats64(
404 struct net_device *ndev,
405 struct rtnl_link_stats64 *storage)
407 @@ -1230,8 +1230,6 @@ static struct rtnl_link_stats64 *xgene_enet_get_stats64(
410 memcpy(storage, stats, sizeof(struct rtnl_link_stats64));
415 static int xgene_enet_set_mac_address(struct net_device *ndev, void *addr)
416 diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
417 index c0f84b73..3c5c8159 100644
418 --- a/drivers/net/ethernet/atheros/alx/main.c
419 +++ b/drivers/net/ethernet/atheros/alx/main.c
420 @@ -1424,8 +1424,8 @@ static void alx_poll_controller(struct net_device *netdev)
424 -static struct rtnl_link_stats64 *alx_get_stats64(struct net_device *dev,
425 - struct rtnl_link_stats64 *net_stats)
426 +static void alx_get_stats64(struct net_device *dev,
427 + struct rtnl_link_stats64 *net_stats)
429 struct alx_priv *alx = netdev_priv(dev);
430 struct alx_hw_stats *hw_stats = &alx->hw.stats;
431 @@ -1469,8 +1469,6 @@ static struct rtnl_link_stats64 *alx_get_stats64(struct net_device *dev,
432 net_stats->rx_packets = hw_stats->rx_ok + net_stats->rx_errors;
434 spin_unlock(&alx->stats_lock);
439 static const struct net_device_ops alx_netdev_ops = {
440 diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
441 index 17aa33c5..55f124d7 100644
442 --- a/drivers/net/ethernet/broadcom/b44.c
443 +++ b/drivers/net/ethernet/broadcom/b44.c
444 @@ -1677,8 +1677,8 @@ static int b44_close(struct net_device *dev)
448 -static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev,
449 - struct rtnl_link_stats64 *nstat)
450 +static void b44_get_stats64(struct net_device *dev,
451 + struct rtnl_link_stats64 *nstat)
453 struct b44 *bp = netdev_priv(dev);
454 struct b44_hw_stats *hwstat = &bp->hw_stats;
455 @@ -1721,7 +1721,6 @@ static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev,
457 } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start));
462 static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
463 diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
464 index 1f7034d7..c23dfcb9 100644
465 --- a/drivers/net/ethernet/broadcom/bnx2.c
466 +++ b/drivers/net/ethernet/broadcom/bnx2.c
467 @@ -6828,13 +6828,13 @@ bnx2_save_stats(struct bnx2 *bp)
468 (unsigned long) (bp->stats_blk->ctr + \
469 bp->temp_stats_blk->ctr)
471 -static struct rtnl_link_stats64 *
473 bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
475 struct bnx2 *bp = netdev_priv(dev);
477 if (bp->stats_blk == NULL)
481 net_stats->rx_packets =
482 GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) +
483 @@ -6898,7 +6898,6 @@ bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
484 GET_32BIT_NET_STATS(stat_IfInMBUFDiscards) +
485 GET_32BIT_NET_STATS(stat_FwRxDrop);
490 /* All ethtool functions called with rtnl_lock */
491 diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
492 index 20e569bd..d6c10783 100644
493 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
494 +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
495 @@ -5664,7 +5664,7 @@ static int bnxt_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
499 -static struct rtnl_link_stats64 *
501 bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
504 @@ -5673,7 +5673,7 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
505 memset(stats, 0, sizeof(struct rtnl_link_stats64));
511 /* TODO check if we need to synchronize with bnxt_close path */
512 for (i = 0; i < bp->cp_nr_rings; i++) {
513 @@ -5720,8 +5720,6 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
514 stats->tx_fifo_errors = le64_to_cpu(tx->tx_fifo_underruns);
515 stats->tx_errors = le64_to_cpu(tx->tx_err);
521 static bool bnxt_mc_list_updated(struct bnxt *bp, u32 *rx_mask)
522 diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
523 index edae2dcc..4d45077e 100644
524 --- a/drivers/net/ethernet/broadcom/tg3.c
525 +++ b/drivers/net/ethernet/broadcom/tg3.c
526 @@ -14145,8 +14145,8 @@ static const struct ethtool_ops tg3_ethtool_ops = {
527 .set_link_ksettings = tg3_set_link_ksettings,
530 -static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
531 - struct rtnl_link_stats64 *stats)
532 +static void tg3_get_stats64(struct net_device *dev,
533 + struct rtnl_link_stats64 *stats)
535 struct tg3 *tp = netdev_priv(dev);
537 @@ -14154,13 +14154,11 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
539 *stats = tp->net_stats_prev;
540 spin_unlock_bh(&tp->lock);
545 tg3_get_nstats(tp, stats);
546 spin_unlock_bh(&tp->lock);
551 static void tg3_set_rx_mode(struct net_device *dev)
552 diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
553 index f42f672b..aa141609 100644
554 --- a/drivers/net/ethernet/brocade/bna/bnad.c
555 +++ b/drivers/net/ethernet/brocade/bna/bnad.c
556 @@ -3111,7 +3111,7 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev)
557 * Used spin_lock to synchronize reading of stats structures, which
558 * is written by BNA under the same lock.
560 -static struct rtnl_link_stats64 *
562 bnad_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
564 struct bnad *bnad = netdev_priv(netdev);
565 @@ -3123,8 +3123,6 @@ bnad_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
566 bnad_netdev_hwstats_fill(bnad, stats);
568 spin_unlock_irqrestore(&bnad->bna_lock, flags);
574 @@ -3430,7 +3428,7 @@ static const struct net_device_ops bnad_netdev_ops = {
575 .ndo_open = bnad_open,
576 .ndo_stop = bnad_stop,
577 .ndo_start_xmit = bnad_start_xmit,
578 - .ndo_get_stats64 = bnad_get_stats64,
579 + .ndo_get_stats64 = bnad_get_stats64,
580 .ndo_set_rx_mode = bnad_set_rx_mode,
581 .ndo_validate_addr = eth_validate_addr,
582 .ndo_set_mac_address = bnad_set_mac_address,
583 diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
584 index 63efa0dc..ccb8fbd6 100644
585 --- a/drivers/net/ethernet/calxeda/xgmac.c
586 +++ b/drivers/net/ethernet/calxeda/xgmac.c
587 @@ -1460,9 +1460,9 @@ static void xgmac_poll_controller(struct net_device *dev)
591 -static struct rtnl_link_stats64 *
593 xgmac_get_stats64(struct net_device *dev,
594 - struct rtnl_link_stats64 *storage)
595 + struct rtnl_link_stats64 *storage)
597 struct xgmac_priv *priv = netdev_priv(dev);
598 void __iomem *base = priv->base;
599 @@ -1490,7 +1490,6 @@ xgmac_get_stats64(struct net_device *dev,
601 writel(0, base + XGMAC_MMC_CTRL);
602 spin_unlock_bh(&priv->stats_lock);
606 static int xgmac_set_mac_address(struct net_device *dev, void *p)
607 diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
608 index 8a37012c..87709a9d 100644
609 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
610 +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
611 @@ -1423,8 +1423,8 @@ void nicvf_update_stats(struct nicvf *nic)
612 nicvf_update_sq_stats(nic, qidx);
615 -static struct rtnl_link_stats64 *nicvf_get_stats64(struct net_device *netdev,
616 - struct rtnl_link_stats64 *stats)
617 +static void nicvf_get_stats64(struct net_device *netdev,
618 + struct rtnl_link_stats64 *stats)
620 struct nicvf *nic = netdev_priv(netdev);
621 struct nicvf_hw_stats *hw_stats = &nic->hw_stats;
622 @@ -1440,7 +1440,6 @@ static struct rtnl_link_stats64 *nicvf_get_stats64(struct net_device *netdev,
623 stats->tx_packets = hw_stats->tx_frames;
624 stats->tx_dropped = hw_stats->tx_drops;
629 static void nicvf_tx_timeout(struct net_device *dev)
630 diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
631 index 0c2a32a3..c4244913 100644
632 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
633 +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
634 @@ -2383,8 +2383,8 @@ int cxgb4_remove_server_filter(const struct net_device *dev, unsigned int stid,
636 EXPORT_SYMBOL(cxgb4_remove_server_filter);
638 -static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev,
639 - struct rtnl_link_stats64 *ns)
640 +static void cxgb_get_stats(struct net_device *dev,
641 + struct rtnl_link_stats64 *ns)
643 struct port_stats stats;
644 struct port_info *p = netdev_priv(dev);
645 @@ -2397,7 +2397,7 @@ static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev,
646 spin_lock(&adapter->stats_lock);
647 if (!netif_device_present(dev)) {
648 spin_unlock(&adapter->stats_lock);
652 t4_get_port_stats_offset(adapter, p->tx_chan, &stats,
654 @@ -2431,7 +2431,6 @@ static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev,
655 ns->tx_errors = stats.tx_error_frames;
656 ns->rx_errors = stats.rx_symbol_err + stats.rx_fcs_err +
657 ns->rx_length_errors + stats.rx_len_err + ns->rx_fifo_errors;
661 static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
662 diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
663 index 48f82ab6..662cc676 100644
664 --- a/drivers/net/ethernet/cisco/enic/enic_main.c
665 +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
666 @@ -680,8 +680,8 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
669 /* dev_base_lock rwlock held, nominally process context */
670 -static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev,
671 - struct rtnl_link_stats64 *net_stats)
672 +static void enic_get_stats(struct net_device *netdev,
673 + struct rtnl_link_stats64 *net_stats)
675 struct enic *enic = netdev_priv(netdev);
676 struct vnic_stats *stats;
677 @@ -693,7 +693,7 @@ static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev,
684 net_stats->tx_packets = stats->tx.tx_frames_ok;
685 net_stats->tx_bytes = stats->tx.tx_bytes_ok;
686 @@ -707,8 +707,6 @@ static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev,
687 net_stats->rx_over_errors = enic->rq_truncated_pkts;
688 net_stats->rx_crc_errors = enic->rq_bad_fcs;
689 net_stats->rx_dropped = stats->rx.rx_no_bufs + stats->rx.rx_drop;
694 static int enic_mc_sync(struct net_device *netdev, const u8 *mc_addr)
695 diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c
696 index f7b42483..2e7554c7 100644
697 --- a/drivers/net/ethernet/ec_bhf.c
698 +++ b/drivers/net/ethernet/ec_bhf.c
699 @@ -458,7 +458,7 @@ static int ec_bhf_stop(struct net_device *net_dev)
703 -static struct rtnl_link_stats64 *
705 ec_bhf_get_stats(struct net_device *net_dev,
706 struct rtnl_link_stats64 *stats)
708 @@ -473,8 +473,6 @@ ec_bhf_get_stats(struct net_device *net_dev,
710 stats->tx_bytes = priv->stat_tx_bytes;
711 stats->rx_bytes = priv->stat_rx_bytes;
716 static const struct net_device_ops ec_bhf_netdev_ops = {
717 diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
718 index 5626908f..59852304 100644
719 --- a/drivers/net/ethernet/emulex/benet/be_main.c
720 +++ b/drivers/net/ethernet/emulex/benet/be_main.c
721 @@ -646,8 +646,8 @@ void be_parse_stats(struct be_adapter *adapter)
725 -static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
726 - struct rtnl_link_stats64 *stats)
727 +static void be_get_stats64(struct net_device *netdev,
728 + struct rtnl_link_stats64 *stats)
730 struct be_adapter *adapter = netdev_priv(netdev);
731 struct be_drv_stats *drvs = &adapter->drv_stats;
732 @@ -711,7 +711,6 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
733 stats->rx_fifo_errors = drvs->rxpp_fifo_overflow_drop +
734 drvs->rx_input_fifo_overflow_drop +
735 drvs->rx_drops_no_pbuf;
739 void be_link_status_update(struct be_adapter *adapter, u8 link_status)
740 diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
741 index c06845b7..249bc6ad 100644
742 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
743 +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
744 @@ -1536,8 +1536,8 @@ void hns_nic_set_rx_mode(struct net_device *ndev)
745 hns_set_multicast_list(ndev);
748 -struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
749 - struct rtnl_link_stats64 *stats)
750 +static void hns_nic_get_stats64(struct net_device *ndev,
751 + struct rtnl_link_stats64 *stats)
755 @@ -1579,8 +1579,6 @@ struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
756 stats->tx_window_errors = ndev->stats.tx_window_errors;
757 stats->rx_compressed = ndev->stats.rx_compressed;
758 stats->tx_compressed = ndev->stats.tx_compressed;
764 diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
765 index bd719e25..a2ff2783 100644
766 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
767 +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
768 @@ -328,8 +328,8 @@ static void ehea_update_bcmc_registrations(void)
769 spin_unlock_irqrestore(&ehea_bcmc_regs.lock, flags);
772 -static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev,
773 - struct rtnl_link_stats64 *stats)
774 +static void ehea_get_stats64(struct net_device *dev,
775 + struct rtnl_link_stats64 *stats)
777 struct ehea_port *port = netdev_priv(dev);
778 u64 rx_packets = 0, tx_packets = 0, rx_bytes = 0, tx_bytes = 0;
779 @@ -352,7 +352,6 @@ static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev,
781 stats->multicast = port->stats.multicast;
782 stats->rx_errors = port->stats.rx_errors;
786 static void ehea_update_stats(struct work_struct *work)
787 diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
788 index 879cca47..a29b12e8 100644
789 --- a/drivers/net/ethernet/intel/e1000e/e1000.h
790 +++ b/drivers/net/ethernet/intel/e1000e/e1000.h
791 @@ -493,8 +493,8 @@ int e1000e_setup_rx_resources(struct e1000_ring *ring);
792 int e1000e_setup_tx_resources(struct e1000_ring *ring);
793 void e1000e_free_rx_resources(struct e1000_ring *ring);
794 void e1000e_free_tx_resources(struct e1000_ring *ring);
795 -struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
796 - struct rtnl_link_stats64 *stats);
797 +void e1000e_get_stats64(struct net_device *netdev,
798 + struct rtnl_link_stats64 *stats);
799 void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
800 void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
801 void e1000e_get_hw_control(struct e1000_adapter *adapter);
802 diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
803 index 7017281b..49f3d868 100644
804 --- a/drivers/net/ethernet/intel/e1000e/netdev.c
805 +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
806 @@ -5920,8 +5920,8 @@ static void e1000_reset_task(struct work_struct *work)
808 * Returns the address of the device statistics structure.
810 -struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
811 - struct rtnl_link_stats64 *stats)
812 +void e1000e_get_stats64(struct net_device *netdev,
813 + struct rtnl_link_stats64 *stats)
815 struct e1000_adapter *adapter = netdev_priv(netdev);
817 @@ -5958,7 +5958,6 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
818 /* Tx Dropped needs to be maintained elsewhere */
820 spin_unlock(&adapter->stats64_lock);
825 diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
826 index 05629381..e97b6c49 100644
827 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
828 +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
829 @@ -1128,8 +1128,8 @@ void fm10k_reset_rx_state(struct fm10k_intfc *interface)
830 * Returns 64bit statistics, for use in the ndo_get_stats64 callback. This
831 * function replaces fm10k_get_stats for kernels which support it.
833 -static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev,
834 - struct rtnl_link_stats64 *stats)
835 +static void fm10k_get_stats64(struct net_device *netdev,
836 + struct rtnl_link_stats64 *stats)
838 struct fm10k_intfc *interface = netdev_priv(netdev);
839 struct fm10k_ring *ring;
840 @@ -1174,8 +1174,6 @@ static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev,
842 /* following stats updated by fm10k_service_task() */
843 stats->rx_missed_errors = netdev->stats.rx_missed_errors;
848 int fm10k_setup_tc(struct net_device *dev, u8 tc)
849 diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
850 index 6d61e443..3cc0bf29 100644
851 --- a/drivers/net/ethernet/intel/i40e/i40e.h
852 +++ b/drivers/net/ethernet/intel/i40e/i40e.h
853 @@ -797,9 +797,8 @@ static inline void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector)
854 void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf);
855 void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf, bool clearpba);
857 -struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
858 - struct net_device *netdev,
859 - struct rtnl_link_stats64 *storage);
860 +void i40e_get_netdev_stats_struct(struct net_device *netdev,
861 + struct rtnl_link_stats64 *storage);
862 int i40e_set_mac(struct net_device *netdev, void *p);
863 void i40e_set_rx_mode(struct net_device *netdev);
865 diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
866 index 31c97e39..2f1554b3 100644
867 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
868 +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
869 @@ -408,15 +408,11 @@ struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi)
870 * Returns the address of the device statistics structure.
871 * The statistics are actually updated from the service task.
874 -struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
875 - struct net_device *netdev,
876 - struct rtnl_link_stats64 *stats)
878 -static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
879 - struct net_device *netdev,
880 - struct rtnl_link_stats64 *stats)
884 +void i40e_get_netdev_stats_struct(struct net_device *netdev,
885 + struct rtnl_link_stats64 *stats)
887 struct i40e_netdev_priv *np = netdev_priv(netdev);
888 struct i40e_ring *tx_ring, *rx_ring;
889 @@ -425,10 +421,10 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
892 if (test_bit(__I40E_DOWN, &vsi->state))
901 for (i = 0; i < vsi->num_queue_pairs; i++) {
902 @@ -468,8 +464,6 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
903 stats->rx_dropped = vsi_stats->rx_dropped;
904 stats->rx_crc_errors = vsi_stats->rx_crc_errors;
905 stats->rx_length_errors = vsi_stats->rx_length_errors;
911 diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
912 index 9affd7c1..076ccfa4 100644
913 --- a/drivers/net/ethernet/intel/igb/igb_main.c
914 +++ b/drivers/net/ethernet/intel/igb/igb_main.c
915 @@ -137,8 +137,8 @@ static void igb_update_phy_info(unsigned long);
916 static void igb_watchdog(unsigned long);
917 static void igb_watchdog_task(struct work_struct *);
918 static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, struct net_device *);
919 -static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *dev,
920 - struct rtnl_link_stats64 *stats);
921 +static void igb_get_stats64(struct net_device *dev,
922 + struct rtnl_link_stats64 *stats);
923 static int igb_change_mtu(struct net_device *, int);
924 static int igb_set_mac(struct net_device *, void *);
925 static void igb_set_uta(struct igb_adapter *adapter, bool set);
926 @@ -5386,8 +5386,8 @@ static void igb_reset_task(struct work_struct *work)
927 * @netdev: network interface device structure
928 * @stats: rtnl_link_stats64 pointer
930 -static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *netdev,
931 - struct rtnl_link_stats64 *stats)
932 +static void igb_get_stats64(struct net_device *netdev,
933 + struct rtnl_link_stats64 *stats)
935 struct igb_adapter *adapter = netdev_priv(netdev);
937 @@ -5395,8 +5395,6 @@ static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *netdev,
938 igb_update_stats(adapter, &adapter->stats64);
939 memcpy(stats, &adapter->stats64, sizeof(*stats));
940 spin_unlock(&adapter->stats64_lock);
946 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
947 index fee1f291..ee4f1cc2 100644
948 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
949 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
950 @@ -8085,8 +8085,9 @@ static void ixgbe_netpoll(struct net_device *netdev)
954 -static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
955 - struct rtnl_link_stats64 *stats)
957 +static void ixgbe_get_stats64(struct net_device *netdev,
958 + struct rtnl_link_stats64 *stats)
960 struct ixgbe_adapter *adapter = netdev_priv(netdev);
962 @@ -8124,13 +8125,13 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
967 /* following stats updated by ixgbe_watchdog_task() */
968 stats->multicast = netdev->stats.multicast;
969 stats->rx_errors = netdev->stats.rx_errors;
970 stats->rx_length_errors = netdev->stats.rx_length_errors;
971 stats->rx_crc_errors = netdev->stats.rx_crc_errors;
972 stats->rx_missed_errors = netdev->stats.rx_missed_errors;
976 #ifdef CONFIG_IXGBE_DCB
977 diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
978 index cbf70fe4..3519769e 100644
979 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
980 +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
981 @@ -3880,8 +3880,8 @@ static void ixgbevf_shutdown(struct pci_dev *pdev)
982 ixgbevf_suspend(pdev, PMSG_SUSPEND);
985 -static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev,
986 - struct rtnl_link_stats64 *stats)
987 +static void ixgbevf_get_stats(struct net_device *netdev,
988 + struct rtnl_link_stats64 *stats)
990 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
992 @@ -3914,8 +3914,6 @@ static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev,
993 stats->tx_bytes += bytes;
994 stats->tx_packets += packets;
1000 #define IXGBEVF_MAX_MAC_HDR_LEN 127
1001 diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
1002 index 707bc468..100f3af8 100644
1003 --- a/drivers/net/ethernet/marvell/mvneta.c
1004 +++ b/drivers/net/ethernet/marvell/mvneta.c
1005 @@ -636,7 +636,7 @@ static void mvneta_mib_counters_clear(struct mvneta_port *pp)
1008 /* Get System Network Statistics */
1009 -static struct rtnl_link_stats64 *
1011 mvneta_get_stats64(struct net_device *dev,
1012 struct rtnl_link_stats64 *stats)
1014 @@ -670,8 +670,6 @@ mvneta_get_stats64(struct net_device *dev,
1015 stats->rx_dropped = dev->stats.rx_dropped;
1017 stats->tx_dropped = dev->stats.tx_dropped;
1022 /* Rx descriptors helper methods */
1023 diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
1024 index 0a4e81a2..17032925 100644
1025 --- a/drivers/net/ethernet/marvell/mvpp2.c
1026 +++ b/drivers/net/ethernet/marvell/mvpp2.c
1027 @@ -5762,7 +5762,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
1031 -static struct rtnl_link_stats64 *
1033 mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1035 struct mvpp2_port *port = netdev_priv(dev);
1036 @@ -5794,8 +5794,6 @@ mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1037 stats->rx_errors = dev->stats.rx_errors;
1038 stats->rx_dropped = dev->stats.rx_dropped;
1039 stats->tx_dropped = dev->stats.tx_dropped;
1044 static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1045 diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
1046 index 941c8e2c..cff8b633 100644
1047 --- a/drivers/net/ethernet/marvell/sky2.c
1048 +++ b/drivers/net/ethernet/marvell/sky2.c
1049 @@ -3898,8 +3898,8 @@ static void sky2_set_multicast(struct net_device *dev)
1050 gma_write16(hw, port, GM_RX_CTRL, reg);
1053 -static struct rtnl_link_stats64 *sky2_get_stats(struct net_device *dev,
1054 - struct rtnl_link_stats64 *stats)
1055 +static void sky2_get_stats(struct net_device *dev,
1056 + struct rtnl_link_stats64 *stats)
1058 struct sky2_port *sky2 = netdev_priv(dev);
1059 struct sky2_hw *hw = sky2->hw;
1060 @@ -3939,8 +3939,6 @@ static struct rtnl_link_stats64 *sky2_get_stats(struct net_device *dev,
1061 stats->rx_dropped = dev->stats.rx_dropped;
1062 stats->rx_fifo_errors = dev->stats.rx_fifo_errors;
1063 stats->tx_fifo_errors = dev->stats.tx_fifo_errors;
1068 /* Can have one global because blinking is controlled by
1069 diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
1070 index 4832223f..6d260da6 100644
1071 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
1072 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
1073 @@ -462,8 +462,8 @@ static void mtk_stats_update(struct mtk_eth *eth)
1077 -static struct rtnl_link_stats64 *mtk_get_stats64(struct net_device *dev,
1078 - struct rtnl_link_stats64 *storage)
1079 +static void mtk_get_stats64(struct net_device *dev,
1080 + struct rtnl_link_stats64 *storage)
1082 struct mtk_mac *mac = netdev_priv(dev);
1083 struct mtk_hw_stats *hw_stats = mac->hw_stats;
1084 @@ -494,8 +494,6 @@ static struct rtnl_link_stats64 *mtk_get_stats64(struct net_device *dev,
1085 storage->tx_errors = dev->stats.tx_errors;
1086 storage->rx_dropped = dev->stats.rx_dropped;
1087 storage->tx_dropped = dev->stats.tx_dropped;
1092 static inline int mtk_max_frag_size(int mtu)
1093 diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
1094 index d223e7cb..ebf5c7e5 100644
1095 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
1096 +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
1097 @@ -1316,7 +1316,7 @@ static void mlx4_en_tx_timeout(struct net_device *dev)
1101 -static struct rtnl_link_stats64 *
1103 mlx4_en_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1105 struct mlx4_en_priv *priv = netdev_priv(dev);
1106 @@ -1324,8 +1324,6 @@ mlx4_en_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1107 spin_lock_bh(&priv->stats_lock);
1108 netdev_stats_to_stats64(stats, &dev->stats);
1109 spin_unlock_bh(&priv->stats_lock);
1114 static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv)
1115 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
1116 index 9d372293..582ba530 100644
1117 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
1118 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
1119 @@ -2647,7 +2647,7 @@ static int mlx5e_ndo_setup_tc(struct net_device *dev, u32 handle,
1120 return mlx5e_setup_tc(dev, tc->tc);
1123 -struct rtnl_link_stats64 *
1125 mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
1127 struct mlx5e_priv *priv = netdev_priv(dev);
1128 @@ -2681,7 +2681,6 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
1130 VPORT_COUNTER_GET(vstats, received_eth_multicast.packets);
1135 static void mlx5e_set_rx_mode(struct net_device *dev)
1136 diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1137 index 1806b1fc..cf21a83a 100644
1138 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1139 +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1140 @@ -948,15 +948,13 @@ static void update_stats_cache(struct work_struct *work)
1141 /* Return the stats from a cache that is updated periodically,
1142 * as this function might get called in an atomic context.
1144 -static struct rtnl_link_stats64 *
1146 mlxsw_sp_port_get_stats64(struct net_device *dev,
1147 struct rtnl_link_stats64 *stats)
1149 struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
1151 memcpy(stats, mlxsw_sp_port->hw_stats.cache, sizeof(*stats));
1156 int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,
1157 diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
1158 index d548f0a5..6e9e7fa4 100644
1159 --- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
1160 +++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
1161 @@ -351,7 +351,7 @@ static int mlxsw_sx_port_change_mtu(struct net_device *dev, int mtu)
1165 -static struct rtnl_link_stats64 *
1167 mlxsw_sx_port_get_stats64(struct net_device *dev,
1168 struct rtnl_link_stats64 *stats)
1170 @@ -380,7 +380,6 @@ mlxsw_sx_port_get_stats64(struct net_device *dev,
1171 tx_dropped += p->tx_dropped;
1173 stats->tx_dropped = tx_dropped;
1177 static const struct net_device_ops mlxsw_sx_port_netdev_ops = {
1178 diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
1179 index 6d1a956e..d26745cc 100644
1180 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
1181 +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
1182 @@ -378,8 +378,8 @@ static inline void put_be32(__be32 val, __be32 __iomem * p)
1183 __raw_writel((__force __u32) val, (__force void __iomem *)p);
1186 -static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
1187 - struct rtnl_link_stats64 *stats);
1188 +static void myri10ge_get_stats(struct net_device *dev,
1189 + struct rtnl_link_stats64 *stats);
1191 static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated)
1193 @@ -3119,8 +3119,8 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
1194 return NETDEV_TX_OK;
1197 -static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
1198 - struct rtnl_link_stats64 *stats)
1199 +static void myri10ge_get_stats(struct net_device *dev,
1200 + struct rtnl_link_stats64 *stats)
1202 const struct myri10ge_priv *mgp = netdev_priv(dev);
1203 const struct myri10ge_slice_netstats *slice_stats;
1204 @@ -3135,7 +3135,6 @@ static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
1205 stats->rx_dropped += slice_stats->rx_dropped;
1206 stats->tx_dropped += slice_stats->tx_dropped;
1211 static void myri10ge_set_multicast_list(struct net_device *dev)
1212 diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
1213 index e0993eba..9c27728f 100644
1214 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
1215 +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
1216 @@ -3116,7 +3116,7 @@ static int vxge_change_mtu(struct net_device *dev, int new_mtu)
1217 * @stats: pointer to struct rtnl_link_stats64
1220 -static struct rtnl_link_stats64 *
1222 vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
1224 struct vxgedev *vdev = netdev_priv(dev);
1225 @@ -3155,8 +3155,6 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
1226 net_stats->tx_bytes += bytes;
1227 net_stats->tx_errors += txstats->tx_errors;
1233 static enum vxge_hw_status vxge_timestamp_config(struct __vxge_hw_device *devh)
1234 diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
1235 index 4ca82bd8..55915cbd 100644
1236 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
1237 +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
1238 @@ -2400,8 +2400,8 @@ int nfp_net_set_ring_size(struct nfp_net *nn, u32 rxd_cnt, u32 txd_cnt)
1242 -static struct rtnl_link_stats64 *nfp_net_stat64(struct net_device *netdev,
1243 - struct rtnl_link_stats64 *stats)
1244 +static void nfp_net_stat64(struct net_device *netdev,
1245 + struct rtnl_link_stats64 *stats)
1247 struct nfp_net *nn = netdev_priv(netdev);
1249 @@ -2431,8 +2431,6 @@ static struct rtnl_link_stats64 *nfp_net_stat64(struct net_device *netdev,
1250 stats->tx_bytes += data[1];
1251 stats->tx_errors += data[2];
1257 static bool nfp_net_ebpf_capable(struct nfp_net *nn)
1258 diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
1259 index 9b0d7f46..d7a07928 100644
1260 --- a/drivers/net/ethernet/nvidia/forcedeth.c
1261 +++ b/drivers/net/ethernet/nvidia/forcedeth.c
1262 @@ -1733,7 +1733,7 @@ static void nv_update_stats(struct net_device *dev)
1263 * Called with read_lock(&dev_base_lock) held for read -
1264 * only synchronized against unregister_netdevice.
1266 -static struct rtnl_link_stats64*
1268 nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage)
1269 __acquires(&netdev_priv(dev)->hwstats_lock)
1270 __releases(&netdev_priv(dev)->hwstats_lock)
1271 @@ -1793,8 +1793,6 @@ nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage)
1273 spin_unlock_bh(&np->hwstats_lock);
1280 diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
1281 index 7a0281a3..8bb16d64 100644
1282 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
1283 +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
1284 @@ -90,8 +90,8 @@ static irqreturn_t netxen_msix_intr(int irq, void *data);
1286 static void netxen_free_ip_list(struct netxen_adapter *, bool);
1287 static void netxen_restore_indev_addr(struct net_device *dev, unsigned long);
1288 -static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *dev,
1289 - struct rtnl_link_stats64 *stats);
1290 +static void netxen_nic_get_stats(struct net_device *dev,
1291 + struct rtnl_link_stats64 *stats);
1292 static int netxen_nic_set_mac(struct net_device *netdev, void *p);
1294 /* PCI Device ID Table */
1295 @@ -2295,8 +2295,8 @@ static void netxen_tx_timeout_task(struct work_struct *work)
1296 clear_bit(__NX_RESETTING, &adapter->state);
1299 -static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *netdev,
1300 - struct rtnl_link_stats64 *stats)
1301 +static void netxen_nic_get_stats(struct net_device *netdev,
1302 + struct rtnl_link_stats64 *stats)
1304 struct netxen_adapter *adapter = netdev_priv(netdev);
1306 @@ -2306,8 +2306,6 @@ static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *netdev,
1307 stats->tx_bytes = adapter->stats.txbytes;
1308 stats->rx_dropped = adapter->stats.rxdropped;
1309 stats->tx_dropped = adapter->stats.txdropped;
1314 static irqreturn_t netxen_intr(int irq, void *data)
1315 diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
1316 index 85f46dbe..645507a9 100644
1317 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c
1318 +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
1319 @@ -1803,9 +1803,8 @@ void qede_fill_by_demand_stats(struct qede_dev *edev)
1320 edev->stats.tx_mac_ctrl_frames = stats.tx_mac_ctrl_frames;
1324 -struct rtnl_link_stats64 *qede_get_stats64(struct net_device *dev,
1325 - struct rtnl_link_stats64 *stats)
1326 +static void qede_get_stats64(struct net_device *dev,
1327 + struct rtnl_link_stats64 *stats)
1329 struct qede_dev *edev = netdev_priv(dev);
1331 @@ -1835,8 +1834,6 @@ struct rtnl_link_stats64 *qede_get_stats64(struct net_device *dev,
1332 stats->collisions = edev->stats.tx_total_collisions;
1333 stats->rx_crc_errors = edev->stats.rx_crc_errors;
1334 stats->rx_frame_errors = edev->stats.rx_align_errors;
1339 #ifdef CONFIG_QED_SRIOV
1340 diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
1341 index 57b35aea..babc1025 100644
1342 --- a/drivers/net/ethernet/qualcomm/emac/emac.c
1343 +++ b/drivers/net/ethernet/qualcomm/emac/emac.c
1344 @@ -319,8 +319,8 @@ static int emac_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
1347 /* Provide network statistics info for the interface */
1348 -static struct rtnl_link_stats64 *emac_get_stats64(struct net_device *netdev,
1349 - struct rtnl_link_stats64 *net_stats)
1350 +static void emac_get_stats64(struct net_device *netdev,
1351 + struct rtnl_link_stats64 *net_stats)
1353 struct emac_adapter *adpt = netdev_priv(netdev);
1354 unsigned int addr = REG_MAC_RX_STATUS_BIN;
1355 @@ -384,8 +384,6 @@ static struct rtnl_link_stats64 *emac_get_stats64(struct net_device *netdev,
1356 net_stats->tx_window_errors = stats->tx_late_col;
1358 spin_unlock(&stats->lock);
1363 static const struct net_device_ops emac_netdev_ops = {
1364 diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
1365 index da4c2d8a..5722e187 100644
1366 --- a/drivers/net/ethernet/realtek/8139too.c
1367 +++ b/drivers/net/ethernet/realtek/8139too.c
1368 @@ -653,9 +653,8 @@ static int rtl8139_poll(struct napi_struct *napi, int budget);
1369 static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance);
1370 static int rtl8139_close (struct net_device *dev);
1371 static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
1372 -static struct rtnl_link_stats64 *rtl8139_get_stats64(struct net_device *dev,
1373 - struct rtnl_link_stats64
1375 +static void rtl8139_get_stats64(struct net_device *dev,
1376 + struct rtnl_link_stats64 *stats);
1377 static void rtl8139_set_rx_mode (struct net_device *dev);
1378 static void __set_rx_mode (struct net_device *dev);
1379 static void rtl8139_hw_start (struct net_device *dev);
1380 @@ -2521,7 +2520,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1384 -static struct rtnl_link_stats64 *
1386 rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1388 struct rtl8139_private *tp = netdev_priv(dev);
1389 @@ -2549,8 +2548,6 @@ rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1390 stats->tx_packets = tp->tx_stats.packets;
1391 stats->tx_bytes = tp->tx_stats.bytes;
1392 } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start));
1397 /* Set or clear the multicast filter for this adaptor.
1398 diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
1399 index 2c4350a1..ac7eab06 100644
1400 --- a/drivers/net/ethernet/realtek/r8169.c
1401 +++ b/drivers/net/ethernet/realtek/r8169.c
1402 @@ -7751,7 +7751,7 @@ static int rtl_open(struct net_device *dev)
1406 -static struct rtnl_link_stats64 *
1408 rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1410 struct rtl8169_private *tp = netdev_priv(dev);
1411 @@ -7805,8 +7805,6 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1412 le16_to_cpu(tp->tc_offset.tx_aborted);
1414 pm_runtime_put_noidle(&pdev->dev);
1419 static void rtl8169_net_suspend(struct net_device *dev)
1420 diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
1421 index ea44a245..49196846 100644
1422 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
1423 +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
1424 @@ -1721,11 +1721,9 @@ static inline u64 sxgbe_get_stat64(void __iomem *ioaddr, int reg_lo, int reg_hi)
1425 * This function is a driver entry point whenever ifconfig command gets
1426 * executed to see device statistics. Statistics are number of
1427 * bytes sent or received, errors occurred etc.
1429 - * This function returns various statistical information of device.
1431 -static struct rtnl_link_stats64 *sxgbe_get_stats64(struct net_device *dev,
1432 - struct rtnl_link_stats64 *stats)
1433 +static void sxgbe_get_stats64(struct net_device *dev,
1434 + struct rtnl_link_stats64 *stats)
1436 struct sxgbe_priv_data *priv = netdev_priv(dev);
1437 void __iomem *ioaddr = priv->ioaddr;
1438 @@ -1776,8 +1774,6 @@ static struct rtnl_link_stats64 *sxgbe_get_stats64(struct net_device *dev,
1439 SXGBE_MMC_TXUFLWHI_GBCNT_REG);
1440 writel(0, ioaddr + SXGBE_MMC_CTL_REG);
1441 spin_unlock(&priv->stats_lock);
1446 /* sxgbe_set_features - entry point to set offload features of the device.
1447 diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
1448 index 6b89e4a7..c6209dd4 100644
1449 --- a/drivers/net/ethernet/sfc/efx.c
1450 +++ b/drivers/net/ethernet/sfc/efx.c
1451 @@ -2232,16 +2232,14 @@ int efx_net_stop(struct net_device *net_dev)
1454 /* Context: process, dev_base_lock or RTNL held, non-blocking. */
1455 -static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev,
1456 - struct rtnl_link_stats64 *stats)
1457 +static void efx_net_stats(struct net_device *net_dev,
1458 + struct rtnl_link_stats64 *stats)
1460 struct efx_nic *efx = netdev_priv(net_dev);
1462 spin_lock_bh(&efx->stats_lock);
1463 efx->type->update_stats(efx, NULL, stats);
1464 spin_unlock_bh(&efx->stats_lock);
1469 /* Context: netif_tx_lock held, BHs disabled. */
1470 diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
1471 index a2371aa1..680fc756 100644
1472 --- a/drivers/net/ethernet/sun/niu.c
1473 +++ b/drivers/net/ethernet/sun/niu.c
1474 @@ -6294,8 +6294,8 @@ static void niu_get_tx_stats(struct niu *np,
1475 stats->tx_errors = errors;
1478 -static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev,
1479 - struct rtnl_link_stats64 *stats)
1480 +static void niu_get_stats(struct net_device *dev,
1481 + struct rtnl_link_stats64 *stats)
1483 struct niu *np = netdev_priv(dev);
1485 @@ -6303,8 +6303,6 @@ static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev,
1486 niu_get_rx_stats(np, stats);
1487 niu_get_tx_stats(np, stats);
1493 static void niu_load_hash_xmac(struct niu *np, u16 *hash)
1494 diff --git a/drivers/net/ethernet/synopsys/dwc_eth_qos.c b/drivers/net/ethernet/synopsys/dwc_eth_qos.c
1495 index 97d64bfe..bcacd08c 100644
1496 --- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c
1497 +++ b/drivers/net/ethernet/synopsys/dwc_eth_qos.c
1498 @@ -2490,7 +2490,7 @@ static void dwceqos_read_mmc_counters(struct net_local *lp, u32 rx_mask,
1499 dwceqos_read(lp, DWC_MMC_RXPACKETCOUNT_GB);
1502 -static struct rtnl_link_stats64*
1504 dwceqos_get_stats64(struct net_device *ndev, struct rtnl_link_stats64 *s)
1506 unsigned long flags;
1507 @@ -2522,8 +2522,6 @@ dwceqos_get_stats64(struct net_device *ndev, struct rtnl_link_stats64 *s)
1509 s->tx_errors = hwstats->txunderflowerror +
1510 hwstats->txcarriererror;
1516 diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c
1517 index 4ef605a9..9cd7cd3c 100644
1518 --- a/drivers/net/ethernet/tile/tilepro.c
1519 +++ b/drivers/net/ethernet/tile/tilepro.c
1520 @@ -2047,8 +2047,8 @@ static int tile_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1522 * Returns the address of the device statistics structure.
1524 -static struct rtnl_link_stats64 *tile_net_get_stats64(struct net_device *dev,
1525 - struct rtnl_link_stats64 *stats)
1526 +static void tile_net_get_stats64(struct net_device *dev,
1527 + struct rtnl_link_stats64 *stats)
1529 struct tile_net_priv *priv = netdev_priv(dev);
1530 u64 rx_packets = 0, tx_packets = 0;
1531 diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
1532 index 9d14731c..ae891364 100644
1533 --- a/drivers/net/ethernet/via/via-rhine.c
1534 +++ b/drivers/net/ethernet/via/via-rhine.c
1535 @@ -513,8 +513,8 @@ static irqreturn_t rhine_interrupt(int irq, void *dev_instance);
1536 static void rhine_tx(struct net_device *dev);
1537 static int rhine_rx(struct net_device *dev, int limit);
1538 static void rhine_set_rx_mode(struct net_device *dev);
1539 -static struct rtnl_link_stats64 *rhine_get_stats64(struct net_device *dev,
1540 - struct rtnl_link_stats64 *stats);
1541 +static void rhine_get_stats64(struct net_device *dev,
1542 + struct rtnl_link_stats64 *stats);
1543 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
1544 static const struct ethtool_ops netdev_ethtool_ops;
1545 static int rhine_close(struct net_device *dev);
1546 @@ -2222,7 +2222,7 @@ static void rhine_slow_event_task(struct work_struct *work)
1547 mutex_unlock(&rp->task_lock);
1550 -static struct rtnl_link_stats64 *
1552 rhine_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1554 struct rhine_private *rp = netdev_priv(dev);
1555 @@ -2245,8 +2245,6 @@ rhine_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1556 stats->tx_packets = rp->tx_stats.packets;
1557 stats->tx_bytes = rp->tx_stats.bytes;
1558 } while (u64_stats_fetch_retry_irq(&rp->tx_stats.syncp, start));
1563 static void rhine_set_rx_mode(struct net_device *dev)
1564 diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
1565 index e46b1ebb..6b944caf 100644
1566 --- a/drivers/net/fjes/fjes_main.c
1567 +++ b/drivers/net/fjes/fjes_main.c
1568 @@ -56,8 +56,7 @@ static void fjes_raise_intr_rxdata_task(struct work_struct *);
1569 static void fjes_tx_stall_task(struct work_struct *);
1570 static void fjes_force_close_task(struct work_struct *);
1571 static irqreturn_t fjes_intr(int, void*);
1572 -static struct rtnl_link_stats64 *
1573 -fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *);
1574 +static void fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *);
1575 static int fjes_change_mtu(struct net_device *, int);
1576 static int fjes_vlan_rx_add_vid(struct net_device *, __be16 proto, u16);
1577 static int fjes_vlan_rx_kill_vid(struct net_device *, __be16 proto, u16);
1578 @@ -762,14 +761,12 @@ static void fjes_tx_retry(struct net_device *netdev)
1579 netif_tx_wake_queue(queue);
1582 -static struct rtnl_link_stats64 *
1584 fjes_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
1586 struct fjes_adapter *adapter = netdev_priv(netdev);
1588 memcpy(stats, &adapter->stats64, sizeof(struct rtnl_link_stats64));
1593 static int fjes_change_mtu(struct net_device *netdev, int new_mtu)
1594 diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
1595 index 36a04e18..48f20945 100644
1596 --- a/drivers/net/hyperv/netvsc_drv.c
1597 +++ b/drivers/net/hyperv/netvsc_drv.c
1598 @@ -918,8 +918,8 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
1602 -static struct rtnl_link_stats64 *netvsc_get_stats64(struct net_device *net,
1603 - struct rtnl_link_stats64 *t)
1604 +static void netvsc_get_stats64(struct net_device *net,
1605 + struct rtnl_link_stats64 *t)
1607 struct net_device_context *ndev_ctx = netdev_priv(net);
1609 @@ -957,8 +957,6 @@ static struct rtnl_link_stats64 *netvsc_get_stats64(struct net_device *net,
1611 t->rx_dropped = net->stats.rx_dropped;
1612 t->rx_errors = net->stats.rx_errors;
1617 static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
1618 diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
1619 index 66c0eeaf..082534e1 100644
1620 --- a/drivers/net/ifb.c
1621 +++ b/drivers/net/ifb.c
1622 @@ -129,8 +129,8 @@ static void ifb_ri_tasklet(unsigned long _txp)
1626 -static struct rtnl_link_stats64 *ifb_stats64(struct net_device *dev,
1627 - struct rtnl_link_stats64 *stats)
1628 +static void ifb_stats64(struct net_device *dev,
1629 + struct rtnl_link_stats64 *stats)
1631 struct ifb_dev_private *dp = netdev_priv(dev);
1632 struct ifb_q_private *txp = dp->tx_private;
1633 @@ -157,8 +157,6 @@ static struct rtnl_link_stats64 *ifb_stats64(struct net_device *dev,
1635 stats->rx_dropped = dev->stats.rx_dropped;
1636 stats->tx_dropped = dev->stats.tx_dropped;
1641 static int ifb_dev_init(struct net_device *dev)
1642 diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
1643 index dfbc4ef6..6629680d 100644
1644 --- a/drivers/net/ipvlan/ipvlan_main.c
1645 +++ b/drivers/net/ipvlan/ipvlan_main.c
1646 @@ -296,8 +296,8 @@ static void ipvlan_set_multicast_mac_filter(struct net_device *dev)
1647 dev_mc_sync(ipvlan->phy_dev, dev);
1650 -static struct rtnl_link_stats64 *ipvlan_get_stats64(struct net_device *dev,
1651 - struct rtnl_link_stats64 *s)
1652 +static void ipvlan_get_stats64(struct net_device *dev,
1653 + struct rtnl_link_stats64 *s)
1655 struct ipvl_dev *ipvlan = netdev_priv(dev);
1657 @@ -334,7 +334,6 @@ static struct rtnl_link_stats64 *ipvlan_get_stats64(struct net_device *dev,
1658 s->rx_dropped = rx_errs;
1659 s->tx_dropped = tx_drps;
1664 static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
1665 diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
1666 index 1b65f0f9..0254b2a9 100644
1667 --- a/drivers/net/loopback.c
1668 +++ b/drivers/net/loopback.c
1669 @@ -97,8 +97,8 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
1670 return NETDEV_TX_OK;
1673 -static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
1674 - struct rtnl_link_stats64 *stats)
1675 +static void loopback_get_stats64(struct net_device *dev,
1676 + struct rtnl_link_stats64 *stats)
1680 @@ -122,7 +122,6 @@ static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
1681 stats->tx_packets = packets;
1682 stats->rx_bytes = bytes;
1683 stats->tx_bytes = bytes;
1687 static u32 always_on(struct net_device *dev)
1688 diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
1689 index 2caac0c3..880ee985 100644
1690 --- a/drivers/net/macsec.c
1691 +++ b/drivers/net/macsec.c
1692 @@ -2899,13 +2899,13 @@ static int macsec_change_mtu(struct net_device *dev, int new_mtu)
1696 -static struct rtnl_link_stats64 *macsec_get_stats64(struct net_device *dev,
1697 - struct rtnl_link_stats64 *s)
1698 +static void macsec_get_stats64(struct net_device *dev,
1699 + struct rtnl_link_stats64 *s)
1707 for_each_possible_cpu(cpu) {
1708 struct pcpu_sw_netstats *stats;
1709 @@ -2929,8 +2929,6 @@ static struct rtnl_link_stats64 *macsec_get_stats64(struct net_device *dev,
1711 s->rx_dropped = dev->stats.rx_dropped;
1712 s->tx_dropped = dev->stats.tx_dropped;
1717 static int macsec_get_iflink(const struct net_device *dev)
1718 diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
1719 index dc8ccac0..94576142 100644
1720 --- a/drivers/net/macvlan.c
1721 +++ b/drivers/net/macvlan.c
1722 @@ -857,8 +857,8 @@ static void macvlan_uninit(struct net_device *dev)
1723 macvlan_port_destroy(port->dev);
1726 -static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
1727 - struct rtnl_link_stats64 *stats)
1728 +static void macvlan_dev_get_stats64(struct net_device *dev,
1729 + struct rtnl_link_stats64 *stats)
1731 struct macvlan_dev *vlan = netdev_priv(dev);
1733 @@ -895,7 +895,6 @@ static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
1734 stats->rx_dropped = rx_errors;
1735 stats->tx_dropped = tx_dropped;
1740 static int macvlan_vlan_rx_add_vid(struct net_device *dev,
1741 diff --git a/drivers/net/nlmon.c b/drivers/net/nlmon.c
1742 index 7b7c70e2..a0daed8a 100644
1743 --- a/drivers/net/nlmon.c
1744 +++ b/drivers/net/nlmon.c
1745 @@ -76,7 +76,7 @@ static int nlmon_close(struct net_device *dev)
1746 return netlink_remove_tap(&nlmon->nt);
1749 -static struct rtnl_link_stats64 *
1751 nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1754 @@ -104,8 +104,6 @@ nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1756 stats->rx_bytes = bytes;
1757 stats->tx_bytes = 0;
1762 static u32 always_on(struct net_device *dev)
1763 diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
1764 index 96fa0e61..d3b17318 100644
1765 --- a/drivers/net/ppp/ppp_generic.c
1766 +++ b/drivers/net/ppp/ppp_generic.c
1767 @@ -1312,7 +1312,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1771 -static struct rtnl_link_stats64*
1773 ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64)
1775 struct ppp *ppp = netdev_priv(dev);
1776 @@ -1332,8 +1332,6 @@ ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64)
1777 stats64->rx_dropped = dev->stats.rx_dropped;
1778 stats64->tx_dropped = dev->stats.tx_dropped;
1779 stats64->rx_length_errors = dev->stats.rx_length_errors;
1784 static int ppp_dev_init(struct net_device *dev)
1785 diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
1786 index 9ed6d1c1..c8c0c231 100644
1787 --- a/drivers/net/slip/slip.c
1788 +++ b/drivers/net/slip/slip.c
1789 @@ -571,7 +571,7 @@ static int sl_change_mtu(struct net_device *dev, int new_mtu)
1791 /* Netdevice get statistics request */
1793 -static struct rtnl_link_stats64 *
1795 sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1797 struct net_device_stats *devstats = &dev->stats;
1798 @@ -602,7 +602,6 @@ sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1799 stats->collisions += comp->sls_o_misses;
1805 /* Netdevice register callback */
1806 diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
1807 index a380649b..95499313 100644
1808 --- a/drivers/net/team/team.c
1809 +++ b/drivers/net/team/team.c
1810 @@ -1798,7 +1798,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu)
1814 -static struct rtnl_link_stats64 *
1816 team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1818 struct team *team = netdev_priv(dev);
1819 @@ -1835,7 +1835,6 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1820 stats->rx_dropped = rx_dropped;
1821 stats->tx_dropped = tx_dropped;
1822 stats->rx_nohandler = rx_nohandler;
1826 static int team_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
1827 diff --git a/drivers/net/tun.c b/drivers/net/tun.c
1828 index a931b733..19fb25b1 100644
1829 --- a/drivers/net/tun.c
1830 +++ b/drivers/net/tun.c
1831 @@ -983,7 +983,7 @@ static void tun_set_headroom(struct net_device *dev, int new_hr)
1832 tun->align = new_hr;
1835 -static struct rtnl_link_stats64 *
1837 tun_net_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1839 u32 rx_dropped = 0, tx_dropped = 0, rx_frame_errors = 0;
1840 @@ -1017,7 +1017,6 @@ tun_net_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1841 stats->rx_dropped = rx_dropped;
1842 stats->rx_frame_errors = rx_frame_errors;
1843 stats->tx_dropped = tx_dropped;
1847 static const struct net_device_ops tun_netdev_ops = {
1848 diff --git a/drivers/net/veth.c b/drivers/net/veth.c
1849 index fbc853e6..e25aa62d 100644
1850 --- a/drivers/net/veth.c
1851 +++ b/drivers/net/veth.c
1852 @@ -161,8 +161,8 @@ static u64 veth_stats_one(struct pcpu_vstats *result, struct net_device *dev)
1853 return atomic64_read(&priv->dropped);
1856 -static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
1857 - struct rtnl_link_stats64 *tot)
1858 +static void veth_get_stats64(struct net_device *dev,
1859 + struct rtnl_link_stats64 *tot)
1861 struct veth_priv *priv = netdev_priv(dev);
1862 struct net_device *peer;
1863 @@ -180,8 +180,6 @@ static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
1864 tot->rx_packets = one.packets;
1871 /* fake multicast ability */
1872 diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
1873 index 1568aedd..15e87add 100644
1874 --- a/drivers/net/virtio_net.c
1875 +++ b/drivers/net/virtio_net.c
1876 @@ -1017,8 +1017,8 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p)
1880 -static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
1881 - struct rtnl_link_stats64 *tot)
1882 +static void virtnet_stats(struct net_device *dev,
1883 + struct rtnl_link_stats64 *tot)
1885 struct virtnet_info *vi = netdev_priv(dev);
1887 @@ -1051,8 +1051,6 @@ static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
1888 tot->rx_dropped = dev->stats.rx_dropped;
1889 tot->rx_length_errors = dev->stats.rx_length_errors;
1890 tot->rx_frame_errors = dev->stats.rx_frame_errors;
1895 #ifdef CONFIG_NET_POLL_CONTROLLER
1896 diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
1897 index aabc6ef3..f88ffafe 100644
1898 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
1899 +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
1900 @@ -113,7 +113,7 @@ vmxnet3_global_stats[] = {
1904 -struct rtnl_link_stats64 *
1906 vmxnet3_get_stats64(struct net_device *netdev,
1907 struct rtnl_link_stats64 *stats)
1909 @@ -160,8 +160,6 @@ vmxnet3_get_stats64(struct net_device *netdev,
1910 stats->rx_dropped += drvRxStats->drop_total;
1911 stats->multicast += devRxStats->mcastPktsRxOK;
1918 diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
1919 index 7dc37a09..ec19df56 100644
1920 --- a/drivers/net/vmxnet3/vmxnet3_int.h
1921 +++ b/drivers/net/vmxnet3/vmxnet3_int.h
1922 @@ -466,8 +466,8 @@ vmxnet3_create_queues(struct vmxnet3_adapter *adapter,
1924 void vmxnet3_set_ethtool_ops(struct net_device *netdev);
1926 -struct rtnl_link_stats64 *
1927 -vmxnet3_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats);
1928 +void vmxnet3_get_stats64(struct net_device *dev,
1929 + struct rtnl_link_stats64 *stats);
1931 extern char vmxnet3_driver_name[];
1933 diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
1934 index 578bd500..499af07a 100644
1935 --- a/drivers/net/vrf.c
1936 +++ b/drivers/net/vrf.c
1937 @@ -79,8 +79,8 @@ static void vrf_tx_error(struct net_device *vrf_dev, struct sk_buff *skb)
1941 -static struct rtnl_link_stats64 *vrf_get_stats64(struct net_device *dev,
1942 - struct rtnl_link_stats64 *stats)
1943 +static void vrf_get_stats64(struct net_device *dev,
1944 + struct rtnl_link_stats64 *stats)
1948 @@ -104,7 +104,6 @@ static struct rtnl_link_stats64 *vrf_get_stats64(struct net_device *dev,
1949 stats->rx_bytes += rbytes;
1950 stats->rx_packets += rpkts;
1955 /* Local traffic destined to local address. Reinsert the packet to rx
1956 diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
1957 index cd442e46..f87cae7e 100644
1958 --- a/drivers/net/xen-netfront.c
1959 +++ b/drivers/net/xen-netfront.c
1960 @@ -1081,8 +1081,8 @@ static int xennet_change_mtu(struct net_device *dev, int mtu)
1964 -static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
1965 - struct rtnl_link_stats64 *tot)
1966 +static void xennet_get_stats64(struct net_device *dev,
1967 + struct rtnl_link_stats64 *tot)
1969 struct netfront_info *np = netdev_priv(dev);
1971 @@ -1113,8 +1113,6 @@ static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
1973 tot->rx_errors = dev->stats.rx_errors;
1974 tot->tx_dropped = dev->stats.tx_dropped;
1979 static void xennet_release_tx_bufs(struct netfront_queue *queue)
1980 diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
1981 index 552a7dcb..d7dea9d4 100644
1982 --- a/drivers/staging/netlogic/xlr_net.c
1983 +++ b/drivers/staging/netlogic/xlr_net.c
1984 @@ -395,14 +395,6 @@ static void xlr_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)
1985 TX_DROP_FRAME_COUNTER);
1988 -static struct rtnl_link_stats64 *xlr_get_stats64(struct net_device *ndev,
1989 - struct rtnl_link_stats64 *stats
1992 - xlr_stats(ndev, stats);
1996 static const struct net_device_ops xlr_netdev_ops = {
1997 .ndo_open = xlr_net_open,
1998 .ndo_stop = xlr_net_stop,
1999 @@ -410,7 +402,7 @@ static const struct net_device_ops xlr_netdev_ops = {
2000 .ndo_select_queue = xlr_net_select_queue,
2001 .ndo_set_mac_address = xlr_net_set_mac_addr,
2002 .ndo_set_rx_mode = xlr_set_rx_mode,
2003 - .ndo_get_stats64 = xlr_get_stats64,
2004 + .ndo_get_stats64 = xlr_stats,
2008 diff --git a/include/linux/device.h b/include/linux/device.h
2009 index 8d732965..6d206930 100644
2010 --- a/include/linux/device.h
2011 +++ b/include/linux/device.h
2012 @@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
2013 int devm_add_action(struct device *dev, void (*action)(void *), void *data);
2014 void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
2017 + * devm_alloc_percpu - Resource-managed alloc_percpu
2018 + * @dev: Device to allocate per-cpu memory for
2019 + * @type: Type to allocate per-cpu memory for
2021 + * Managed alloc_percpu. Per-cpu memory allocated with this function is
2022 + * automatically freed on driver detach.
2025 + * Pointer to allocated memory on success, NULL on failure.
2027 +#define devm_alloc_percpu(dev, type) \
2028 + ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \
2029 + __alignof__(type)))
2031 +void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
2033 +void devm_free_percpu(struct device *dev, void __percpu *pdata);
2035 static inline int devm_add_action_or_reset(struct device *dev,
2036 void (*action)(void *), void *data)
2038 diff --git a/include/linux/fsl/svr.h b/include/linux/fsl/svr.h
2039 new file mode 100644
2040 index 00000000..e95c8f43
2042 +++ b/include/linux/fsl/svr.h
2045 + * MPC85xx cpu type detection
2047 + * Copyright 2011-2012 Freescale Semiconductor, Inc.
2049 + * This is free software; you can redistribute it and/or modify
2050 + * it under the terms of the GNU General Public License as published by
2051 + * the Free Software Foundation; either version 2 of the License, or
2052 + * (at your option) any later version.
2058 +#define SVR_REV(svr) ((svr) & 0xFF) /* SOC design resision */
2059 +#define SVR_MAJ(svr) (((svr) >> 4) & 0xF) /* Major revision field*/
2060 +#define SVR_MIN(svr) (((svr) >> 0) & 0xF) /* Minor revision field*/
2062 +/* Some parts define SVR[0:23] as the SOC version */
2063 +#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF) /* SOC Version fields */
2065 +#define SVR_8533 0x803400
2066 +#define SVR_8535 0x803701
2067 +#define SVR_8536 0x803700
2068 +#define SVR_8540 0x803000
2069 +#define SVR_8541 0x807200
2070 +#define SVR_8543 0x803200
2071 +#define SVR_8544 0x803401
2072 +#define SVR_8545 0x803102
2073 +#define SVR_8547 0x803101
2074 +#define SVR_8548 0x803100
2075 +#define SVR_8555 0x807100
2076 +#define SVR_8560 0x807000
2077 +#define SVR_8567 0x807501
2078 +#define SVR_8568 0x807500
2079 +#define SVR_8569 0x808000
2080 +#define SVR_8572 0x80E000
2081 +#define SVR_P1010 0x80F100
2082 +#define SVR_P1011 0x80E500
2083 +#define SVR_P1012 0x80E501
2084 +#define SVR_P1013 0x80E700
2085 +#define SVR_P1014 0x80F101
2086 +#define SVR_P1017 0x80F700
2087 +#define SVR_P1020 0x80E400
2088 +#define SVR_P1021 0x80E401
2089 +#define SVR_P1022 0x80E600
2090 +#define SVR_P1023 0x80F600
2091 +#define SVR_P1024 0x80E402
2092 +#define SVR_P1025 0x80E403
2093 +#define SVR_P2010 0x80E300
2094 +#define SVR_P2020 0x80E200
2095 +#define SVR_P2040 0x821000
2096 +#define SVR_P2041 0x821001
2097 +#define SVR_P3041 0x821103
2098 +#define SVR_P4040 0x820100
2099 +#define SVR_P4080 0x820000
2100 +#define SVR_P5010 0x822100
2101 +#define SVR_P5020 0x822000
2102 +#define SVR_P5021 0X820500
2103 +#define SVR_P5040 0x820400
2104 +#define SVR_T4240 0x824000
2105 +#define SVR_T4120 0x824001
2106 +#define SVR_T4160 0x824100
2107 +#define SVR_T4080 0x824102
2108 +#define SVR_C291 0x850000
2109 +#define SVR_C292 0x850020
2110 +#define SVR_C293 0x850030
2111 +#define SVR_B4860 0X868000
2112 +#define SVR_G4860 0x868001
2113 +#define SVR_G4060 0x868003
2114 +#define SVR_B4440 0x868100
2115 +#define SVR_G4440 0x868101
2116 +#define SVR_B4420 0x868102
2117 +#define SVR_B4220 0x868103
2118 +#define SVR_T1040 0x852000
2119 +#define SVR_T1041 0x852001
2120 +#define SVR_T1042 0x852002
2121 +#define SVR_T1020 0x852100
2122 +#define SVR_T1021 0x852101
2123 +#define SVR_T1022 0x852102
2124 +#define SVR_T1023 0x854100
2125 +#define SVR_T1024 0x854000
2126 +#define SVR_T2080 0x853000
2127 +#define SVR_T2081 0x853100
2129 +#define SVR_8610 0x80A000
2130 +#define SVR_8641 0x809000
2131 +#define SVR_8641D 0x809001
2133 +#define SVR_9130 0x860001
2134 +#define SVR_9131 0x860000
2135 +#define SVR_9132 0x861000
2136 +#define SVR_9232 0x861400
2138 +#define SVR_Unknown 0xFFFFFF
2141 diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
2142 index f2912914..22308465 100644
2143 --- a/include/linux/fsl_devices.h
2144 +++ b/include/linux/fsl_devices.h
2145 @@ -99,7 +99,10 @@ struct fsl_usb2_platform_data {
2146 unsigned suspended:1;
2147 unsigned already_suspended:1;
2148 unsigned has_fsl_erratum_a007792:1;
2149 + unsigned has_fsl_erratum_14:1;
2150 unsigned has_fsl_erratum_a005275:1;
2151 + unsigned has_fsl_erratum_a006918:1;
2152 + unsigned has_fsl_erratum_a005697:1;
2153 unsigned check_phy_clk_valid:1;
2155 /* register save area for suspend/resume */
2156 diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
2157 index 9c6c8ef2..90b4107e 100644
2158 --- a/include/linux/netdev_features.h
2159 +++ b/include/linux/netdev_features.h
2160 @@ -74,6 +74,7 @@ enum {
2161 NETIF_F_BUSY_POLL_BIT, /* Busy poll */
2163 NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */
2164 + NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */
2167 * Add your fresh new feature above and remember to update
2168 @@ -136,6 +137,7 @@ enum {
2169 #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
2170 #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
2171 #define NETIF_F_HW_TC __NETIF_F(HW_TC)
2172 +#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ)
2174 #define for_each_netdev_feature(mask_addr, bit) \
2175 for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
2176 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
2177 index c3a1537c..67ef59d0 100644
2178 --- a/include/linux/netdevice.h
2179 +++ b/include/linux/netdevice.h
2180 @@ -916,8 +916,8 @@ struct netdev_xdp {
2181 * Callback used when the transmitter has not made any progress
2182 * for dev->watchdog ticks.
2184 - * struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
2185 - * struct rtnl_link_stats64 *storage);
2186 + * void (*ndo_get_stats64)(struct net_device *dev,
2187 + * struct rtnl_link_stats64 *storage);
2188 * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
2189 * Called when a user wants to get the network device usage
2190 * statistics. Drivers must do one of the following:
2191 @@ -1165,8 +1165,8 @@ struct net_device_ops {
2192 struct neigh_parms *);
2193 void (*ndo_tx_timeout) (struct net_device *dev);
2195 - struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
2196 - struct rtnl_link_stats64 *storage);
2197 + void (*ndo_get_stats64)(struct net_device *dev,
2198 + struct rtnl_link_stats64 *storage);
2199 bool (*ndo_has_offload_stats)(int attr_id);
2200 int (*ndo_get_offload_stats)(int attr_id,
2201 const struct net_device *dev,
2202 @@ -1509,6 +1509,8 @@ enum netdev_priv_flags {
2203 * @if_port: Selectable AUI, TP, ...
2205 * @mtu: Interface MTU value
2206 + * @min_mtu: Interface Minimum MTU value
2207 + * @max_mtu: Interface Maximum MTU value
2208 * @type: Interface hardware type
2209 * @hard_header_len: Maximum hardware header length.
2210 * @min_header_len: Minimum hardware header length
2211 @@ -1735,6 +1737,8 @@ struct net_device {
2215 + unsigned int min_mtu;
2216 + unsigned int max_mtu;
2217 unsigned short type;
2218 unsigned short hard_header_len;
2219 unsigned short min_header_len;
2220 diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
2221 index 9a0c945e..06f33c98 100644
2222 --- a/include/linux/skbuff.h
2223 +++ b/include/linux/skbuff.h
2224 @@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb);
2225 void kfree_skb_list(struct sk_buff *segs);
2226 void skb_tx_error(struct sk_buff *skb);
2227 void consume_skb(struct sk_buff *skb);
2228 +void skb_recycle(struct sk_buff *skb);
2229 void __kfree_skb(struct sk_buff *skb);
2230 extern struct kmem_cache *skbuff_head_cache;
2232 @@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_locked(struct sock *sk,
2234 int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
2235 int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
2236 +void copy_skb_header(struct sk_buff *new, const struct sk_buff *old);
2237 int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
2238 __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
2239 int len, __wsum csum);
2240 diff --git a/include/linux/sys_soc.h b/include/linux/sys_soc.h
2241 index 2739ccb6..9f5eb06f 100644
2242 --- a/include/linux/sys_soc.h
2243 +++ b/include/linux/sys_soc.h
2244 @@ -13,6 +13,7 @@ struct soc_device_attribute {
2246 const char *revision;
2252 @@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_device *soc_dev);
2254 struct device *soc_device_to_device(struct soc_device *soc);
2256 +const struct soc_device_attribute *soc_device_match(
2257 + const struct soc_device_attribute *matches);
2258 #endif /* __SOC_BUS_H */
2259 diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
2260 index 59557c07..876de4f9 100644
2261 --- a/include/net/ip_tunnels.h
2262 +++ b/include/net/ip_tunnels.h
2263 @@ -261,8 +261,8 @@ int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
2264 int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict);
2265 int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
2267 -struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
2268 - struct rtnl_link_stats64 *tot);
2269 +void ip_tunnel_get_stats64(struct net_device *dev,
2270 + struct rtnl_link_stats64 *tot);
2271 struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
2272 int link, __be16 flags,
2273 __be32 remote, __be32 local,
2274 diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
2275 index 51f38442..5c01afbf 100644
2276 --- a/include/uapi/linux/if_ether.h
2277 +++ b/include/uapi/linux/if_ether.h
2279 #define ETH_DATA_LEN 1500 /* Max. octets in payload */
2280 #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
2281 #define ETH_FCS_LEN 4 /* Octets in the FCS */
2282 +#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */
2285 * These are the defined Ethernet Protocol ID's.
2286 diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
2287 index fbfacd51..ca3cf29b 100644
2288 --- a/net/8021q/vlan_dev.c
2289 +++ b/net/8021q/vlan_dev.c
2290 @@ -671,7 +671,8 @@ static int vlan_ethtool_get_ts_info(struct net_device *dev,
2294 -static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
2295 +static void vlan_dev_get_stats64(struct net_device *dev,
2296 + struct rtnl_link_stats64 *stats)
2298 struct vlan_pcpu_stats *p;
2299 u32 rx_errors = 0, tx_dropped = 0;
2300 @@ -702,8 +703,6 @@ static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, st
2302 stats->rx_errors = rx_errors;
2303 stats->tx_dropped = tx_dropped;
2308 #ifdef CONFIG_NET_POLL_CONTROLLER
2309 diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
2310 index 5f5e28f2..73d66ae3 100644
2311 --- a/net/bridge/br_device.c
2312 +++ b/net/bridge/br_device.c
2313 @@ -156,8 +156,8 @@ static int br_dev_stop(struct net_device *dev)
2317 -static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
2318 - struct rtnl_link_stats64 *stats)
2319 +static void br_get_stats64(struct net_device *dev,
2320 + struct rtnl_link_stats64 *stats)
2322 struct net_bridge *br = netdev_priv(dev);
2323 struct pcpu_sw_netstats tmp, sum = { 0 };
2324 @@ -181,8 +181,6 @@ static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
2325 stats->tx_packets = sum.tx_packets;
2326 stats->rx_bytes = sum.rx_bytes;
2327 stats->rx_packets = sum.rx_packets;
2332 static int br_change_mtu(struct net_device *dev, int new_mtu)
2333 diff --git a/net/core/dev.c b/net/core/dev.c
2334 index 912f40ac..17e16cf7 100644
2335 --- a/net/core/dev.c
2336 +++ b/net/core/dev.c
2337 @@ -6600,9 +6600,18 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
2338 if (new_mtu == dev->mtu)
2341 - /* MTU must be positive. */
2343 + /* MTU must be positive, and in range */
2344 + if (new_mtu < 0 || new_mtu < dev->min_mtu) {
2345 + net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n",
2346 + dev->name, new_mtu, dev->min_mtu);
2350 + if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) {
2351 + net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n",
2352 + dev->name, new_mtu, dev->min_mtu);
2356 if (!netif_device_present(dev))
2358 diff --git a/net/core/skbuff.c b/net/core/skbuff.c
2359 index 7e7b7ce0..0f9c014a 100644
2360 --- a/net/core/skbuff.c
2361 +++ b/net/core/skbuff.c
2362 @@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *skb, int budget)
2364 EXPORT_SYMBOL(napi_consume_skb);
2367 + * skb_recycle - clean up an skb for reuse
2370 + * Recycles the skb to be reused as a receive buffer. This
2371 + * function does any necessary reference count dropping, and
2372 + * cleans up the skbuff as if it just came from __alloc_skb().
2374 +void skb_recycle(struct sk_buff *skb)
2376 + struct skb_shared_info *shinfo;
2377 + u8 head_frag = skb->head_frag;
2379 + skb_release_head_state(skb);
2381 + shinfo = skb_shinfo(skb);
2382 + memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
2383 + atomic_set(&shinfo->dataref, 1);
2385 + memset(skb, 0, offsetof(struct sk_buff, tail));
2386 + skb->data = skb->head + NET_SKB_PAD;
2387 + skb->head_frag = head_frag;
2388 + skb_reset_tail_pointer(skb);
2390 +EXPORT_SYMBOL(skb_recycle);
2392 /* Make sure a field is enclosed inside headers_start/headers_end section */
2393 #define CHECK_SKB_FIELD(field) \
2394 BUILD_BUG_ON(offsetof(struct sk_buff, field) < \
2395 @@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off)
2396 skb->inner_mac_header += off;
2399 -static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
2400 +void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
2402 __copy_skb_header(new, old);
2404 @@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
2405 skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
2406 skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
2408 +EXPORT_SYMBOL(copy_skb_header);
2410 static inline int skb_alloc_rx_flag(const struct sk_buff *skb)
2412 diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
2413 index 0fd1976a..9d6c1009 100644
2414 --- a/net/ipv4/ip_tunnel_core.c
2415 +++ b/net/ipv4/ip_tunnel_core.c
2416 @@ -188,8 +188,8 @@ int iptunnel_handle_offloads(struct sk_buff *skb,
2417 EXPORT_SYMBOL_GPL(iptunnel_handle_offloads);
2419 /* Often modified stats are per cpu, other are shared (netdev->stats) */
2420 -struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
2421 - struct rtnl_link_stats64 *tot)
2422 +void ip_tunnel_get_stats64(struct net_device *dev,
2423 + struct rtnl_link_stats64 *tot)
2427 @@ -214,8 +214,6 @@ struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
2428 tot->rx_bytes += rx_bytes;
2429 tot->tx_bytes += tx_bytes;
2434 EXPORT_SYMBOL_GPL(ip_tunnel_get_stats64);
2436 diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
2437 index eecc64e1..ce73136a 100644
2438 --- a/net/l2tp/l2tp_eth.c
2439 +++ b/net/l2tp/l2tp_eth.c
2440 @@ -106,8 +106,8 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
2441 return NETDEV_TX_OK;
2444 -static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev,
2445 - struct rtnl_link_stats64 *stats)
2446 +static void l2tp_eth_get_stats64(struct net_device *dev,
2447 + struct rtnl_link_stats64 *stats)
2449 struct l2tp_eth *priv = netdev_priv(dev);
2451 @@ -117,10 +117,8 @@ static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev,
2452 stats->rx_bytes = atomic_long_read(&priv->rx_bytes);
2453 stats->rx_packets = atomic_long_read(&priv->rx_packets);
2454 stats->rx_errors = atomic_long_read(&priv->rx_errors);
2459 static const struct net_device_ops l2tp_eth_netdev_ops = {
2460 .ndo_init = l2tp_eth_dev_init,
2461 .ndo_uninit = l2tp_eth_dev_uninit,
2462 diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
2463 index 37bec0f8..aee93423 100644
2464 --- a/net/mac80211/iface.c
2465 +++ b/net/mac80211/iface.c
2466 @@ -1133,7 +1133,7 @@ static u16 ieee80211_netdev_select_queue(struct net_device *dev,
2467 return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb);
2470 -static struct rtnl_link_stats64 *
2472 ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
2475 @@ -1158,8 +1158,6 @@ ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
2476 stats->rx_bytes += rx_bytes;
2477 stats->tx_bytes += tx_bytes;
2483 static const struct net_device_ops ieee80211_dataif_ops = {
2484 diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
2485 index e7da2902..95fd5744 100644
2486 --- a/net/openvswitch/vport-internal_dev.c
2487 +++ b/net/openvswitch/vport-internal_dev.c
2488 @@ -106,7 +106,7 @@ static void internal_dev_destructor(struct net_device *dev)
2492 -static struct rtnl_link_stats64 *
2494 internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
2497 @@ -134,8 +134,6 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
2498 stats->tx_bytes += local_stats.tx_bytes;
2499 stats->tx_packets += local_stats.tx_packets;
2505 static void internal_set_rx_headroom(struct net_device *dev, int new_hr)
2506 diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
2507 index a62de9e4..5b287e1d 100644
2508 --- a/net/sched/sch_generic.c
2509 +++ b/net/sched/sch_generic.c
2510 @@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long arg)
2511 txq->trans_timeout++;
2515 + /* Devices with HW_ACCEL_MQ have multiple txqs
2516 + * but update only the first one's transmission
2517 + * timestamp so avoid checking the rest.
2519 + if (dev->features & NETIF_F_HW_ACCEL_MQ)
2523 if (some_queue_timedout) {
2524 diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
2525 index 2cd9b447..5e25213e 100644
2526 --- a/net/sched/sch_teql.c
2527 +++ b/net/sched/sch_teql.c
2528 @@ -401,8 +401,8 @@ static int teql_master_close(struct net_device *dev)
2532 -static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev,
2533 - struct rtnl_link_stats64 *stats)
2534 +static void teql_master_stats64(struct net_device *dev,
2535 + struct rtnl_link_stats64 *stats)
2537 struct teql_master *m = netdev_priv(dev);
2539 @@ -410,7 +410,6 @@ static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev,
2540 stats->tx_bytes = m->tx_bytes;
2541 stats->tx_errors = m->tx_errors;
2542 stats->tx_dropped = m->tx_dropped;
2546 static int teql_master_mtu(struct net_device *dev, int new_mtu)