From: Wei Fang <wei.fang@nxp.com>
To: claudiu.manoil@nxp.com, vladimir.oltean@nxp.com,
xiaoning.wang@nxp.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev
Subject: [PATCH net-next 2/5] net: enetc: show RX drop counters only for assigned RX rings
Date: Wed, 8 Apr 2026 13:58:46 +0800 [thread overview]
Message-ID: <20260408055849.1314033-3-wei.fang@nxp.com> (raw)
In-Reply-To: <20260408055849.1314033-1-wei.fang@nxp.com>
For ENETC v1, each SI provides 16 RBDCR registers for RX ring drop
counters, but this does not imply that an SI actually owns 16 RX rings.
The ENETC hardware supports a total of 16 RX rings, which are assigned
to 3 SIs (1 PSI and 2 VSIs), so each SI is assigned fewer than 16 RX
rings.
The current implementation always reports 16 RX drop counters per SI,
leading to redundant output for SIs with fewer RX rings. Update the
logic to display drop counters only for the RX rings that are actually
assigned to the SI.
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
.../ethernet/freescale/enetc/enetc_ethtool.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
index c30a119e9142..36d1a2b810c2 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
@@ -124,22 +124,6 @@ static const struct {
{ ENETC_SITFRM, "SI tx frames" },
{ ENETC_SITUCA, "SI tx u-cast frames" },
{ ENETC_SITMCA, "SI tx m-cast frames" },
- { ENETC_RBDCR(0), "Rx ring 0 discarded frames" },
- { ENETC_RBDCR(1), "Rx ring 1 discarded frames" },
- { ENETC_RBDCR(2), "Rx ring 2 discarded frames" },
- { ENETC_RBDCR(3), "Rx ring 3 discarded frames" },
- { ENETC_RBDCR(4), "Rx ring 4 discarded frames" },
- { ENETC_RBDCR(5), "Rx ring 5 discarded frames" },
- { ENETC_RBDCR(6), "Rx ring 6 discarded frames" },
- { ENETC_RBDCR(7), "Rx ring 7 discarded frames" },
- { ENETC_RBDCR(8), "Rx ring 8 discarded frames" },
- { ENETC_RBDCR(9), "Rx ring 9 discarded frames" },
- { ENETC_RBDCR(10), "Rx ring 10 discarded frames" },
- { ENETC_RBDCR(11), "Rx ring 11 discarded frames" },
- { ENETC_RBDCR(12), "Rx ring 12 discarded frames" },
- { ENETC_RBDCR(13), "Rx ring 13 discarded frames" },
- { ENETC_RBDCR(14), "Rx ring 14 discarded frames" },
- { ENETC_RBDCR(15), "Rx ring 15 discarded frames" },
};
static const struct {
@@ -224,6 +208,7 @@ static const char rx_ring_stats[][ETH_GSTRING_LEN] = {
"Rx ring %2d recycle failures",
"Rx ring %2d redirects",
"Rx ring %2d redirect failures",
+ "Rx ring %2d discarded frames",
};
static const char tx_ring_stats[][ETH_GSTRING_LEN] = {
@@ -308,6 +293,7 @@ static void enetc_get_ethtool_stats(struct net_device *ndev,
data[o++] = priv->rx_ring[i]->stats.recycle_failures;
data[o++] = priv->rx_ring[i]->stats.xdp_redirect;
data[o++] = priv->rx_ring[i]->stats.xdp_redirect_failures;
+ data[o++] = enetc_rd(hw, ENETC_RBDCR(i));
}
if (!enetc_si_is_pf(priv->si))
--
2.34.1
next prev parent reply other threads:[~2026-04-08 6:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 5:58 [PATCH net-next 0/5] net: enetc: improve statistics for v1 and add statistics for v4 Wei Fang
2026-04-08 5:58 ` [PATCH net-next 1/5] net: enetc: add support for the standardized counters Wei Fang
2026-04-08 5:58 ` Wei Fang [this message]
2026-04-08 5:58 ` [PATCH net-next 3/5] net: enetc: remove standardized counters from enetc_pm_counters Wei Fang
2026-04-08 5:58 ` [PATCH net-next 4/5] net: enetc: add unstructured pMAC counters for ENETC v1 Wei Fang
2026-04-08 5:58 ` [PATCH net-next 5/5] net: enetc: add unstructured counters for ENETC v4 Wei Fang
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=20260408055849.1314033-3-wei.fang@nxp.com \
--to=wei.fang@nxp.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoning.wang@nxp.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