Skip to contentSkip to conversation

app/testpmd: fix flow creation parsing

PATCH Applied Alexander Kozyrev 4 participants 4 messages Mar 1, 2022 – Mar 3, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fix flow creation parsing

A pattern template creation shares the parsing mechanism with a simple flow creation. The pattern template creation only consists of pattern items while the flow creation continues with actions. The parsing mechanism now accommodates both cases and allows to stop at the item end token, which should not happen for the flow creation. Fix parsing mechanism to differentiate between these two cases.

Bugzilla ID: 941

Fixes 04cc665fab ("app/testpmd: add flow template management")
---
 app/test-pmd/cmdline_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)
app/test-pmd/cmdline_flow.c +8 -0
index 4f7a9f17f9..fc4a6d9cca 100644
@@ -6864,6 +6864,14 @@ parse_vc(struct context *ctx, const struct token *token,
 		ctx->object = out->args.vc.pattern;
 		ctx->objmask = NULL;
 		return len;
+	case ITEM_END:
+		if ((out->command == VALIDATE || out->command == CREATE) &&
+		    ctx->last)
+			return -1;
+		if (out->command == PATTERN_TEMPLATE_CREATE &&
+		    !ctx->last)
+			return -1;
+		break;
 	case ACTIONS:
 		out->args.vc.actions =
 			(void *)RTE_ALIGN_CEIL((uintptr_t)
Signature · 1 line
2.18.2
Acked-by on v1 1/1
#1 lore raw

Hi Alexander,

Quoted 39 lines

-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Subject: [PATCH] app/testpmd: fix flow creation parsing

A pattern template creation shares the parsing mechanism with a simple flow creation. The pattern template creation only consists of pattern items while the flow creation continues with actions. The parsing mechanism now accommodates both cases and allows to stop at the item end token, which should not happen for the flow creation. Fix parsing mechanism to differentiate between these two cases.

Bugzilla ID: 941

Fixes 04cc665fab ("app/testpmd: add flow template management")
---
 app/test-pmd/cmdline_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)
app/test-pmd/cmdline_flow.c +8 -1
index 4f7a9f17f9..fc4a6d9cca 100644
@@ -6864,6 +6864,14 @@ parse_vc(struct context *ctx, const struct token *token,
 		ctx->object = out->args.vc.pattern;
 		ctx->objmask = NULL;
 		return len;
+	case ITEM_END:
+		if ((out->command == VALIDATE || out->command == CREATE) &&
+		    ctx->last)
+			return -1;
+		if (out->command == PATTERN_TEMPLATE_CREATE &&
+		    !ctx->last)
+			return -1;
+		break;
 	case ACTIONS:
 		out->args.vc.actions =
 			(void *)RTE_ALIGN_CEIL((uintptr_t)
--
Quoted 1 line

2.18.2

Thanks,
Ori

Tested-by
#2 lore raw
Quoted 54 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Wednesday, March 2, 2022 4:13 PM
To: Alexander Kozyrev <[email protected]>; [email protected]
Cc: Suanming Mou <[email protected]>
Subject: RE: [PATCH] app/testpmd: fix flow creation parsing

Hi Alexander,

app/test-pmd/cmdline_flow.c parse_vc(struct context *ctx, const struct token

Quoted 24 lines

-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Subject: [PATCH] app/testpmd: fix flow creation parsing

A pattern template creation shares the parsing mechanism with a simple flow creation. The pattern template creation only consists of pattern items while the flow creation continues with actions.
The parsing mechanism now accommodates both cases and allows to stop at the item end token, which should not happen for the flow creation. Fix parsing mechanism to differentiate between these two cases.

Bugzilla ID: 941

Fixes 04cc665fab ("app/testpmd: add flow template management")
---
 app/test-pmd/cmdline_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)
app/test-pmd/cmdline_flow.c +0 -0
index 4f7a9f17f9..fc4a6d9cca 100644
@@ -6864,6 +6864,14 @@ parse_vc(struct context *ctx, const struct token

*token,

Quoted 15 lines
app/test-pmd/cmdline_flow.c +8 -1
 		ctx->object = out->args.vc.pattern;
 		ctx->objmask = NULL;
 		return len;
+	case ITEM_END:
+		if ((out->command == VALIDATE || out->command == CREATE) &&
+		    ctx->last)
+			return -1;
+		if (out->command == PATTERN_TEMPLATE_CREATE &&
+		    !ctx->last)
+			return -1;
+		break;
 	case ACTIONS:
 		out->args.vc.actions =
 			(void *)RTE_ALIGN_CEIL((uintptr_t)
--
Quoted 1 line

2.18.2

Quoted 2 lines

Thanks,
Ori

Applied
#3 lore raw
Quoted 21 lines · ZhiminX
Quoted 21 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Wednesday, March 2, 2022 4:13 PM
To: Alexander Kozyrev <[email protected]>; [email protected]
Cc: Suanming Mou <[email protected]>
Subject: RE: [PATCH] app/testpmd: fix flow creation parsing

Hi Alexander,

Quoted 11 lines

-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Subject: [PATCH] app/testpmd: fix flow creation parsing

A pattern template creation shares the parsing mechanism with a simple flow creation. The pattern template creation only consists of pattern items while the flow creation continues with actions.
The parsing mechanism now accommodates both cases and allows to stop at the item end token, which should not happen for the flow creation. Fix parsing mechanism to differentiate between these two cases.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Bugzilla ID: 941

Fixes 04cc665fab ("app/testpmd: add flow template management")

Applied to dpdk-next-net/main, thanks.