[PATCH 23.11] app/testpmd: fix flex link parsing for ethernet items

Dariusz Sosnowski dsosnowski at nvidia.com
Mon Jul 13 17:31:37 CEST 2026


From: Shani Peretz <shperetz at nvidia.com>

Offending patch introduced a switch statement
to determine the correct memcpy size for flex item link parsing.
However, the switch only handled IPV4, IPV6, UDP, and TCP item types,
causing all other types (including ETH) to be rejected
with "Unsupported item type".

This broke flex item configurations that use ETH in their input_link,
such as eCPRI which specifies "eth type is 0xAEFE".

Add ETH and VLAN to the supported item types and fix break indentation.

Fixes: fb6b3edf46cb ("app/testpmd: fix flex item link parsing")

Signed-off-by: Shani Peretz <shperetz at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 app/test-pmd/cmd_flex_item.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmd_flex_item.c b/app/test-pmd/cmd_flex_item.c
index a799b31ffd..0b6699cd5f 100644
--- a/app/test-pmd/cmd_flex_item.c
+++ b/app/test-pmd/cmd_flex_item.c
@@ -145,18 +145,24 @@ flex_link_item_parse(const char *src, struct rte_flow_item *item)
 		return ret;
 	item->type = pattern->type;
 	switch (item->type) {
+	case RTE_FLOW_ITEM_TYPE_ETH:
+		sz = sizeof(struct rte_flow_item_eth);
+		break;
+	case RTE_FLOW_ITEM_TYPE_VLAN:
+		sz = sizeof(struct rte_flow_item_vlan);
+		break;
 	case RTE_FLOW_ITEM_TYPE_IPV4:
 		sz = sizeof(struct rte_flow_item_ipv4);
-	break;
+		break;
 	case RTE_FLOW_ITEM_TYPE_IPV6:
 		sz = sizeof(struct rte_flow_item_ipv6);
-	break;
+		break;
 	case RTE_FLOW_ITEM_TYPE_UDP:
 		sz = sizeof(struct rte_flow_item_udp);
-       break;
+		break;
 	case RTE_FLOW_ITEM_TYPE_TCP:
 		sz = sizeof(struct rte_flow_item_tcp);
-	break;
+		break;
 	default:
 		printf("Unsupported item type in specified in link\n");
 		return -EINVAL;
-- 
2.47.3



More information about the stable mailing list