netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures
@ 2024-10-21  3:12 Hangbin Liu
  2024-10-21  3:12 ` [PATCHv3 net-next 1/2] bonding: return detailed error when loading native XDP fails Hangbin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hangbin Liu @ 2024-10-21  3:12 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, Jiri Pirko, Sebastian Andrzej Siewior,
	Lorenzo Bianconi, Andrii Nakryiko, Jussi Maki, Jay Vosburgh,
	Andy Gospodarek, Jonathan Corbet, Andrew Lunn,
	Nikolay Aleksandrov, Toke Høiland-Jørgensen,
	Simon Horman, linux-doc, linux-kernel, bpf, Hangbin Liu

Based on discussion[1], this patch set returns detailed error about XDP
failures. And update bonding document about XDP supports.

v3: drop patch that modified the return value (Toke Høiland-Jørgensen)
    drop the sentence that repeat title (Nikolay Aleksandrov)
v2: update the title in the doc (Nikolay Aleksandrov)

[1]
https://lore.kernel.org/netdev/8088f2a7-3ab1-4a1e-996d-c15703da13cc@blackwall.org/o
Hangbin Liu (2):
  bonding: return detailed error when loading native XDP fails
  Documentation: bonding: add XDP support explanation

 Documentation/networking/bonding.rst | 11 +++++++++++
 drivers/net/bonding/bond_main.c      |  5 ++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

-- 
2.46.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCHv3 net-next 1/2] bonding: return detailed error when loading native XDP fails
  2024-10-21  3:12 [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures Hangbin Liu
@ 2024-10-21  3:12 ` Hangbin Liu
  2024-10-21  3:12 ` [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation Hangbin Liu
  2024-10-28 23:20 ` [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Hangbin Liu @ 2024-10-21  3:12 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, Jiri Pirko, Sebastian Andrzej Siewior,
	Lorenzo Bianconi, Andrii Nakryiko, Jussi Maki, Jay Vosburgh,
	Andy Gospodarek, Jonathan Corbet, Andrew Lunn,
	Nikolay Aleksandrov, Toke Høiland-Jørgensen,
	Simon Horman, linux-doc, linux-kernel, bpf, Hangbin Liu

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>
---
 drivers/net/bonding/bond_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b1bffd8e9a95..f0f76b6ac8be 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;
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation
  2024-10-21  3:12 [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures Hangbin Liu
  2024-10-21  3:12 ` [PATCHv3 net-next 1/2] bonding: return detailed error when loading native XDP fails Hangbin Liu
@ 2024-10-21  3:12 ` Hangbin Liu
  2024-10-22 10:37   ` Toke Høiland-Jørgensen
  2024-10-28 23:20 ` [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Hangbin Liu @ 2024-10-21  3:12 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, Jiri Pirko, Sebastian Andrzej Siewior,
	Lorenzo Bianconi, Andrii Nakryiko, Jussi Maki, Jay Vosburgh,
	Andy Gospodarek, Jonathan Corbet, Andrew Lunn,
	Nikolay Aleksandrov, Toke Høiland-Jørgensen,
	Simon Horman, linux-doc, linux-kernel, bpf, Hangbin Liu

Add document about which modes have native XDP support.

Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 Documentation/networking/bonding.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/networking/bonding.rst b/Documentation/networking/bonding.rst
index e774b48de9f5..7c8d22d68682 100644
--- a/Documentation/networking/bonding.rst
+++ b/Documentation/networking/bonding.rst
@@ -2916,6 +2916,17 @@ from the bond (``ifenslave -d bond0 eth0``). The bonding driver will
 then restore the MAC addresses that the slaves had before they were
 enslaved.
 
+9.  What bonding modes support native XDP?
+------------------------------------------
+
+  * balance-rr (0)
+  * active-backup (1)
+  * balance-xor (2)
+  * 802.3ad (4)
+
+Note that the vlan+srcmac hash policy does not support native XDP.
+For other bonding modes, the XDP program must be loaded with generic mode.
+
 16. Resources and Links
 =======================
 
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation
  2024-10-21  3:12 ` [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation Hangbin Liu
@ 2024-10-22 10:37   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-10-22 10:37 UTC (permalink / raw)
  To: Hangbin Liu, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, Jiri Pirko, Sebastian Andrzej Siewior,
	Lorenzo Bianconi, Andrii Nakryiko, Jussi Maki, Jay Vosburgh,
	Andy Gospodarek, Jonathan Corbet, Andrew Lunn,
	Nikolay Aleksandrov, Simon Horman, linux-doc, linux-kernel, bpf,
	Hangbin Liu

Hangbin Liu <liuhangbin@gmail.com> writes:

> Add document about which modes have native XDP support.
>
> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures
  2024-10-21  3:12 [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures Hangbin Liu
  2024-10-21  3:12 ` [PATCHv3 net-next 1/2] bonding: return detailed error when loading native XDP fails Hangbin Liu
  2024-10-21  3:12 ` [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation Hangbin Liu
@ 2024-10-28 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-28 23:20 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, davem, edumazet, kuba, pabeni, ast, daniel, hawk,
	john.fastabend, jiri, bigeasy, lorenzo, andriin, joamaki, jv,
	andy, corbet, andrew+netdev, razor, toke, horms, linux-doc,
	linux-kernel, bpf

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 21 Oct 2024 03:12:09 +0000 you wrote:
> Based on discussion[1], this patch set returns detailed error about XDP
> failures. And update bonding document about XDP supports.
> 
> v3: drop patch that modified the return value (Toke Høiland-Jørgensen)
>     drop the sentence that repeat title (Nikolay Aleksandrov)
> v2: update the title in the doc (Nikolay Aleksandrov)
> 
> [...]

Here is the summary with links:
  - [PATCHv3,net-next,1/2] bonding: return detailed error when loading native XDP fails
    https://git.kernel.org/netdev/net-next/c/22ccb684c1ca
  - [PATCHv3,net-next,2/2] Documentation: bonding: add XDP support explanation
    https://git.kernel.org/netdev/net-next/c/9f59eccd9dd5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-28 23:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21  3:12 [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures Hangbin Liu
2024-10-21  3:12 ` [PATCHv3 net-next 1/2] bonding: return detailed error when loading native XDP fails Hangbin Liu
2024-10-21  3:12 ` [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation Hangbin Liu
2024-10-22 10:37   ` Toke Høiland-Jørgensen
2024-10-28 23:20 ` [PATCHv3 net-next 0/2] Bonding: returns detailed error about XDP failures patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).