Skip to content

Commit da82ac2

Browse files
liuhangbingregkh
authored andcommitted
bonding: return detailed error when loading native XDP fails
[ Upstream commit 22ccb68 ] Bonding only supports native XDP for specific modes, which can lead to confusion for users regarding why XDP loads successfully at times and fails at others. This patch enhances error handling by returning detailed error messages, providing users with clearer insights into the specific reasons for the failure when loading native XDP. Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Link: https://patch.msgid.link/20241021031211.814-2-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Rajani Kantha <681739313@139.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4a63523 commit da82ac2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5699,8 +5699,11 @@ static int bond_xdp_set(struct net_device *dev, struct bpf_prog *prog,
56995699

57005700
ASSERT_RTNL();
57015701

5702-
if (!bond_xdp_check(bond))
5702+
if (!bond_xdp_check(bond)) {
5703+
BOND_NL_ERR(dev, extack,
5704+
"No native XDP support for the current bonding mode");
57035705
return -EOPNOTSUPP;
5706+
}
57045707

57055708
old_prog = bond->xdp_prog;
57065709
bond->xdp_prog = prog;

0 commit comments

Comments
 (0)