common/cnxk: fix issue with IPv6 ext matching

Message ID 20230112063620.1057554-1-psatheesh@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series common/cnxk: fix issue with IPv6 ext matching |

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

Commit Message

Satheesh Paul Antonysamy Jan. 12, 2023, 6:36 a.m. UTC
  From: Kiran Kumar K <kirankumark@marvell.com>

While configuring ipv6 flow, ipv6 ext ltype should be
matched along with ipv6. Adding changes to fix this issue.

Fixes: 474e275b1bc6 ("common/cnxk: support extensions attributes in IPv6 item")
Cc: stable@dpdk.org

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/common/cnxk/roc_npc_mcam.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
  

Comments

Jerin Jacob Jan. 12, 2023, 1:32 p.m. UTC | #1
On Thu, Jan 12, 2023 at 12:06 PM <psatheesh@marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> While configuring ipv6 flow, ipv6 ext ltype should be
> matched along with ipv6. Adding changes to fix this issue.
>
> Fixes: 474e275b1bc6 ("common/cnxk: support extensions attributes in IPv6 item")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> Reviewed-by: Satheesh Paul <psatheesh@marvell.com>


Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks

    common/cnxk: fix issue with IPv6 ext matching

    While configuring IPv6 flow, IPv6 ext ltype should be
    matched along with IPv6. Adding changes to fix this issue.

    Fixes: 474e275b1bc6 ("common/cnxk: support extensions attributes
in IPv6 item")
    Cc: stable@dpdk.org

    Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
    Reviewed-by: Satheesh Paul <psatheesh@marvell.com>


> ---
>  drivers/common/cnxk/roc_npc_mcam.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
> index c419ce3a4c..0abd8872b1 100644
> --- a/drivers/common/cnxk/roc_npc_mcam.c
> +++ b/drivers/common/cnxk/roc_npc_mcam.c
> @@ -727,15 +727,16 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst)
>          * because for AH and ESP, LC LFLAG is zero and we don't want to match
>          * zero in LFLAG.
>          */
> -       lcflag_offset =
> -               __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &
> -                                  ((1ULL << NPC_LFLAG_LC_OFFSET) - 1));
> -       lcflag_offset *= 4;
> -
> -       mask = (0xfULL << lcflag_offset);
> -       val = pst->flow->mcam_data[0] & mask;
> -       if (val)
> -               pst->flow->mcam_mask[0] |= mask;
> +       if (pst->npc->keyx_supp_nmask[pst->nix_intf] & (1ULL << NPC_LFLAG_LC_OFFSET)) {
> +               lcflag_offset = __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &
> +                                                  ((1ULL << NPC_LFLAG_LC_OFFSET) - 1));
> +               lcflag_offset *= 4;
> +
> +               mask = (0xfULL << lcflag_offset);
> +               val = pst->flow->mcam_data[0] & mask;
> +               if (val)
> +                       pst->flow->mcam_mask[0] |= mask;
> +       }
>  }
>
>  int
> --
> 2.35.3
>
  

Patch

diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
index c419ce3a4c..0abd8872b1 100644
--- a/drivers/common/cnxk/roc_npc_mcam.c
+++ b/drivers/common/cnxk/roc_npc_mcam.c
@@ -727,15 +727,16 @@  npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst)
 	 * because for AH and ESP, LC LFLAG is zero and we don't want to match
 	 * zero in LFLAG.
 	 */
-	lcflag_offset =
-		__builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &
-				   ((1ULL << NPC_LFLAG_LC_OFFSET) - 1));
-	lcflag_offset *= 4;
-
-	mask = (0xfULL << lcflag_offset);
-	val = pst->flow->mcam_data[0] & mask;
-	if (val)
-		pst->flow->mcam_mask[0] |= mask;
+	if (pst->npc->keyx_supp_nmask[pst->nix_intf] & (1ULL << NPC_LFLAG_LC_OFFSET)) {
+		lcflag_offset = __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &
+						   ((1ULL << NPC_LFLAG_LC_OFFSET) - 1));
+		lcflag_offset *= 4;
+
+		mask = (0xfULL << lcflag_offset);
+		val = pst->flow->mcam_data[0] & mask;
+		if (val)
+			pst->flow->mcam_mask[0] |= mask;
+	}
 }
 
 int