Skip to contentSkip to conversation

app/testpmd: fix flex item input link parsing

PATCH Applied Gregory Etelson 3 participants 3 messages Mar 10, 2022 – Mar 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fix flex item input link parsing

Testpmd reads flex item configuration from a JSON file. Flex item input link description is stored in testpmd flow item format. For example, eth type is 0x0800. The item description is placed into a general testpmd CLI flow rule command template and parsed to convert string into flow item object.

The patch adds the actions section to the flow rule template.

Fixes 59f3a8acbcdb ("app/testpmd: add flex item commands")
---
 app/test-pmd/cmd_flex_item.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
app/test-pmd/cmd_flex_item.c +2 -1
index 9050825a81..78a89c0f8a 100644
@@ -133,7 +133,8 @@ flex_link_item_parse(const char *src, struct rte_flow_item *item)
 	struct rte_flow_item *pattern;
 	struct rte_flow_action *actions;
 
-	sprintf(flow_rule, "flow create 0 pattern %s / end", src);
+	sprintf(flow_rule,
+		"flow create 0 pattern %s / end actions drop / end", src);
 	src = flow_rule;
 	ret = flow_parse(src, (void *)data, sizeof(data),
 			 &attr, &pattern, &actions);
Signature · 1 line
2.35.1
Acked-by on v1 1/1
#1 lore raw
Quoted 44 lines

-----Original Message-----
From: Gregory Etelson <[email protected]>
Sent: Thursday, March 10, 2022 8:00
To: [email protected]
Cc: Gregory Etelson <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; Xiaoyun Li <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: [PATCH] app/testpmd: fix flex item input link parsing

Testpmd reads flex item configuration from a JSON file.
Flex item input link description is stored in testpmd flow item format. For example, eth type is 0x0800.
The item description is placed into a general testpmd CLI flow rule command template and parsed to convert string into flow item object.

The patch adds the actions section to the flow rule template.

Fixes 59f3a8acbcdb ("app/testpmd: add flex item commands")
---
 app/test-pmd/cmd_flex_item.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
app/test-pmd/cmd_flex_item.c +2 -1
index 9050825a81..78a89c0f8a 100644
@@ -133,7 +133,8 @@ flex_link_item_parse(const char *src, struct
 rte_flow_item *item)
 	struct rte_flow_item *pattern;
 	struct rte_flow_action *actions;
 
-	sprintf(flow_rule, "flow create 0 pattern %s / end", src);
+	sprintf(flow_rule,
+		"flow create 0 pattern %s / end actions drop / end", src);
 	src = flow_rule;
 	ret = flow_parse(src, (void *)data, sizeof(data),

&attr, &pattern, &actions);
--
2.35.1

#2 lore raw
Quoted 6 lines
Quoted 6 lines

Testpmd reads flex item configuration from a JSON file.
Flex item input link description is stored in testpmd flow item format. For example, eth type is 0x0800.
The item description is placed into a general testpmd CLI flow rule command template and parsed to convert string into flow item object.

Quoted 7 lines
Quoted 6 lines

The patch adds the actions section to the flow rule template.

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

Applied, thanks.