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

Message ID 1722575288-2408630-1-git-send-email-tathagat.dpdk@gmail.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series [v5] net/gve : Update EOP & csum bit in txd rte_mbuf chain |

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/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

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

Comments

Tathagat Priyadarshi Aug. 2, 2024, 5:10 a.m. UTC | #1
Updated the if-else block with an optimised inverse operator. Thanks
for your suggestion Stephen.

On Fri, Aug 2, 2024 at 10:36 AM Tathagat Priyadarshi
<tathagat.dpdk@gmail.com> wrote:
>
> 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>
> ---
>  drivers/net/gve/gve_tx_dqo.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
> index a65e6aa..bbaf46d 100644
> --- a/drivers/net/gve/gve_tx_dqo.c
> +++ b/drivers/net/gve/gve_tx_dqo.c
> @@ -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
>
  
Tathagat Priyadarshi Aug. 6, 2024, 2:44 p.m. UTC | #2
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-send-email-tathagat.dpdk@gmail.com/

TIA

On Fri, Aug 2, 2024 at 10:40 AM Tathagat Priyadarshi
<tathagat.dpdk@gmail.com> wrote:
>
> Updated the if-else block with an optimised inverse operator. Thanks
> for your suggestion Stephen.
>
> On Fri, Aug 2, 2024 at 10:36 AM Tathagat Priyadarshi
> <tathagat.dpdk@gmail.com> wrote:
> >
> > 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>
> > ---
> >  drivers/net/gve/gve_tx_dqo.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
> > index a65e6aa..bbaf46d 100644
> > --- a/drivers/net/gve/gve_tx_dqo.c
> > +++ b/drivers/net/gve/gve_tx_dqo.c
> > @@ -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
> >
  
Ferruh Yigit Aug. 7, 2024, 7:36 a.m. UTC | #3
On 8/6/2024 3:44 PM, Tathagat Priyadarshi wrote:
> 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-
> send-email-tathagat.dpdk@gmail.com/
> 
> 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
  
Ferruh Yigit Aug. 7, 2024, 9:39 a.m. UTC | #4
On 8/2/2024 6:08 AM, Tathagat Priyadarshi wrote:
> 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>
>

Updated commit log slightly, please check the merged version.

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 a65e6aa..bbaf46d 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -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;
 	}