• Daniel Borkmann's avatar
    xdp, bonding: Fix feature flags when there are no slave devs anymore · f267f262
    Daniel Borkmann authored
    Commit 9b0ed890 ("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 9b0ed890, 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: 9b0ed890 ("bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY")
    Signed-off-by: default avatarDaniel 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: default avatarToke Høiland-Jørgensen <toke@redhat.com>
    Message-ID: <20240305090829.17131-1-daniel@iogearbox.net>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    f267f262
bond_main.c 176 KB