DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/gve: Add support for TSO in DQO RDA
@ 2024-08-01 10:19 Tathagat Priyadarshi
  2024-08-01 10:33 ` Tathagat Priyadarshi
  2024-08-09 18:51 ` [PATCH v3] net/gve: add " Tathagat Priyadarshi
  0 siblings, 2 replies; 9+ messages in thread
From: Tathagat Priyadarshi @ 2024-08-01 10:19 UTC (permalink / raw)
  To: rushilg, joshwash; +Cc: dev, Tathagat Priyadarshi, Varun Lakkur Ambaji Rao

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 | 42 ++++++++++++++++++++++++++++++++++++------
 1 file changed, 36 insertions(+), 6 deletions(-)

diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 579b8d6..e5cdb57 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,8 @@
 	uint16_t sw_id;
 	uint64_t bytes;
 	uint16_t first_sw_id;
+	uint8_t tso;
+	uint8_t csum;
 
 	sw_ring = txq->sw_ring;
 	txr = txq->tx_ring;
@@ -108,12 +121,31 @@
 				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;
+
+		if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
+			tso = 1;
+			csum = 1;
+		} else if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO) {
+			tso = 0;
+			csum = 1;
+		} else {
+			tso = 0;
+			csum = 0;
+		}
+
+		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");
@@ -127,6 +159,7 @@
 			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;
