Skip to contentSkip to conversation

net/gve : Update EOP bit in txd rte_mbuf chain

PATCH Superseded Tathagat Priyadarshi 4 participants 16 messages Jul 31, 2024 – Aug 7, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/gve : Update EOP bit in txd rte_mbuf chain

The EOP 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")
---
 drivers/net/gve/gve_tx_dqo.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/gve/gve_tx_dqo.c +1 -0
index a65e6aa..579b8d6 100644
@@ -126,6 +126,7 @@
 			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;
 
 			/* size of desc_ring and sw_ring could be different */
 			tx_id = (tx_id + 1) & mask;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 18 lines · On Wed, Jul 31, 2024, 09:37 Tathagat Priyadarshi <[email protected]>…

The EOP 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")
---
 drivers/net/gve/gve_tx_dqo.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/gve/gve_tx_dqo.c +0 -0
index a65e6aa..579b8d6 100644

drivers/net/gve/gve_tx_dqo.c line 129

Quoted 4 lines
drivers/net/gve/gve_tx_dqo.c +1 -0
@@ -126,6 +126,7 @@
                        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;

Please also update checksum offload for each mbuf.

Quoted 7 lines
drivers/net/gve/gve_tx_dqo.c +0 -1
                        /* size of desc_ring and sw_ring could be different */
                        tx_id = (tx_id + 1) & mask;
--

1.8.3.1

Thanks for all of the contributions! Let's try to get this applied to stable release as well.

#2 lore raw

Hi Joshua,

We have addressed the checksum offload update for each mbuf in the following patch (net/gve: Add support for TSO in DQO RDA).
https://patches.dpdk.org/project/dpdk/patch/[email protected]/

Thanks a lot!

Quoted 37 lines · Joshua Washington
Quoted 18 lines · On Wed, Jul 31, 2024, 09:37 Tathagat Priyadarshi <[email protected]>…

The EOP 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")
---
 drivers/net/gve/gve_tx_dqo.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/gve/gve_tx_dqo.c +0 -0
index a65e6aa..579b8d6 100644

drivers/net/gve/gve_tx_dqo.c line 129

Quoted 4 lines
drivers/net/gve/gve_tx_dqo.c +1 -0
@@ -126,6 +126,7 @@
                        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;

Please also update checksum offload for each mbuf.

Quoted 7 lines
drivers/net/gve/gve_tx_dqo.c +0 -1
                        /* size of desc_ring and sw_ring could be different */
                        tx_id = (tx_id + 1) & mask;
--

1.8.3.1

Thanks for all of the contributions! Let's try to get this applied to stable release as well.

#3 lore raw
In reply to Tathagat Priyadarshi
Quoted 9 lines · Tathagat Priyadarshi

The EOP 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")

Hi Tathagat,

Can you please address issues reported from
'./devtools/check-git-log.sh' script?

And there is a request to backport to stable trees, please include following tag:
Cc: [email protected]

And please use following order/syntax in commit log:

```
<commit log>

Fixes: 4022f99 ("net/gve: support basic Tx data path for DQO")
Cc: [email protected]

Signed-off-by: Tathagat Priyadarshi <[email protected]>
Signed-off-by: Varun Lakkur Ambaji Rao <[email protected]>
```
#4 lore raw

Hi, can we try to serialize these patches? Let's fix the multidescriptor packets issue present in the driver first (ensuring that the entire descriptor is written each time). The TSO support is an entirely new feature and should likely not be backported to stable releases.

#5 lore raw

Hi Josh,

