bnxt_en: Fix Priority Bytes and Packets counters in ethtool -S.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 22 Mar 2020 20:40:01 +0000 (16:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:01:40 +0000 (11:01 +0200)
commit2ac37a531115cffa178fd8674130524950f39707
tree6deac77862dc85a8509f7028136cca270e701650
parent53d0bf064c9ff4263128e1f0459a0e74c087f43f
bnxt_en: Fix Priority Bytes and Packets counters in ethtool -S.

[ Upstream commit a24ec3220f369aa0b94c863b6b310685a727151c ]

There is an indexing bug in determining these ethtool priority
counters.  Instead of using the queue ID to index, we need to
normalize by modulo 10 to get the index.  This index is then used
to obtain the proper CoS queue counter.  Rename bp->pri2cos to
bp->pri2cos_idx to make this more clear.

Fixes: e37fed790335 ("bnxt_en: Add ethtool -S priority counters.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c