summaryrefslogtreecommitdiff
path: root/include/net/udp.h
diff options
context:
space:
mode:
authorCong Wang <cong.wang@bytedance.com>2021-03-31 05:32:32 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-04-01 20:56:14 +0300
commitd7f571188ecf25c244789b883c878ec7c64b5b08 (patch)
treef7180f3bdac5f80fbac0000a3927f05fb431013c /include/net/udp.h
parent8a59f9d1e3d4340659fdfee8879dc09a6f2546e1 (diff)
downloadlinux-d7f571188ecf25c244789b883c878ec7c64b5b08.tar.xz
udp: Implement ->read_sock() for sockmap
This is similar to tcp_read_sock(), except we do not need to worry about connections, we just need to retrieve skb from UDP receive queue. Note, the return value of ->read_sock() is unused in sk_psock_verdict_data_ready(), and UDP still does not support splice() due to lack of ->splice_read(), so users can not reach udp_read_sock() directly. Signed-off-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20210331023237.41094-12-xiyou.wangcong@gmail.com
Diffstat (limited to 'include/net/udp.h')
-rw-r--r--include/net/udp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index df7cc1edc200..347b62a753c3 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -329,6 +329,8 @@ 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);
/* UDP uses skb->dev_scratch to cache as much information as possible and avoid
* possibly multiple cache miss on dequeue()