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