net: bcmgenet: Track per TX/RX rings statistics
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 16 Mar 2017 17:27:08 +0000 (10:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2017 22:30:24 +0000 (15:30 -0700)
commit37a30b435b92a6b577795c642b6326fd0ea96e3f
tree4330a3cdfc5a31e70cee01b119cd4085820dfbc7
parentbf4e0a3db97eb882368fd82980b3b1fa0b5b9778
net: bcmgenet: Track per TX/RX rings statistics

__bcmgenet_tx_reclaim() is currently summing TX bytes/packets in a way
that is not SMP friendly, mutliples CPUs could run
__bcmgenet_tx_reclaim() independently and still update stats->tx_bytes
and stats->tx_packets, cloberring the other CPUs statistics.

Fix this by tracking per RX and TX rings the number of bytes, packets,
dropped and errors statistics, and provide a bcmgenet_get_stats()
function which aggregates everything and returns a consistent output.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/genet/bcmgenet.h