From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 617D85693 for ; Mon, 1 Jun 2015 10:50:08 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YzLUS-0005VG-7C; Mon, 01 Jun 2015 10:54:47 +0200 Message-ID: <556C1CD5.9020108@6wind.com> Date: Mon, 01 Jun 2015 10:50:29 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Helin Zhang , dev@dpdk.org 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> In-Reply-To: <1432629400-25303-3-git-send-email-helin.zhang@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Mon, 01 Jun 2015 08:50:08 -0000 Hi Helin, 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 */ There's a small indent typo here: (1ULL << 15) is not aligned with the lines above > > /* 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_mbuf *m) > m->pkt_len = 0; > m->tx_offload = 0; > m->vlan_tci = 0; > + m->vlan_tci_outer = 0; > m->nb_segs = 1; > m->port = 0xff; > > @@ -849,6 +856,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m) > mi->data_len = m->data_len; > mi->port = m->port; > mi->vlan_tci = m->vlan_tci; > + mi->vlan_tci_outer = m->vlan_tci_outer; > mi->tx_offload = m->tx_offload; > mi->hash = m->hash; > > 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 =" to find them all. Do we need to update rte_vlan_insert() and rte_vlan_strip() to support QinQ? Regards, Olivier