Re: [RFC] iproute2, ifindex option

Stephen Hemminger
2011-07-20T15:37:58Z

On Mon, 18 Jul 2011 11:38:33 +0300
Denys Fedoryshchenko <denys@visp.net.lb> wrote:

> After battling with iproute2 interface name caching, i decided to try
> to introduce ifindex option, where i can specify manually device index,
> and avoid expensive device index lookups, especially during massive
> changes for qdisc/class.
> In batch mode ll_map cache will cause problems on servers with ppp
> interfaces (same name after while can have another index), and also if i
> run command too often, each start it will retrieve list of all
> interfaces, on 3k+ interfaces it will be CPU hog.
>
> This is sample of patch, just for qdisc/class/filter modify and show
> operation.
>
> Here is some changes in logic, because before qdisc code during _list
> operation was not checking duplicate "dev" argument, as it done in
> _modify code and class/filter list code.
>
> Also maybe i need to change duparg to something else? Because:
> centaur iproute2-newifindex # tc/tc -s -d filter show ifindex 23 dev
> sdf
> Error: duplicate "ifindex": "sdf" is the second value.
> Or it is ok like this?
>
> I'm sorry that patch is not inline, seems my webmail can't do it now, i
> will try to install normal mail client.

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.