net/mlx5: Implement devlink port function cmds to control ipsec_crypto
authorDima Chumak <dchumak@nvidia.com>
Fri, 25 Aug 2023 06:28:35 +0000 (23:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 28 Aug 2023 00:08:45 +0000 (17:08 -0700)
commit06bab69658a8afb493204448f29703e12e6d3960
tree125311030a1de685c08b2594973102b60e9a6fe0
parent8efd7b17a3b03242c97281d88463ad56e8f551f8
net/mlx5: Implement devlink port function cmds to control ipsec_crypto

Implement devlink port function commands to enable / disable IPsec
crypto offloads.  This is used to control the IPsec capability of the
device.

When ipsec_crypto is enabled for a VF, it prevents adding IPsec crypto
offloads on the PF, because the two cannot be active simultaneously due
to HW constraints. Conversely, if there are any active IPsec crypto
offloads on the PF, it's not allowed to enable ipsec_crypto on a VF,
until PF IPsec offloads are cleared.

Signed-off-by: Dima Chumak <dchumak@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20230825062836.103744-8-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/device_drivers/ethernet/mellanox/mlx5/switchdev.rst
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c
drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c