DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix GTP PSC raw processing
@ 2022-06-30 12:50 Gregory Etelson
  2022-07-01 13:42 ` Singh, Aman Deep
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gregory Etelson @ 2022-06-30 12:50 UTC (permalink / raw)
  To: dev
  Cc: getelson, matan, rasland, stable, Ori Kam, Aman Singh,
	Yuying Zhang, Viacheslav Ovsiienko

Fix GTP PSP extension size initialization.
Clear input buffer.

cc: stable@dpdk.org

Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 6cb1173385..7f50028eb7 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer *in)
 				const struct rte_flow_item_gtp_psc
 					*opt = item->spec;
 				struct rte_gtp_psc_generic_hdr *hdr;
-
-				*total_size += RTE_ALIGN(sizeof(hdr),
+				size_t hdr_size = RTE_ALIGN(sizeof(*hdr),
 							 sizeof(int32_t));
+
+				*total_size += hdr_size;
 				hdr = (typeof(hdr))(data_tail - (*total_size));
+				memset(hdr, 0, hdr_size);
 				*hdr = opt->hdr;
 				hdr->ext_hdr_len = 1;
 				gtp_psc = i;
-- 
2.34.1


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

* Re: [PATCH] app/testpmd: fix GTP PSC raw processing
  2022-06-30 12:50 [PATCH] app/testpmd: fix GTP PSC raw processing Gregory Etelson
@ 2022-07-01 13:42 ` Singh, Aman Deep
  2022-07-01 15:23   ` Gregory Etelson
  2022-07-04  9:08 ` Singh, Aman Deep
  2022-07-06 16:11 ` [PATCH v2] " Gregory Etelson
  2 siblings, 1 reply; 7+ messages in thread
From: Singh, Aman Deep @ 2022-07-01 13:42 UTC (permalink / raw)
  To: Gregory Etelson, dev
  Cc: matan, rasland, stable, Ori Kam, Yuying Zhang, Viacheslav Ovsiienko

Hi Gregory,


On 6/30/2022 6:20 PM, Gregory Etelson wrote:
> Fix GTP PSP extension size initialization.
> Clear input buffer.
>
> cc: stable@dpdk.org
>
> Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> ---
>   app/test-pmd/cmdline_flow.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 6cb1173385..7f50028eb7 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer *in)
>   				const struct rte_flow_item_gtp_psc
>   					*opt = item->spec;
>   				struct rte_gtp_psc_generic_hdr *hdr;
> -
> -				*total_size += RTE_ALIGN(sizeof(hdr),
> +				size_t hdr_size = RTE_ALIGN(sizeof(*hdr),
>   							 sizeof(int32_t));

we missed sizeof(*hdr), last time. Ok now.

> +
> +				*total_size += hdr_size;
>   				hdr = (typeof(hdr))(data_tail - (*total_size));
> +				memset(hdr, 0, hdr_size);

Is this memset adding a value here ?

>   				*hdr = opt->hdr;
>   				hdr->ext_hdr_len = 1;
>   				gtp_psc = i;


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

* RE: [PATCH] app/testpmd: fix GTP PSC raw processing
  2022-07-01 13:42 ` Singh, Aman Deep
@ 2022-07-01 15:23   ` Gregory Etelson
  0 siblings, 0 replies; 7+ messages in thread
From: Gregory Etelson @ 2022-07-01 15:23 UTC (permalink / raw)
  To: Singh, Aman Deep, dev
  Cc: Matan Azrad, Raslan Darawsheh, stable, Ori Kam, Yuying Zhang,
	Slava Ovsiienko

Hello,

> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer
> *in)
> >                               const struct rte_flow_item_gtp_psc
> >                                       *opt = item->spec;
> >                               struct rte_gtp_psc_generic_hdr *hdr;
> > -
> > -                             *total_size += RTE_ALIGN(sizeof(hdr),
> > +                             size_t hdr_size = RTE_ALIGN(sizeof(*hdr),
> >                                                        sizeof(int32_t));
> 
> we missed sizeof(*hdr), last time. Ok now.
> 
> > +
> > +                             *total_size += hdr_size;
> >                               hdr = (typeof(hdr))(data_tail - (*total_size));
> > +                             memset(hdr, 0, hdr_size);
> 
> Is this memset adding a value here ?
> 

Size of struct rte_gtp_psc_generic_hdr is 3 bytes. In a packet the structure is padded 
with one extra byte for 32bits aligned value. The extra byte content is not covered by 
the GTP_PSC flow item configuration. Application must explicitly put 0 in that byte.
The patch zeros entire 32bits.

> >                               *hdr = opt->hdr;
> >                               hdr->ext_hdr_len = 1;
> >                               gtp_psc = i;


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

* Re: [PATCH] app/testpmd: fix GTP PSC raw processing
  2022-06-30 12:50 [PATCH] app/testpmd: fix GTP PSC raw processing Gregory Etelson
  2022-07-01 13:42 ` Singh, Aman Deep
