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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 04:42:48 +0000 (21:42 -0700)
commita24ec3220f369aa0b94c863b6b310685a727151c
tree6b2b7581e62810085d3c5cf40662a8b3abd85a61
parentb06d072ccc4b1acd0147b17914b7ad1caa1818bb
bnxt_en: Fix Priority Bytes and Packets counters in ethtool -S.

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>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c