net/mlx5: E-Switch, reserve and use same uplink metadata across ports
authorSunil Rani <sunrani@nvidia.com>
Tue, 9 Mar 2021 22:53:39 +0000 (00:53 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 23 Feb 2022 23:21:58 +0000 (15:21 -0800)
commit0b0ea3c5b1c087b20ee3edb8f0846bce5f08a807
treed721c30ea11fcd303ab2e2bb190464053949262c
parentc2c922dae77f36e24d246c6e310cee0c61afc6fb
net/mlx5: E-Switch, reserve and use same uplink metadata across ports

When in switchdev mode wire traffic will hit the FDB in one of two
scenarios.

- Shared FDB, in that case traffic from both physical ports should be
  tagged by the same metadata value so a single FDB rule could catch
  traffic from both ports.

- Two E-Switches, traffic from each physical port will hit the native
  E-Switch which means traffic from one physical port can't reach the
  E-Switch of the other one.

Looking at those two scenarios it means we can always use the same metadata
value to tag wire traffic regardless of the mode.

Reserve a single metadata value to be used to tag wire traffic.

Signed-off-by: Sunil Rani <sunrani@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c