• Taehee Yoo's avatar
    net: atlantic: Implement xdp data plane · 26efaef7
    Taehee Yoo authored
    It supports XDP_PASS, XDP_DROP and multi buffer.
    
    The new function aq_nic_xmit_xdpf() is used to send packet with
    xdp_frame and internally it calls aq_nic_map_xdp().
    
    AQC chip supports 32 multi-queues and 8 vectors(irq).
    there are two option
    1. under 8 cores and 4 tx queues per core.
    2. under 4 cores and 8 tx queues per core.
    
    Like ixgbe, these tx queues can be used only for XDP_TX, XDP_REDIRECT
    queue. If so, no tx_lock is needed.
    But this patchset doesn't use this strategy because getting hardware tx
    queue index cost is too high.
    So, tx_lock is used in the aq_nic_xmit_xdpf().
    
    single-core, single queue, 80% cpu utilization.
    
      30.75%  bpf_prog_xxx_xdp_prog_tx  [k] bpf_prog_xxx_xdp_prog_tx
      10.35%  [kernel]                  [k] aq_hw_read_reg <---------- here
       4.38%  [kernel]                  [k] get_page_from_freelist
    
    single-core, 8 queues, 100% cpu utilization, half PPS.
    
      45.56%  [kernel]                  [k] aq_hw_read_reg <---------- here
      17.58%  bpf_prog_xxx_xdp_prog_tx  [k] bpf_prog_xxx_xdp_prog_tx
       4.72%  [kernel]                  [k] hw_atl_b0_hw_ring_rx_receive
    
    The new function __aq_ring_xdp_clean() is a xdp rx handler and this is
    called only when XDP is attached.
    Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    26efaef7
aq_ring.c 23.2 KB