patch 'common/cnxk: fix E-tag pattern parsing' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Thu Jun 26 14:01:18 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/28/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=26f01ea8285ae3eb02870a4667f58657019d5441

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 26f01ea8285ae3eb02870a4667f58657019d5441 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh at marvell.com>
Date: Thu, 22 May 2025 15:41:16 +0530
Subject: [PATCH] common/cnxk: fix E-tag pattern parsing
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit a610e32b96768b84436ba523bc97af88df4d6963 ]

E-tag pattern parsing was using wrong length leading
to a segfault. Fixing this by using the correct length
of the pattern item.

Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API")

Signed-off-by: Satheesh Paul <psatheesh at marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark at marvell.com>
---
 drivers/common/cnxk/roc_npc.c       | 5 +++--
 drivers/common/cnxk/roc_npc_parse.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index 9ea96a524c..9c95e57876 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -820,10 +820,11 @@ npc_parse_pattern(struct npc *npc, const struct roc_npc_item_info pattern[],
 	pst->mcam_data = (uint8_t *)flow->mcam_data;
 	pst->mcam_mask = (uint8_t *)flow->mcam_mask;
 
-	while (pattern->type != ROC_NPC_ITEM_TYPE_END &&
-	       layer < PLT_DIM(parse_stage_funcs)) {
+	while (pattern->type != ROC_NPC_ITEM_TYPE_END && layer < PLT_DIM(parse_stage_funcs)) {
 		/* Skip place-holders */
 		pattern = npc_parse_skip_void_and_any_items(pattern);
+		if (pattern->type == ROC_NPC_ITEM_TYPE_END)
+			break;
 
 		pst->pattern = pattern;
 		rc = parse_stage_funcs[layer](pst);
diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index 3c288070fb..3ee8752dae 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -505,6 +505,7 @@ npc_parse_lb(struct npc_parse_state *pst)
 		 */
 		lt = NPC_LT_LB_ETAG;
 		lflags = 0;
+		info.len = pattern->size;
 
 		last_pattern = pst->pattern;
 		pattern = npc_parse_skip_void_and_any_items(pst->pattern + 1);
@@ -519,7 +520,6 @@ npc_parse_lb(struct npc_parse_state *pst)
 			lflags = NPC_F_ETAG_CTAG;
 			last_pattern = pattern;
 		}
-		info.len = pattern->size;
 	} else if (pst->pattern->type == ROC_NPC_ITEM_TYPE_QINQ) {
 		info.hw_mask = NULL;
 		info.len = pattern->size;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-26 19:59:20.017497834 +0800
+++ 0058-common-cnxk-fix-E-tag-pattern-parsing.patch	2025-06-26 19:59:17.438418042 +0800
@@ -1 +1 @@
-From a610e32b96768b84436ba523bc97af88df4d6963 Mon Sep 17 00:00:00 2001
+From 26f01ea8285ae3eb02870a4667f58657019d5441 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit a610e32b96768b84436ba523bc97af88df4d6963 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 1f2461e026..50106b8773 100644
+index 9ea96a524c..9c95e57876 100644
@@ -24 +26 @@
-@@ -995,10 +995,11 @@ npc_parse_pattern(struct npc *npc, const struct roc_npc_item_info pattern[],
+@@ -820,10 +820,11 @@ npc_parse_pattern(struct npc *npc, const struct roc_npc_item_info pattern[],
@@ -39 +41 @@
-index b52024f434..37b43995db 100644
+index 3c288070fb..3ee8752dae 100644
@@ -42 +44 @@
-@@ -531,6 +531,7 @@ npc_parse_lb(struct npc_parse_state *pst)
+@@ -505,6 +505,7 @@ npc_parse_lb(struct npc_parse_state *pst)
@@ -50 +52 @@
-@@ -545,7 +546,6 @@ npc_parse_lb(struct npc_parse_state *pst)
+@@ -519,7 +520,6 @@ npc_parse_lb(struct npc_parse_state *pst)


More information about the stable mailing list