Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b0ed89

Browse files
magnus-karlssonkuba-moo
authored andcommitted
bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY
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: cb9e6e5 ("bonding: add xdp_features support") Reported-by: Prashant Batra <[email protected]> Link: https://lore.kernel.org/all/CAJ8uoz2ieZCopgqTvQ9ZY6xQgTbujmC6XkMTamhp68O-h_-rLg@mail.gmail.com/T/ Signed-off-by: Magnus Karlsson <[email protected]> Reviewed-by: Toke Høiland-Jørgensen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4e1d71c commit 9b0ed89

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,8 @@ void bond_xdp_set_features(struct net_device *bond_dev)
18191819
bond_for_each_slave(bond, slave, iter)
18201820
val &= slave->dev->xdp_features;
18211821

1822+
val &= ~NETDEV_XDP_ACT_XSK_ZEROCOPY;
1823+
18221824
xdp_set_features_flag(bond_dev, val);
18231825
}
18241826

@@ -5909,9 +5911,6 @@ void bond_setup(struct net_device *bond_dev)
59095911
if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
59105912
bond_dev->features |= BOND_XFRM_FEATURES;
59115913
#endif /* CONFIG_XFRM_OFFLOAD */
5912-
5913-
if (bond_xdp_check(bond))
5914-
bond_dev->xdp_features = NETDEV_XDP_ACT_MASK;
59155914
}
59165915

59175916
/* Destroy a bonding device.

0 commit comments

Comments
 (0)