net/mlx5: Handle IPsec steering upon master unbind/bind
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 21 Sep 2023 12:10:35 +0000 (15:10 +0300)
committerLeon Romanovsky <leon@kernel.org>
Mon, 2 Oct 2023 08:22:22 +0000 (11:22 +0300)
commit82f9378c443c206d3f9e45844306e5270e7e4109
tree3be22361b33ee2cf03d58f1e6bb9fe4b3f418ff5
parentf2f0231cfe8905af217e5bf1a08bfb8e4d3b74fb
net/mlx5: Handle IPsec steering upon master unbind/bind

When the master device is unbinded, make sure to clean up all of the
steering rules or flow tables that were created over the master, in
order to allow proper unbinding of master, and for ethernet traffic
to continue to work independently.

Upon bringing master device back up and attaching the slave to it,
checks if the slave already has IPsec configured and if so reconfigure
the rules needed to support RoCE traffic.

Note that while master device is unbound, the user is unable to
configure IPsec again, since they are in a kind of illegal state in
which they are in MPV mode but the slave has no master.

However if IPsec was configured before hand, it will continue to work
for ethernet traffic while master is unbound, and would continue to
work for all traffic when the master is bound back again.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Link: https://lore.kernel.org/r/8434e88912c588affe51b34669900382a132e873.1695296682.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c
drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.h