Re: [PATCH bpf 1/2] libbpf: Ignore non function pointer member in struct_ops

2021-02-10 Thread Martin KaFai Lau
On Wed, Feb 10, 2021 at 12:26:20PM -0800, Andrii Nakryiko wrote: > On Tue, Feb 9, 2021 at 12:40 PM Martin KaFai Lau wrote: > > > > When libbpf initializes the kernel's struct_ops in > > "bpf_map__init_kern_struct_ops()", it enforces all > > pointer types must be a function pointer and rejects > >

Re: [PATCH bpf 1/2] libbpf: Ignore non function pointer member in struct_ops

2021-02-10 Thread Andrii Nakryiko
On Tue, Feb 9, 2021 at 12:40 PM Martin KaFai Lau wrote: > > When libbpf initializes the kernel's struct_ops in > "bpf_map__init_kern_struct_ops()", it enforces all > pointer types must be a function pointer and rejects > others. It turns out to be too strict. For example, > when directly using "

[PATCH bpf 1/2] libbpf: Ignore non function pointer member in struct_ops

2021-02-09 Thread Martin KaFai Lau
When libbpf initializes the kernel's struct_ops in "bpf_map__init_kern_struct_ops()", it enforces all pointer types must be a function pointer and rejects others. It turns out to be too strict. For example, when directly using "struct tcp_congestion_ops" from vmlinux.h, it has a "struct module *o