Skip to contentSkip to conversation

common/cnxk: fix issue with IPv6 ext matching

PATCH In review [email protected] 2 participants 2 messages Jan 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: fix issue with IPv6 ext matching

From: Kiran Kumar K <[email protected]>

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")
---
 drivers/common/cnxk/roc_npc_mcam.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/common/cnxk/roc_npc_mcam.c +10 -9
index c419ce3a4c..0abd8872b1 100644
@@ -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
Signature · 1 line
2.35.3
Reviewed-by Satheesh Paul on v1 1/1
#1 lore raw
Quoted 11 lines · On Thu, Jan 12, 2023 at 12:06 PM <[email protected]> wrote:

From: Kiran Kumar K <[email protected]>

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

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: [email protected]

Quoted 37 lines
---
 drivers/common/cnxk/roc_npc_mcam.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/common/cnxk/roc_npc_mcam.c +10 -10
index c419ce3a4c..0abd8872b1 100644
@@ -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