numam-dpdk/drivers/net/bnxt
Adrien Mazarguil e58638c324 ethdev: fix TPID handling in flow API
TPID handling in rte_flow VLAN and E_TAG pattern item definitions is not
consistent with the normal stacking order of pattern items, which is
confusing to applications.

Problem is that when followed by one of these layers, the EtherType field
of the preceding layer keeps its "inner" definition, and the "outer" TPID
is provided by the subsequent layer, the reverse of how a packet looks like
on the wire:

 Wire:     [ ETH TPID = A | VLAN EtherType = B | B DATA ]
 rte_flow: [ ETH EtherType = B | VLAN TPID = A | B DATA ]

Worse, when QinQ is involved, the stacking order of VLAN layers is
unspecified. It is unclear whether it should be reversed (innermost to
outermost) as well given TPID applies to the previous layer:

 Wire:       [ ETH TPID = A | VLAN TPID = B | VLAN EtherType = C | C DATA ]
 rte_flow 1: [ ETH EtherType = C | VLAN TPID = B | VLAN TPID = A | C DATA ]
 rte_flow 2: [ ETH EtherType = C | VLAN TPID = A | VLAN TPID = B | C DATA ]

While specifying EtherType/TPID is hopefully rarely necessary, the stacking
order in case of QinQ and the lack of documentation remain an issue.

This patch replaces TPID in the VLAN pattern item with an inner
EtherType/TPID as is usually done everywhere else (e.g. struct vlan_hdr),
clarifies documentation and updates all relevant code.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Summary of changes for PMDs that implement ETH, VLAN or E_TAG pattern
items:

- bnxt: EtherType matching is supported with and without VLAN, but TPID
  matching is not and triggers an error.

- e1000: EtherType matching is only supported with the ETHERTYPE filter,
  which does not support VLAN matching, therefore no impact.

- enic: same as bnxt.

- i40e: same as bnxt with existing FDIR limitations on allowed EtherType
  values. The remaining filter types (VXLAN, NVGRE, QINQ) do not support
  EtherType matching.

- ixgbe: same as e1000, with additional minor change to rely on the new
  E-Tag macro definition.

- mlx4: EtherType/TPID matching is not supported, no impact.

- mlx5: same as bnxt.

- mvpp2: same as bnxt.

- sfc: same as bnxt.

- tap: same as bnxt.

Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")
Fixes: 99e7003831 ("net/ixgbe: parse L2 tunnel filter")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
..
bnxt_cpr.c net/bnxt: cache address of doorbell to subsequent access 2018-04-27 15:54:56 +01:00
bnxt_cpr.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_ethdev.c net/bnxt: avoid invalid vnic id in set L2 Rx mask 2018-04-27 15:54:56 +01:00
bnxt_filter.c ethdev: fix TPID handling in flow API 2018-04-27 18:00:54 +01:00
bnxt_filter.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_hwrm.c net/bnxt: avoid invalid vnic id in set L2 Rx mask 2018-04-27 15:54:56 +01:00
bnxt_hwrm.h net/bnxt: add code to determine the Tx COS queue 2018-04-27 15:54:56 +01:00
bnxt_irq.c net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_irq.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_nvm_defs.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_ring.c net/bnxt: cache address of doorbell to subsequent access 2018-04-27 15:54:56 +01:00
bnxt_ring.h net/bnxt: avoid freeing memzone multiple times 2018-04-27 15:54:56 +01:00
bnxt_rxq.c net/bnxt: avoid freeing memzone multiple times 2018-04-27 15:54:56 +01:00
bnxt_rxq.h net/bnxt: avoid freeing memzone multiple times 2018-04-27 15:54:56 +01:00
bnxt_rxr.c net/bnxt: fix mbuf data offset initialization 2018-04-27 15:54:56 +01:00
bnxt_rxr.h net/bnxt: fix Rx checksum flags for tunnel frames 2018-04-27 15:54:55 +01:00
bnxt_stats.c net/bnxt: maintain mbuf alloc failure counter per queue 2018-04-27 15:54:56 +01:00
bnxt_stats.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_txq.c net/bnxt: avoid freeing memzone multiple times 2018-04-27 15:54:56 +01:00
bnxt_txq.h net/bnxt: avoid freeing memzone multiple times 2018-04-27 15:54:56 +01:00
bnxt_txr.c net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_txr.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_vnic.c net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt_vnic.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
bnxt.h net/bnxt: cache address of doorbell to subsequent access 2018-04-27 15:54:56 +01:00
hsi_struct_def_dpdk.h net/bnxt: add code to determine the Tx COS queue 2018-04-27 15:54:56 +01:00
Makefile pci: introduce library and driver 2017-10-26 23:17:31 +02:00
rte_pmd_bnxt_version.map net/bnxt: fix automatic clearing of VF stats 2017-07-06 15:00:57 +02:00
rte_pmd_bnxt.c net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00
rte_pmd_bnxt.h net/bnxt: convert to SPDX license tag 2018-04-14 00:40:21 +02:00