]> git.baikalelectronics.ru Git - kernel.git/commit
net: Introduce a new proto_ops ->read_skb()
authorCong Wang <cong.wang@bytedance.com>
Wed, 15 Jun 2022 16:20:12 +0000 (09:20 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 20 Jun 2022 12:05:52 +0000 (14:05 +0200)
commit94b02d77281ef6a8a003ca6053ab7d8e77b44c98
tree968209ff361fc86f0f49071cf4817c65e21d10aa
parent5b1c8052b4a6b8625351beb9e0ce3526022d78c0
net: Introduce a new proto_ops ->read_skb()

Currently both splice() and sockmap use ->read_sock() to
read skb from receive queue, but for sockmap we only read
one entire skb at a time, so ->read_sock() is too conservative
to use. Introduce a new proto_ops ->read_skb() which supports
this sematic, with this we can finally pass the ownership of
skb to recv actors.

For non-TCP protocols, all ->read_sock() can be simply
converted to ->read_skb().

Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20220615162014.89193-3-xiyou.wangcong@gmail.com
include/linux/net.h
include/net/tcp.h
include/net/udp.h
net/core/skmsg.c
net/ipv4/af_inet.c
net/ipv4/tcp.c
net/ipv4/udp.c
net/ipv6/af_inet6.c
net/unix/af_unix.c