diff options
author | Edward Cree <ecree.xilinx@gmail.com> | 2022-07-28 21:57:43 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-07-30 07:22:05 +0300 |
commit | a95115c407a26c55fdeb6750811a0252687b331e (patch) | |
tree | 2b162418cec2caa82841e71864cca26b169e0e43 /drivers/net/ethernet/sfc/ef100_rep.c | |
parent | 71930846b36f8e4e68267f8a3d47e33435c3657a (diff) | |
download | linux-a95115c407a26c55fdeb6750811a0252687b331e.tar.xz |
sfc: plumb ef100 representor stats
Implement .ndo_get_stats64() method to read values out of struct
efx_rep_sw_stats.
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef100_rep.c')
-rw-r--r-- | drivers/net/ethernet/sfc/ef100_rep.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_rep.c b/drivers/net/ethernet/sfc/ef100_rep.c index d07539f091b8..102071ed051b 100644 --- a/drivers/net/ethernet/sfc/ef100_rep.c +++ b/drivers/net/ethernet/sfc/ef100_rep.c @@ -79,10 +79,24 @@ static int efx_ef100_rep_get_phys_port_name(struct net_device *dev, return 0; } +static void efx_ef100_rep_get_stats64(struct net_device *dev, + struct rtnl_link_stats64 *stats) +{ + struct efx_rep *efv = netdev_priv(dev); + + stats->rx_packets = atomic64_read(&efv->stats.rx_packets); + stats->tx_packets = atomic64_read(&efv->stats.tx_packets); + stats->rx_bytes = atomic64_read(&efv->stats.rx_bytes); + stats->tx_bytes = atomic64_read(&efv->stats.tx_bytes); + stats->rx_dropped = atomic64_read(&efv->stats.rx_dropped); + stats->tx_errors = atomic64_read(&efv->stats.tx_errors); +} + static const struct net_device_ops efx_ef100_rep_netdev_ops = { .ndo_start_xmit = efx_ef100_rep_xmit, .ndo_get_port_parent_id = efx_ef100_rep_get_port_parent_id, .ndo_get_phys_port_name = efx_ef100_rep_get_phys_port_name, + .ndo_get_stats64 = efx_ef100_rep_get_stats64, }; static void efx_ef100_rep_get_drvinfo(struct net_device *dev, |