Re: [RFC] iproute2, ifindex option

Denys Fedoryshchenko
2011-07-20T16:12:59Z

On Wed, 20 Jul 2011 08:58:42 -0700, Stephen Hemminger wrote:
> On Wed, 20 Jul 2011 18:54:44 +0300
> Denys Fedoryshchenko <denys@visp.net.lb> wrote:
>
>> On Wed, 20 Jul 2011 08:37:53 -0700, Stephen Hemminger wrote:
>> >
>> > If caching is a problem, I would rather just get rid of the cache
>> > altogether.
>> > There are a number of other places where it is a problem as well.
>> It is good, but it must be controlled. Also people put some efforts
>> to
>> improve it...
>> Before i did custom patch to "trash" the cache, but after cache
>> improved i should rewrite it. If required, i can make cache
>> behavior
>> changeable (on,off,flush ?).
>> Will it help for you too?
>>
>> I think ifindex is good anyway, because sometimes it is better to
>> refer
>> to specific ppp interface by ifindex.
>
> The problem is that it is not possible to make a "safe" cache since
> it is possible for network device names to be changed at any time.

Maybe then by removing cache, but using ifindex option, and maybe even
adding in output additional ifindex field (for show commands), we can
leave user to implement his own caching?

Another thing, on tc -s -d qdisc show, if there is many interfaces,
without cache on each line ll_index_to_name() it will be CPU and netlink
hog to retrieve all interface names again and again, especially if there
is too many intefaces.