Skip to content

Commit

Permalink
net/gve: fix Tx for chained mbuf
Browse files Browse the repository at this point in the history
The EOP and CSUM bit was not set for all the packets in mbuf chain
causing packet transmission stalls for packets split across
mbuf in chain.

Fixes: 4022f99 ("net/gve: support basic Tx data path for DQO")
Cc: stable@dpdk.org

Signed-off-by: Tathagat Priyadarshi <tathagat.dpdk@gmail.com>
Signed-off-by: Varun Lakkur Ambaji Rao <varun.la@gmail.com>
Acked-by: Joshua Washington <joshwash@google.com>
  • Loading branch information
priyadarshitathagat authored and ferruhy committed Aug 7, 2024
1 parent 3cdd251 commit e0f7ebe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,7 @@ Vakul Garg <vakul.garg@nxp.com>
Vamsi Attunuru <vattunuru@marvell.com>
Vamsi Krishna Atluri <vamsi.atluri@amd.com>
Vanshika Shukla <vanshika.shukla@nxp.com>
Varun Lakkur Ambaji Rao <varun.la@gmail.com>
Varun Sethi <v.sethi@nxp.com>
Vasily Philipov <vasilyf@mellanox.com>
Veerasenareddy Burru <vburru@marvell.com>
Expand Down
9 changes: 6 additions & 3 deletions drivers/net/gve/gve_tx_dqo.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
uint16_t sw_id;
uint64_t bytes;
uint16_t first_sw_id;
uint8_t csum;

sw_ring = txq->sw_ring;
txr = txq->tx_ring;
Expand All @@ -114,6 +115,9 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
ol_flags = tx_pkt->ol_flags;
nb_used = tx_pkt->nb_segs;
first_sw_id = sw_id;

csum = !!(ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO);

do {
if (sw_ring[sw_id] != NULL)
PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring");
Expand All @@ -126,6 +130,8 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
txd->pkt.dtype = GVE_TX_PKT_DESC_DTYPE_DQO;
txd->pkt.compl_tag = rte_cpu_to_le_16(first_sw_id);
txd->pkt.buf_size = RTE_MIN(tx_pkt->data_len, GVE_TX_MAX_BUF_SIZE_DQO);
txd->pkt.end_of_packet = 0;
txd->pkt.checksum_offload_enable = csum;

/* size of desc_ring and sw_ring could be different */
tx_id = (tx_id + 1) & mask;
Expand All @@ -138,9 +144,6 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
/* fill the last descriptor with End of Packet (EOP) bit */
txd->pkt.end_of_packet = 1;

if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO)
txd->pkt.checksum_offload_enable = 1;

txq->nb_free -= nb_used;
txq->nb_used += nb_used;
}
Expand Down

0 comments on commit e0f7ebe

Please sign in to comment.