app/testpmd: fix flow creation parsing
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
--- app/test-pmd/cmdline_flow.c | 8 ++++++++ 1 file changed, 8 insertions(+)
app/test-pmd/cmdline_flow.c +8 -0
@@ -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
Hi Alexander,
Quoted 39 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Subject: [PATCH] app/testpmd: fix flow creation parsingA 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")Signed-off-by Alexander Kozyrev <[email protected]>--- app/test-pmd/cmdline_flow.c | 8 ++++++++ 1 file changed, 8 insertions(+)app/test-pmd/cmdline_flow.c +8
-1@@ -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
Huang, ZhiminX
Tested-byQuoted 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 parsingHi 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 parsingA 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")Signed-off-by Alexander Kozyrev <[email protected]>--- app/test-pmd/cmdline_flow.c | 8 ++++++++ 1 file changed, 8 insertions(+)app/test-pmd/cmdline_flow.c +0
-0@@ -6864,6 +6864,14 @@ parse_vc(struct context *ctx, const struct token*token,
Quoted 15 lines
app/test-pmd/cmdline_flow.c +8
-1ctx->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
Acked-by Ori Kam <[email protected]>
Quoted 2 lines
Thanks,
Ori
Ferruh Yigit
AppliedQuoted 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 parsingHi Alexander,
Quoted 11 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Subject: [PATCH] app/testpmd: fix flow creation parsingA 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")Signed-off-by Alexander Kozyrev <[email protected]>Acked-by Ori Kam <[email protected]>Tested-by Zhimin Huang <[email protected] >
Applied to dpdk-next-net/main, thanks.