patch 'app/testpmd: fix flex item link parsing' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Nov 21 12:20:52 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/26/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/01961bc399fa0249515b289908b46509c49f0129

Thanks.

Kevin

---
>From 01961bc399fa0249515b289908b46509c49f0129 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Sun, 16 Nov 2025 14:14:37 +0200
Subject: [PATCH] app/testpmd: fix flex item link parsing

[ upstream commit 39454e245b125ae555bc5a3a058cc3c1e1280f82 ]

The flex_link_item_parse function was using FLEX_MAX_FLOW_PATTERN_LENGTH
for all memcpy operations regardless of the actual flow item type. This
could lead to copying incorrect amounts of data.

This patch adds a switch statement to determine the correct size based
on the actual flow item type (IPv4, IPv6, UDP, TCP) and uses that size
for the memcpy operations on spec, mask, and last fields.

Also adds validation to reject unsupported item types.

Fixes: 59f3a8acbcdb ("app/testpmd: add flex item commands")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
---
 app/test-pmd/cmd_flex_item.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/cmd_flex_item.c b/app/test-pmd/cmd_flex_item.c
index e6e1cefeb3..af6c087feb 100644
--- a/app/test-pmd/cmd_flex_item.c
+++ b/app/test-pmd/cmd_flex_item.c
@@ -144,19 +144,20 @@ flex_link_item_parse(const char *src, struct rte_flow_item *item)
 		return ret;
 	item->type = pattern->type;
-	if (pattern->spec) {
+	ret = rte_flow_conv(RTE_FLOW_CONV_OP_ITEM_MASK, NULL, 0, item, NULL);
+	if ((ret > 0) && pattern->spec) {
 		ptr = (void *)(uintptr_t)item->spec;
-		memcpy(ptr, pattern->spec, FLEX_MAX_FLOW_PATTERN_LENGTH);
+		memcpy(ptr, pattern->spec, ret);
 	} else {
 		item->spec = NULL;
 	}
-	if (pattern->mask) {
+	if ((ret > 0) && pattern->mask) {
 		ptr = (void *)(uintptr_t)item->mask;
-		memcpy(ptr, pattern->mask, FLEX_MAX_FLOW_PATTERN_LENGTH);
+		memcpy(ptr, pattern->mask, ret);
 	} else {
 		item->mask = NULL;
 	}
-	if (pattern->last) {
+	if ((ret > 0) && pattern->last) {
 		ptr = (void *)(uintptr_t)item->last;
-		memcpy(ptr, pattern->last, FLEX_MAX_FLOW_PATTERN_LENGTH);
+		memcpy(ptr, pattern->last, ret);
 	} else {
 		item->last = NULL;
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-21 11:05:11.702940903 +0000
+++ 0068-app-testpmd-fix-flex-item-link-parsing.patch	2025-11-21 11:05:09.546173834 +0000
@@ -1 +1 @@
-From 39454e245b125ae555bc5a3a058cc3c1e1280f82 Mon Sep 17 00:00:00 2001
+From 01961bc399fa0249515b289908b46509c49f0129 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 39454e245b125ae555bc5a3a058cc3c1e1280f82 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list