mbox series

[bpf-next,00/10] selftests/bpf: Retire bpf_tcp_helpers.h

Message ID 20240509175026.3423614-1-martin.lau@linux.dev (mailing list archive)
Headers show
Series selftests/bpf: Retire bpf_tcp_helpers.h | expand

Message

Martin KaFai Lau May 9, 2024, 5:50 p.m. UTC
From: Martin KaFai Lau <martin.lau@kernel.org>

The earlier commit 8e6d9ae2e09f ("selftests/bpf: Use bpf_tracing.h instead of bpf_tcp_helpers.h")
removed the bpf_tcp_helpers.h usages from the non networking tests.

This patch set is a continuation of this effort to retire
the bpf_tcp_helpers.h from the networking tests (mostly tcp-cc related).

The main usage of the bpf_tcp_helpers.h is the partial kernel
socket definitions (e.g. sock, tcp_sock). New fields are kept adding
back to those partial socket definitions while everything is available
in the vmlinux.h. The recent bpf_cc_cubic.c test tried to extend
bpf_tcp_helpers.c but eventually used the vmlinux.h instead. To avoid
this unnecessary detour for new tests and have one consistent way
of using the kernel sockets, this patch set retires the bpf_tcp_helpers.h
usages and consolidates the tests to use vmlinux.h instead.

Martin KaFai Lau (10):
  selftests/bpf: Remove bpf_tracing_net.h usages from two networking
    tests
  selftests/bpf: Replace the bpf_tcp_helpers.h usage with
    bpf_tracing_net.h in some obvious tests
  selftests/bpf: Add a few tcp helper functions and macros to
    bpf_tracing_net.h
  selftests/bpf: Reuse the tcp_sk() from the bpf_tracing_net.h
  selftests/bpf: Sanitize the SEC and inline usages in the bpf-tcp-cc
    tests
  selftests/bpf: Rename tcp-cc private struct in bpf_cubic and bpf_dctcp
  selftests/bpf: Use bpf_tracing_net.h in bpf_cubic
  selftests/bpf: Use bpf_tracing_net.h in bpf_dctcp
  selftests/bpf: Remove bpf_tcp_helpers.h usage in other misc bpf tcp-cc
    tests
  selftests/bpf: Retire bpf_tcp_helpers.h

 tools/testing/selftests/bpf/bpf_tcp_helpers.h | 241 ------------------
 .../selftests/bpf/progs/bpf_cc_cubic.c        |  39 ++-
 tools/testing/selftests/bpf/progs/bpf_cubic.c |  73 +++---
 tools/testing/selftests/bpf/progs/bpf_dctcp.c |  62 +++--
 .../selftests/bpf/progs/bpf_dctcp_release.c   |  10 +-
 .../selftests/bpf/progs/bpf_tcp_nogpl.c       |   8 +-
 .../selftests/bpf/progs/bpf_tracing_net.h     |  42 +++
 .../selftests/bpf/progs/connect4_prog.c       |  21 +-
 .../testing/selftests/bpf/progs/fib_lookup.c  |   2 +-
 .../testing/selftests/bpf/progs/mptcp_sock.c  |   4 +-
 .../selftests/bpf/progs/sockopt_qos_to_cc.c   |  16 +-
 .../bpf/progs/tcp_ca_incompl_cong_ops.c       |  12 +-
 .../selftests/bpf/progs/tcp_ca_kfunc.c        |  22 +-
 .../bpf/progs/tcp_ca_unsupp_cong_op.c         |   2 +-
 .../selftests/bpf/progs/tcp_ca_update.c       |  18 +-
 .../bpf/progs/tcp_ca_write_sk_pacing.c        |  20 +-
 .../bpf/progs/test_btf_skc_cls_ingress.c      |  16 +-
 .../selftests/bpf/progs/test_lwt_redirect.c   |   2 +-
 .../selftests/bpf/progs/test_sock_fields.c    |   6 +-
 .../selftests/bpf/progs/test_tcpbpf_kern.c    |  13 +-
 20 files changed, 190 insertions(+), 439 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/bpf_tcp_helpers.h

