]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfrm: Add explicit dev to .xdo_dev_state_{add,delete,free}
authorCosmin Ratiu <cratiu@nvidia.com>
Fri, 11 Apr 2025 07:49:56 +0000 (10:49 +0300)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 16 Apr 2025 09:01:41 +0000 (11:01 +0200)
commit43eca05b6a3b917c600e10cc6b06bfa57fa57401
tree69f22de7f62496144a4a0d638df48cea3638eab8
parentd53dda291bbd993a29b84d358d282076e3d01506
xfrm: Add explicit dev to .xdo_dev_state_{add,delete,free}

Previously, device driver IPSec offload implementations would fall into
two categories:
1. Those that used xso.dev to determine the offload device.
2. Those that used xso.real_dev to determine the offload device.

The first category didn't work with bonding while the second did.
In a non-bonding setup the two pointers are the same.

This commit adds explicit pointers for the offload netdevice to
.xdo_dev_state_add() / .xdo_dev_state_delete() / .xdo_dev_state_free()
which eliminates the confusion and allows drivers from the first
category to work with bonding.

xso.real_dev now becomes a private pointer managed by the bonding
driver.

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>
14 files changed:
Documentation/networking/xfrm_device.rst
drivers/net/bonding/bond_main.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
drivers/net/ethernet/intel/ixgbevf/ipsec.c
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
drivers/net/netdevsim/ipsec.c
include/linux/netdevice.h
include/net/xfrm.h
net/xfrm/xfrm_device.c
net/xfrm/xfrm_state.c