Updated the patch
(https://patches.dpdk.org/project/dpdk/patch/[email protected]/),
please ACK if it looks good.

Thanks!

Quoted 2 lines · Joshua Washington

Hi, can we try to serialize these patches? Let's fix the multidescriptor packets issue present in the driver first (ensuring that the entire descriptor is written each time). The TSO support is an entirely new feature and should likely not be backported to stable releases.

#6 lore raw

PATCH v2 1/1 net/gve : Update EOP bit in txd rte_mbuf chain

In reply to Tathagat Priyadarshi

The EOP 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")
---
 drivers/net/gve/gve_tx_dqo.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/gve/gve_tx_dqo.c +1 -0
index a65e6aa..579b8d6 100644
@@ -126,6 +126,7 @@
 			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;
 
 			/* size of desc_ring and sw_ring could be different */
 			tx_id = (tx_id + 1) & mask;
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH v3 1/1 net/gve : Update EOP & csum bit in txd rte_mbuf chain

In reply to Tathagat Priyadarshi

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")
---
 drivers/net/gve/gve_tx_dqo.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/gve/gve_tx_dqo.c +9 -3
index a65e6aa..91db037 100644
@@ -89,6 +89,7 @@
 	uint16_t sw_id;
 	uint64_t bytes;
 	uint16_t first_sw_id;
+	uint8_t csum;
 
 	sw_ring = txq->sw_ring;
 	txr = txq->tx_ring;
@@ -114,6 +115,12 @@
 		ol_flags = tx_pkt->ol_flags;
 		nb_used = tx_pkt->nb_segs;
 		first_sw_id = sw_id;
+
+		if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO)
+			csum = 1;
+		else
+			cusm = 0;
+
 		do {
 			if (sw_ring[sw_id] != NULL)
 				PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring");
@@ -126,6 +133,8 @@
 			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;
@@ -138,9 +147,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;
 	}
Signature · 1 line
1.8.3.1
#8 lore raw

Re: [PATCH v3] net/gve : Update EOP & csum bit in txd rte_mbuf chain

drivers/net/gve/gve_tx_dqo.c line 123

Quoted 5 lines · On Thu, 1 Aug 2024 17:27:53 +0000 Tathagat Priyadarshi…
drivers/net/gve/gve_tx_dqo.c +5 -0
+		if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO)
+			csum = 1;
+		else
+			cusm = 0;
+

Obvious typo, did you do a final test build?

Could also use logical inverse operator instead of if() which will generate better code sometimes.

		csum = !!(ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO);
#9 lore raw

Re: [PATCH v3] net/gve : Update EOP & csum bit in txd rte_mbuf chain

Thanks for your suggestion Stephen, I have already updated the patch with v4 & fixed the typo. Will consider your suggestion in the next version of the patch.

Quoted 17 lines · Stephen Hemminger

drivers/net/gve/gve_tx_dqo.c line 123

Quoted 5 lines · On Thu, 1 Aug 2024 17:27:53 +0000 Tathagat Priyadarshi…
drivers/net/gve/gve_tx_dqo.c +5 -0
+             if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO)
+                     csum = 1;
+             else
+                     cusm = 0;
+

Obvious typo, did you do a final test build?

Could also use logical inverse operator instead of if() which will generate better code sometimes.

                csum = !!(ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO);
#10 lore raw

PATCH v4 1/1 net/gve : Update EOP & csum bit in txd rte_mbuf chain

In reply to Tathagat Priyadarshi

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")
---
 drivers/net/gve/gve_tx_dqo.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/gve/gve_tx_dqo.c +9 -3
index a65e6aa..1374e1a 100644
@@ -89,6 +89,7 @@
 	uint16_t sw_id;
 	uint64_t bytes;
 	uint16_t first_sw_id;
+	uint8_t csum;
 
 	sw_ring = txq->sw_ring;
 	txr = txq->tx_ring;
@@ -114,6 +115,12 @@
 		ol_flags = tx_pkt->ol_flags;
 		nb_used = tx_pkt->nb_segs;
 		first_sw_id = sw_id;
+
+		if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO)
+			csum = 1;
+		else
+			csum = 0;
+
 		do {
 			if (sw_ring[sw_id] != NULL)
 				PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring");
@@ -126,6 +133,8 @@
 			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;
@@ -138,9 +147,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;
 	}
