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)
commit965b57b469a589d64d81b1688b38dcb537011bb0
tree968209ff361fc86f0f49071cf4817c65e21d10aa
parent04919bed948dc22a0032a9da867b7dcb8aece4ca
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