mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
net: enetc: show RX drop counters only for assigned RX rings
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> Link: https://patch.msgid.link/20260408055849.1314033-3-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c6c223fd06
commit
c571d309d4
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user