Subject: Re: [PATCH bpf-next v3 12/13] tools: libbpf: allow map reuse

From: Jakub Kicinski <[email-masked]>
Date: Tue, 10 Jul 2018 21:53:52 -0700

On Tue, 10 Jul 2018 20:45:36 -0700, Andrey Ignatov wrote:
> Acked-by: Andrey Ignatov <[email-masked]>

Thank you! :)
 
> Thanks for all the changes Jakub! Sorry, it forced you to deal with
> strerror_r().

No worries, I already had issues with reallocarray().  Because we have
two reasons now the split seems more justified, and it's cleaner IMHO.

> One thing, I'm not really sure, is if there is a reason not to copy
> ifindex as well from the map that corresponds to passed fd. It's fine
> with me to follow-up separately though if it's needed.

To handle the ifindex correctly we would have to deal with net
namespaces.  Note that ifindex comes with the pair of netns_* fields
in bpf_map_info.  Netdev can also be moved to another namespace after
the information is cached in libbpf.

Right now there is no use for ifindex other than to populate the
attribute at creation time (where it always refer to current namespace).
I'd rather keep ifindex as a input only parameter until we have a clear
use for reading it, otherwise we have to decide on the semantics in the
dark and may bring in quite a bit of complexity for no good reason.