From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 03/13] rte_ether: set PKT_RX_VLAN_STRIPPED in rte_vlan_strip() Date: Thu, 9 Feb 2017 16:56:38 +0100 Message-ID: <20170209165638.34019d58@glumotte.dev.6wind.com> References: <1643890.a9zoQB8M0i@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , olivier.matz@6wind.com, dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id CE4B5FA65 for ; Thu, 9 Feb 2017 16:56:46 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id r141so23698903wmg.1 for ; Thu, 09 Feb 2017 07:56:46 -0800 (PST) In-Reply-To: <1643890.a9zoQB8M0i@xps13> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, On Mon, 30 Jan 2017 10:54:08 +0100, Thomas Monjalon wrote: > It is fixing the introduction of the new flag PKT_RX_VLAN_STRIPPED. >=20 > Fixes: b37b528d957c ("mbuf: add new Rx flags for stripped VLAN") >=20 > This patch is applying the flag to the software emulation case > (currently only for virtio). > So the comment of this flag should be changed: >=20 > /** > * A vlan has been stripped by the hardware and its tci is saved in > * mbuf->vlan_tci. This can only happen if vlan stripping is enabled > * in the RX configuration of the PMD. > */ > #define PKT_RX_VLAN_STRIPPED (1ULL << > 6) = =20 >=20 >=20 > > Signed-off-by: Micha=C5=82 Miros=C5=82aw =20 > [...] > > --- a/lib/librte_net/rte_ether.h > > +++ b/lib/librte_net/rte_ether.h > > @@ -357,7 +357,7 @@ static inline int rte_vlan_strip(struct > > rte_mbuf *m) return -1; > > =20 > > struct vlan_hdr *vh =3D (struct vlan_hdr *)(eh + 1); > > - m->ol_flags |=3D PKT_RX_VLAN_PKT; > > + m->ol_flags |=3D PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED; > > m->vlan_tci =3D rte_be_to_cpu_16(vh->vlan_tci); > > =20 > > /* Copy ether header over rather than moving whole packet > > */ =20 >=20 > I think this flag should also be removed in the function > rte_vlan_insert(). Agree with Thomas, I think rte_vlan_insert() should be updated too. But I don't think the comment of the mbuf flag should be changed: "stripped by the hardware" is a bit ambiguous for virtual drivers, but we can understand that for virtual drivers the same work is done in software. Regards, Olivier