]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: include all ring counters in interface stats
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 12 Jun 2018 04:33:36 +0000 (21:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Jun 2018 22:18:28 +0000 (15:18 -0700)
commit0cf077f5aa21f1876305f21417f88a1192cd6582
tree88d80d9e155624f6aecad4597e957dd0060e3b41
parentc3ac9c87edf3a907c5094ac6a8f2d492a51419db
nfp: include all ring counters in interface stats

We are gathering software statistics on per-ring basis.
.ndo_get_stats64 handler adds the rings up.  Unfortunately
we are currently only adding up active rings, which means
that if user decreases the number of active rings the
statistics from deactivated rings will no longer be counted
and total interface statistics may go backwards.

Always sum all possible rings, the stats are allocated
statically for max number of rings, so we don't have to
worry about them being removed.  We could add the stats
up when user changes the ring count, but it seems unnecessary..
Adding up inactive rings will be very quick since no datapath
will be touching them.

Fixes: 49788072ad90 ("nfp: add support for ethtool .set_channels")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c