mbox series

[bpf,v4,0/4] sock_map: fix ->poll() and update selftests

Message ID 20211008203306.37525-1-xiyou.wangcong@gmail.com (mailing list archive)
Headers show
Series sock_map: fix ->poll() and update selftests | expand

Message

Cong Wang Oct. 8, 2021, 8:33 p.m. UTC
From: Cong Wang <cong.wang@bytedance.com>

This patchset fixes ->poll() for sockets in sockmap and updates
selftests accordingly with select(). Please check each patch
for more details.

Fixes: c50524ec4e3a ("Merge branch 'sockmap: add sockmap support for unix datagram socket'")
Fixes: 89d69c5d0fbc ("Merge branch 'sockmap: introduce BPF_SK_SKB_VERDICT and support UDP'")
Acked-by: John Fastabend <john.fastabend@gmail.com>

---
v4: add a comment in udp_poll()

v3: drop sk_psock_get_checked()
    reuse tcp_bpf_sock_is_readable()

v2: rename and reuse ->stream_memory_read()
    fix a compile error in sk_psock_get_checked()

Cong Wang (3):
  net: rename ->stream_memory_read to ->sock_is_readable
  skmsg: extract and reuse sk_msg_is_readable()
  net: implement ->sock_is_readable() for UDP and AF_UNIX

Yucong Sun (1):
  selftests/bpf: use recv_timeout() instead of retries

 include/linux/skmsg.h                         |  1 +
 include/net/sock.h                            |  8 +-
 include/net/tls.h                             |  2 +-
 net/core/skmsg.c                              | 14 ++++
 net/ipv4/tcp.c                                |  5 +-
 net/ipv4/tcp_bpf.c                            | 15 +---
 net/ipv4/udp.c                                |  3 +
 net/ipv4/udp_bpf.c                            |  1 +
 net/tls/tls_main.c                            |  4 +-
 net/tls/tls_sw.c                              |  2 +-
 net/unix/af_unix.c                            |  4 +
 net/unix/unix_bpf.c                           |  2 +
 .../selftests/bpf/prog_tests/sockmap_listen.c | 75 +++++--------------
 13 files changed, 58 insertions(+), 78 deletions(-)

Comments

Jakub Sitnicki Oct. 12, 2021, 7:45 a.m. UTC | #1
On Fri, Oct 08, 2021 at 10:33 PM CEST, Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>
>
> This patchset fixes ->poll() for sockets in sockmap and updates
> selftests accordingly with select(). Please check each patch
> for more details.
>
> Fixes: c50524ec4e3a ("Merge branch 'sockmap: add sockmap support for unix datagram socket'")
> Fixes: 89d69c5d0fbc ("Merge branch 'sockmap: introduce BPF_SK_SKB_VERDICT and support UDP'")
> Acked-by: John Fastabend <john.fastabend@gmail.com>
>
> ---

For the series:

Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
John Fastabend Oct. 22, 2021, 3:34 p.m. UTC | #2
Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>
> 
> This patchset fixes ->poll() for sockets in sockmap and updates
> selftests accordingly with select(). Please check each patch
> for more details.
> 
> Fixes: c50524ec4e3a ("Merge branch 'sockmap: add sockmap support for unix datagram socket'")
> Fixes: 89d69c5d0fbc ("Merge branch 'sockmap: introduce BPF_SK_SKB_VERDICT and support UDP'")
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> 
> ---
> v4: add a comment in udp_poll()
> 
> v3: drop sk_psock_get_checked()
>     reuse tcp_bpf_sock_is_readable()
> 
> v2: rename and reuse ->stream_memory_read()
>     fix a compile error in sk_psock_get_checked()
> 
> Cong Wang (3):
>   net: rename ->stream_memory_read to ->sock_is_readable
>   skmsg: extract and reuse sk_msg_is_readable()
>   net: implement ->sock_is_readable() for UDP and AF_UNIX
> 
> Yucong Sun (1):
>   selftests/bpf: use recv_timeout() instead of retries
> 
>  include/linux/skmsg.h                         |  1 +
>  include/net/sock.h                            |  8 +-
>  include/net/tls.h                             |  2 +-
>  net/core/skmsg.c                              | 14 ++++
>  net/ipv4/tcp.c                                |  5 +-
>  net/ipv4/tcp_bpf.c                            | 15 +---
>  net/ipv4/udp.c                                |  3 +
>  net/ipv4/udp_bpf.c                            |  1 +
>  net/tls/tls_main.c                            |  4 +-
>  net/tls/tls_sw.c                              |  2 +-
>  net/unix/af_unix.c                            |  4 +
>  net/unix/unix_bpf.c                           |  2 +
>  .../selftests/bpf/prog_tests/sockmap_listen.c | 75 +++++--------------
>  13 files changed, 58 insertions(+), 78 deletions(-)
> 
> -- 
> 2.30.2
> 

For the series. Thanks.

Acked-by: John Fastabend <john.fastabend@gmail.com>