From: Konrad Leszczynski <konrad.leszczynski@intel.com>
To: davem@davemloft.net, andrew+netdev@lunn.ch, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
cezary.rojewski@intel.com, sebastian.basierski@intel.com,
Piotr Warpechowski <piotr.warpechowski@intel.com>,
Konrad Leszczynski <konrad.leszczynski@intel.com>
Subject: [PATCH net-next v3 3/3] net: stmmac: correct Tx descriptors debugfs prints
Date: Tue, 16 Sep 2025 14:48:08 +0200 [thread overview]
Message-ID: <20250916124808.218514-4-konrad.leszczynski@intel.com> (raw)
In-Reply-To: <20250916124808.218514-1-konrad.leszczynski@intel.com>
From: Piotr Warpechowski <piotr.warpechowski@intel.com>
It was observed that extended descriptors are not printed out fully and
enhanced descriptors are completely omitted in stmmac_rings_status_show().
Correct printing according to documentation and other existing prints in
the driver.
Reviewed-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Reviewed-by: Sebastian Basierski <sebastian.basierski@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Piotr Warpechowski <piotr.warpechowski@intel.com>
---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 31 ++++++++++++++-----
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4df967500cd3..38f130cb0c9f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6355,14 +6355,25 @@ static void sysfs_display_ring(void *head, int size, int extend_desc,
desc_size = extend_desc ? sizeof(*ep) : sizeof(*p);
for (i = 0; i < size; i++) {
dma_addr = dma_phy_addr + i * desc_size;
- seq_printf(seq, "%d [%pad]: 0x%x 0x%x 0x%x 0x%x\n",
- i, &dma_addr,
- le32_to_cpu(p->des0), le32_to_cpu(p->des1),
- le32_to_cpu(p->des2), le32_to_cpu(p->des3));
- if (extend_desc)
- p = &(++ep)->basic;
- else
+ if (extend_desc) {
+ seq_printf(seq, "%d [%pad]: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
+ i, &dma_addr,
+ le32_to_cpu(ep->basic.des0),
+ le32_to_cpu(ep->basic.des1),
+ le32_to_cpu(ep->basic.des2),
+ le32_to_cpu(ep->basic.des3),
+ le32_to_cpu(ep->des4),
+ le32_to_cpu(ep->des5),
+ le32_to_cpu(ep->des6),
+ le32_to_cpu(ep->des7));
+ ep++;
+ } else {
+ seq_printf(seq, "%d [%pad]: 0x%x 0x%x 0x%x 0x%x\n",
+ i, &dma_addr,
+ le32_to_cpu(p->des0), le32_to_cpu(p->des1),
+ le32_to_cpu(p->des2), le32_to_cpu(p->des3));
p++;
+ }
}
}
@@ -6402,7 +6413,11 @@ static int stmmac_rings_status_show(struct seq_file *seq, void *v)
seq_printf(seq, "Extended descriptor ring:\n");
sysfs_display_ring((void *)tx_q->dma_etx,
priv->dma_conf.dma_tx_size, 1, seq, tx_q->dma_tx_phy);
- } else if (!(tx_q->tbs & STMMAC_TBS_AVAIL)) {
+ } else if (tx_q->tbs & STMMAC_TBS_AVAIL) {
+ seq_printf(seq, "Enhanced descriptor ring:\n");
+ sysfs_display_ring((void *)tx_q->dma_entx,
+ priv->dma_conf.dma_tx_size, 1, seq, tx_q->dma_tx_phy);
+ } else {
seq_printf(seq, "Descriptor ring:\n");
sysfs_display_ring((void *)tx_q->dma_tx,
priv->dma_conf.dma_tx_size, 0, seq, tx_q->dma_tx_phy);
--
2.34.1
prev parent reply other threads:[~2025-09-16 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 12:48 [PATCH net-next v3 0/3] net: stmmac: new features Konrad Leszczynski
2025-09-16 12:48 ` [PATCH net-next v3 1/3] net: stmmac: enhance VLAN protocol detection for GRO Konrad Leszczynski
2025-09-17 14:54 ` Simon Horman
2025-09-16 12:48 ` [PATCH net-next v3 2/3] net: stmmac: add TC flower filter support for IP EtherType Konrad Leszczynski
2025-09-16 12:48 ` Konrad Leszczynski [this message]
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=20250916124808.218514-4-konrad.leszczynski@intel.com \
--to=konrad.leszczynski@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=cezary.rojewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=piotr.warpechowski@intel.com \
--cc=sebastian.basierski@intel.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
all inboxes | Powered by JetHome®