diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2022-06-28 10:51:55 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-29 20:19:05 -0700 |
commit | 961d6c70d886ecc057f6e501db5879feb55db3b3 (patch) | |
tree | c5d8a31a4873c1057ea6b37471ccc970705e2381 /drivers/net/dsa | |
parent | c4748ff6566b77d236052375747576009a1af1f7 (diff) |
net: dsa: microchip: count pause packets together will all other packets
This switch is calculating tx/rx_bytes for all packets including pause.
So, include rx/tx_pause counter to rx/tx_packets to make tx/rx_bytes fit
to rx/tx_packets.
Link: https://lore.kernel.org/all/20220624220317.ckhx6z7cmzegvoqi@skbuf/
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/microchip/ksz_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 5e534f7bce0b..29b42b3b39c9 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -683,8 +683,10 @@ void ksz_r_mib_stats64(struct ksz_device *dev, int port) spin_lock(&mib->stats64_lock); - stats->rx_packets = raw->rx_bcast + raw->rx_mcast + raw->rx_ucast; - stats->tx_packets = raw->tx_bcast + raw->tx_mcast + raw->tx_ucast; + stats->rx_packets = raw->rx_bcast + raw->rx_mcast + raw->rx_ucast + + raw->rx_pause; + stats->tx_packets = raw->tx_bcast + raw->tx_mcast + raw->tx_ucast + + raw->tx_pause; /* HW counters are counting bytes + FCS which is not acceptable * for rtnl_link_stats64 interface |