Commit a6d0b83f authored by Doug Berger's avatar Doug Berger Committed by David S. Miller

net: bcmgenet: correct per TX/RX ring statistics

The change to track net_device_stats per ring to better support SMP
missed updating the rx_dropped member.

The ndo_get_stats method is also needed to combine the results for
ethtool statistics (-S) before filling in the ethtool structure.

Fixes: 37a30b43 ("net: bcmgenet: Track per TX/RX rings statistics")
Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9d3cdd44
...@@ -934,6 +934,8 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev, ...@@ -934,6 +934,8 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev,
if (netif_running(dev)) if (netif_running(dev))
bcmgenet_update_mib_counters(priv); bcmgenet_update_mib_counters(priv);
dev->netdev_ops->ndo_get_stats(dev);
for (i = 0; i < BCMGENET_STATS_LEN; i++) { for (i = 0; i < BCMGENET_STATS_LEN; i++) {
const struct bcmgenet_stats *s; const struct bcmgenet_stats *s;
char *p; char *p;
...@@ -3156,6 +3158,7 @@ static struct net_device_stats *bcmgenet_get_stats(struct net_device *dev) ...@@ -3156,6 +3158,7 @@ static struct net_device_stats *bcmgenet_get_stats(struct net_device *dev)
dev->stats.rx_packets = rx_packets; dev->stats.rx_packets = rx_packets;
dev->stats.rx_errors = rx_errors; dev->stats.rx_errors = rx_errors;
dev->stats.rx_missed_errors = rx_errors; dev->stats.rx_missed_errors = rx_errors;
dev->stats.rx_dropped = rx_dropped;
return &dev->stats; return &dev->stats;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment