Re: [PATCH bpf-next v4 11/11] bpf: selftests: Add selftests for module kfunc support
From: Alexei Starovoitov <hidden>
Date: 2021-09-22 18:24:29
Also in:
bpf
From: Alexei Starovoitov <hidden>
Date: 2021-09-22 18:24:29
Also in:
bpf
On Tue, Sep 21, 2021 at 11:06 PM Kumar Kartikeya Dwivedi [off-list ref] wrote:
On Wed, Sep 22, 2021 at 05:33:26AM IST, Andrii Nakryiko wrote:quoted
quoted
[...] Hmm, good idea, I'd just need to fill in the BTF id dynamically at runtime, but that should be possible. Though we still need to craft distinct calls (I am trying to test the limit where insn->off is different for each case). Since we try to reuse index in both gen_loader and libbpf, just generating same call 256 times would not be enough.You just need to generate one instruction with offset = 257 to test this. And separately one call with fd_array that has module BTF fd at fd_array[256] (to check that 256 is ok). Or am I missing something?That won't be enough, if I just pass insn->imm = id, insn->off = 257, it becomes first descriptor in kfunc_tab and kfunc_btf_tab. The total limit is 256, and they are kept in sorted order by based on id and off for the first, off for the second. So 256 different offs are needed (imm may be same actually), so that both fill up.
Just to test the 256 limit? I don't think it's necessary. afaik there is no test that exercises the 64 map limit.