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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 12 23:07:06 CEST 2025


Hi,

FYI, your patch has been queued to stable release 22.11.9

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/14/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6545751f4d31b383a9e352d0a0b277ded2e00728

Thanks.

Luca Boccassi

---
>From 6545751f4d31b383a9e352d0a0b277ded2e00728 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

[ 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 a5b5f95dec..a6b62074f0 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -712,10 +712,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 ce66d2a7d8..79fc7b3bf6 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -453,6 +453,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);
@@ -467,7 +468,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.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-12 22:06:25.675737255 +0100
+++ 0049-common-cnxk-fix-E-tag-pattern-parsing.patch	2025-06-12 22:06:23.878044807 +0100
@@ -1 +1 @@
-From a610e32b96768b84436ba523bc97af88df4d6963 Mon Sep 17 00:00:00 2001
+From 6545751f4d31b383a9e352d0a0b277ded2e00728 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a610e32b96768b84436ba523bc97af88df4d6963 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 1f2461e026..50106b8773 100644
+index a5b5f95dec..a6b62074f0 100644
@@ -24 +25 @@
-@@ -995,10 +995,11 @@ npc_parse_pattern(struct npc *npc, const struct roc_npc_item_info pattern[],
+@@ -712,10 +712,11 @@ npc_parse_pattern(struct npc *npc, const struct roc_npc_item_info pattern[],
@@ -39 +40 @@
-index b52024f434..37b43995db 100644
+index ce66d2a7d8..79fc7b3bf6 100644
@@ -42 +43 @@
-@@ -531,6 +531,7 @@ npc_parse_lb(struct npc_parse_state *pst)
+@@ -453,6 +453,7 @@ npc_parse_lb(struct npc_parse_state *pst)
@@ -50 +51 @@
-@@ -545,7 +546,6 @@ npc_parse_lb(struct npc_parse_state *pst)
+@@ -467,7 +468,6 @@ npc_parse_lb(struct npc_parse_state *pst)


More information about the stable mailing list