bonding: Correctly support GSO ESP offload
authorCosmin Ratiu <cratiu@nvidia.com>
Mon, 27 Jan 2025 10:41:47 +0000 (12:41 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 28 Jan 2025 12:20:48 +0000 (13:20 +0100)
commit9e6c4e6b605c1fa3e24f74ee0b641e95f090188a
tree4113de5ba3120521fd1a892dc7a4eebfda5b4678
parent740a3e71567195427495cb4d68bdee1eb1482ba4
bonding: Correctly support GSO ESP offload

The referenced fix is incomplete. It correctly computes
bond_dev->gso_partial_features across slaves, but unfortunately
netdev_fix_features discards gso_partial_features from the feature set
if NETIF_F_GSO_PARTIAL isn't set in bond_dev->features.

This is visible with ethtool -k bond0 | grep esp:
tx-esp-segmentation: off [requested on]
esp-hw-offload: on
esp-tx-csum-hw-offload: on

This patch reworks the bonding GSO offload support by:
- making aggregating gso_partial_features across slaves similar to the
  other feature sets (this part is a no-op).
- advertising the default partial gso features on empty bond devs, same
  as with other feature sets (also a no-op).
- adding NETIF_F_GSO_PARTIAL to hw_enc_features filtered across slaves.
- adding NETIF_F_GSO_PARTIAL to features in bond_setup()

With all of these, 'ethtool -k bond0 | grep esp' now reports:
tx-esp-segmentation: on
esp-hw-offload: on
esp-tx-csum-hw-offload: on

Fixes: 4861333b4217 ("bonding: add ESP offload features when slaves support")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20250127104147.759658-1-cratiu@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/bonding/bond_main.c