For TSO packets, the context descriptor is written and tx_id advanced
before a completion tag is allocated. If no tag is available, the
burst stops, but when earlier packets in the burst were sent, the
tail written at the end of the burst still covers the context
descriptor. The device then receives it with no data descriptors
behind it, and the slot is never deducted from nb_free.

Allocate the completion tag before writing any descriptor.

Fixes: 5fd289ff3a00 ("net/gve: support out-of-order completions on DQ Tx")
Cc: [email protected]

Signed-off-by: Tathagat Priyadarshi <[email protected]>
---
 drivers/net/gve/gve_tx_dqo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index a2ebadd0b8..36d56b7d26 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -308,15 +308,15 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf 
**tx_pkts, uint16_t nb_pkts)
                        break;
                }
 
+               if (!gve_free_compl_tags_pop(txq, &compl_tag))
+                       break;
+
                if (tso) {
                        txd = &txr[tx_id];
                        gve_tx_fill_seg_desc_dqo(txd, tx_pkt);
                        tx_id = (tx_id + 1) & mask;
                }
 
-               if (!gve_free_compl_tags_pop(txq, &compl_tag))
-                       break;
-
                pkts[compl_tag].mbuf = tx_pkt;
                while (tx_pkt) {
                        /* Skip writing descriptors if mbuf has no data. */
-- 
2.43.0

Reply via email to