On 4/22/19 5:29 AM, Kristian Evensen wrote:
> Hi David,
> 
> On Sun, Apr 21, 2019 at 3:33 AM David Ahern <dsah...@gmail.com> wrote:
>> Missed this in v1: you definitely do not want to call ll_init_map here.
>> It does a full kink dump which can be expensive on large scale setups.
>> ll_name_to_index alone should be fine.
> 
> Thanks a lot for all your comments! It is not so strange that you
> missed the ll_init_map()-call in v1, as it was not there :) I have
> removed the call you commented and fou_parse_opt() works as intended.
> I initially thought that ll_init_map() was required for the different
> lookup-functions to work, but I see now that it is not the case.
> 
> Is the init_map()-call in print_fou_mapping() ok or shall I remove it
> as well? I guess, at least in theory, showing fou sockets can lead to
> resolving several unique interface indexes.
> 

I would only call ll_init_map for dumps that require a lot of link
information - e.g., link dump, address dump, interface stats, etc. For
use cases where the expectation is that only a few links are referenced,
those can be retrieved and added to the cache on an as used basis via
ll_index_to_name and ll_name_to_index.

Reply via email to