[v2,08/12] net/txgbe: fix incorrect device statistics
Checks
Commit Message
The extend statistic "rx_undersize_errors" is incorrectly read as the
counter of frames received with a length error, which names
"rx_length_error". And "rx_undersize_errors" is the counter of
shorter-than-64B frames received without any errors.
In addition, "tx_broadcast_packets" should use rd64() to get the full
count on the low and high registers.
Fixes: c9bb590d4295 ("net/txgbe: support device statistics")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/txgbe_ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -2250,7 +2250,7 @@ txgbe_read_stats_registers(struct txgbe_hw *hw,
hw_stats->rx_total_bytes += rd64(hw, TXGBE_MACRXGBOCTL);
hw_stats->rx_broadcast_packets += rd64(hw, TXGBE_MACRXOCTL);
- hw_stats->tx_broadcast_packets += rd32(hw, TXGBE_MACTXOCTL);
+ hw_stats->tx_broadcast_packets += rd64(hw, TXGBE_MACTXOCTL);
hw_stats->rx_size_64_packets += rd64(hw, TXGBE_MACRX1TO64L);
hw_stats->rx_size_65_to_127_packets += rd64(hw, TXGBE_MACRX65TO127L);
@@ -2269,7 +2269,8 @@ txgbe_read_stats_registers(struct txgbe_hw *hw,
hw_stats->tx_size_1024_to_max_packets +=
rd64(hw, TXGBE_MACTX1024TOMAXL);
- hw_stats->rx_undersize_errors += rd64(hw, TXGBE_MACRXERRLENL);
+ hw_stats->rx_length_errors += rd64(hw, TXGBE_MACRXERRLENL);
+ hw_stats->rx_undersize_errors += rd32(hw, TXGBE_MACRXUNDERSIZE);
hw_stats->rx_oversize_cnt += rd32(hw, TXGBE_MACRXOVERSIZE);
hw_stats->rx_jabber_errors += rd32(hw, TXGBE_MACRXJABBER);