]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bonding: fix xfrm offload feature setup on active-backup mode
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 25 Sep 2025 02:33:03 +0000 (02:33 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 Sep 2025 07:55:11 +0000 (09:55 +0200)
commit5b66169f6be4847008c0aea50885ff0632151479
treed2a5396f01bfda081ec8cff997318ffa3c3e14f7
parenteb11f02f3151e86f41bb15cc47b7400e91c07a4f
bonding: fix xfrm offload feature setup on active-backup mode

The active-backup bonding mode supports XFRM ESP offload. However, when
a bond is added using command like `ip link add bond0 type bond mode 1
miimon 100`, the `ethtool -k` command shows that the XFRM ESP offload is
disabled. This occurs because, in bond_newlink(), we change bond link
first and register bond device later. So the XFRM feature update in
bond_option_mode_set() is not called as the bond device is not yet
registered, leading to the offload feature not being set successfully.

To resolve this issue, we can modify the code order in bond_newlink() to
ensure that the bond device is registered first before changing the bond
link parameters. This change will allow the XFRM ESP offload feature to be
correctly enabled.

Fixes: 007ab5345545 ("bonding: fix feature flag setting at init time")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250925023304.472186-1-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_netlink.c
include/net/bonding.h