]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: Allow bpf_xdp_adjust_tail() to grow packet size
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 14 May 2020 10:51:25 +0000 (12:51 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 May 2020 04:21:56 +0000 (21:21 -0700)
commit6b411aa0aefd6c346d1a450f1cb710d8e20da1a9
treef03ab9412cde9c6a8076e9f1b83e6fe1aae17058
parent22a902c8d577d36dd9e977d991773aea0d72ba65
xdp: Allow bpf_xdp_adjust_tail() to grow packet size

Finally, after all drivers have a frame size, allow BPF-helper
bpf_xdp_adjust_tail() to grow or extend packet size at frame tail.

Remember that helper/macro xdp_data_hard_end have reserved some
tailroom.  Thus, this helper makes sure that the BPF-prog don't have
access to this tailroom area.

V2: Remove one chicken check and use WARN_ONCE for other

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/158945348530.97035.12577148209134239291.stgit@firesoul
include/uapi/linux/bpf.h
net/core/filter.c