]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: Avoid using xso.real_dev unnecessarily
authorCosmin Ratiu <cratiu@nvidia.com>
Fri, 11 Apr 2025 07:49:53 +0000 (10:49 +0300)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 16 Apr 2025 09:00:51 +0000 (11:00 +0200)
commitd79444e8c3d40b11f5e155e5591d53bd1e512e1f
treef3033b7d932ae16417a4aac1d3eea0c6842eee8a
parent20eb35da409fa60fa03ea828cd3d1d9c8a51e103
net/mlx5: Avoid using xso.real_dev unnecessarily

xso.real_dev is the active device of an offloaded xfrm state and is
managed by bonding. As such, it's subject to change when states are
migrated to a new device. Using it in places other than
offloading/unoffloading the states is risky.

This commit saves the device into the driver-specific struct
mlx5e_ipsec_sa_entry and switches mlx5e_ipsec_init_macs() and
mlx5e_ipsec_netevent_event() to make use of it.

Additionally, mlx5e_xfrm_update_stats() used xso.real_dev to validate
that correct net locks are held. But in a bonding config, the net of the
master device is the same as the underlying devices, and the net is
already a local var, so use that instead.

The only remaining references to xso.real_dev are now in the
.xdo_dev_state_add() / .xdo_dev_state_delete() path.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h