From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 9845BB38D for ; Tue, 2 Jun 2015 04:37:50 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 01 Jun 2015 19:37:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,536,1427785200"; d="scan'208";a="739134792" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga002.jf.intel.com with ESMTP; 01 Jun 2015 19:37:48 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 2 Jun 2015 10:37:42 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.94]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.23]) with mapi id 14.03.0224.002; Tue, 2 Jun 2015 10:37:41 +0800 From: "Zhang, Helin" To: Olivier MATZ , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan Thread-Index: AQHQnEgMei1+mBFQaE6DSEWuUtj4352Yf/uw Date: Tue, 2 Jun 2015 02:37:40 +0000 Message-ID: References: <1430793143-3610-1-git-send-email-helin.zhang@intel.com> <1432629400-25303-1-git-send-email-helin.zhang@intel.com> <1432629400-25303-3-git-send-email-helin.zhang@intel.com> <556C1CD5.9020108@6wind.com> In-Reply-To: <556C1CD5.9020108@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2015 02:37:51 -0000 > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Monday, June 1, 2015 4:50 PM > To: Zhang, Helin; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for do= uble > vlan >=20 > Hi Helin, >=20 > On 05/26/2015 10:36 AM, Helin Zhang wrote: > > Use the reserved 16 bits in rte_mbuf structure for the outer vlan, > > also add QinQ offloading flags for both RX and TX sides. > > > > Signed-off-by: Helin Zhang > > --- > > lib/librte_mbuf/rte_mbuf.h | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > > index ab6de67..4551df9 100644 > > --- a/lib/librte_mbuf/rte_mbuf.h > > +++ b/lib/librte_mbuf/rte_mbuf.h > > @@ -101,11 +101,17 @@ extern "C" { > > #define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12) /**< RX tunnel packet with > IPv6 header. */ > > #define PKT_RX_FDIR_ID (1ULL << 13) /**< FD id reported if FDIR > match. */ > > #define PKT_RX_FDIR_FLX (1ULL << 14) /**< Flexible bytes reported= if > FDIR match. */ > > +#define PKT_RX_QINQ_PKT (1ULL << 15) /**< RX packet with double > VLAN stripped. */ > > /* add new RX flags here */ >=20 > There's a small indent typo here: (1ULL << 15) is not aligned with the li= nes above Will fix it. >=20 >=20 > > > > /* add new TX flags here */ > > > > /** > > + * Second VLAN insertion (QinQ) flag. > > + */ > > +#define PKT_TX_QINQ_PKT (1ULL << 49) /**< TX packet with double > VLAN inserted. */ > > + > > +/** > > * TCP segmentation offload. To enable this offload feature for a > > * packet to be transmitted on hardware supporting TSO: > > * - set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag > > implies @@ -279,7 +285,7 @@ struct rte_mbuf { > > uint16_t data_len; /**< Amount of data in segment buffer. */ > > uint32_t pkt_len; /**< Total pkt len: sum of all segments. */ > > uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order= ) */ > > - uint16_t reserved; > > + uint16_t vlan_tci_outer; /**< Outer VLAN Tag Control Identifier > > +(CPU order) */ > > union { > > uint32_t rss; /**< RSS hash result if RSS enabled */ > > struct { > > @@ -777,6 +783,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbu= f > *m) > > m->pkt_len =3D 0; > > m->tx_offload =3D 0; > > m->vlan_tci =3D 0; > > + m->vlan_tci_outer =3D 0; > > m->nb_segs =3D 1; > > m->port =3D 0xff; > > > > @@ -849,6 +856,7 @@ static inline void rte_pktmbuf_attach(struct rte_mb= uf > *mi, struct rte_mbuf *m) > > mi->data_len =3D m->data_len; > > mi->port =3D m->port; > > mi->vlan_tci =3D m->vlan_tci; > > + mi->vlan_tci_outer =3D m->vlan_tci_outer; > > mi->tx_offload =3D m->tx_offload; > > mi->hash =3D m->hash; > > > > >=20 > Maybe some more affectations are missing. For instance in > examples/ipv4_multicast/main.c or in examples/vhost/main.c. > You can grep "->vlan_tci =3D" to find them all. Will add vlan_tci_outer in ipv4_multicast/main.c. After talking with vhost developers, it does not need to support double vla= n at this moment, so I will keep it as is. >=20 > Do we need to update rte_vlan_insert() and rte_vlan_strip() to support Qi= nQ? They are the software version of vlan stripping and insertion. It was mainl= y for virtio. I'd like to keep it as is, and let who want it to develop the double vlan s= tripping/insertion version in the future. Thank you very much! - Helin >=20 > Regards, > Olivier