• Ong Boon Leong's avatar
    net: stmmac: Add support for XDP_TX action · be8b38a7
    Ong Boon Leong authored
    This patch adds support for XDP_TX action which enables XDP program to
    transmit back received frames.
    
    This patch has been tested with the "xdp2" app located in samples/bpf
    dir. The DUT receives burst traffic packet generated using pktgen script
    'pktgen_sample03_burst_single_flow.sh'.
    
    v4: Moved stmmac_tx_timer_arm() to be done once at the end of NAPI RX.
        Fixed stmmac_xdp_xmit_back() to return STMMAC_XDP_CONSUMED if
        XDP buffer to frame conversion fails. Thanks to Jakub's input.
    
    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 pointing out.
    Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    be8b38a7
stmmac.h 8.22 KB