* [PATCH net v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY
@ 2024-02-07 8:47 Magnus Karlsson
2024-02-07 9:57 ` Toke Høiland-Jørgensen
2024-02-09 2:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Magnus Karlsson @ 2024-02-07 8:47 UTC (permalink / raw)
To: magnus.karlsson, bjorn, ast, daniel, netdev, maciej.fijalkowski,
kuba, toke, pabeni, davem, j.vosburgh, andy, hawk, john.fastabend,
edumazet, lorenzo
Cc: bpf, Prashant Batra
From: Magnus Karlsson <magnus.karlsson@intel.com>
Do not report the XDP capability NETDEV_XDP_ACT_XSK_ZEROCOPY as the
bonding driver does not support XDP and AF_XDP in zero-copy mode even
if the real NIC drivers do.
Note that the driver used to report everything as supported before a
device was bonded. Instead of just masking out the zero-copy support
from this, have the driver report that no XDP feature is supported
until a real device is bonded. This seems to be more truthful as it is
the real drivers that decide what XDP features are supported.
Fixes: cb9e6e584d58 ("bonding: add xdp_features support")
Reported-by: Prashant Batra <prbatra.mail@gmail.com>
Link: https://lore.kernel.org/all/CAJ8uoz2ieZCopgqTvQ9ZY6xQgTbujmC6XkMTamhp68O-h_-rLg@mail.gmail.com/T/
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
---
drivers/net/bonding/bond_main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4e0600c7b050..a11748b8d69b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1819,6 +1819,8 @@ void bond_xdp_set_features(struct net_device *bond_dev)
bond_for_each_slave(bond, slave, iter)
val &= slave->dev->xdp_features;
+ val &= ~NETDEV_XDP_ACT_XSK_ZEROCOPY;
+
xdp_set_features_flag(bond_dev, val);
}
@@ -5909,9 +5911,6 @@ void bond_setup(struct net_device *bond_dev)
if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
bond_dev->features |= BOND_XFRM_FEATURES;
#endif /* CONFIG_XFRM_OFFLOAD */
-
- if (bond_xdp_check(bond))
- bond_dev->xdp_features = NETDEV_XDP_ACT_MASK;
}
/* Destroy a bonding device.
base-commit: cb88cb53badb8aeb3955ad6ce80b07b598e310b8
--
2.42.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY
2024-02-07 8:47 [PATCH net v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY Magnus Karlsson
@ 2024-02-07 9:57 ` Toke Høiland-Jørgensen
2024-02-09 2:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-02-07 9:57 UTC (permalink / raw)
To: Magnus Karlsson, magnus.karlsson, bjorn, ast, daniel, netdev,
maciej.fijalkowski, kuba, pabeni, davem, j.vosburgh, andy, hawk,
john.fastabend, edumazet, lorenzo
Cc: bpf, Prashant Batra
Magnus Karlsson <magnus.karlsson@gmail.com> writes:
> From: Magnus Karlsson <magnus.karlsson@intel.com>
>
> Do not report the XDP capability NETDEV_XDP_ACT_XSK_ZEROCOPY as the
> bonding driver does not support XDP and AF_XDP in zero-copy mode even
> if the real NIC drivers do.
>
> Note that the driver used to report everything as supported before a
> device was bonded. Instead of just masking out the zero-copy support
> from this, have the driver report that no XDP feature is supported
> until a real device is bonded. This seems to be more truthful as it is
> the real drivers that decide what XDP features are supported.
>
> Fixes: cb9e6e584d58 ("bonding: add xdp_features support")
> Reported-by: Prashant Batra <prbatra.mail@gmail.com>
> Link: https://lore.kernel.org/all/CAJ8uoz2ieZCopgqTvQ9ZY6xQgTbujmC6XkMTamhp68O-h_-rLg@mail.gmail.com/T/
> Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY
2024-02-07 8:47 [PATCH net v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY Magnus Karlsson
2024-02-07 9:57 ` Toke Høiland-Jørgensen
@ 2024-02-09 2:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-09 2:50 UTC (permalink / raw)
To: Magnus Karlsson
Cc: magnus.karlsson, bjorn, ast, daniel, netdev, maciej.fijalkowski,
kuba, toke, pabeni, davem, j.vosburgh, andy, hawk, john.fastabend,
edumazet, lorenzo, bpf, prbatra.mail
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 7 Feb 2024 09:47:36 +0100 you wrote:
> From: Magnus Karlsson <magnus.karlsson@intel.com>
>
> Do not report the XDP capability NETDEV_XDP_ACT_XSK_ZEROCOPY as the
> bonding driver does not support XDP and AF_XDP in zero-copy mode even
> if the real NIC drivers do.
>
> Note that the driver used to report everything as supported before a
> device was bonded. Instead of just masking out the zero-copy support
> from this, have the driver report that no XDP feature is supported
> until a real device is bonded. This seems to be more truthful as it is
> the real drivers that decide what XDP features are supported.
>
> [...]
Here is the summary with links:
- [net,v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY
https://git.kernel.org/netdev/net/c/9b0ed890ac2a
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] 3+ messages in thread
end of thread, other threads:[~2024-02-09 2:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 8:47 [PATCH net v2] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY Magnus Karlsson
2024-02-07 9:57 ` Toke Høiland-Jørgensen
2024-02-09 2:50 ` 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).