• Jesper Dangaard Brouer's avatar
    bpf: cpumap xdp_buff to skb conversion and allocation · 1c601d82
    Jesper Dangaard Brouer authored
    This patch makes cpumap functional, by adding SKB allocation and
    invoking the network stack on the dequeuing CPU.
    
    For constructing the SKB on the remote CPU, the xdp_buff in converted
    into a struct xdp_pkt, and it mapped into the top headroom of the
    packet, to avoid allocating separate mem.  For now, struct xdp_pkt is
    just a cpumap internal data structure, with info carried between
    enqueue to dequeue.
    
    If a driver doesn't have enough headroom it is simply dropped, with
    return code -EOVERFLOW.  This will be picked up the xdp tracepoint
    infrastructure, to allow users to catch this.
    
    V2: take into account xdp->data_meta
    
    V4:
     - Drop busypoll tricks, keeping it more simple.
     - Skip RPS and Generic-XDP-recursive-reinjection, suggested by Alexei
    
    V5: correct RCU read protection around __netif_receive_skb_core.
    
    V6: Setting TASK_RUNNING vs TASK_INTERRUPTIBLE based on talk with Rik van Riel
    Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1c601d82
cpumap.c 19.1 KB