Thread (18 messages) 18 messages, 3 authors, 2021-10-06

Re: [dpdk-dev] [PATCH v3] net/af_packet: reinsert the stripped vlan tag

From: Tudor Cornea <hidden>
Date: 2021-09-29 14:14:20

Thanks Stephen, for the suggestion

I've sent v4 of the patch, which adds the succinct description in the
af_packet documentation..


On Fri, 24 Sept 2021 at 18:11, Stephen Hemminger [off-list ref]
wrote:
On Fri, 24 Sep 2021 14:44:45 +0300
Tudor Cornea [off-list ref] wrote:
quoted
+Features and Limitations of the af_packet PMD
+---------------------------------------------
+
+Since the following commit, the Linux kernel strips the vlan tag
+
+.. code-block:: console
+
+    commit bcc6d47903612c3861201cc3a866fb604f26b8b2
+    Author: Jiri Pirko <jpirko@xxxxxxxxxx>
+    Date:   Thu Apr 7 19:48:33 2011 +0000
+
+     net: vlan: make non-hw-accel rx path similar to hw-accel
+
+Running on such a kernel results in receiving untagged frames while
using
quoted
+the af_packet PMD. Fortunately, the stripped information is still
available
quoted
+for use in ``mbuf->vlan_tci``, and applications could check
``PKT_RX_VLAN_STRIPPED``.
quoted
+
+However, we currently don't have a way to describe offloads which can't
be
quoted
+disabled by PMDs, and this creates an inconsistency with the way
applications
quoted
+expect the PMD offloads to work, and requires them to be aware of which
+underlying driver they use.
+
+Since release 21.11 the af_packet PMD will implement support for the
+``DEV_RX_OFFLOAD_VLAN_STRIP`` offload, and users can control the
desired vlan
quoted
+stripping behavior.
+
+It's important to note that the default case will change. If previously,
+the vlan tag was stripped, if the application now requires the same
behavior,
quoted
+it will need to configure ``rxmode.offloads`` with
``DEV_RX_OFFLOAD_VLAN_STRIP``.
quoted
+
+The PMD driver will re-insert the vlan tag transparently to the
application
quoted
+if the kernel strips it, as long as the ``DEV_RX_OFFLOAD_VLAN_STRIP``
is not
quoted
+enabled.
This seems like the wrong place for this text.
It is not a new feature, it is a bug fix.

If you want to describe it as an enhancement, the text should be succinct
and describe
the situation from user point of view. Something like:

    Af_packet PMD now works with VLAN's on Linux
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help