On 2/16/23 2:40 PM, Andrii Nakryiko wrote:
So this will always require a programmatic bpf_map__set_map_flags() call, there is currently no declarative way to do this, right? Is there any way to avoid this BPF_F_LINK flag approach? How bad would it be if kernel just always created bpf_link-backed struct_ops?
It still needs to support the per-link behavior.
Alternatively, should we think about SEC(".struct_ops.link") or something like that to instruct libbpf to add this BPF_F_LINK flag automatically?
I like this idea. Easier for users that is always link only. The users can also stay with SEC(".struct_ops") and decide later if BPF_F_LINK should be set depending on the runtime config and environment like kernel version...etc.