Writing zero-length descriptors to the hardware can cause the hardware
to reject that packet and stop transmitting altogether.
Fixes: 4022f9999f56 ("net/gve: support basic Tx data path for DQO")
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Joshua Washington <[email protected]>
Reviewed-by: Ankit Garg <[email protected]>
---
drivers/net/gve/gve_tx_dqo.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 652a0e5175..b2e5aae634 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -168,6 +168,11 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf
**tx_pkts, uint16_t nb_pkts)
if (sw_ring[sw_id] != NULL)
PMD_DRV_LOG(DEBUG, "Overwriting an entry in
sw_ring");
+ /* Skip writing descriptor if mbuf has no data. */
+ if (!tx_pkt->data_len)
+ goto finish_mbuf;
+
+ txd = &txr[tx_id];
sw_ring[sw_id] = tx_pkt;
/* fill Tx descriptors */
@@ -189,12 +194,14 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf
**tx_pkts, uint16_t nb_pkts)
tx_id = (tx_id + 1) & mask;
}
+finish_mbuf:
sw_id = (sw_id + 1) & sw_mask;
bytes += tx_pkt->data_len;
tx_pkt = tx_pkt->next;
} while (tx_pkt);
- /* fill the last descriptor with End of Packet (EOP) bit */
+ /* fill the last written descriptor with End of Packet (EOP)
bit */
+ txd = &txr[(tx_id - 1) & mask];
txd->pkt.end_of_packet = 1;
txq->nb_free -= nb_descs;
--
2.50.0.727.gbf7dc18ff4-goog