veristat: change guess for __sk_buff from CGROUP_SKB to SCHED_CLS

SCHED_CLS seems to be a better option as a default guess for freplace
programs that have __sk_buff as a context type.

Reported-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230330190115.3942962-1-andrii@kernel.org
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
This commit is contained in:
Andrii Nakryiko 2023-03-30 12:01:15 -07:00 committed by Martin KaFai Lau
parent 4ca13d1002
commit d816129530

View File

@ -798,7 +798,7 @@ static int guess_prog_type_by_ctx_name(const char *ctx_name,
enum bpf_attach_type attach_type;
} ctx_map[] = {
/* __sk_buff is most ambiguous, for now we assume cgroup_skb */
{ "__sk_buff", "sk_buff", BPF_PROG_TYPE_CGROUP_SKB, BPF_CGROUP_INET_INGRESS },
{ "__sk_buff", "sk_buff", BPF_PROG_TYPE_SCHED_CLS },
{ "bpf_sock", "sock", BPF_PROG_TYPE_CGROUP_SOCK, BPF_CGROUP_INET4_POST_BIND },
{ "bpf_sock_addr", "bpf_sock_addr_kern", BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_INET4_BIND },
{ "bpf_sock_ops", "bpf_sock_ops_kern", BPF_PROG_TYPE_SOCK_OPS, BPF_CGROUP_SOCK_OPS },