app/testpmd: fix GTP PSC raw processing
PATCH 1/1 app/testpmd: fix GTP PSC raw processing
Fix GTP PSP extension size initialization.
Clear input buffer.
--- app/test-pmd/cmdline_flow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +4 -2
@@ -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;
Signature · 1 line
2.34.1
Hi Gregory,
Quoted 16 lines · Gregory Etelson
Fix GTP PSP extension size initialization.
Clear input buffer.Fixes c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")Signed-off-by Gregory Etelson <[email protected]>--- app/test-pmd/cmdline_flow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)app/test-pmd/cmdline_flow.c +0
-0
app/test-pmd/cmdline_flow.c cmd_set_raw_parsed(const struct buffer *in) · line 11034
Quoted 7 lines
app/test-pmd/cmdline_flow.c +1
-2@@ -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.
app/test-pmd/cmdline_flow.c cmd_set_raw_parsed(const struct buffer *in) · line 11038
Quoted 4 lines
app/test-pmd/cmdline_flow.c +3
-0+ + *total_size += hdr_size; hdr = (typeof (hdr))(data_tail - (*total_size)); +memset (hdr,0 , hdr_size);
Is this memset adding a value here ?
Quoted 3 lines
app/test-pmd/cmdline_flow.c +0
-0*hdr = opt->hdr; hdr->ext_hdr_len =1 ; gtp_psc = i;
Hello,
Quoted 12 lines
app/test-pmd/cmdline_flow.c cmd_set_raw_parsed(const struct buffer
Quoted 3 lines
app/test-pmd/cmdline_flow.c +0
-0@@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer*in)
app/test-pmd/cmdline_flow.c cmd_set_raw_parsed(const struct buffer *in) · line 11034
Quoted 7 lines
app/test-pmd/cmdline_flow.c +1
-2const 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 ));
Quoted 9 lines
we missed
sizeof(*hdr), last time. Ok now.app/test-pmd/cmdline_flow.c cmd_set_raw_parsed(const struct buffer *in) · line 11038
Quoted 4 lines
app/test-pmd/cmdline_flow.c +3
-0+ + *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.
Quoted 3 lines
Quoted 3 lines
app/test-pmd/cmdline_flow.c +0
-0*hdr = opt->hdr; hdr->ext_hdr_len =1 ; gtp_psc = i;
Quoted 7 lines · Gregory Etelson
Fix GTP PSP extension size initialization.
Clear input buffer.Fixes c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")Signed-off-by Gregory Etelson <[email protected]>
Quoted 2 lines
---
Andrew Rybchenko
Reviewed-byQuoted 9 lines · Aman Deep
Quoted 6 lines · Gregory Etelson
Fix GTP PSP extension size initialization.
Clear input buffer.Fixes c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
Incorrect order:
Fixes: ...
Cc: ...
Quoted 3 lines
Quoted 1 line
Signed-off-by Gregory Etelson <[email protected]>Acked-by Aman Singh<[email protected]>
Missing space before e-mail above.
PATCH v2 1/1 app/testpmd: fix GTP PSC raw processing
In reply to Gregory EtelsonFix GTP PSP extension size initialization.
Clear input buffer.
---
v2: fix comment tags order.
--- app/test-pmd/cmdline_flow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +4 -2
@@ -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;
Signature · 1 line
2.34.1
Andrew Rybchenko
AppliedQuoted 9 lines · Gregory Etelson
Fix GTP PSP extension size initialization.
Clear input buffer.Fixes c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")Signed-off-by Gregory Etelson <[email protected]>Acked-by Aman Singh <[email protected]>Reviewed-by Andrew Rybchenko <[email protected]>
Applied to dpdk-next-net/main, thanks.