113 lines
4 KiB
Diff
113 lines
4 KiB
Diff
|
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);
|