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 2/3] net: stmmac: correct Tx descriptors debugfs prints
Date: Thu, 28 Aug 2025 12:02:36 +0200 [thread overview]
Message-ID: <20250828100237.4076570-3-konrad.leszczynski@intel.com> (raw)
In-Reply-To: <20250828100237.4076570-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.
Fixes: 79a4f4dfa69a8379 ("net: stmmac: reduce dma ring display code duplication")
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>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@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 7b16d1207b80..70c3dd88a749 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6351,14 +6351,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++;
+ }
}
}
@@ -6398,7 +6409,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
next prev parent reply other threads:[~2025-08-28 9:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 10:02 [PATCH net 0/3] net: stmmac: misc fixes Konrad Leszczynski
2025-08-28 10:02 ` [PATCH net 1/3] net: stmmac: replace memcpy with strscpy in ethtool Konrad Leszczynski
2025-08-28 13:29 ` Vadim Fedorenko
2025-09-01 19:59 ` Jakub Kicinski
2025-09-04 18:53 ` Sebastian Basierski
2025-09-04 19:18 ` Andrew Lunn
2025-09-15 13:18 ` Konrad Leszczynski
2025-08-28 10:02 ` Konrad Leszczynski [this message]
2025-08-28 13:34 ` [PATCH net 2/3] net: stmmac: correct Tx descriptors debugfs prints Vadim Fedorenko
2025-09-01 20:01 ` Jakub Kicinski
2025-09-04 18:54 ` Sebastian Basierski
2025-09-15 12:54 ` Konrad Leszczynski
2025-09-15 15:05 ` Jakub Kicinski
2025-08-28 10:02 ` [PATCH net 3/3] net: stmmac: check if interface is running before TC block setup Konrad Leszczynski
2025-08-28 13:39 ` Vadim Fedorenko
2025-09-01 20:03 ` Jakub Kicinski
2025-09-04 19:01 ` Sebastian Basierski
2025-09-05 1:56 ` Jakub Kicinski
2025-09-09 18:47 ` Sebastian Basierski
2025-09-16 23:29 ` Jakub Kicinski
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=20250828100237.4076570-3-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®