summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2021-09-14 15:49:24 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-09-14 15:49:42 -0700
commit67dfac47dac67a44d5bbdab2541a35ce33a2729a (patch)
treebe606ccb8cf5dffa18fbb25b5b8cab1ca0674bfa /tools/testing
parentca304b40c20d5750f08200f0ad3445384646620c (diff)
parentb6291a6f30d35bd4459dc35aac2f30669a4356ac (diff)
Merge branch 'libbpf: Streamline internal BPF program sections handling'
Andrii Nakryiko says: ==================== This small patch set performs internal refactorings around libbpf BPF program ELF section definitions' handling. This is preparatory changes for further changes around making libbpf BPF program section handling more strict but also pluggable and customizable, as part of the libbpf 1.0 effort. See individual patches for details. ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_cubic.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_cubic.c b/tools/testing/selftests/bpf/progs/bpf_cubic.c
index f62df4d023f9..d9660e7200e2 100644
--- a/tools/testing/selftests/bpf/progs/bpf_cubic.c
+++ b/tools/testing/selftests/bpf/progs/bpf_cubic.c
@@ -169,11 +169,7 @@ static __always_inline void bictcp_hystart_reset(struct sock *sk)
ca->sample_cnt = 0;
}
-/* "struct_ops/" prefix is not a requirement
- * It will be recognized as BPF_PROG_TYPE_STRUCT_OPS
- * as long as it is used in one of the func ptr
- * under SEC(".struct_ops").
- */
+/* "struct_ops/" prefix is a requirement */
SEC("struct_ops/bpf_cubic_init")
void BPF_PROG(bpf_cubic_init, struct sock *sk)
{
@@ -188,10 +184,8 @@ void BPF_PROG(bpf_cubic_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/bpf_cubic_cwnd_event")
void BPF_PROG(bpf_cubic_cwnd_event, struct sock *sk, enum tcp_ca_event event)
{
if (event == CA_EVENT_TX_START) {