linux-stable/drivers/net/bonding
Jarod Wilson a3b658cfb6 bonding: allow xfrm offload setup post-module-load
At the moment, bonding xfrm crypto offload can only be set up if the bonding
module is loaded with active-backup mode already set. We need to be able to
make this work with bonds set to AB after the bonding driver has already
been loaded.

So what's done here is:

1) move #define BOND_XFRM_FEATURES to net/bonding.h so it can be used
by both bond_main.c and bond_options.c
2) set BOND_XFRM_FEATURES in bond_dev->hw_features universally, rather than
only when loading in AB mode
3) wire up xfrmdev_ops universally too
4) disable BOND_XFRM_FEATURES in bond_dev->features if not AB
5) exit early (non-AB case) from bond_ipsec_offload_ok, to prevent a
performance hit from traversing into the underlying drivers
5) toggle BOND_XFRM_FEATURES in bond_dev->wanted_features and call
netdev_change_features() from bond_option_mode_set()

In my local testing, I can change bonding modes back and forth on the fly,
have hardware offload work when I'm in AB, and see no performance penalty
to non-AB software encryption, despite having xfrm bits all wired up for
all modes now.

Fixes: 18cb261afd ("bonding: support hardware encryption offload to slaves")
Reported-by: Huy Nguyen <huyn@mellanox.com>
CC: Saeed Mahameed <saeedm@mellanox.com>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: "David S. Miller" <davem@davemloft.net>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Steffen Klassert <steffen.klassert@secunet.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: netdev@vger.kernel.org
CC: intel-wired-lan@lists.osuosl.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-01 15:53:32 -07:00
..
bond_3ad.c bonding: rename AD_STATE_* to LACP_STATE_* 2019-12-26 13:09:37 -08:00
bond_alb.c Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2020-05-09 01:05:30 -07:00
bond_debugfs.c bonding: no need to print a message if debugfs_create_dir() fails 2019-08-10 15:25:47 -07:00
bond_main.c bonding: allow xfrm offload setup post-module-load 2020-07-01 15:53:32 -07:00
bond_netlink.c bonding: fix value exported by Netlink for peer_notif_delay 2019-07-08 19:28:44 -07:00
bond_options.c bonding: allow xfrm offload setup post-module-load 2020-07-01 15:53:32 -07:00
bond_procfs.c bonding: add an option to specify a delay between peer notifications 2019-07-04 12:30:48 -07:00
bond_sysfs.c bonding: add an option to specify a delay between peer notifications 2019-07-04 12:30:48 -07:00
bond_sysfs_slave.c bonding: Fix reference count leak in bond_sysfs_slave_add. 2020-05-28 11:08:16 -07:00
bonding_priv.h drivers: Remove inclusion of vermagic header 2020-04-21 13:27:37 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00