diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2024-10-21 03:12:10 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-10-28 16:09:42 -0700 |
commit | 22ccb684c1cae37411450e6e86a379cd3c29cb8f (patch) | |
tree | c7b620711e8fed2fdbdab0231dd90684114a554f | |
parent | 825199bf2017e4549586f038ede9acec68de883d (diff) | |
download | lwn-22ccb684c1cae37411450e6e86a379cd3c29cb8f.tar.gz lwn-22ccb684c1cae37411450e6e86a379cd3c29cb8f.zip |
bonding: return detailed error when loading native XDP fails
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>
-rw-r--r-- | drivers/net/bonding/bond_main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3928287f5865..5812e8eaccf1 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -5676,8 +5676,11 @@ static int bond_xdp_set(struct net_device *dev, struct bpf_prog *prog, ASSERT_RTNL(); - if (!bond_xdp_check(bond)) + if (!bond_xdp_check(bond)) { + BOND_NL_ERR(dev, extack, + "No native XDP support for the current bonding mode"); return -EOPNOTSUPP; + } old_prog = bond->xdp_prog; bond->xdp_prog = prog; |