linux-stable/drivers/net/bonding
Daniel Borkmann f267f26281 xdp, bonding: Fix feature flags when there are no slave devs anymore
Commit 9b0ed890ac ("bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY")
changed the driver from reporting everything as supported before a device
was bonded into having the driver report that no XDP feature is supported
until a real device is bonded as it seems to be more truthful given
eventually real underlying devices decide what XDP features are supported.

The change however did not take into account when all slave devices get
removed from the bond device. In this case after 9b0ed890ac, the driver
keeps reporting a feature mask of 0x77, that is, NETDEV_XDP_ACT_MASK &
~NETDEV_XDP_ACT_XSK_ZEROCOPY whereas it should have reported a feature
mask of 0.

Fix it by resetting XDP feature flags in the same way as if no XDP program
is attached to the bond device. This was uncovered by the XDP bond selftest
which let BPF CI fail. After adjusting the starting masks on the latter
to 0 instead of NETDEV_XDP_ACT_MASK the test passes again together with
this fix.

Fixes: 9b0ed890ac ("bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Magnus Karlsson <magnus.karlsson@intel.com>
Cc: Prashant Batra <prbatra.mail@gmail.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Message-ID: <20240305090829.17131-1-daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2024-03-05 16:19:42 -08:00
..
bond_3ad.c drivers/net/bonding/bond_3ad: return when there's no aggregator 2023-01-03 09:17:12 +00:00
bond_alb.c bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk 2023-11-21 12:06:50 +01:00
bond_debugfs.c bonding: remove redundant NULL check in debugfs function 2023-08-11 11:10:55 +01:00
bond_main.c xdp, bonding: Fix feature flags when there are no slave devs anymore 2024-03-05 16:19:42 -08:00
bond_netlink.c netlink: make range pointers in policies const 2023-10-26 16:24:09 -07:00
bond_options.c bonding: fix send_peer_notif overflow 2023-05-10 09:27:20 +01:00
bond_procfs.c bonding: show NS IPv6 targets in proc master info 2022-05-31 10:50:02 +02:00
bond_sysfs.c bonding: add modifier to initialization function and exit function 2023-08-11 11:10:55 +01:00
bond_sysfs_slave.c net: bonding: Convert to use sysfs_emit()/sysfs_emit_at() APIs 2022-09-30 12:29:45 +01:00
bonding_priv.h net: bonding: Add SPDX identifier to remaining files 2023-05-16 15:38:06 +02:00
Makefile