mbox series

[RESEND,bpf,v3,0/8] sock_map: some bug fixes and improvements

Message ID 20210615021342.7416-1-xiyou.wangcong@gmail.com (mailing list archive)
Headers show
Series sock_map: some bug fixes and improvements | expand

Message

Cong Wang June 15, 2021, 2:13 a.m. UTC
From: Cong Wang <cong.wang@bytedance.com>

This patchset contains a few bug fixes and improvements for sock_map.

Patch 1 improves recvmsg() accuracy for UDP, patch 2 improves UDP
non-blocking read() by retrying on EAGAIN. With both of them, the
failure rate of the UDP test case goes down from 10% to 1%.

Patch 3 is memory leak fix I posted, no change since v1. The rest
patches address similar memory leaks or improve error handling,
including one increases sk_drops counter for error cases. Please
check each patch description for more details.

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

---
Resend this patchset as it is lost after John's review.

v3: add another bug fix as patch 4
    update patch 5 accordingly
    address John's review on the last patch
    fix a few typos in patch descriptions

v2: group all patches together
    set max for retries of EAGAIN

Cong Wang (8):
  skmsg: improve udp_bpf_recvmsg() accuracy
  selftests/bpf: Retry for EAGAIN in udp_redir_to_connected()
  udp: fix a memory leak in udp_read_sock()
  skmsg: clear skb redirect pointer before dropping it
  skmsg: fix a memory leak in sk_psock_verdict_apply()
  skmsg: teach sk_psock_verdict_apply() to return errors
  skmsg: pass source psock to sk_psock_skb_redirect()
  skmsg: increase sk->sk_drops when dropping packets

 include/linux/skmsg.h                         |  2 -
 net/core/skmsg.c                              | 82 +++++++++----------
 net/ipv4/tcp_bpf.c                            | 24 +++++-
 net/ipv4/udp.c                                |  2 +
 net/ipv4/udp_bpf.c                            | 47 +++++++++--
 .../selftests/bpf/prog_tests/sockmap_listen.c |  7 +-
 6 files changed, 112 insertions(+), 52 deletions(-)

Comments

Jakub Sitnicki June 19, 2021, 9:57 a.m. UTC | #1
On Tue, Jun 15, 2021 at 04:13 AM CEST, Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>
>
> This patchset contains a few bug fixes and improvements for sock_map.
>
> Patch 1 improves recvmsg() accuracy for UDP, patch 2 improves UDP
> non-blocking read() by retrying on EAGAIN. With both of them, the
> failure rate of the UDP test case goes down from 10% to 1%.
>
> Patch 3 is memory leak fix I posted, no change since v1. The rest
> patches address similar memory leaks or improve error handling,
> including one increases sk_drops counter for error cases. Please
> check each patch description for more details.
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
>
> ---

For the series:

Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
patchwork-bot+netdevbpf@kernel.org June 21, 2021, 3 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf.git (refs/heads/master):

On Mon, 14 Jun 2021 19:13:34 -0700 you wrote:
> From: Cong Wang <cong.wang@bytedance.com>
> 
> This patchset contains a few bug fixes and improvements for sock_map.
> 
> Patch 1 improves recvmsg() accuracy for UDP, patch 2 improves UDP
> non-blocking read() by retrying on EAGAIN. With both of them, the
> failure rate of the UDP test case goes down from 10% to 1%.
> 
> [...]

Here is the summary with links:
  - [RESEND,bpf,v3,1/8] skmsg: improve udp_bpf_recvmsg() accuracy
    https://git.kernel.org/bpf/bpf/c/9f2470fbc4cb
  - [RESEND,bpf,v3,2/8] selftests/bpf: Retry for EAGAIN in udp_redir_to_connected()
    https://git.kernel.org/bpf/bpf/c/a7e65fe7d820
  - [RESEND,bpf,v3,3/8] udp: fix a memory leak in udp_read_sock()
    https://git.kernel.org/bpf/bpf/c/e00a5c331bf5
  - [RESEND,bpf,v3,4/8] skmsg: clear skb redirect pointer before dropping it
    https://git.kernel.org/bpf/bpf/c/30b9c54a707d
  - [RESEND,bpf,v3,5/8] skmsg: fix a memory leak in sk_psock_verdict_apply()
    https://git.kernel.org/bpf/bpf/c/0cf6672b23c8
  - [RESEND,bpf,v3,6/8] skmsg: teach sk_psock_verdict_apply() to return errors
    https://git.kernel.org/bpf/bpf/c/1581a6c1c329
  - [RESEND,bpf,v3,7/8] skmsg: pass source psock to sk_psock_skb_redirect()
    https://git.kernel.org/bpf/bpf/c/42830571f1fd
  - [RESEND,bpf,v3,8/8] skmsg: increase sk->sk_drops when dropping packets
    https://git.kernel.org/bpf/bpf/c/781dd0431eb5

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html