]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Replace TCP CC string comparisons with bpf_strncmp
authorHoyeon Lee <hoyeon.lee@suse.com>
Sat, 15 Nov 2025 22:55:39 +0000 (07:55 +0900)
committerMartin KaFai Lau <martin.lau@kernel.org>
Tue, 18 Nov 2025 22:57:53 +0000 (14:57 -0800)
commitec12ab2cda6607debde3f5cf6d425a1ec5fae1dd
tree913dbd3fc9deb949b6cbf4e0f3205510afade6a8
parentf700b37314d9b96dce66e31d2da865b201fa6b38
selftests/bpf: Replace TCP CC string comparisons with bpf_strncmp

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.

Reviewed-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Hoyeon Lee <hoyeon.lee@suse.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20251115225550.1086693-5-hoyeon.lee@suse.com
tools/testing/selftests/bpf/progs/bpf_iter_setsockopt.c
tools/testing/selftests/bpf/progs/connect4_prog.c