mbox series

[bpf-next,v6,0/8] sock_map: clean up and refactor code for BPF_SK_SKB_VERDICT

Message ID 20210220052924.106599-1-xiyou.wangcong@gmail.com
Headers show
Series sock_map: clean up and refactor code for BPF_SK_SKB_VERDICT | expand

Message

Cong Wang Feb. 20, 2021, 5:29 a.m. UTC
From: Cong Wang <cong.wang@bytedance.com>

This patchset is the first series of patches separated out from
the original large patchset, to make reviews easier. This patchset
does not add any new feature or change any functionality but merely
cleans up the existing sockmap and skmsg code and refactors it, to
prepare for the patches followed up. This passed all BPF selftests.

To see the big picture, the original whole patchset is available
on github: https://github.com/congwang/linux/tree/sockmap

and this patchset is also available on github:
https://github.com/congwang/linux/tree/sockmap1

---
v6: fix !CONFIG_INET case

v5: improve CONFIG_BPF_SYSCALL dependency
    add 3 trivial clean up patches

v4: reuse skb dst instead of skb ext
    fix another Kconfig error

v3: fix a few Kconfig compile errors
    remove an unused variable
    add a comment for bpf_convert_data_end_access()

v2: split the original patchset
    compute data_end with bpf_convert_data_end_access()
    get rid of psock->bpf_running
    reduce the scope of CONFIG_BPF_STREAM_PARSER
    do not add CONFIG_BPF_SOCK_MAP

Cong Wang (8):
  bpf: clean up sockmap related Kconfigs
  skmsg: get rid of struct sk_psock_parser
  bpf: compute data_end dynamically with JIT code
  skmsg: move sk_redir from TCP_SKB_CB to skb
  sock_map: rename skb_parser and skb_verdict
  sock_map: make sock_map_prog_update() static
  skmsg: make __sk_psock_purge_ingress_msg() static
  skmsg: get rid of sk_psock_bpf_run()

 include/linux/bpf.h                           |  29 +--
 include/linux/bpf_types.h                     |   6 +-
 include/linux/skbuff.h                        |   3 +
 include/linux/skmsg.h                         |  82 +++++--
 include/net/tcp.h                             |  41 +---
 include/net/udp.h                             |   4 +-
 init/Kconfig                                  |   1 +
 net/Kconfig                                   |   6 +-
 net/core/Makefile                             |   6 +-
 net/core/filter.c                             |  48 ++--
 net/core/skmsg.c                              | 207 ++++++++----------
 net/core/sock_map.c                           |  77 +++----
 net/ipv4/Makefile                             |   2 +-
 net/ipv4/tcp_bpf.c                            |   4 +-
 .../selftests/bpf/prog_tests/sockmap_listen.c |   8 +-
 .../selftests/bpf/progs/test_sockmap_listen.c |   4 +-
 16 files changed, 270 insertions(+), 258 deletions(-)

Comments

Jakub Sitnicki Feb. 22, 2021, 12:32 p.m. UTC | #1
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>

>

> This patchset is the first series of patches separated out from

> the original large patchset, to make reviews easier. This patchset

> does not add any new feature or change any functionality but merely

> cleans up the existing sockmap and skmsg code and refactors it, to

> prepare for the patches followed up. This passed all BPF selftests.

>

> To see the big picture, the original whole patchset is available

> on github: https://github.com/congwang/linux/tree/sockmap

>

> and this patchset is also available on github:

> https://github.com/congwang/linux/tree/sockmap1

>

> ---


Thanks for the effort. It definitely looks like an improvement to me.

-Jakub