DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>, stable@dpdk.org
Subject: [PATCH 5/9] net/ngbe: rename some extended statistic
Date: Fri,  2 Sep 2022 11:00:07 +0800	[thread overview]
Message-ID: <20220902030011.377523-6-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20220902030011.377523-1-jiawenwu@trustnetic.com>

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 and tx_drop_packets to rx_dma_drop and tx_dma_drop
to indicate the drop location.
And add tx_dma_drop to extended statistics.

Fixes: 8b433d04adc9 ("net/ngbe: support device xstats")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ngbe/base/ngbe_type.h |  5 ++---
 drivers/net/ngbe/ngbe_ethdev.c    | 10 +++++-----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ngbe/base/ngbe_type.h b/drivers/net/ngbe/base/ngbe_type.h
index 4a6c273f1e..73111f7950 100644
--- a/drivers/net/ngbe/base/ngbe_type.h
+++ b/drivers/net/ngbe/base/ngbe_type.h
@@ -142,9 +142,8 @@ struct ngbe_hw_stats {
 	u64 mng_bmc2host_packets;
 	u64 mng_host2bmc_packets;
 	/* Basix RxTx */
-	u64 rx_drop_packets;
-	u64 tx_drop_packets;
 	u64 rx_dma_drop;
+	u64 tx_dma_drop;
 	u64 tx_secdrp_packets;
 	u64 rx_packets;
 	u64 tx_packets;
@@ -170,7 +169,7 @@ struct ngbe_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/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c
index 86c28099c4..df32bf64ff 100644
--- a/drivers/net/ngbe/ngbe_ethdev.c
+++ b/drivers/net/ngbe/ngbe_ethdev.c
@@ -165,6 +165,7 @@ static const struct rte_ngbe_xstats_name_off rte_ngbe_stats_strings[] = {
 	HW_XSTAT(tx_management_packets),
 	HW_XSTAT(rx_management_dropped),
 	HW_XSTAT(rx_dma_drop),
+	HW_XSTAT(tx_dma_drop),
 	HW_XSTAT(tx_secdrp_packets),
 
 	/* Basic Error */
@@ -175,7 +176,7 @@ static const struct rte_ngbe_xstats_name_off rte_ngbe_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),
@@ -1374,9 +1375,8 @@ ngbe_read_stats_registers(struct ngbe_hw *hw,
 	hw_stats->rx_xoff_packets += rd32(hw, NGBE_PBRXLNKXOFF);
 
 	/* DMA Stats */
-	hw_stats->rx_drop_packets += rd32(hw, NGBE_DMARXDROP);
-	hw_stats->tx_drop_packets += rd32(hw, NGBE_DMATXDROP);
 	hw_stats->rx_dma_drop += rd32(hw, NGBE_DMARXDROP);
+	hw_stats->tx_dma_drop += rd32(hw, NGBE_DMATXDROP);
 	hw_stats->tx_secdrp_packets += rd32(hw, NGBE_DMATXSECDROP);
 	hw_stats->rx_packets += rd32(hw, NGBE_DMARXPKT);
 	hw_stats->tx_packets += rd32(hw, NGBE_DMATXPKT);
@@ -1413,7 +1413,7 @@ ngbe_read_stats_registers(struct ngbe_hw *hw,
 			rd64(hw, NGBE_MACTX1024TOMAXL);
 
 	hw_stats->rx_undersize_errors += rd64(hw, NGBE_MACRXERRLENL);
-	hw_stats->rx_oversize_errors += rd32(hw, NGBE_MACRXOVERSIZE);
+	hw_stats->rx_oversize_cnt += rd32(hw, NGBE_MACRXOVERSIZE);
 	hw_stats->rx_jabber_errors += rd32(hw, NGBE_MACRXJABBER);
 
 	/* MNG Stats */
@@ -1512,7 +1512,7 @@ ngbe_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->rdb_drp_cnt +
 			  hw_stats->rx_illegal_byte_errors +
 			  hw_stats->rx_error_bytes +
 			  hw_stats->rx_fragment_errors;
-- 
2.27.0


  parent reply	other threads:[~2022-09-02  3:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  3:00 [PATCH 0/9] Wangxun fixes and supports Jiawen Wu
2022-09-02  3:00 ` [PATCH 1/9] net/txgbe: fix IPv6 rule in flow director Jiawen Wu
2022-09-02  3:00 ` [PATCH 2/9] net/txgbe: fix OEM customized LED Jiawen Wu
2022-09-02  3:00 ` [PATCH 3/9] net/txgbe: remove semaphore between SW/FW Jiawen Wu
2022-09-02  3:00 ` [PATCH 4/9] net/txgbe: rename some extended statistic Jiawen Wu
2022-09-02  3:00 ` Jiawen Wu [this message]
2022-09-02  3:00 ` [PATCH 6/9] net/ngbe: remove semaphore between SW/FW Jiawen Wu
2022-09-02  3:00 ` [PATCH 7/9] net/ngbe: fix max frame size Jiawen Wu
2022-09-02  3:00 ` [PATCH 8/9] net/ngbe: fix YT PHY mixed mode occasionally failing link Jiawen Wu
2022-09-02  3:00 ` [PATCH 9/9] net/ngbe: support to set link down/up Jiawen Wu
2022-09-21 11:46   ` Ferruh Yigit
2022-09-13  1:55 ` [PATCH 0/9] Wangxun fixes and supports Jiawen Wu
2022-09-21 11:48 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220902030011.377523-6-jiawenwu@trustnetic.com \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).