Skip to content

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: selftests/bpf: networking test cleanups and build fix
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1023883

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4722981
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1023883
version: 1

…ect test

The cls_redirect test uses a custom addr_port structure to represent
IPv4/IPv6 addresses and ports. This custom wrapper requires extra
conversion logic and specific helpers such as fill_addr_port(), which
are no longer necessary when using standard socket address structures.

This commit replaces addr_port with the standard sockaddr_storage so
that test handles address families and ports using the native socket
types. This removes the custom helper, eliminates redundant casts,
and simplifies tuple handling without functional changes.

Signed-off-by: Hoyeon Lee <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4722981
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1023883
version: 1

…rt test

The select_reuseport selftest uses a custom sa46 union to represent
IPv4 and IPv6 addresses. This custom wrapper requires extra manual
handling for address family and field extraction.

Replace sa46 with sockaddr_storage and update the helper functions to
operate on native socket structures. This simplifies the code and
removes unnecessary custom address-handling logic. No functional
changes intended.

Signed-off-by: Hoyeon Lee <[email protected]>
Some BPF selftests contain identical copies of the min(), max(),
before(), and after() helpers. These repeated snippets are the same
across the tests and do not need to be defined separately.

Move these helpers into bpf_tracing_net.h so they can be shared by
TCP related BPF programs. This removes repeated code and keeps the
helpers in a single place.

Signed-off-by: Hoyeon Lee <[email protected]>
The connect4_prog and bpf_iter_setsockopt tests duplicate the same
open-coded TCP congestion control string comparison logic. Since
bpf_strncmp() provides the same functionality, use it instead to
avoid repeated open-coded loops.

This change applies only to functional BPF tests and does not affect
the verifier performance benchmarks (veristat.cfg). No functional
changes intended.

Signed-off-by: Hoyeon Lee <[email protected]>
The selftests/bpf invokes a nested make when building runqslower, but
LLVM toolchain version (clang/llvm-strip) is not propagated. As a
result, runqslower is built with system default clang, not respecting
specified LLVM version.

    # LLVM=-21 make -C tools/testing/selftests/bpf
    ...
    make feature_display=0 -C /bpf/tools/bpf/runqslower                        \
        OUTPUT=/bpf/tools/testing/selftests/bpf/tools/build/runqslower/        \
        BPFOBJ_OUTPUT=/bpf/tools/testing/selftests/bpf/tools/build/libbpf/     \
        BPFOBJ=/bpf/tools/testing/selftests/bpf/tools/build/libbpf/libbpf.a    \
        BPF_INCLUDE=/bpf/tools/testing/selftests/bpf/tools/include             \
        BPFTOOL_OUTPUT=/bpf/tools/testing/selftests/bpf/tools/build/bpftool/   \
        VMLINUX_BTF=/sys/kernel/btf/vmlinux BPF_TARGET_ENDIAN=--target=bpfel   \
        EXTRA_CFLAGS='-g -O0  ' EXTRA_LDFLAGS=' ' &&                           \
        cp  /bpf/tools/testing/selftests/bpf/tools/build/runqslower/runqslower \
            /bpf/tools/testing/selftests/bpf/runqslower
    clang -g -O2 --target=bpfel -I/bpf/tools/testing/selftests/bpf/tools/build/runqslower/ \
          -I/bpf/tools/testing/selftests/bpf/tools/include -I/bpf/tools/include/uapi       \
          -c runqslower.bpf.c -o /bpf/tools/testing/selftests/bpf/tools/build/runqslower/runqslower.bpf.o && \
          llvm-strip -g /bpf/tools/testing/selftests/bpf/tools/build/runqslower//runqslower.bpf.o
    /bin/sh: 1: clang: not found

Explicitly propagate CLANG and LLVM_STRIP to the runqslower sub-make so
that the LLVM toolchain selection from lib.mk is preserved.

Signed-off-by: Hoyeon Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants