[dpdk-dev] [PATCH] fm10k: fix wrong VLAN value in RX mbuf
He, Shaopeng
shaopeng.he at intel.com
Fri Nov 20 03:54:49 CET 2015
Hi, Stephen
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Friday, November 20, 2015 1:26 AM
> To: He, Shaopeng
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] fm10k: fix wrong VLAN value in RX mbuf
>
> On Wed, 18 Nov 2015 16:50:09 +0800
> Shaopeng He <shaopeng.he at intel.com> wrote:
>
> > VLAN value should be copied from RX descriptor to mbuf, this patch
> > fixes this issue.
> >
> > Signed-off-by: Shaopeng He <shaopeng.he at intel.com>
> > ---
> > drivers/net/fm10k/fm10k_rxtx.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/fm10k/fm10k_rxtx.c
> > b/drivers/net/fm10k/fm10k_rxtx.c index 1bac28d..eeb635e 100644
> > --- a/drivers/net/fm10k/fm10k_rxtx.c
> > +++ b/drivers/net/fm10k/fm10k_rxtx.c
> > @@ -146,6 +146,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf
> > **rx_pkts, #endif
> >
> > mbuf->hash.rss = desc.d.rss;
> > + mbuf->vlan_tci = desc.w.vlan &
> FM10K_RXD_VLAN_ID_MASK;
> >
> > rx_pkts[count] = mbuf;
> > if (++next_dd == q->nb_desc) {
> > @@ -292,6 +293,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct
> rte_mbuf **rx_pkts,
> > rx_desc_to_ol_flags(first_seg, &desc); #endif
> > first_seg->hash.rss = desc.d.rss;
> > + first_seg->vlan_tci = desc.w.vlan &
> FM10K_RXD_VLAN_ID_MASK;
> >
> > /* Prefetch data of first segment, if configured to do so. */
> > rte_packet_prefetch((char *)first_seg->buf_addr +
>
> Good catch, this bug means VLAN's would not work right now.
> But I think it isn't quite right.
Actually, VLAN filter works well, only the vlan_tci in mbuf has wrong value.
And because not much places use the vlan_tci, this bug was not
found before.
>
> By masking the VLAN you are losing the received priority bits.
> Other drivers like ixgbe preserve the priority bits.
Yes, you are right, in next version, I will preserve the priority bits like others.
Thanks,
--Shaopeng
More information about the dev
mailing list