DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix flow creation parsing
@ 2022-03-01 22:47 Alexander Kozyrev
  2022-03-02  8:12 ` Ori Kam
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kozyrev @ 2022-03-01 22:47 UTC (permalink / raw)
  To: dev; +Cc: orika, suanmingm

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")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4f7a9f17f9..fc4a6d9cca 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -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)
-- 
2.18.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] app/testpmd: fix flow creation parsing
  2022-03-01 22:47 [PATCH] app/testpmd: fix flow creation parsing Alexander Kozyrev
@ 2022-03-02  8:12 ` Ori Kam
  2022-03-02  8:33   ` Huang, ZhiminX
  0 siblings, 1 reply; 4+ messages in thread
From: Ori Kam @ 2022-03-02  8:12 UTC (permalink / raw)
  To: Alexander Kozyrev, dev; +Cc: Suanming Mou

Hi Alexander,


> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> 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")
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> ---
>  app/test-pmd/cmdline_flow.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 4f7a9f17f9..fc4a6d9cca 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -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)
> --
> 2.18.2


Acked-by: Ori Kam <orika@nvidia.com>
Thanks,
Ori

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] app/testpmd: fix flow creation parsing
  2022-03-02  8:12 ` Ori Kam
@ 2022-03-02  8:33   ` Huang, ZhiminX
  2022-03-03 13:39     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Huang, ZhiminX @ 2022-03-02  8:33 UTC (permalink / raw)
  To: Ori Kam, Alexander Kozyrev, dev; +Cc: Suanming Mou

> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Wednesday, March 2, 2022 4:13 PM
> To: Alexander Kozyrev <akozyrev@nvidia.com>; dev@dpdk.org
> Cc: Suanming Mou <suanmingm@nvidia.com>
> Subject: RE: [PATCH] app/testpmd: fix flow creation parsing
> 
> Hi Alexander,
> 
> 
> > -----Original Message-----
> > From: Alexander Kozyrev <akozyrev@nvidia.com>
> > 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")
> >
> > Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> > ---
> >  app/test-pmd/cmdline_flow.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 4f7a9f17f9..fc4a6d9cca 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -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)
> > --
> > 2.18.2
> 
> 
> Acked-by: Ori Kam <orika@nvidia.com>
> Thanks,
> Ori

Tested-by: Zhimin Huang <zhiminx.huang@intel.com >



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] app/testpmd: fix flow creation parsing
  2022-03-02  8:33   ` Huang, ZhiminX
@ 2022-03-03 13:39     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2022-03-03 13:39 UTC (permalink / raw)
  To: Huang, ZhiminX, Ori Kam, Alexander Kozyrev, dev; +Cc: Suanming Mou

On 3/2/2022 8:33 AM, Huang, ZhiminX wrote:
>> -----Original Message-----
>> From: Ori Kam <orika@nvidia.com>
>> Sent: Wednesday, March 2, 2022 4:13 PM
>> To: Alexander Kozyrev <akozyrev@nvidia.com>; dev@dpdk.org
>> Cc: Suanming Mou <suanmingm@nvidia.com>
>> Subject: RE: [PATCH] app/testpmd: fix flow creation parsing
>>
>> Hi Alexander,
>>
>>
>>> -----Original Message-----
>>> From: Alexander Kozyrev <akozyrev@nvidia.com>
>>> 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")
>>>
>>> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
>>
>> Acked-by: Ori Kam <orika@nvidia.com>
> 
> Tested-by: Zhimin Huang <zhiminx.huang@intel.com >
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-03 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 22:47 [PATCH] app/testpmd: fix flow creation parsing Alexander Kozyrev
2022-03-02  8:12 ` Ori Kam
2022-03-02  8:33   ` Huang, ZhiminX
2022-03-03 13:39     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).