Patch "xdp, bonding: Fix feature flags when there are no slave devs anymore" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    xdp, bonding: Fix feature flags when there are no slave devs anymore

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xdp-bonding-fix-feature-flags-when-there-are-no-slav.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 822e696a3853d19db35d8337a39aca3874f2196a
Author: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
Date:   Tue Mar 5 10:08:28 2024 +0100

    xdp, bonding: Fix feature flags when there are no slave devs anymore
    
    [ Upstream commit f267f262815033452195f46c43b572159262f533 ]
    
    Commit 9b0ed890ac2a ("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 9b0ed890ac2a, 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: 9b0ed890ac2a ("bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY")
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Cc: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
    Cc: Prashant Batra <prbatra.mail@xxxxxxxxx>
    Cc: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
    Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
    Reviewed-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
    Message-ID: <20240305090829.17131-1-daniel@xxxxxxxxxxxxx>
    Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6cf7f364704e8..b094c48bebc30 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1811,7 +1811,7 @@ void bond_xdp_set_features(struct net_device *bond_dev)
 
 	ASSERT_RTNL();
 
-	if (!bond_xdp_check(bond)) {
+	if (!bond_xdp_check(bond) || !bond_has_slaves(bond)) {
 		xdp_clear_features_flag(bond_dev);
 		return;
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux