Eric Dumazet a54d51fb2d udp: fix busy polling
Generic sk_busy_loop_end() only looks at sk->sk_receive_queue
for presence of packets.

Problem is that for UDP sockets after blamed commit, some packets
could be present in another queue: udp_sk(sk)->reader_queue

In some cases, a busy poller could spin until timeout expiration,
even if some packets are available in udp_sk(sk)->reader_queue.

v3: - make sk_busy_loop_end() nicer (Willem)

v2: - add a READ_ONCE(sk->sk_family) in sk_is_inet() to avoid KCSAN splats.
    - add a sk_is_inet() check in sk_is_udp() (Willem feedback)
    - add a sk_is_inet() check in sk_is_tcp().

Fixes: 2276f58ac589 ("udp: use a separate rx queue for packet reception")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-01-21 18:09:30 +00:00
..
2023-10-01 19:09:54 +01:00
2024-01-18 11:37:24 -08:00
2023-12-15 16:25:55 -08:00
2024-01-21 18:09:30 +00:00
2023-12-26 20:31:01 +00:00
2024-01-11 10:07:29 -08:00
2024-01-18 12:45:05 -08:00
2023-12-29 07:46:38 +00:00
2024-01-03 18:37:22 -08:00
2024-01-19 21:30:09 -08:00
2024-01-04 10:29:18 +00:00
2024-01-11 14:19:23 -08:00
2023-12-26 20:31:01 +00:00
2023-12-18 16:46:08 -08:00
2023-12-12 14:24:14 +01:00
2024-01-04 10:23:10 -08:00
2024-01-04 10:23:10 -08:00
2024-01-08 11:43:04 -08:00