aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch
blob: 4fa29b29098d0575951a71aff1f3753a3c8cb3c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
From: Mathew McBride <matt@traverse.com.au>
Date: Tue, 24 Oct 2017 11:30:00 +1100
Subject: [PATCH] dpaa: backport use of 4.9 ndo_get_stats64

This patch changes the declarations of ndo_get_stats64 handlers
to the previous struct rtnl_link_stats64 * return type instead of
the mainline void return.

Suggested-by: Adrien Gallouët <adrien@gallouet.fr>
Signed-off-by: Mathew McBride <matt@traverse.com.au>

---
 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c |    5 +++--
 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h |    4 ++--
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c            |    3 ++-
 drivers/staging/fsl-dpaa2/ethsw/switch.c                  |    4 ++--
 drivers/staging/fsl-dpaa2/evb/evb.c                       |    4 ++--
 5 files changed, 11 insertions(+), 9 deletions(-)

--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1296,7 +1296,7 @@ static int dpaa2_eth_set_addr(struct net
 /** Fill in counters maintained by the GPP driver. These may be different from
  * the hardware counters obtained by ethtool.
  */
-static void dpaa2_eth_get_stats(struct net_device *net_dev,
+static struct rtnl_link_stats64 *dpaa2_eth_get_stats(struct net_device *net_dev,
 				struct rtnl_link_stats64 *stats)
 {
 	struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
@@ -1312,6 +1312,7 @@ static void dpaa2_eth_get_stats(struct n
 		for (j = 0; j < num; j++)
 			netstats[j] += cpustats[j];
 	}
+	return stats;
 }
 
 static int dpaa2_eth_change_mtu(struct net_device *net_dev, int mtu)
--- a/drivers/staging/fsl-dpaa2/ethsw/switch.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/switch.c
@@ -1094,7 +1094,7 @@ static int ethsw_port_fdb_del(struct ndm
 	return 0;
 }
 
-void ethsw_port_get_stats(struct net_device *netdev,
+struct rtnl_link_stats64 *ethsw_port_get_stats(struct net_device *netdev,
 			  struct rtnl_link_stats64 *storage)
 {
 	struct ethsw_port_priv	*port_priv = netdev_priv(netdev);
@@ -1154,7 +1154,7 @@ void ethsw_port_get_stats(struct net_dev
 	if (err)
 		goto error;
 
-	return;
+	return storage;
 
 error:
 	netdev_err(netdev, "dpsw_if_get_counter err %d\n", err);
--- a/drivers/staging/fsl-dpaa2/evb/evb.c
+++ b/drivers/staging/fsl-dpaa2/evb/evb.c
@@ -765,7 +765,7 @@ static int evb_dellink(struct net_device
 	return 0;
 }
 
-void evb_port_get_stats(struct net_device *netdev,
+struct rtnl_link_stats64 *evb_port_get_stats(struct net_device *netdev,
 			struct rtnl_link_stats64 *storage)
 {
 	struct evb_port_priv	*port_priv = netdev_priv(netdev);
@@ -842,7 +842,7 @@ void evb_port_get_stats(struct net_devic
 	if (unlikely(err))
 		goto error;
 
-	return;
+	return storage;
 
 error:
 	netdev_err(netdev, "dpdmux_if_get_counter err %d\n", err);
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
@@ -239,8 +239,8 @@ EXPORT_SYMBOL(dpa_timeout);
  * Calculates the statistics for the given device by adding the statistics
  * collected by each CPU.
  */
-void __cold
-dpa_get_stats64(struct net_device *net_dev,
+struct rtnl_link_stats64 __cold
+*dpa_get_stats64(struct net_device *net_dev,
 		struct rtnl_link_stats64 *stats)
 {
 	struct dpa_priv_s *priv = netdev_priv(net_dev);
@@ -258,6 +258,7 @@ dpa_get_stats64(struct net_device *net_d
 		for (j = 0; j < numstats; j++)
 			netstats[j] += cpustats[j];
 	}
+	return stats;
 }
 EXPORT_SYMBOL(dpa_get_stats64);
 
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h
@@ -140,8 +140,8 @@ int dpa_netdev_init(struct net_device *n
 int __cold dpa_start(struct net_device *net_dev);
 int __cold dpa_stop(struct net_device *net_dev);
 void __cold dpa_timeout(struct net_device *net_dev);
-void __cold
-dpa_get_stats64(struct net_device *net_dev,
+struct rtnl_link_stats64 __cold
+*dpa_get_stats64(struct net_device *net_dev,
 		struct rtnl_link_stats64 *stats);
 int dpa_change_mtu(struct net_device *net_dev, int new_mtu);
 int dpa_ndo_init(struct net_device *net_dev);