If I understood "well" within tools/testing/selftests/bpf/bpf_helpers.h
bpf heleprs prototypes are defined.
If I want to now which helpers are usable with a specific program type I need to search within the results of 'func_proto(enum bpf_func_id func_id' kernel/ net/ drivers/
For example to check the helpers which a socket filter program can call I can read the following definition
static const struct bpf_func_proto *
sock_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
{
switch (func_id) {
/* inet and inet6 sockets are created in a process
* context so there is always a valid uid/gid
*/
case BPF_FUNC_get_current_uid_gid:
return &bpf_get_current_uid_gid_proto;
case BPF_FUNC_get_local_storage:
return &bpf_get_local_storage_proto;
default:
return bpf_base_func_proto(func_id);
}
}
QUESTIONS:
1)I can't see load_half
, but still I can call it from my socket filter program. Why? 2) which is the difference between socket_filter
and sk_filter
?