Re: [PATCH bpf-next v2 12/12] tools: bpftool: allow reuse of maps with bpftool prog load

2018-07-09 Thread Jakub Kicinski
On Mon, 9 Jul 2018 12:48:20 -0700, Alexei Starovoitov wrote:
> On Mon, Jul 09, 2018 at 10:59:44AM -0700, Jakub Kicinski wrote:
> > Add map parameter to prog load which will allow reuse of existing
> > maps instead of creating new ones.
> > 
> > We need feature detection and compat code for reallocarray, since
> > it's not available in many libc versions.
> > 
> > Signed-off-by: Jakub Kicinski 
> > Reviewed-by: Quentin Monnet   
> 
> cmdline interface feels a bit awkward to use, but it's a nice improvement.
> Acked-by: Alexei Starovoitov 

Thanks, what about the cmdline feels awkward?  The syntax or having to
manipulate map reuse at cmdline level?

> any plans to extend bpf_map_def similar to iproute2 ?
> so things like pinned file name and map reuse can be specified in .c file
> instead of cmdline?

TBH for my purposes (testing, showcasing) being able to modify things
from command line is more convenient than baking such info in ELF files.
No plans to extend bpf_map_def at this point :(


Re: [PATCH bpf-next v2 12/12] tools: bpftool: allow reuse of maps with bpftool prog load

2018-07-09 Thread Alexei Starovoitov
On Mon, Jul 09, 2018 at 10:59:44AM -0700, Jakub Kicinski wrote:
> Add map parameter to prog load which will allow reuse of existing
> maps instead of creating new ones.
> 
> We need feature detection and compat code for reallocarray, since
> it's not available in many libc versions.
> 
> Signed-off-by: Jakub Kicinski 
> Reviewed-by: Quentin Monnet 

cmdline interface feels a bit awkward to use, but it's a nice improvement.
Acked-by: Alexei Starovoitov 

any plans to extend bpf_map_def similar to iproute2 ?
so things like pinned file name and map reuse can be specified in .c file
instead of cmdline?