Skip to content

Commit

Permalink
net/gve: support TSO in DQO RDA
Browse files Browse the repository at this point in the history
The patch intends on adding support for TSO in DQO RDA format.

Signed-off-by: Tathagat Priyadarshi <tathagat.dpdk@gmail.com>
Signed-off-by: Varun Lakkur Ambaji Rao <varun.la@gmail.com>
Acked-by: Rushil Gupta <rushilg@google.com>
  • Loading branch information
priyadarshitathagat authored and ferruhy committed Aug 27, 2024
1 parent c627fc3 commit 334bda1
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions drivers/net/gve/gve_tx_dqo.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq)
txq->complq_tail = next;
}

static inline void
gve_tx_fill_seg_desc_dqo(volatile union gve_tx_desc_dqo *desc, struct rte_mbuf *tx_pkt)
{
uint32_t hlen = tx_pkt->l2_len + tx_pkt->l3_len + tx_pkt->l4_len;
desc->tso_ctx.cmd_dtype.dtype = GVE_TX_TSO_CTX_DESC_DTYPE_DQO;
desc->tso_ctx.cmd_dtype.tso = 1;
desc->tso_ctx.mss = (uint16_t)tx_pkt->tso_segsz;
desc->tso_ctx.tso_total_len = tx_pkt->pkt_len - hlen;
desc->tso_ctx.header_len = (uint8_t)hlen;
}

uint16_t
gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
{
Expand All @@ -89,6 +100,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 tso;
uint8_t csum;

sw_ring = txq->sw_ring;
Expand All @@ -109,15 +121,23 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
gve_tx_clean_dqo(txq);
}

if (txq->nb_free < tx_pkt->nb_segs)
break;

ol_flags = tx_pkt->ol_flags;
nb_used = tx_pkt->nb_segs;
first_sw_id = sw_id;

tso = !!(ol_flags & RTE_MBUF_F_TX_TCP_SEG);
csum = !!(ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO);

nb_used += tso;
if (txq->nb_free < nb_used)
break;

if (tso) {
txd = &txr[tx_id];
gve_tx_fill_seg_desc_dqo(txd, tx_pkt);
tx_id = (tx_id + 1) & mask;
}

do {
if (sw_ring[sw_id] != NULL)
PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring");
Expand Down

0 comments on commit 334bda1

Please sign in to comment.