xdp: Cpumap redirect use frame_sz and increase skb_tailroom
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 14 May 2020 10:49:38 +0000 (12:49 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 May 2020 04:21:54 +0000 (21:21 -0700)
commitdb612f749e2454c506f20155bba2871f0307d133
tree6c06de2552a875163ec1c586cc03cd2c104c0c67
parent34cc0b338a61de3eee3a2bfcaf4f9d6e9fae091a
xdp: Cpumap redirect use frame_sz and increase skb_tailroom

Knowing the memory size backing the packet/xdp_frame data area, and
knowing it already have reserved room for skb_shared_info, simplifies
using build_skb significantly.

With this change we no-longer lie about the SKB truesize, but more
importantly a significant larger skb_tailroom is now provided, e.g. when
drivers uses a full PAGE_SIZE. This extra tailroom (in linear area) can be
used by the network stack when coalescing SKBs (e.g. in skb_try_coalesce,
see TCP cases where tcp_queue_rcv() can 'eat' skb).

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/158945337822.97035.13557959180460986059.stgit@firesoul
kernel/bpf/cpumap.c