@@ -139,9 +172,6 @@
 		/* 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;
 	}
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] net/gve: Add support for TSO in DQO RDA
  2024-08-01 10:19 [PATCH] net/gve: Add support for TSO in DQO RDA Tathagat Priyadarshi
@ 2024-08-01 10:33 ` Tathagat Priyadarshi
  2024-08-07  9:40   ` Ferruh Yigit
  2024-08-09 18:51 ` [PATCH v3] net/gve: add " Tathagat Priyadarshi
  1 sibling, 1 reply; 9+ messages in thread
From: Tathagat Priyadarshi @ 2024-08-01 10:33 UTC (permalink / raw)
  To: rushilg, joshwash; +Cc: dev, Varun Lakkur Ambaji Rao

The following patch depends on
https://patches.dpdk.org/project/dpdk/patch/1722443901-2400194-1-git-send-email-tathagat.dpdk@gmail.com/
Will retrigger git patch checks post its approved and upstreamed. To
avoid conflicts.

On Thu, Aug 1, 2024 at 3:47 PM 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 | 42 ++++++++++++++++++++++++++++++++++++------
>  1 file changed, 36 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
> index 579b8d6..e5cdb57 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,8 @@
>         uint16_t sw_id;
>         uint64_t bytes;
>         uint16_t first_sw_id;
> +       uint8_t tso;
> +       uint8_t csum;
>
>         sw_ring = txq->sw_ring;
>         txr = txq->tx_ring;
> @@ -108,12 +121,31 @@
>                                 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;
> +
> +               if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
> +                       tso = 1;
> +                       csum = 1;
> +               } else if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO) {
> +                       tso = 0;
> +                       csum = 1;
> +               } else {
> +                       tso = 0;
> +                       csum = 0;
> +               }
> +
> +               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");
> @@ -127,6 +159,7 @@
>                         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;
> @@ -139,9 +172,6 @@
>                 /* 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;
>         }
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] net/gve: Add support for TSO in DQO RDA
  2024-08-01 10:33 ` Tathagat Priyadarshi
@ 2024-08-07  9:40   ` Ferruh Yigit
  2024-08-08 18:25     ` Tathagat Priyadarshi
  0 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2024-08-07  9:40 UTC (permalink / raw)
  To: Tathagat Priyadarshi, rushilg, joshwash; +Cc: dev, Varun Lakkur Ambaji Rao

On 8/1/2024 11:33 AM, Tathagat Priyadarshi wrote:
> The following patch depends on
> https://patches.dpdk.org/project/dpdk/patch/1722443901-2400194-1-git-
> send-email-tathagat.dpdk@gmail.com/
> Will retrigger git patch checks post its approved and upstreamed. To
> avoid conflicts.
>

Hi Tathagat,

This patch has bits from other patch just merged, can you please send a
new version of this patch, on top of latest next-net [1] tree?

[1]
https://git.dpdk.org/next/dpdk-next-net/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] net/gve: Add support for TSO in DQO RDA
  2024-08-07  9:40   ` Ferruh Yigit
@ 2024-08-08 18:25     ` Tathagat Priyadarshi
  2024-08-08 22:45       ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Tathagat Priyadarshi @ 2024-08-08 18:25 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: rushilg, joshwash, dev, Varun Lakkur Ambaji Rao

> Hi Tathagat,
>
> This patch has bits from other patch just merged, can you please send a
> new version of this patch, on top of latest next-net [1] tree?
>
> [1]
> https://git.dpdk.org/next/dpdk-next-net/

Superseded via https://patches.dpdk.org/project/dpdk/patch/1723141392-2437012-1-git-send-email-tathagat.dpdk@gmail.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] net/gve: Add support for TSO in DQO RDA
  2024-08-08 18:25     ` Tathagat Priyadarshi
@ 2024-08-08 22:45       ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2024-08-08 22:45 UTC (permalink / raw)
  To: Tathagat Priyadarshi; +Cc: rushilg, joshwash, dev, Varun Lakkur Ambaji Rao

On 8/8/2024 7:25 PM, Tathagat Priyadarshi wrote:
>> Hi Tathagat,
>>
>> This patch has bits from other patch just merged, can you please send a
>> new version of this patch, on top of latest next-net [1] tree?
>>
>> [1]
>> https://git.dpdk.org/next/dpdk-next-net/
> 
> Superseded via https://patches.dpdk.org/project/dpdk/patch/1723141392-2437012-1-git-send-email-tathagat.dpdk@gmail.com/
>

Thank you.

Instead of replying with this 'superseded' note, expectation is to send
next version, v2 in this case, send as a reply to previous version.
This way both versions will be in the same email thread, so it will be
more clear that old version is superseded. Also it will be in same email
thread in the mail list archive, so someone looking them later will be
able to see all versions history in same thread.
How to send new version as reply to previous one is documented in the
contribution guide, can you please check?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3] net/gve: add support for TSO in DQO RDA
  2024-08-01 10:19 [PATCH] net/gve: Add support for TSO in DQO RDA Tathagat Priyadarshi
  2024-08-01 10:33 ` Tathagat Priyadarshi
@ 2024-08-09 18:51 ` Tathagat Priyadarshi
  2024-08-19 10:03   ` Tathagat Priyadarshi
  2024-08-27  3:11   ` Rushil Gupta
  1 sibling, 2 replies; 9+ messages in thread
From: Tathagat Priyadarshi @ 2024-08-09 18:51 UTC (permalink / raw)
  To: dev; +Cc: Tathagat Priyadarshi, Varun Lakkur Ambaji Rao

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;
 }
 
+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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] net/gve: add support for TSO in DQO RDA
  2024-08-09 18:51 ` [PATCH v3] net/gve: add " Tathagat Priyadarshi
@ 2024-08-19 10:03   ` Tathagat Priyadarshi
  2024-08-27  3:11   ` Rushil Gupta
  1 sibling, 0 replies; 9+ messages in thread
From: Tathagat Priyadarshi @ 2024-08-19 10:03 UTC (permalink / raw)
  To: dev, Joshua Washington, Rushil Gupta; +Cc: Varun Lakkur Ambaji Rao

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?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] net/gve: add support for TSO in DQO RDA
  2024-08-09 18:51 ` [PATCH v3] net/gve: add " Tathagat Priyadarshi
  2024-08-19 10:03   ` Tathagat Priyadarshi
@ 2024-08-27  3:11   ` Rushil Gupta
  2024-08-27 14:04     ` Ferruh Yigit
  1 sibling, 1 reply; 9+ messages in thread
From: Rushil Gupta @ 2024-08-27  3:11 UTC (permalink / raw)
  To: Tathagat Priyadarshi; +Cc: dev, Varun Lakkur Ambaji Rao

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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] net/gve: add support for TSO in DQO RDA
  2024-08-27  3:11   ` Rushil Gupta
@ 2024-08-27 14:04     ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2024-08-27 14:04 UTC (permalink / raw)
  To: Rushil Gupta, Tathagat Priyadarshi; +Cc: dev, Varun Lakkur Ambaji Rao

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-27 14:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-01 10:19 [PATCH] net/gve: Add support for TSO in DQO RDA Tathagat Priyadarshi
2024-08-01 10:33 ` Tathagat Priyadarshi
2024-08-07  9:40   ` Ferruh Yigit
2024-08-08 18:25     ` Tathagat Priyadarshi
2024-08-08 22:45       ` Ferruh Yigit
2024-08-09 18:51 ` [PATCH v3] net/gve: add " Tathagat Priyadarshi
2024-08-19 10:03   ` Tathagat Priyadarshi
2024-08-27  3:11   ` Rushil Gupta
2024-08-27 14:04     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).