summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2025-10-30 14:59:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-02 22:15:22 +0900
commitda82ac2a03eebd7d766a3b885332d4863b25429f (patch)
treecadf6a55fa14f70a6df2c59448c6d4ea4f584171 /drivers
parent4a63523d3541eef4cf504a9682e6fbe94ffe79a6 (diff)
downloadlinux-da82ac2a03eebd7d766a3b885332d4863b25429f.tar.gz
linux-da82ac2a03eebd7d766a3b885332d4863b25429f.tar.bz2
linux-da82ac2a03eebd7d766a3b885332d4863b25429f.zip
bonding: return detailed error when loading native XDP fails
[ Upstream commit 22ccb684c1cae37411450e6e86a379cd3c29cb8f ] 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bonding/bond_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 46628a7ed497..93e6d069dfc6 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5699,8 +5699,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;