]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: add test for xdp_bonding xmit_hash_policy compat
authorJiayuan Chen <jiayuan.chen@shopee.com>
Thu, 26 Feb 2026 08:03:02 +0000 (16:03 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Mar 2026 09:47:38 +0000 (10:47 +0100)
commit181cafbd8a01d22f3078a84f079c4a7cc0653068
tree2ef69d246132684a63267b3cec6685a3f481f1fb
parent479d589b40b836442bbdadc3fdb37f001bb67f26
selftests/bpf: add test for xdp_bonding xmit_hash_policy compat

Add a selftest to verify that changing xmit_hash_policy to vlan+srcmac
is rejected when a native XDP program is loaded on a bond in 802.3ad
mode.  Without the fix in bond_option_xmit_hash_policy_set(), the change
succeeds silently, creating an inconsistent state that triggers a kernel
WARNING in dev_xdp_uninstall() when the bond is torn down.

The test attaches native XDP to a bond0 (802.3ad, layer2+3), then
attempts to switch xmit_hash_policy to vlan+srcmac and asserts the
operation fails.  It also verifies the change succeeds after XDP is
detached, confirming the rejection is specific to the XDP-loaded state.

Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Link: https://patch.msgid.link/20260226080306.98766-3-jiayuan.chen@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/bpf/prog_tests/xdp_bonding.c