Re: [RFC PATCH] libbpf: Support setting map max_entries at runtime

2020-09-02 Thread Andrii Nakryiko
On Mon, Aug 31, 2020 at 4:03 PM Barret Rhoden wrote: > > The max_entries for a BPF map may depend on runtime parameters. > Currently, we need to know the maximum value at BPF compile time. For > instance, if you want an array map with NR_CPUS entries, you would hard > code your architecture's

[RFC PATCH] libbpf: Support setting map max_entries at runtime

2020-08-31 Thread Barret Rhoden
The max_entries for a BPF map may depend on runtime parameters. Currently, we need to know the maximum value at BPF compile time. For instance, if you want an array map with NR_CPUS entries, you would hard code your architecture's largest value for CONFIG_NR_CPUS. This wastes memory at runtime.