From cb98b55ba2a37b05de86721a3612166c0f5548f9 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Wed, 24 Aug 2022 11:23:48 +0800 Subject: [PATCH] selftests/bpf: Update selftests to always provide "struct_ops" SEC mainline inclusion from mainline-5.16-rc1 commit 53df63ccdc0258118e53089197d0428c5330cc9c category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=53df63ccdc0258118e53089197d0428c5330cc9c ------------------------------------------------- Update struct_ops selftests to always specify "struct_ops" section prefix. Libbpf will require a proper BPF program type set in the next patch, so this prevents tests breaking. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20210914014733.2768-2-andrii@kernel.org (cherry picked from commit 53df63ccdc0258118e53089197d0428c5330cc9c) Signed-off-by: Wang Yufen Conflicts: tools/testing/selftests/bpf/progs/bpf_cubic.c Signed-off-by: Wang Yufen --- tools/testing/selftests/bpf/progs/bpf_cubic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/bpf_cubic.c b/tools/testing/selftests/bpf/progs/bpf_cubic.c index 6939bfd8690f..4d09cca501e8 100644 --- a/tools/testing/selftests/bpf/progs/bpf_cubic.c +++ b/tools/testing/selftests/bpf/progs/bpf_cubic.c @@ -188,10 +188,8 @@ void BPF_PROG(bictcp_init, struct sock *sk) tcp_sk(sk)->snd_ssthresh = initial_ssthresh; } -/* No prefix in SEC will also work. - * The remaining tcp-cubic functions have an easier way. - */ -SEC("no-sec-prefix-bictcp_cwnd_event") +/* "struct_ops" prefix is a requirement */ +SEC("struct_ops/bictcp_cwnd_event") void BPF_PROG(bictcp_cwnd_event, struct sock *sk, enum tcp_ca_event event) { if (event == CA_EVENT_TX_START) { -- GitLab