提交 cb98b55b 编写于 作者: A Andrii Nakryiko 提交者: Zheng Zengkai

selftests/bpf: Update selftests to always provide "struct_ops" SEC

mainline inclusion
from mainline-5.16-rc1
commit 53df63cc
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: NAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Acked-by: NMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20210914014733.2768-2-andrii@kernel.org
(cherry picked from commit 53df63cc)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>

Conflicts:
	tools/testing/selftests/bpf/progs/bpf_cubic.c
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 666c6402
...@@ -188,10 +188,8 @@ void BPF_PROG(bictcp_init, struct sock *sk) ...@@ -188,10 +188,8 @@ void BPF_PROG(bictcp_init, struct sock *sk)
tcp_sk(sk)->snd_ssthresh = initial_ssthresh; tcp_sk(sk)->snd_ssthresh = initial_ssthresh;
} }
/* No prefix in SEC will also work. /* "struct_ops" prefix is a requirement */
* The remaining tcp-cubic functions have an easier way. SEC("struct_ops/bictcp_cwnd_event")
*/
SEC("no-sec-prefix-bictcp_cwnd_event")
void BPF_PROG(bictcp_cwnd_event, struct sock *sk, enum tcp_ca_event event) void BPF_PROG(bictcp_cwnd_event, struct sock *sk, enum tcp_ca_event event)
{ {
if (event == CA_EVENT_TX_START) { if (event == CA_EVENT_TX_START) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册