Rename rx_oversize_errors to rx_oversize_cnt since it depends on giant
packet size limit instead of MTU, by hardware design.
Rename rx_drop_packets to rx_rdb_drop to indicate the drop location.
And add rx_dma_drop to extended statistics.

Fixes: 91fe49c87d76 ("net/txgbe: support device xstats")
Cc: sta...@dpdk.org

Signed-off-by: Jiawen Wu <jiawe...@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_type.h |  4 ++--
 drivers/net/txgbe/txgbe_ethdev.c    | 11 ++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_type.h 
b/drivers/net/txgbe/base/txgbe_type.h
index 343279127f..c3486b472f 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -356,9 +356,9 @@ struct txgbe_hw_stats {
        u64 tx_management_packets;
        u64 rx_management_dropped;
        u64 rx_dma_drop;
-       u64 rx_drop_packets;
 
        /* Basic Error */
+       u64 rx_rdb_drop;
        u64 rx_crc_errors;
        u64 rx_illegal_byte_errors;
        u64 rx_error_bytes;
@@ -366,7 +366,7 @@ struct txgbe_hw_stats {
        u64 rx_length_errors;
        u64 rx_undersize_errors;
        u64 rx_fragment_errors;
-       u64 rx_oversize_errors;
+       u64 rx_oversize_cnt;
        u64 rx_jabber_errors;
        u64 rx_l3_l4_xsum_error;
        u64 mac_local_errors;
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 9dc9948219..1c1d959ab5 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -183,8 +183,10 @@ static const struct rte_txgbe_xstats_name_off 
rte_txgbe_stats_strings[] = {
        HW_XSTAT(rx_management_packets),
        HW_XSTAT(tx_management_packets),
        HW_XSTAT(rx_management_dropped),
+       HW_XSTAT(rx_dma_drop),
 
        /* Basic Error */
+       HW_XSTAT(rx_rdb_drop),
        HW_XSTAT(rx_crc_errors),
        HW_XSTAT(rx_illegal_byte_errors),
        HW_XSTAT(rx_error_bytes),
@@ -192,7 +194,7 @@ static const struct rte_txgbe_xstats_name_off 
rte_txgbe_stats_strings[] = {
        HW_XSTAT(rx_length_errors),
        HW_XSTAT(rx_undersize_errors),
        HW_XSTAT(rx_fragment_errors),
-       HW_XSTAT(rx_oversize_errors),
+       HW_XSTAT(rx_oversize_cnt),
        HW_XSTAT(rx_jabber_errors),
        HW_XSTAT(rx_l3_l4_xsum_error),
        HW_XSTAT(mac_local_errors),
@@ -2157,7 +2159,7 @@ txgbe_read_stats_registers(struct txgbe_hw *hw,
        hw_stats->rx_bytes += rd64(hw, TXGBE_DMARXOCTL);
        hw_stats->tx_bytes += rd64(hw, TXGBE_DMATXOCTL);
        hw_stats->rx_dma_drop += rd32(hw, TXGBE_DMARXDROP);
-       hw_stats->rx_drop_packets += rd32(hw, TXGBE_PBRXDROP);
+       hw_stats->rx_rdb_drop += rd32(hw, TXGBE_PBRXDROP);
 
        /* MAC Stats */
        hw_stats->rx_crc_errors += rd64(hw, TXGBE_MACRXERRCRCL);
@@ -2189,7 +2191,7 @@ txgbe_read_stats_registers(struct txgbe_hw *hw,
                        rd64(hw, TXGBE_MACTX1024TOMAXL);
 
        hw_stats->rx_undersize_errors += rd64(hw, TXGBE_MACRXERRLENL);
-       hw_stats->rx_oversize_errors += rd32(hw, TXGBE_MACRXOVERSIZE);
+       hw_stats->rx_oversize_cnt += rd32(hw, TXGBE_MACRXOVERSIZE);
        hw_stats->rx_jabber_errors += rd32(hw, TXGBE_MACRXJABBER);
 
        /* MNG Stats */
@@ -2311,8 +2313,7 @@ txgbe_dev_stats_get(struct rte_eth_dev *dev, struct 
rte_eth_stats *stats)
                          hw_stats->rx_mac_short_packet_dropped +
                          hw_stats->rx_length_errors +
                          hw_stats->rx_undersize_errors +
-                         hw_stats->rx_oversize_errors +
-                         hw_stats->rx_drop_packets +
+                         hw_stats->rx_rdb_drop +
                          hw_stats->rx_illegal_byte_errors +
                          hw_stats->rx_error_bytes +
                          hw_stats->rx_fragment_errors +
-- 
2.27.0

Reply via email to