mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Two tests are added: - cgroup_mprog_opts, which mimics tc_opts.c ([1]). Both prog and link attach are tested. Some negative tests are also included. - cgroup_mprog_ordering, which actually runs the program with some mprog API flags. [1] https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/prog_tests/tc_opts.c Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20250606163156.2429955-1-yonghong.song@linux.dev
30 lines
521 B
C
30 lines
521 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
|
|
#include <vmlinux.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
SEC("cgroup/getsockopt")
|
|
int getsockopt_1(struct bpf_sockopt *ctx)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
SEC("cgroup/getsockopt")
|
|
int getsockopt_2(struct bpf_sockopt *ctx)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
SEC("cgroup/getsockopt")
|
|
int getsockopt_3(struct bpf_sockopt *ctx)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
SEC("cgroup/getsockopt")
|
|
int getsockopt_4(struct bpf_sockopt *ctx)
|
|
{
|
|
return 1;
|
|
}
|