[v1,1/1] net/cnxk: program DF bit appropriately in vector mode

Message ID 20220901062802.2508287-1-hpothula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v1,1/1] net/cnxk: program DF bit appropriately in vector mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Hanumanth Pothula Sept. 1, 2022, 6:28 a.m. UTC
  In vector mode, DF bit is not programmed correctly, as the
return value of vsetq_lane_u64() is ignored, which actually
contains the updated value, leading HW to free mbufs though
NIX_TX_OFFLOAD_MBUF_NOFF_F flag is set.

Hence, save return value of vsetq_lane_u64() appropriately so
that DF bit is programmed correctly.

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
---
 drivers/net/cnxk/cn10k_tx.h | 8 ++++----
 drivers/net/cnxk/cn9k_tx.h  | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
  

Comments

Jerin Jacob Sept. 19, 2022, 4:57 p.m. UTC | #1
On Thu, Sep 1, 2022 at 11:58 AM Hanumanth Pothula <hpothula@marvell.com> wrote:
>
> In vector mode, DF bit is not programmed correctly, as the
> return value of vsetq_lane_u64() is ignored, which actually
> contains the updated value, leading HW to free mbufs though
> NIX_TX_OFFLOAD_MBUF_NOFF_F flag is set.
>
> Hence, save return value of vsetq_lane_u64() appropriately so
> that DF bit is programmed correctly.
>
> Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>

Applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/net/cnxk/cn10k_tx.h | 8 ++++----
>  drivers/net/cnxk/cn9k_tx.h  | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
> index ea13866b20..fb33e7150b 100644
> --- a/drivers/net/cnxk/cn10k_tx.h
> +++ b/drivers/net/cnxk/cn10k_tx.h
> @@ -2477,28 +2477,28 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
>                         mbuf3 = (uint64_t *)tx_pkts[3];
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf0))
> -                               vsetq_lane_u64(0x80000, xmask01, 0);
> +                               xmask01 = vsetq_lane_u64(0x80000, xmask01, 0);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf0)->pool,
>                                         (void **)&mbuf0, 1, 0);
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf1))
> -                               vsetq_lane_u64(0x80000, xmask01, 1);
> +                               xmask01 = vsetq_lane_u64(0x80000, xmask01, 1);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf1)->pool,
>                                         (void **)&mbuf1, 1, 0);
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf2))
> -                               vsetq_lane_u64(0x80000, xmask23, 0);
> +                               xmask23 = vsetq_lane_u64(0x80000, xmask23, 0);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf2)->pool,
>                                         (void **)&mbuf2, 1, 0);
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf3))
> -                               vsetq_lane_u64(0x80000, xmask23, 1);
> +                               xmask23 = vsetq_lane_u64(0x80000, xmask23, 1);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf3)->pool,
> diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
> index 6ce81f5c96..a609814dfb 100644
> --- a/drivers/net/cnxk/cn9k_tx.h
> +++ b/drivers/net/cnxk/cn9k_tx.h
> @@ -1705,28 +1705,28 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
>                         mbuf3 = (uint64_t *)tx_pkts[3];
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf0))
> -                               vsetq_lane_u64(0x80000, xmask01, 0);
> +                               xmask01 = vsetq_lane_u64(0x80000, xmask01, 0);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf0)->pool,
>                                         (void **)&mbuf0, 1, 0);
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf1))
> -                               vsetq_lane_u64(0x80000, xmask01, 1);
> +                               xmask01 = vsetq_lane_u64(0x80000, xmask01, 1);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf1)->pool,
>                                         (void **)&mbuf1, 1, 0);
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf2))
> -                               vsetq_lane_u64(0x80000, xmask23, 0);
> +                               xmask23 = vsetq_lane_u64(0x80000, xmask23, 0);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf2)->pool,
>                                         (void **)&mbuf2, 1, 0);
>
>                         if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf3))
> -                               vsetq_lane_u64(0x80000, xmask23, 1);
> +                               xmask23 = vsetq_lane_u64(0x80000, xmask23, 1);
>                         else
>                                 RTE_MEMPOOL_CHECK_COOKIES(
>                                         ((struct rte_mbuf *)mbuf3)->pool,
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index ea13866b20..fb33e7150b 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -2477,28 +2477,28 @@  cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
 			mbuf3 = (uint64_t *)tx_pkts[3];
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf0))
-				vsetq_lane_u64(0x80000, xmask01, 0);
+				xmask01 = vsetq_lane_u64(0x80000, xmask01, 0);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf0)->pool,
 					(void **)&mbuf0, 1, 0);
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf1))
-				vsetq_lane_u64(0x80000, xmask01, 1);
+				xmask01 = vsetq_lane_u64(0x80000, xmask01, 1);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf1)->pool,
 					(void **)&mbuf1, 1, 0);
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf2))
-				vsetq_lane_u64(0x80000, xmask23, 0);
+				xmask23 = vsetq_lane_u64(0x80000, xmask23, 0);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf2)->pool,
 					(void **)&mbuf2, 1, 0);
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf3))
-				vsetq_lane_u64(0x80000, xmask23, 1);
+				xmask23 = vsetq_lane_u64(0x80000, xmask23, 1);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf3)->pool,
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 6ce81f5c96..a609814dfb 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -1705,28 +1705,28 @@  cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 			mbuf3 = (uint64_t *)tx_pkts[3];
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf0))
-				vsetq_lane_u64(0x80000, xmask01, 0);
+				xmask01 = vsetq_lane_u64(0x80000, xmask01, 0);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf0)->pool,
 					(void **)&mbuf0, 1, 0);
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf1))
-				vsetq_lane_u64(0x80000, xmask01, 1);
+				xmask01 = vsetq_lane_u64(0x80000, xmask01, 1);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf1)->pool,
 					(void **)&mbuf1, 1, 0);
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf2))
-				vsetq_lane_u64(0x80000, xmask23, 0);
+				xmask23 = vsetq_lane_u64(0x80000, xmask23, 0);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf2)->pool,
 					(void **)&mbuf2, 1, 0);
 
 			if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf3))
-				vsetq_lane_u64(0x80000, xmask23, 1);
+				xmask23 = vsetq_lane_u64(0x80000, xmask23, 1);
 			else
 				RTE_MEMPOOL_CHECK_COOKIES(
 					((struct rte_mbuf *)mbuf3)->pool,