Signature · 1 line
1.8.3.1
#11 lore raw

PATCH v5 1/1 net/gve : Update EOP & csum bit in txd rte_mbuf chain

In reply to Tathagat Priyadarshi

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")
---
 drivers/net/gve/gve_tx_dqo.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/gve/gve_tx_dqo.c +6 -3
index a65e6aa..bbaf46d 100644
@@ -89,6 +89,7 @@
 	uint16_t sw_id;
 	uint64_t bytes;
 	uint16_t first_sw_id;
+	uint8_t csum;
 
 	sw_ring = txq->sw_ring;
 	txr = txq->tx_ring;
@@ -114,6 +115,9 @@
 		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");
@@ -126,6 +130,8 @@
 			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;
@@ -138,9 +144,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;
 	}
Signature · 1 line
1.8.3.1
#12 lore raw

Re: [PATCH v5] net/gve : Update EOP & csum bit in txd rte_mbuf chain

Updated the if-else block with an optimised inverse operator. Thanks for your suggestion Stephen.

Quoted 60 lines · Tathagat Priyadarshi

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")
---
 drivers/net/gve/gve_tx_dqo.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/gve/gve_tx_dqo.c +6 -4
index a65e6aa..bbaf46d 100644
@@ -89,6 +89,7 @@
        uint16_t sw_id;
        uint64_t bytes;
        uint16_t first_sw_id;
+       uint8_t csum;
 
        sw_ring = txq->sw_ring;
        txr = txq->tx_ring;
@@ -114,6 +115,9 @@
                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");
@@ -126,6 +130,8 @@
                        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;
@@ -138,9 +144,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

#13 lore raw

Re: [PATCH v5] net/gve : Update EOP & csum bit in txd rte_mbuf chain

hi Ferruh,

Could you please accept the updated patch?! let us know what's pending.

https://patches.dpdk.org/project/dpdk/patch/[email protected]/

TIA

Quoted 66 lines · Tathagat Priyadarshi

Updated the if-else block with an optimised inverse operator. Thanks for your suggestion Stephen.

Quoted 60 lines · Tathagat Priyadarshi

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")
---
 drivers/net/gve/gve_tx_dqo.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/gve/gve_tx_dqo.c +6 -4
index a65e6aa..bbaf46d 100644
@@ -89,6 +89,7 @@
        uint16_t sw_id;
        uint64_t bytes;
        uint16_t first_sw_id;
+       uint8_t csum;
 
        sw_ring = txq->sw_ring;
        txr = txq->tx_ring;
@@ -114,6 +115,9 @@
                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");
@@ -126,6 +130,8 @@
                        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;
@@ -138,9 +144,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

#14 lore raw

Re: [PATCH v5] net/gve : Update EOP & csum bit in txd rte_mbuf chain

Quoted 9 lines · Tathagat Priyadarshi

hi Ferruh,

Could you please accept the updated patch?! let us know what's pending.

https://patches.dpdk.org/project/dpdk/patch/1722575288-2408630-1-git-
[email protected]/

TIA

Hi Tathagat,

It is not waiting anything in particular, just waiting for processing, I will try to check today.

Btw, a few housekeeping items,
- I have commented a few times before to run './devtools/check-git-log.sh' script and fix issues, if you are not fixing them then maintainers need to spend time and fix them, please use the script next time.

- Please do not top-post in the mail list, meaning put your notes below the email, and if you are addressing anything specific, just put your comment below it.
The combination of top-post and bottom-post makes long email threads unreadable, so we go with bottom-post option.

Thanks,
ferruh

Applied
#15 lore raw

Re: [PATCH v5] net/gve : Update EOP & csum bit in txd rte_mbuf chain

In reply to Tathagat Priyadarshi
Quoted 4 lines · Tathagat Priyadarshi

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.

Quoted 8 lines
Fixes 4022f99 ("net/gve: support basic Tx data path for DQO")

Updated commit log slightly, please check the merged version.

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