From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <olivier.matz@6wind.com>
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 <dev@dpdk.org>; Thu,  9 Feb 2017 16:56:46 +0100 (CET)
Received: by mail-wm0-f43.google.com with SMTP id r141so23698903wmg.1
 for <dev@dpdk.org>; Thu, 09 Feb 2017 07:56:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:date:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=qTWF7b68ToCZcqJytxNaYvwAJCwZOoVDNl6Zt7/M/ow=;
 b=SpTAKwHS+h0A1vrRdv4XYuJnm8zc3EA2hG3JcHcvezQotryUbd+20jfe08Dtq1Uqul
 3cSzXwheJD1K8B87uc7XOq03ulAQWaSDiBZQWRZX5X4l98vW0p5xPhNYJxPau4CNY/jU
 HBPEMBOIHCOgp/mHVw/R3tY+Ne2hWvso8lpYK0FX+hUXZPbVeABhrmgHiiLcaliQ609m
 /fuEcXlp5rgjH+UXVKKlFROWNqSbtt8O+viK6LnagzSkHev+yIkZG+Ws/G5Fgd/yHVvB
 NcgHNpiYvi/auxaEkMYNDLCMRiKHGOXw3Yy5xdRxx4QAgy5D7vdrbh4WyiKmMwdpTou1
 GwOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:date:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=qTWF7b68ToCZcqJytxNaYvwAJCwZOoVDNl6Zt7/M/ow=;
 b=sgt+cCcRVhcprgFTvjrJyYYQrna/riaQP0Ye3e70nvaiiu6a4IBfQEFOGiFjL37CK8
 4uRITiF3apJDWfUxX3naGoDwR3GuUHH56HFw+ujiNb9xbuuVwvPpcIpKw+6Mns1fSYIe
 j8P6JX7N/zBDlQraL8jo5B1aUDolrkkiWLEPePWZHbhpsknlpXBXj4qeIWkz6hoDQEQJ
 /dUkZxKh7x7EaXc71jqIvN9O/YIx13vytfP9hAMmBVxydFwpFNDbeqGa3ZmuYGrKd3qK
 So1jhpitfFJ5FAj7vkeX8vboR+rsrZ6e/69HqgqmZ9ctJbUX7FtqvBqDeWkjMiBXxbWu
 8chg==
X-Gm-Message-State: AMke39kVONDX7vg4x83Hw/A+9vq+FVFzjCovirYN0plZhdX1QsKyGG5sBApo/CoO+VT2M6XK
X-Received: by 10.28.153.139 with SMTP id b133mr3387129wme.93.1486655806512;
 Thu, 09 Feb 2017 07:56:46 -0800 (PST)
Received: from glumotte.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com.
 [62.23.145.78])
 by smtp.gmail.com with ESMTPSA id u47sm19173671wrb.15.2017.02.09.07.56.46
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 09 Feb 2017 07:56:46 -0800 (PST)
From: Olivier MATZ <olivier.matz@6wind.com>
X-Google-Original-From: Olivier MATZ <olivier.matz@dev.6wind.com>
Date: Thu, 9 Feb 2017 16:56:38 +0100
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= <mirq-linux@rere.qmqm.pl>,
 olivier.matz@6wind.com, dev@dpdk.org
Message-ID: <20170209165638.34019d58@glumotte.dev.6wind.com>
In-Reply-To: <1643890.a9zoQB8M0i@xps13>
References: <cover.1481590851.git.mirq-linux@rere.qmqm.pl>
 <f475d2d0fda01cf521578cda8af7019c15058d5e.1481590851.git.mirq-linux@rere.qmqm.pl>
 <1643890.a9zoQB8M0i@xps13>
X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: [dpdk-dev] [PATCH 03/13] rte_ether: set PKT_RX_VLAN_STRIPPED in
 rte_vlan_strip()
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Feb 2017 15:56:46 -0000

Hi,

On Mon, 30 Jan 2017 10:54:08 +0100, Thomas Monjalon
<thomas.monjalon@6wind.com> 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 <michal.miroslaw@atendesoftwar=
e.pl> =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