• Wei Fang's avatar
    net: fec: dynamically set the NETDEV_XDP_ACT_NDO_XMIT feature of XDP · be7ecbe7
    Wei Fang authored
    When a XDP program is installed or uninstalled, fec_restart() will
    be invoked to reset MAC and buffer descriptor rings. It's reasonable
    not to transmit any packet during the process of reset. However, the
    NETDEV_XDP_ACT_NDO_XMIT bit of xdp_features is enabled by default,
    that is to say, it's possible that the fec_enet_xdp_xmit() will be
    invoked even if the process of reset is not finished. In this case,
    the redirected XDP frames might be dropped and available transmit BDs
    may be incorrectly deemed insufficient. So this patch disable the
    NETDEV_XDP_ACT_NDO_XMIT feature by default and dynamically configure
    this feature when the bpf program is installed or uninstalled.
    
    Fixes: e4ac7cc6
    
     ("net: fec: turn on XDP features")
    Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    be7ecbe7
fec_main.c 121 KB