mbox series

[bpf-next,v4,0/4] sockmap: some performance optimizations

Message ID 20220615162014.89193-1-xiyou.wangcong@gmail.com (mailing list archive)
Headers show
Series sockmap: some performance optimizations | expand

Message

Cong Wang June 15, 2022, 4:20 p.m. UTC
From: Cong Wang <cong.wang@bytedance.com>

This patchset contains two optimizations for sockmap. The first one
eliminates a skb_clone() and the second one eliminates a memset(). With
this patchset, the throughput of UDP transmission via sockmap gets
improved by 61%.

v4: replace kfree_skb() with consume_skb()

v3: avoid touching tcp_recv_skb()

v2: clean up coding style for tcp_read_skb()
    get rid of some redundant variables
    add a comment for ->read_skb()
---
Cong Wang (4):
  tcp: introduce tcp_read_skb()
  net: introduce a new proto_ops ->read_skb()
  skmsg: get rid of skb_clone()
  skmsg: get rid of unncessary memset()

 include/linux/net.h |  4 ++++
 include/net/tcp.h   |  1 +
 include/net/udp.h   |  3 +--
 net/core/skmsg.c    | 48 +++++++++++++++++----------------------------
 net/ipv4/af_inet.c  |  3 ++-
 net/ipv4/tcp.c      | 44 +++++++++++++++++++++++++++++++++++++++++
 net/ipv4/udp.c      | 11 +++++------
 net/ipv6/af_inet6.c |  3 ++-
 net/unix/af_unix.c  | 23 +++++++++-------------
 9 files changed, 86 insertions(+), 54 deletions(-)

Comments

John Fastabend June 18, 2022, 1:31 a.m. UTC | #1
Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>
> 
> This patchset contains two optimizations for sockmap. The first one
> eliminates a skb_clone() and the second one eliminates a memset(). With
> this patchset, the throughput of UDP transmission via sockmap gets
> improved by 61%.
> 
> v4: replace kfree_skb() with consume_skb()
> 
> v3: avoid touching tcp_recv_skb()
> 
> v2: clean up coding style for tcp_read_skb()
>     get rid of some redundant variables
>     add a comment for ->read_skb()
> ---
> Cong Wang (4):
>   tcp: introduce tcp_read_skb()
>   net: introduce a new proto_ops ->read_skb()
>   skmsg: get rid of skb_clone()
>   skmsg: get rid of unncessary memset()
> 
>  include/linux/net.h |  4 ++++
>  include/net/tcp.h   |  1 +
>  include/net/udp.h   |  3 +--
>  net/core/skmsg.c    | 48 +++++++++++++++++----------------------------
>  net/ipv4/af_inet.c  |  3 ++-
>  net/ipv4/tcp.c      | 44 +++++++++++++++++++++++++++++++++++++++++
>  net/ipv4/udp.c      | 11 +++++------
>  net/ipv6/af_inet6.c |  3 ++-
>  net/unix/af_unix.c  | 23 +++++++++-------------
>  9 files changed, 86 insertions(+), 54 deletions(-)
> 
> -- 
> 2.34.1
> 

Thanks Cong, nice set of improvements.

Reviewed-by: John Fastabend <john.fastabend@gmail.com>
patchwork-bot+netdevbpf@kernel.org June 20, 2022, 12:10 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Wed, 15 Jun 2022 09:20:10 -0700 you wrote:
> From: Cong Wang <cong.wang@bytedance.com>
> 
> This patchset contains two optimizations for sockmap. The first one
> eliminates a skb_clone() and the second one eliminates a memset(). With
> this patchset, the throughput of UDP transmission via sockmap gets
> improved by 61%.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v4,1/4] tcp: introduce tcp_read_skb()
    https://git.kernel.org/bpf/bpf-next/c/04919bed948d
  - [bpf-next,v4,2/4] net: introduce a new proto_ops ->read_skb()
    https://git.kernel.org/bpf/bpf-next/c/965b57b469a5
  - [bpf-next,v4,3/4] skmsg: get rid of skb_clone()
    https://git.kernel.org/bpf/bpf-next/c/57452d767fea
  - [bpf-next,v4,4/4] skmsg: get rid of unncessary memset()
    https://git.kernel.org/bpf/bpf-next/c/43312915b5ba

You are awesome, thank you!