aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
authorCong Wang <cong.wang@bytedance.com>2021-06-14 19:13:35 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2021-06-21 16:48:11 +0200
commit9f2470fbc4cb4583c080bb729a998933ba61aca4 (patch)
tree42bfdf373fe8a554dc733cfb558e989e4e8dfae0 /net/ipv4/udp.c
parentbpf: Fix libelf endian handling in resolv_btfids (diff)
downloadlinux-dev-9f2470fbc4cb4583c080bb729a998933ba61aca4.tar.xz
linux-dev-9f2470fbc4cb4583c080bb729a998933ba61aca4.zip
skmsg: Improve udp_bpf_recvmsg() accuracy
I tried to reuse sk_msg_wait_data() for different protocols, but it turns out it can not be simply reused. For example, UDP actually uses two queues to receive skb: udp_sk(sk)->reader_queue and sk->sk_receive_queue. So we have to check both of them to know whether we have received any packet. Also, UDP does not lock the sock during BH Rx path, it makes no sense for its ->recvmsg() to lock the sock. It is always possible for ->recvmsg() to be called before packets actually arrive in the receive queue, we just use best effort to make it accurate here. Fixes: 1f5be6b3b063 ("udp: Implement udp_bpf_recvmsg() for sockmap") Signed-off-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Jakub Sitnicki <jakub@cloudflare.com> Link: https://lore.kernel.org/bpf/20210615021342.7416-2-xiyou.wangcong@gmail.com
Diffstat (limited to 'net/ipv4/udp.c')
0 files changed, 0 insertions, 0 deletions