DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mana: fix Tx stall from send queue free-space unit mismatch
@ 2026-09-14 10:58 Rita Ruvinsky
  2026-09-14 16:14 ` Stephen Hemminger
  2026-09-17  6:23 ` [PATCH v2] " Rita Ruvinsky
  0 siblings, 2 replies; 6+ messages in thread
From: Rita Ruvinsky @ 2026-09-14 10:58 UTC (permalink / raw)
  To: dev; +Cc: longli, weh, stable, Rita Ruvinsky

gdma_post_work_request() subtracted a unit count from an entry count:

  queue_free_units = queue->count - (queue->head - queue->tail);

queue->count is in entries, while head and tail are in WQE alignment
units. On a 512-entry, 128KB send queue the check saw 512 units of
capacity instead of queue->size / GDMA_WQE_ALIGNMENT_UNIT_SIZE = 4096,
and returned -EBUSY with the queue one eighth full. A workload that
fills that window faster than it drains makes rte_eth_tx_burst() return
0 for long enough to look like a dead port.

Derive the capacity from queue->size, which is also what the ring wrap
in gdma_get_wqe_pointer() uses. Rx is unaffected: its WQEs occupy
exactly one unit, so entries and units coincide.

Fixes: 56dd45c0ce7b ("net/mana: implement hardware layer operations")
Cc: stable@dpdk.org

Signed-off-by: Rita Ruvinsky <rita.ruvinsky@weka.io>
---
Independent of patchwork 167383 and 167384 (net/mana MR length
truncation / Rx WQE double free) from the same author, currently in
awaiting-upstream: this touches gdma.c only and applies cleanly with or
without them.

 drivers/net/mana/gdma.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mana/gdma.c b/drivers/net/mana/gdma.c
index 7f66a7a7cf..c80fc25f21 100644
--- a/drivers/net/mana/gdma.c
+++ b/drivers/net/mana/gdma.c
@@ -138,7 +138,12 @@ gdma_post_work_request(struct mana_gdma_queue *queue,
 				client_oob_size + sgl_data_size,
 			  GDMA_WQE_ALIGNMENT_UNIT_SIZE);
 	uint8_t *wq_buffer_pointer;
-	uint32_t queue_free_units = queue->count - (queue->head - queue->tail);
+	/* head/tail count WQE alignment units, so the capacity they are compared
+	 * against must too: queue->count is in entries and undercounts the
+	 * queue, stalling Tx well below capacity.
+	 */
+	uint32_t queue_free_units = queue->size / GDMA_WQE_ALIGNMENT_UNIT_SIZE -
+					(queue->head - queue->tail);
 
 	if (wqe_size / GDMA_WQE_ALIGNMENT_UNIT_SIZE > queue_free_units) {
 		DP_LOG(DEBUG, "WQE size %u queue count %u head %u tail %u",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-17  6:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 10:58 [PATCH] net/mana: fix Tx stall from send queue free-space unit mismatch Rita Ruvinsky
2026-09-14 16:14 ` Stephen Hemminger
2026-09-14 16:24   ` [EXTERNAL] " Wei Hu
2026-09-16 11:12     ` Rita Ruvinsky
2026-09-16 15:17       ` Stephen Hemminger
2026-09-17  6:23 ` [PATCH v2] " Rita Ruvinsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox