]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit60bd25cebfc34b65c6c68a3c31414010efa7bd72
tree6c06de2552a875163ec1c586cc03cd2c104c0c67
parentcc822b9b67fa31f85cde98d24b159ad301b0cd27
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