[v3] net/gve: add support for TSO in DQO RDA

Message ID 1723229462-2439640-1-git-send-email-tathagat.dpdk@gmail.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series [v3] net/gve: add support for TSO in DQO RDA |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-compile-amd64-testing pending Testing pending
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS

Commit Message

Tathagat Priyadarshi Aug. 9, 2024, 6:51 p.m. UTC
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>
---
 drivers/net/gve/gve_tx_dqo.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
  

Comments

Tathagat Priyadarshi Aug. 19, 2024, 10:03 a.m. UTC | #1
On Sat, Aug 10, 2024 at 12:19 AM Tathagat Priyadarshi
<tathagat.dpdk@gmail.com> wrote:
>
> 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>
> ---
>  drivers/net/gve/gve_tx_dqo.c | 26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)


Hi @Joshua Washington / @Rushil Gupta ,
Could you please review this patch?
  
Rushil Gupta Aug. 27, 2024, 3:11 a.m. UTC | #2
Acked-by: Rushil Gupta <rushilg@google.com>

Thanks!


On Fri, Aug 9, 2024 at 11:49 AM Tathagat Priyadarshi
<tathagat.dpdk@gmail.com> wrote:
>
> 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>
> ---
>  drivers/net/gve/gve_tx_dqo.c | 26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
> index b9d6d01..731c287 100644
> --- a/drivers/net/gve/gve_tx_dqo.c
> +++ b/drivers/net/gve/gve_tx_dqo.c
> @@ -72,6 +72,17 @@
>         txq->complq_tail = next;
>  }
>
I see that we are not populating the flex metadata here like the linux
driver. These metadata fields allow guest vm to send metadata to fxp.
However; that can be a separate change.


> +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)
>  {
> @@ -89,6 +100,7 @@
>         uint16_t sw_id;
>         uint64_t bytes;
>         uint16_t first_sw_id;
> +       uint8_t tso;
>         uint8_t csum;
>
>         sw_ring = txq->sw_ring;
> @@ -109,15 +121,23 @@
>                                 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");
> --
> 1.8.3.1
>
  
Ferruh Yigit Aug. 27, 2024, 2:04 p.m. UTC | #3
On 8/27/2024 4:11 AM, Rushil Gupta wrote:

> On Fri, Aug 9, 2024 at 11:49 AM Tathagat Priyadarshi
> <tathagat.dpdk@gmail.com> wrote:
>>
>> 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>
>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index b9d6d01..731c287 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -72,6 +72,17 @@ 
 	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)
 {
@@ -89,6 +100,7 @@ 
 	uint16_t sw_id;
 	uint64_t bytes;
 	uint16_t first_sw_id;
+	uint8_t tso;
 	uint8_t csum;
 
 	sw_ring = txq->sw_ring;
@@ -109,15 +121,23 @@ 
 				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");