diff options
author | Cong Wang <cong.wang@bytedance.com> | 2022-06-15 09:20:12 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-06-20 14:05:52 +0200 |
commit | 965b57b469a589d64d81b1688b38dcb537011bb0 (patch) | |
tree | 968209ff361fc86f0f49071cf4817c65e21d10aa /include/net/udp.h | |
parent | 04919bed948dc22a0032a9da867b7dcb8aece4ca (diff) |
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
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index b60eea2e3fae..987f7fc7c0aa 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -306,8 +306,7 @@ struct sock *__udp6_lib_lookup(struct net *net, struct sk_buff *skb); struct sock *udp6_lib_lookup_skb(const struct sk_buff *skb, __be16 sport, __be16 dport); -int udp_read_sock(struct sock *sk, read_descriptor_t *desc, - sk_read_actor_t recv_actor); +int udp_read_skb(struct sock *sk, skb_read_actor_t recv_actor); /* UDP uses skb->dev_scratch to cache as much information as possible and avoid * possibly multiple cache miss on dequeue() |