From: Bruce Richardson <bruce.richardson@intel.com>
To: "Zhang, Helin" <helin.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH RFC 1/6] mbuf: update mbuf structure for QinQ support
Date: Wed, 6 May 2015 09:39:15 +0100 [thread overview]
Message-ID: <20150506083915.GA3824@bricha3-MOBL3> (raw)
In-Reply-To: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A859453@SHSMSX104.ccr.corp.intel.com>
On Wed, May 06, 2015 at 04:06:17AM +0000, Zhang, Helin wrote:
>
>
> > -----Original Message-----
> > From: Ananyev, Konstantin
> > Sent: Tuesday, May 5, 2015 7:05 PM
> > To: Zhang, Helin; dev@dpdk.org
> > Subject: RE: [dpdk-dev] [PATCH RFC 1/6] mbuf: update mbuf structure for
> > QinQ support
> >
> > Hi Helin,
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang
> > > Sent: Tuesday, May 05, 2015 3:32 AM
> > > To: dev@dpdk.org
> > > Subject: [dpdk-dev] [PATCH RFC 1/6] mbuf: update mbuf structure for
> > > QinQ support
> > >
> > > To support QinQ, 'vlan_tci' should be replaced by 'vlan_tci0' and
> > > 'vlan_tci1'. Also new offload flags of 'PKT_RX_QINQ_PKT' and
> > > 'PKT_TX_QINQ_PKT' should be added.
> > >
> > > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> > > ---
> > > app/test-pmd/flowgen.c | 2 +-
> > > app/test-pmd/macfwd.c | 2 +-
> > > app/test-pmd/macswap.c | 2 +-
> > > app/test-pmd/rxonly.c | 2 +-
> > > app/test-pmd/txonly.c | 2 +-
> > > app/test/packet_burst_generator.c | 4 ++--
> > > lib/librte_ether/rte_ether.h | 4 ++--
> > > lib/librte_mbuf/rte_mbuf.h | 22
> > +++++++++++++++++++---
> > > lib/librte_pmd_e1000/em_rxtx.c | 8 ++++----
> > > lib/librte_pmd_e1000/igb_rxtx.c | 8 ++++----
> > > lib/librte_pmd_enic/enic_ethdev.c | 2 +-
> > > lib/librte_pmd_enic/enic_main.c | 2 +-
> > > lib/librte_pmd_fm10k/fm10k_rxtx.c | 2 +-
> > > lib/librte_pmd_i40e/i40e_rxtx.c | 8 ++++----
> > > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 11 +++++------
> > > lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 6 +++---
> > > 16 files changed, 51 insertions(+), 36 deletions(-)
> > >
<snip>
> > --- 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)
> > > +
> > > +/**
> > > * 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 @@ -268,7 +274,6 @@ 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;
> >
> > Now here is an implicit 2-bytes whole between 'reserved' and 'rss'.
> > Probably better to make it explicit - make 'reserved' uint32_t.
> Yes, the layout will be changed according to the demands of Vector PMD.
> The vlan structure will be kept the same, but the mbuf structure layout will
> be re-organized a bit.
Why not just put the extra vlan tag into the reserved space. In the original
work to restructure the mbuf, that was what the reserved space was put there
for [it was marked as reserved as it was requested that fields not be fully
dedicated until used, and we did not have double-vlan support at that time].
However, it seems more sensible to put the vlans there now, unless there is
a good reason to move them to the new location in the mbuf that you propose
below.
/Bruce
>
> >
> > Another thing - it looks like your change will break ixgbe vector RX.
> Yes, in the cover-letter, I noted that the vector PMD will be updated soon
> together with the code changes.
>
> >
> > > union {
> > > uint32_t rss; /**< RSS hash result if RSS enabled */
> > > @@ -289,6 +294,15 @@ struct rte_mbuf {
> > > uint32_t usr; /**< User defined tags. See
> > rte_distributor_process() */
> > > } hash; /**< hash information */
> > >
> > > + /* VLAN tags */
> > > + union {
> > > + uint32_t vlan_tags;
> > > + struct {
> > > + uint16_t vlan_tci0;
> > > + uint16_t vlan_tci1;
> >
> > Do you really need to change vlan_tci to vlan_tci0?
> > Can't you keep 'vlan_tci' for first vlan tag, and add something like
> > 'vlan_tci_ext', or 'vlan_tci_next' for second one?
> > Would save you a lot of changes, again users who use single vlan wouldn't
> > need to update their code for 2.1.
> Yes, good point! The names came from the original mbuf definition done by
> Bruce long long ago. If more guys suggest keeping th old one, and just add a new
> one, I will do like that in the next version of patch set.
> Thank you all!
>
> >
> > > + };
> > > + };
> > > +
> > > uint32_t seqn; /**< Sequence number. See also rte_reorder_insert()
> > > */
> > >
> > > /* second cache line - fields only used in slow path or on TX */ @@
> > > -766,7 +780,8 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf
> > *m)
> > > m->next = NULL;
> > > m->pkt_len = 0;
> > > m->tx_offload = 0;
> > > - m->vlan_tci = 0;
> > > + m->vlan_tci0 = 0;
> > > + m->vlan_tci1 = 0;
> >
> > Why just not:
> > m-> vlan_tags = 0;
> > ?
> Accepted. Good point!
>
> >
> > > m->nb_segs = 1;
> > > m->port = 0xff;
> > >
> > > @@ -838,7 +853,8 @@ static inline void rte_pktmbuf_attach(struct
> > rte_mbuf *mi, struct rte_mbuf *m)
> > > mi->data_off = m->data_off;
> > > mi->data_len = m->data_len;
> > > mi->port = m->port;
> > > - mi->vlan_tci = m->vlan_tci;
> > > + mi->vlan_tci0 = m->vlan_tci0;
> > > + mi->vlan_tci1 = m->vlan_tci1;
> >
> > Same thing, why not:
> > mi-> vlan_tags = m-> vlan_tags;
> > ?
> Accepted. Good point!
>
> Regards,
> Helin
<snip>
next prev parent reply other threads:[~2015-05-06 8:39 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 2:32 [dpdk-dev] [PATCH RFC 0/6] support of QinQ stripping and insertion of i40e Helin Zhang
2015-05-05 2:32 ` [dpdk-dev] [PATCH RFC 1/6] mbuf: update mbuf structure for QinQ support Helin Zhang
2015-05-05 11:04 ` Ananyev, Konstantin
2015-05-05 15:42 ` Chilikin, Andrey
2015-05-05 22:37 ` Ananyev, Konstantin
2015-05-06 4:07 ` Zhang, Helin
2015-05-06 4:06 ` Zhang, Helin
2015-05-06 8:39 ` Bruce Richardson [this message]
2015-05-06 8:48 ` Zhang, Helin
2015-05-05 2:32 ` [dpdk-dev] [PATCH RFC 2/6] i40e: reconfigure the hardware to support QinQ stripping/insertion Helin Zhang
2015-05-05 2:32 ` [dpdk-dev] [PATCH RFC 3/6] i40e: support of QinQ stripping/insertion in RX/TX Helin Zhang
2015-05-05 2:32 ` [dpdk-dev] [PATCH RFC 4/6] ethdev: add QinQ offload capability flags Helin Zhang
2015-05-05 2:32 ` [dpdk-dev] [PATCH RFC 5/6] i40e: update of " Helin Zhang
2015-05-05 2:32 ` [dpdk-dev] [PATCH RFC 6/6] app/testpmd: support of QinQ stripping and insertion Helin Zhang
2015-05-26 8:36 ` [dpdk-dev] [PATCH 0/5] support i40e " Helin Zhang
2015-05-26 8:36 ` [dpdk-dev] [PATCH 1/5] ixgbe: remove a discarded source line Helin Zhang
2015-06-01 8:50 ` Olivier MATZ
2015-06-02 1:45 ` Zhang, Helin
2015-05-26 8:36 ` [dpdk-dev] [PATCH 2/5] mbuf: use the reserved 16 bits for double vlan Helin Zhang
2015-05-26 14:55 ` Stephen Hemminger
2015-05-26 15:00 ` Zhang, Helin
2015-05-26 15:02 ` Ananyev, Konstantin
2015-05-26 15:35 ` Stephen Hemminger
2015-05-26 15:46 ` Ananyev, Konstantin
2015-05-27 1:07 ` Zhang, Helin
2015-06-01 8:50 ` Olivier MATZ
2015-06-02 2:37 ` Zhang, Helin
2015-05-26 8:36 ` [dpdk-dev] [PATCH 3/5] i40e: support double vlan stripping and insertion Helin Zhang
2015-06-01 8:50 ` Olivier MATZ
2015-06-02 2:45 ` Zhang, Helin
2015-05-26 8:36 ` [dpdk-dev] [PATCH 4/5] i40evf: add supported offload capability flags Helin Zhang
2015-05-26 8:36 ` [dpdk-dev] [PATCH 5/5] app/testpmd: add test cases for qinq stripping and insertion Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 0/6] support i40e QinQ " Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 1/6] ixgbe: remove a discarded source line Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 2/6] mbuf: use the reserved 16 bits for double vlan Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 3/6] i40e: support double vlan stripping and insertion Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 4/6] i40evf: add supported offload capability flags Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 5/6] app/testpmd: add test cases for qinq stripping and insertion Helin Zhang
2015-06-02 3:16 ` [dpdk-dev] [PATCH v2 6/6] examples/ipv4_multicast: support double vlan " Helin Zhang
2015-06-02 7:37 ` [dpdk-dev] [PATCH v2 0/6] support i40e QinQ " Liu, Jijiang
2015-06-08 7:32 ` Cao, Min
2015-06-08 7:40 ` Olivier MATZ
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 0/7] " Helin Zhang
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 1/7] ixgbe: remove a discarded source line Helin Zhang
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 2/7] mbuf: use the reserved 16 bits for double vlan Helin Zhang
2015-06-25 8:31 ` Zhang, Helin
2015-06-28 20:36 ` Thomas Monjalon
2015-06-30 7:33 ` Olivier MATZ
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 3/7] i40e: support double vlan stripping and insertion Helin Zhang
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 4/7] i40evf: add supported offload capability flags Helin Zhang
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 5/7] app/testpmd: add test cases for qinq stripping and insertion Helin Zhang
2015-06-11 7:03 ` [dpdk-dev] [PATCH v3 6/7] examples/ipv4_multicast: support double vlan " Helin Zhang
2015-06-11 7:04 ` [dpdk-dev] [PATCH v3 7/7] doc: update testpmd command Helin Zhang
2015-06-11 7:25 ` [dpdk-dev] [PATCH v3 0/7] support i40e QinQ stripping and insertion Wu, Jingjing
2015-07-07 14:43 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150506083915.GA3824@bricha3-MOBL3 \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=helin.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).