DPDK patches and discussions
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev <dev@dpdk.org>, Ferruh Yigit <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] mbuf: fix to update documentation of QinQ stripped bit interpretation
Date: Fri, 7 Feb 2020 19:13:04 +0530	[thread overview]
Message-ID: <CAOBf=mtRbtkc5BJxkBRok8BYOm3ZrNCvY4ncEd5uM5W6KmQ9uA@mail.gmail.com> (raw)
In-Reply-To: <20200206172500.GQ22738@platinum>

Olivier,

On Thu, Feb 6, 2020 at 10:55 PM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> Hi Somnath,
>
> Sorry for the delay, please find some comments below.
>
> I suggest the following title instead:
>
>   mbuf: extend meaning of QinQ stripped bit
>
> On Mon, Jan 06, 2020 at 02:04:23PM +0530, Somnath Kotur wrote:
> > Certain hardware may be able to strip and/or save only the outermost
> > VLAN instead of both the VLANs in the mbuf in a QinQ scenario.
> > To handle such cases, we could re-interpret setting of just
> > PKT_RX_QINQ_STRIPPED to indicate that only the outermost VLAN has
> > been stripped and saved in mbuf->vlan_tci_outer.
>
> To be sure we're on the same page: we are talking about case 7 of this
> link: http://inbox.dpdk.org/dev/20191227145041.GQ22738@platinum/

I'm not sure we are on the same page then, please see my response inline below
>
> So, even if the inner vlan_tci is not stripped from packet data, it has
> to be saved in m->vlan_tci, because it is implied by PKT_RX_VLAN.
>
> From the same link, the case where the driver only strips+saves the
> outer vlan without saving or stripping the inner one is case 3.
>
While this is how it works currently, I'm wondering how will the
application know if this was
a double VLAN pkt, correct?
Also when i look at options 5 and 7 I don't really see the difference
in semantics between them ?
Both seem to store the outer-vlan and inner-vlan in m->vlan_tci_outer
and m->vlan_tci_inner respectively

7/ PKT_RX_VLAN | PKT_RX_QINQ | PKT_RX_QINQ_STRIPPED
   outer-vlan is removed from packet data
   m->vlan_tci_outer=outer-vlan
   m->vlan_tci=inner-vlan

I was hoping that with the new interpretation of PKT_RX_QINQ_STRIPPED,
it only meant that outer-vlan is removed from packet data
and m->vlan_tci_outer = outer_vlan, while PKT_RX_QINQ implies it is a
double-vlan pkt and PKT_RX_VLAN implies that pkt has VLAN
associated with it?   Not m->vlan_tci = inner-vlan

Thanks
Som


> > Only When both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2
> > VLANs have been stripped by the hardware and their TCI are saved in
> > mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
> >
> > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > ---
> >  lib/librte_mbuf/rte_mbuf_core.h | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h
> > index 9a8557d..db1070b 100644
> > --- a/lib/librte_mbuf/rte_mbuf_core.h
> > +++ b/lib/librte_mbuf/rte_mbuf_core.h
> > @@ -124,12 +124,19 @@
> >  #define PKT_RX_FDIR_FLX      (1ULL << 14)
> >
> >  /**
> > - * The 2 vlans have been stripped by the hardware and their tci are
> > - * saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
> > + * The outer vlan has been stripped by the hardware and their tci are
> > + * saved in mbuf->vlan_tci_outer (outer).
>
> their tci are -> its tci is
>
> >   * This can only happen if vlan stripping is enabled in the RX
> >   * configuration of the PMD.
> > - * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN |
> > - * PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ) must also be set.
> > + * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN |  PKT_RX_QINQ)
> > + * must also be set.
>
> ok
>
> > + * When both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 vlans
> > + * have been stripped by the hardware and their tci are saved in
> > + * mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
>
> This is correct, but I'd use a bullet list to add another sentence:
>
>  * - If both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 vlans
>  *   have been stripped by the hardware and their tci are saved in
>  *   mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
>  * - If PKT_RX_QINQ_STRIPPED is set and PKT_RX_VLAN_STRIPPED is unset, only the
>  *   outer vlan is removed from packet data, but both tci are saved in
>  *   mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
>
> > + * This can only happen if vlan stripping is enabled in the RX configuration
> > + * of the PMD.
>
> The same exact sentence is above, this one can be removed.
>
> > + * When PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set,
> > + * (PKT_RX_VLAN | PKT_RX_QINQ) must also be set.
>
> This can be removed too as it is redundant with above sentence:
>
>  * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN |  PKT_RX_QINQ)
>  * must also be set.
>
>
> Thanks,
> Olivier

  reply	other threads:[~2020-02-07 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06  8:34 Somnath Kotur
2020-02-06 16:27 ` Somnath Kotur
2020-02-06 17:25 ` Olivier Matz
2020-02-07 13:43   ` Somnath Kotur [this message]
2020-02-07 14:29     ` Olivier Matz
2020-02-26  0:55       ` Stephen Hemminger
2020-04-24 18:24         ` Thomas Monjalon
2020-05-24 15:34           ` Thomas Monjalon
2020-06-11  6:11             ` Thomas Monjalon
2020-04-25 13:08 ` Andrew Rybchenko
2020-10-06  7:22 ` [dpdk-dev] [PATCH v2] mbuf: extend meaning of QinQ stripped bit Olivier Matz
2020-10-08 13:13   ` David Marchand
2020-10-12  8:20   ` Andrew Rybchenko
2020-10-15 20:58   ` David Marchand

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='CAOBf=mtRbtkc5BJxkBRok8BYOm3ZrNCvY4ncEd5uM5W6KmQ9uA@mail.gmail.com' \
    --to=somnath.kotur@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=olivier.matz@6wind.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).