[PATCH] app/testpmd: fix GTP PSC raw processing

Gregory Etelson getelson at nvidia.com
Fri Jul 1 17:23:55 CEST 2022


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;



More information about the stable mailing list