Comments

Alexei Starovoitov May 9, 2024, 6:24 p.m. UTC | #1
On Thu, May 9, 2024 at 10:50 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
>
> From: Martin KaFai Lau <martin.lau@kernel.org>
>
> The earlier commit 8e6d9ae2e09f ("selftests/bpf: Use bpf_tracing.h instead of bpf_tcp_helpers.h")
> removed the bpf_tcp_helpers.h usages from the non networking tests.
>
> This patch set is a continuation of this effort to retire
> the bpf_tcp_helpers.h from the networking tests (mostly tcp-cc related).
>
> The main usage of the bpf_tcp_helpers.h is the partial kernel
> socket definitions (e.g. sock, tcp_sock). New fields are kept adding
> back to those partial socket definitions while everything is available
> in the vmlinux.h. The recent bpf_cc_cubic.c test tried to extend
> bpf_tcp_helpers.c but eventually used the vmlinux.h instead. To avoid
> this unnecessary detour for new tests and have one consistent way
> of using the kernel sockets, this patch set retires the bpf_tcp_helpers.h
> usages and consolidates the tests to use vmlinux.h instead.

Nice cleanup! Applied.
patchwork-bot+netdevbpf@kernel.org May 9, 2024, 6:30 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu,  9 May 2024 10:50:16 -0700 you wrote:
> From: Martin KaFai Lau <martin.lau@kernel.org>
> 
> The earlier commit 8e6d9ae2e09f ("selftests/bpf: Use bpf_tracing.h instead of bpf_tcp_helpers.h")
> removed the bpf_tcp_helpers.h usages from the non networking tests.
> 
> This patch set is a continuation of this effort to retire
> the bpf_tcp_helpers.h from the networking tests (mostly tcp-cc related).
> 
> [...]

Here is the summary with links:
  - [bpf-next,01/10] selftests/bpf: Remove bpf_tracing_net.h usages from two networking tests
    https://git.kernel.org/bpf/bpf-next/c/c0338e609e6e
  - [bpf-next,02/10] selftests/bpf: Add a few tcp helper functions and macros to bpf_tracing_net.h
    https://git.kernel.org/bpf/bpf-next/c/cbaec46df6c0
  - [bpf-next,03/10] selftests/bpf: Reuse the tcp_sk() from the bpf_tracing_net.h
    https://git.kernel.org/bpf/bpf-next/c/cc5b18ce1714
  - [bpf-next,04/10] selftests/bpf: Sanitize the SEC and inline usages in the bpf-tcp-cc tests
    https://git.kernel.org/bpf/bpf-next/c/7d3851a31832
  - [bpf-next,05/10] selftests/bpf: Rename tcp-cc private struct in bpf_cubic and bpf_dctcp
    https://git.kernel.org/bpf/bpf-next/c/b1d87ae9b0d3
  - [bpf-next,06/10] selftests/bpf: Use bpf_tracing_net.h in bpf_cubic
    https://git.kernel.org/bpf/bpf-next/c/a824c9a8a4d9
  - [bpf-next,07/10] selftests/bpf: Use bpf_tracing_net.h in bpf_dctcp
    https://git.kernel.org/bpf/bpf-next/c/6ad4e6e94697
  - [bpf-next,08/10] selftests/bpf: Remove bpf_tcp_helpers.h usages from other misc bpf tcp-cc tests
    https://git.kernel.org/bpf/bpf-next/c/6eee55aa769c
  - [bpf-next,09/10] selftests/bpf: Remove the bpf_tcp_helpers.h usages from other non tcp-cc tests
    https://git.kernel.org/bpf/bpf-next/c/c075c9c4af28
  - [bpf-next,10/10] selftests/bpf: Retire bpf_tcp_helpers.h
    https://git.kernel.org/bpf/bpf-next/c/6a650816b098

You are awesome, thank you!