]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net/mlx5: E-Switch, Add ovs internal port mapping to metadata support
authorAriel Levkovich <lariel@nvidia.com>
Thu, 29 Apr 2021 06:53:41 +0000 (09:53 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:54:28 +0000 (10:54 +0200)
commit3651168c805bd42c07684241a12e3c91750f5bb3
tree1bceeb32d9025605797125fab0bf8fd0d691f984
parent26149485971abfb9b92eae57a41592611273403a
net/mlx5: E-Switch, Add ovs internal port mapping to metadata support

BugLink: https://bugs.launchpad.net/bugs/1983498
Adding infrastructure to map ovs internal port device to vport
match metadata to support offload of rules with internal port as
the filter device or as the destination device.

The infrastructure allows adding and removing internal port device
to an eswitch database and getting a unique vport metadata value to
be placed and match on in reg_c0 when offloading rules that are coming
from or going to an internal port.

The new int port metadata can be written to the source port register
in HW to indicate that current source port of the packet is the
internal port and not one of the actual HW vports (uplink or VF).
Using this method, it is possible to offload TC rules with an OVS
internal port as their destination port (overwriting the src vport
register) or as the filter port (matching on the value of the src
vport register and making sure it matches to the internal port's
value).

There is also a need to handle a miss case where the packet's
src port value was changed in HW to an internal port but a following
rule which matches on this new src port value wasn't found in HW.

In such case, the packet will be forwarded to the driver with
metadata which allows driver to restore the info of the internal
port's netdevice. Once this info is restored, the uplink driver
can forward the packet to the relevant netdevice in SW.

Signed-off-by: Ariel Levkovich <lariel@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
(cherry picked from commit 4f4edcc2b84fecec66748ecbb90a84b981ecdaae)
Signed-off-by: Zachary Tahenakos <zachary.tahenakos@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.h
drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c