[v2] mbuf: extend meaning of QinQ stripped bit

Message ID 20201006072232.27755-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] mbuf: extend meaning of QinQ stripped bit |

Checks

Context Check Description
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed

Commit Message

Olivier Matz Oct. 6, 2020, 7:22 a.m. UTC
  From: Somnath Kotur <somnath.kotur@broadcom.com>

Clarify the documentation of QinQ flags, and extend the meaning of the
flag: 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).

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---

Hi,

Here is an update of this old patch from Somnath.

Olivier


v2:
- better reword PKT_RX_QINQ_STRIPPED documentation
- also update PKT_RX_QINQ documentation

 lib/librte_mbuf/rte_mbuf_core.h | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
  

Comments

David Marchand Oct. 8, 2020, 1:13 p.m. UTC | #1
On Tue, Oct 6, 2020 at 9:23 AM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> From: Somnath Kotur <somnath.kotur@broadcom.com>
>
> Clarify the documentation of QinQ flags, and extend the meaning of the
> flag: 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).
>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Is it only a documentation fix and the drivers are already
implementing this behavior?
CC driver maintainers for double check.


Thanks.
  
Andrew Rybchenko Oct. 12, 2020, 8:20 a.m. UTC | #2
On 10/6/20 10:22 AM, Olivier Matz wrote:
> From: Somnath Kotur <somnath.kotur@broadcom.com>
> 
> Clarify the documentation of QinQ flags, and extend the meaning of the
> flag: 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).
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  
David Marchand Oct. 15, 2020, 8:58 p.m. UTC | #3
On Tue, Oct 6, 2020 at 9:23 AM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> From: Somnath Kotur <somnath.kotur@broadcom.com>
>
> Clarify the documentation of QinQ flags, and extend the meaning of the
> flag: 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).
>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Applied, thanks Olivier.
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h
index 8c2c20644d..8f631b84cf 100644
--- a/lib/librte_mbuf/rte_mbuf_core.h
+++ b/lib/librte_mbuf/rte_mbuf_core.h
@@ -126,12 +126,19 @@  extern "C" {
 #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).
- * This can only happen if vlan stripping is enabled in the RX
+ * The outer VLAN has been stripped by the hardware and its TCI is
+ * saved in mbuf->vlan_tci_outer.
+ * 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 and PKT_RX_QINQ
+ * must also be set.
+ *
+ * - If both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 VLANs
+ *   have been stripped by the hardware and their TCIs 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).
  */
 #define PKT_RX_QINQ_STRIPPED (1ULL << 15)
 
@@ -159,8 +166,8 @@  extern "C" {
 
 /**
  * The RX packet is a double VLAN, and the outer tci has been
- * saved in in mbuf->vlan_tci_outer. If PKT_RX_QINQ set, PKT_RX_VLAN
- * also should be set and inner tci should be saved to mbuf->vlan_tci.
+ * saved in mbuf->vlan_tci_outer. If this flag is set, PKT_RX_VLAN
+ * must also be set and the inner tci is saved in mbuf->vlan_tci.
  * If the flag PKT_RX_QINQ_STRIPPED is also present, both VLANs
  * headers have been stripped from mbuf data, else they are still
  * present.