Hi, On Tue, Feb 06, 2018 at 03:23:34PM -0800, Ajit Khaparde wrote: > On Tue, Feb 6, 2018 at 9:07 AM, Olivier Matz <olivier.m...@6wind.com> wrote: > > > The hw flags are not read correctly: the defines > > RX_PKT_CMPL_FLAGS_ITYPE_* are not bits but values, so the should not be > > tested with if (value & X) but with if ((value & MASK) == X). > > This was resulting in a wrong packet type. > > > > For instance, an IPv4/ICMP packet was returning a value of 7 for > > the layer 4, which is undefined. > > > > This patch rework the way packet types are processed, to ensure > > that only valid packet types will be advertised. > > > > Fixes: 3d2a6644eb05 ("net/bnxt: support getting ptypes") > > Cc: sta...@dpdk.org > > > > Signed-off-by: Olivier Matz <olivier.m...@6wind.com> > > > Acked-by: Ajit Khaparde <ajit.khapa...@broadcom.com> >
[...] > > + case RTE_LE32(RX_PKT_CMPL_FLAGS_ITYPE_UDP): > > + if (!t_ipcs) > > + pkt_type |= l3 | RTE_PTYPE_L4_UDP; > > + else > > + pkt_type |= l3 | RTE_PTYPE_INNER_L4_UDP; > > + break; > > + > > + case RTE_LE32(RX_PKT_CMPL_FLAGS_ITYPE_IP): > > + if (!t_ipcs) > > + pkt_type |= l3 | RTE_PTYPE_L4_ICMP; > > + else > > + pkt_type |= l3 | RTE_PTYPE_INNER_L4_ICMP; > > + break; > > + } Sorry, it looks there is a typo here: it should be pkt_type |= l3 (not ICMP). I'll send a new version.