[v2,09/12] net/ngbe: 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: fdb1e851975a ("net/ngbe: support basic statistics")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ngbe/ngbe_ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -1429,7 +1429,7 @@ ngbe_read_stats_registers(struct ngbe_hw *hw,
hw_stats->rx_total_bytes += rd64(hw, NGBE_MACRXGBOCTL);
hw_stats->rx_broadcast_packets += rd64(hw, NGBE_MACRXOCTL);
- hw_stats->tx_broadcast_packets += rd32(hw, NGBE_MACTXOCTL);
+ hw_stats->tx_broadcast_packets += rd64(hw, NGBE_MACTXOCTL);
hw_stats->rx_size_64_packets += rd64(hw, NGBE_MACRX1TO64L);
hw_stats->rx_size_65_to_127_packets += rd64(hw, NGBE_MACRX65TO127L);
@@ -1448,7 +1448,8 @@ ngbe_read_stats_registers(struct ngbe_hw *hw,
hw_stats->tx_size_1024_to_max_packets +=
rd64(hw, NGBE_MACTX1024TOMAXL);
- hw_stats->rx_undersize_errors += rd64(hw, NGBE_MACRXERRLENL);
+ hw_stats->rx_length_errors += rd64(hw, NGBE_MACRXERRLENL);
+ hw_stats->rx_undersize_errors += rd32(hw, NGBE_MACRXUNDERSIZE);
hw_stats->rx_oversize_cnt += rd32(hw, NGBE_MACRXOVERSIZE);
hw_stats->rx_jabber_errors += rd32(hw, NGBE_MACRXJABBER);