DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] about PKT_RX_VLAN_PKT mbuf flag
Date: Fri, 9 Jun 2017 15:38:55 +0200	[thread overview]
Message-ID: <20170609153855.01ce0e67@platinum> (raw)

Hi,

After a discussion on the ML [1][2], the commit b37b528d95 ("mbuf: add
new Rx flags for stripped VLAN") [3] marked the mbuf flag
PKT_RX_VLAN_PKT as deprecated, because its behavior was not consistent
among drivers.
It has been partially replaced by PKT_RX_VLAN_STRIPPED which is better
defined.

The flag was kept for 2 reasons:
- let the applications and PMDs move to the new flag
- let the ixgbe driver (maybe others?) implement a new way to do
  Rx vlan offload without vlan strip.

A future work was planned to do the cleanup, but it was never done.
Searching for this flag in the source shows that some PMDs still use
the old flag although it is deprecated.

We need to clean this up. I propose the following, which should not
hurt apps or PMDs too much, knowing PKT_RX_VLAN_PKT is deprecated since
16.07:

  Replace all occurences of PKT_RX_VLAN_PKT by a new flag
  PKT_RX_VLAN_SAVED. The meaning of this new flag is: "the vlan
  tci is saved in mbuf metadata".
  When PKT_RX_VLAN_STRIPPED is present, PKT_RX_VLAN_SAVED is
  implied.

About the RTE_PTYPE_L2_ETHER_VLAN packet type, and as described
in rte_mbuf_ptype.h, "the packet type gives information about the data
carried by the mbuf". It means that the packet type must not be
set to RTE_PTYPE_L2_ETHER_VLAN if the vlan was stripped.

Examples:

- Ether/Vlan/IP packet is received
  vlan stripping is off
  the resulting mbuf data contains Ether/Vlan/IP
  PKT_RX_VLAN_SAVED may be set, in this case m->vlan_tci contains
    the id of the vlan
  ptype is set to RTE_PTYPE_L2_ETHER_VLAN if supported

- Ether/Vlan/IP packet is received
  vlan stripping is on
  the resulting mbuf data contains Ether/IP
  PKT_RX_VLAN_STRIPPED is set and m->vlan_tci contains the id of
    the vlan which was stripped
  PKT_RX_VLAN_SAVED may be set, but anyway it is implied by
    PKT_RX_VLAN_STRIPPED
  ptype is set to RTE_PTYPE_L2_ETHER


Comments are welcome. PKT_RX_VLAN_SAVED is probably not the
best names, ideas are welcome.

Olivier


[1] http://dpdk.org/ml/archives/dev/2016-April/037837.html
[2] http://dpdk.org/ml/archives/dev/2016-June/041068.html
[3] http://dpdk.org/browse/dpdk/commit/?id=b37b528d957c

                 reply	other threads:[~2017-06-09 13:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170609153855.01ce0e67@platinum \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    /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).