mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-21 16:31:14 +02:00

Add a selftest to confirm the issue, which gets -EINVAL when update attached freplace prog to prog_array map, has been fixed. cd tools/testing/selftests/bpf; ./test_progs -t tailcalls 328/25 tailcalls/tailcall_freplace:OK 328 tailcalls:OK Summary: 1/25 PASSED, 0 SKIPPED, 0 FAILED Acked-by: Yonghong Song <yonghong.song@linux.dev> Signed-off-by: Leon Hwang <leon.hwang@linux.dev> Link: https://lore.kernel.org/r/20240728114612.48486-3-leon.hwang@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
23 lines
319 B
C
23 lines
319 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
#include "bpf_misc.h"
|
|
|
|
__noinline
|
|
int subprog(struct __sk_buff *skb)
|
|
{
|
|
int ret = 1;
|
|
|
|
__sink(ret);
|
|
return ret;
|
|
}
|
|
|
|
SEC("tc")
|
|
int entry_tc(struct __sk_buff *skb)
|
|
{
|
|
return subprog(skb);
|
|
}
|
|
|
|
char __license[] SEC("license") = "GPL";
|