• Ong Boon Leong's avatar
    net: stmmac: Add support for XDP_REDIRECT action · 8b278a5b
    Ong Boon Leong authored
    This patch adds the support of XDP_REDIRECT to another remote cpu for
    further action. It also implements ndo_xdp_xmit ops, enabling the driver
    to transmit packets forwarded to it by XDP program running on another
    interface.
    
    This patch has been tested using "xdp_redirect_cpu" for XDP_REDIRECT
    + drop testing. It also been tested with "xdp_redirect" sample app
    which can be used to exercise ndo_xdp_xmit ops. The burst traffics are
    generated using pktgen_sample03_burst_single_flow.sh in samples/pktgen
    directory.
    
    v4: Move xdp_do_flush() processing into stmmac_finalize_xdp_rx() and
        combined the XDP verdict of XDP TX and REDIRECT together.
    
    v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
        sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
        for point out.
    Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8b278a5b
stmmac.h 8.24 KB