@ 2022-07-04  9:08 ` Singh, Aman Deep
  2022-07-06 14:28   ` Andrew Rybchenko
  2022-07-06 16:11 ` [PATCH v2] " Gregory Etelson
  2 siblings, 1 reply; 7+ messages in thread
From: Singh, Aman Deep @ 2022-07-04  9:08 UTC (permalink / raw)
  To: Gregory Etelson, dev
  Cc: matan, rasland, stable, Ori Kam, Yuying Zhang, Viacheslav Ovsiienko



On 6/30/2022 6:20 PM, Gregory Etelson wrote:
> Fix GTP PSP extension size initialization.
> Clear input buffer.
>
> cc: stable@dpdk.org
>
> Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>

Acked-by: Aman Singh<aman.deep.singh@intel.com>

> ---
>


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

* Re: [PATCH] app/testpmd: fix GTP PSC raw processing
  2022-07-04  9:08 ` Singh, Aman Deep
@ 2022-07-06 14:28   ` Andrew Rybchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Rybchenko @ 2022-07-06 14:28 UTC (permalink / raw)
  To: Singh, Aman Deep, Gregory Etelson, dev
  Cc: matan, rasland, stable, Ori Kam, Yuying Zhang,
	Viacheslav Ovsiienko, Thomas Monjalon

On 7/4/22 12:08, Singh, Aman Deep wrote:
> 
> 
> On 6/30/2022 6:20 PM, Gregory Etelson wrote:
>> Fix GTP PSP extension size initialization.
>> Clear input buffer.
>>
>> cc: stable@dpdk.org
>>
>> Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")

Incorrect order:
Fixes: ...
Cc: ...

>> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> 
> Acked-by: Aman Singh<aman.deep.singh@intel.com>

Missing space before e-mail above.

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>


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

* [PATCH v2] app/testpmd: fix GTP PSC raw processing
  2022-06-30 12:50 [PATCH] app/testpmd: fix GTP PSC raw processing Gregory Etelson
  2022-07-01 13:42 ` Singh, Aman Deep
  2022-07-04  9:08 ` Singh, Aman Deep
@ 2022-07-06 16:11 ` Gregory Etelson
  2022-07-07 12:35   ` Andrew Rybchenko
  2 siblings, 1 reply; 7+ messages in thread
From: Gregory Etelson @ 2022-07-06 16:11 UTC (permalink / raw)
  To: dev
  Cc: getelson, matan, rasland, stable, Aman Singh, Andrew Rybchenko,
	Ori Kam, Yuying Zhang, Viacheslav Ovsiienko

Fix GTP PSP extension size initialization.
Clear input buffer.

Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
v2: fix comment tags order. 
---
 app/test-pmd/cmdline_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 6cb1173385..7f50028eb7 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer *in)
 				const struct rte_flow_item_gtp_psc
 					*opt = item->spec;
 				struct rte_gtp_psc_generic_hdr *hdr;
-
-				*total_size += RTE_ALIGN(sizeof(hdr),
+				size_t hdr_size = RTE_ALIGN(sizeof(*hdr),
 							 sizeof(int32_t));
+
+				*total_size += hdr_size;
 				hdr = (typeof(hdr))(data_tail - (*total_size));
+				memset(hdr, 0, hdr_size);
 				*hdr = opt->hdr;
 				hdr->ext_hdr_len = 1;
 				gtp_psc = i;
-- 
2.34.1


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

* Re: [PATCH v2] app/testpmd: fix GTP PSC raw processing
  2022-07-06 16:11 ` [PATCH v2] " Gregory Etelson
@ 2022-07-07 12:35   ` Andrew Rybchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Rybchenko @ 2022-07-07 12:35 UTC (permalink / raw)
  To: Gregory Etelson, dev
  Cc: matan, rasland, stable, Aman Singh, Ori Kam, Yuying Zhang,
	Viacheslav Ovsiienko

On 7/6/22 19:11, Gregory Etelson wrote:
> Fix GTP PSP extension size initialization.
> Clear input buffer.
> 
> Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Aman Singh <aman.deep.singh@intel.com>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

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


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

end of thread, other threads:[~2022-07-07 12:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 12:50 [PATCH] app/testpmd: fix GTP PSC raw processing Gregory Etelson
2022-07-01 13:42 ` Singh, Aman Deep
2022-07-01 15:23   ` Gregory Etelson
2022-07-04  9:08 ` Singh, Aman Deep
2022-07-06 14:28   ` Andrew Rybchenko
2022-07-06 16:11 ` [PATCH v2] " Gregory Etelson
2022-07-07 12:35   ` Andrew Rybchenko

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