]> git.baikalelectronics.ru Git - kernel.git/commit
veth: Rework veth_xdp_rcv_skb in order to accept non-linear skb
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 11 Mar 2022 09:14:19 +0000 (10:14 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 17 Mar 2022 19:33:52 +0000 (20:33 +0100)
commit519e3d5b62563da10ef3551783eef12318eece91
treeff61dd415a8a1ec5beb9073f6eebf32495f12516
parent1deff9fe14ccca3b122e32f81dd8949de9327b62
veth: Rework veth_xdp_rcv_skb in order to accept non-linear skb

Introduce veth_convert_skb_to_xdp_buff routine in order to
convert a non-linear skb into a xdp buffer. If the received skb
is cloned or shared, veth_convert_skb_to_xdp_buff will copy it
in a new skb composed by order-0 pages for the linear and the
fragmented area. Moreover veth_convert_skb_to_xdp_buff guarantees
we have enough headroom for xdp.
This is a preliminary patch to allow attaching xdp programs with frags
support on veth devices.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/8d228b106bc1903571afd1d77e797bffe9a5ea7c.1646989407.git.lorenzo@kernel.org
drivers/net/veth.c
net/core/xdp.c