netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, gospo@broadcom.com
Subject: [PATCH net-next 06/12] bnxt_en: Add tx_resets ring counter
Date: Mon, 14 Aug 2023 21:56:52 -0700	[thread overview]
Message-ID: <20230815045658.80494-7-michael.chan@broadcom.com> (raw)
In-Reply-To: <20230815045658.80494-1-michael.chan@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 2949 bytes --]

Add a new tx_resets ring counter.  This counter will be saved as
tx_total_resets across any reset.  Since we currently do a full reset
in bnxt_sched_reset_txr(), the per ring counter will always be cleared
during reset.  Only the tx_total_resets count will be meaningful and we
only dispaly this under ethtool -S.

Link: https://lore.kernel.org/netdev/CACKFLimD-bKmJ1tGZOLYRjWzEwxkri-Mw7iFme1x2Dr0twdCeg@mail.gmail.com/
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 3 +++
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         | 6 ++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 +
 3 files changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index bea562d08d6c..5d6ea2782c2f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9397,6 +9397,8 @@ static void bnxt_disable_napi(struct bnxt *bp)
 		struct bnxt_cp_ring_info *cpr;
 
 		cpr = &bnapi->cp_ring;
+		if (bnapi->tx_fault)
+			cpr->sw_stats.tx.tx_resets++;
 		if (bnapi->in_reset)
 			cpr->sw_stats.rx.rx_resets++;
 		napi_disable(&bnapi->napi);
@@ -10951,6 +10953,7 @@ static void bnxt_get_one_ring_err_stats(struct bnxt *bp,
 	stats->rx_total_netpoll_discards += sw_stats->rx.rx_netpoll_discards;
 	stats->rx_total_ring_discards +=
 		BNXT_GET_RING_STATS64(hw_stats, rx_discard_pkts);
+	stats->tx_total_resets += sw_stats->tx.tx_resets;
 	stats->tx_total_ring_discards +=
 		BNXT_GET_RING_STATS64(hw_stats, tx_discard_pkts);
 	stats->total_missed_irqs += sw_stats->cmn.missed_irqs;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 7287fd3c0763..84cbcfa61bc1 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -939,12 +939,17 @@ struct bnxt_rx_sw_stats {
 	u64			rx_netpoll_discards;
 };
 
+struct bnxt_tx_sw_stats {
+	u64			tx_resets;
+};
+
 struct bnxt_cmn_sw_stats {
 	u64			missed_irqs;
 };
 
 struct bnxt_sw_stats {
 	struct bnxt_rx_sw_stats rx;
+	struct bnxt_tx_sw_stats tx;
 	struct bnxt_cmn_sw_stats cmn;
 };
 
@@ -955,6 +960,7 @@ struct bnxt_total_ring_err_stats {
 	u64			rx_total_oom_discards;
 	u64			rx_total_netpoll_discards;
 	u64			rx_total_ring_discards;
+	u64			tx_total_resets;
 	u64			tx_total_ring_discards;
 	u64			total_missed_irqs;
 };
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index a9f1eede24e9..547247d98eba 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -346,6 +346,7 @@ static const char *const bnxt_ring_err_stats_arr[] = {
 	"rx_total_oom_discards",
 	"rx_total_netpoll_discards",
 	"rx_total_ring_discards",
+	"tx_total_resets",
 	"tx_total_ring_discards",
 	"total_missed_irqs",
 };
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

  parent reply	other threads:[~2023-08-15  4:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15  4:56 [PATCH net-next 00/12] bnxt_en: Update for net-next Michael Chan
2023-08-15  4:56 ` [PATCH net-next 01/12] bnxt_en: Use the unified RX page pool buffers for XDP and non-XDP Michael Chan
2023-08-15  4:56 ` [PATCH net-next 02/12] bnxt_en: Let the page pool manage the DMA mapping Michael Chan
2023-08-15  4:56 ` [PATCH net-next 03/12] bnxt_en: Increment rx_resets counter in bnxt_disable_napi() Michael Chan
2023-08-15  4:56 ` [PATCH net-next 04/12] bnxt_en: Save ring error counters across reset Michael Chan
2023-08-15  4:56 ` [PATCH net-next 05/12] bnxt_en: Display the ring error counters under ethtool -S Michael Chan
2023-08-15  4:56 ` Michael Chan [this message]
2023-08-15 16:33   ` [PATCH net-next 06/12] bnxt_en: Add tx_resets ring counter Simon Horman
2023-08-15  4:56 ` [PATCH net-next 07/12] bnxt_en: Update firmware interface to 1.10.2.171 Michael Chan
2023-08-15  4:56 ` [PATCH net-next 08/12] bnxt_en: Enhance hwmon temperature reporting Michael Chan
2023-08-15  4:56 ` [PATCH net-next 09/12] bnxt_en: Move hwmon functions into a dedicated file Michael Chan
2023-08-15  4:56 ` [PATCH net-next 10/12] bnxt_en: Modify the driver to use hwmon_device_register_with_info Michael Chan
2023-08-15 14:44   ` Guenter Roeck
2023-08-15  4:56 ` [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon Michael Chan
2023-08-15 15:05   ` Guenter Roeck
2023-08-16 10:28     ` Kalesh Anakkur Purayil
2023-08-16 12:13       ` Guenter Roeck
2023-08-16 16:12         ` Kalesh Anakkur Purayil
2023-08-16 19:25           ` Guenter Roeck
2023-08-17  6:28             ` Michael Chan
2023-08-17 13:44               ` Guenter Roeck
2023-08-15  4:56 ` [PATCH net-next 12/12] bnxt_en: Event handler for Thermal event Michael Chan
2023-08-15 15:16   ` Guenter Roeck

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=20230815045658.80494-7-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gospo@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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).