Message ID | 1432629400-25303-3-git-send-email-helin.zhang@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 01E929A92; Tue, 26 May 2015 10:36:59 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D5EDAC2FC for <dev@dpdk.org>; Tue, 26 May 2015 10:36:53 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 26 May 2015 01:36:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,497,1427785200"; d="scan'208";a="700227652" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 26 May 2015 01:36:52 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t4Q8amOC006634; Tue, 26 May 2015 16:36:48 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t4Q8akmb025351; Tue, 26 May 2015 16:36:48 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t4Q8aktM025347; Tue, 26 May 2015 16:36:46 +0800 From: Helin Zhang <helin.zhang@intel.com> To: dev@dpdk.org Date: Tue, 26 May 2015 16:36:37 +0800 Message-Id: <1432629400-25303-3-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1432629400-25303-1-git-send-email-helin.zhang@intel.com> References: <1430793143-3610-1-git-send-email-helin.zhang@intel.com> <1432629400-25303-1-git-send-email-helin.zhang@intel.com> Subject: [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 <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> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Zhang, Helin
May 26, 2015, 8:36 a.m. UTC
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 <helin.zhang@intel.com>
---
lib/librte_mbuf/rte_mbuf.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Comments
On Tue, 26 May 2015 16:36:37 +0800 Helin Zhang <helin.zhang@intel.com> 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 <helin.zhang@intel.com> Yet another change that is much needed, but breaks ABI compatibility.
Hi Stephen > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, May 26, 2015 10:55 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for > double vlan > > On Tue, 26 May 2015 16:36:37 +0800 > Helin Zhang <helin.zhang@intel.com> 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 <helin.zhang@intel.com> > > Yet another change that is much needed, but breaks ABI compatibility. Even just use the reserved 16 bits? It seems yes. Would it be acceptable to use the original name of 'reserved' for the outer vlan? And then announce the name change, and rename it one release after? Regards, Helin
Hi Stephen, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Tuesday, May 26, 2015 3:55 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan > > On Tue, 26 May 2015 16:36:37 +0800 > Helin Zhang <helin.zhang@intel.com> 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 <helin.zhang@intel.com> > > Yet another change that is much needed, but breaks ABI compatibility. Why do you think it breaks ABI compatibility? As I can see, it uses field that was reserved. Konstantin
On Tue, 26 May 2015 15:02:51 +0000 "Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote: > Hi Stephen, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger > > Sent: Tuesday, May 26, 2015 3:55 PM > > To: Zhang, Helin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan > > > > On Tue, 26 May 2015 16:36:37 +0800 > > Helin Zhang <helin.zhang@intel.com> 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 <helin.zhang@intel.com> > > > > Yet another change that is much needed, but breaks ABI compatibility. > > Why do you think it breaks ABI compatibility? > As I can see, it uses field that was reserved. > Konstantin Because an application maybe assuming something or reusing the reserved fields. Yes, it would be dumb of application to do that but from absolute ABI point of view it is a change.
> -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, May 26, 2015 4:35 PM > To: Ananyev, Konstantin > Cc: Zhang, Helin; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan > > On Tue, 26 May 2015 15:02:51 +0000 > "Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote: > > > Hi Stephen, > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger > > > Sent: Tuesday, May 26, 2015 3:55 PM > > > To: Zhang, Helin > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan > > > > > > On Tue, 26 May 2015 16:36:37 +0800 > > > Helin Zhang <helin.zhang@intel.com> 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 <helin.zhang@intel.com> > > > > > > Yet another change that is much needed, but breaks ABI compatibility. > > > > Why do you think it breaks ABI compatibility? > > As I can see, it uses field that was reserved. > > Konstantin > > Because an application maybe assuming something or reusing the reserved fields. But properly behaving application, shouldn't do that right? And for misbehaving ones, why should we care about them? > Yes, it would be dumb of application to do that but from absolute ABI point > of view it is a change. So, in theory, even adding a new field to the end of rte_mbuf is an ABI breakage? Konstantin
> -----Original Message----- > From: Ananyev, Konstantin > Sent: Tuesday, May 26, 2015 11:46 PM > To: Stephen Hemminger > Cc: Zhang, Helin; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for > double vlan > > > > > -----Original Message----- > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > Sent: Tuesday, May 26, 2015 4:35 PM > > To: Ananyev, Konstantin > > Cc: Zhang, Helin; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for > > double vlan > > > > On Tue, 26 May 2015 15:02:51 +0000 > > "Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote: > > > > > Hi Stephen, > > > > > > > -----Original Message----- > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen > > > > Hemminger > > > > Sent: Tuesday, May 26, 2015 3:55 PM > > > > To: Zhang, Helin > > > > Cc: dev@dpdk.org > > > > Subject: Re: [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits > > > > for double vlan > > > > > > > > On Tue, 26 May 2015 16:36:37 +0800 Helin Zhang > > > > <helin.zhang@intel.com> 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 <helin.zhang@intel.com> > > > > > > > > Yet another change that is much needed, but breaks ABI > compatibility. > > > > > > Why do you think it breaks ABI compatibility? > > > As I can see, it uses field that was reserved. > > > Konstantin > > > > Because an application maybe assuming something or reusing the > reserved fields. > > But properly behaving application, shouldn't do that right? > And for misbehaving ones, why should we care about them? For any reserved bits, I think all application users should avoid touching it, as it is reserved for future use, or some special reason. Otherwise, un-predicted behavior can be expected. Regards, Helin > > > Yes, it would be dumb of application to do that but from absolute ABI > > point of view it is a change. > > So, in theory, even adding a new field to the end of rte_mbuf is an ABI > breakage? > Konstantin
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 <helin.zhang@intel.com> > --- > 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
> -----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 double > vlan > > 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 <helin.zhang@intel.com> > > --- > > 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 Will fix it. > > > > > > /* 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. Will add vlan_tci_outer in ipv4_multicast/main.c. After talking with vhost developers, it does not need to support double vlan at this moment, so I will keep it as is. > > Do we need to update rte_vlan_insert() and rte_vlan_strip() to support QinQ? They are the software version of vlan stripping and insertion. It was mainly for virtio. I'd like to keep it as is, and let who want it to develop the double vlan stripping/insertion version in the future. Thank you very much! - Helin > > Regards, > Olivier
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 */ /* 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;