Subject: Re: [RFC] Stable interface index option

From: Sowmini Varadhan <[email-masked]>
Date: Tue, 1 Dec 2015 11:11:14 -0500

On (12/01/15 16:50), Maximilian Wilhelm wrote:
> What I have in mind is that the user can supply a list of (ifname ->
> ifindex) entries via a sysfs/procfs interface and if such a list is
> present, the kernel will search the list for every ifname which is

Having the user supply such a list is hazardous for the reason below,
esp if you consider that you can have virtual interfaces that 
take up that number.  It also allows for a sparse ifindex number
space, which can be inefficient (thus the cisco choice)

> What I'm not sure about is what to do if there is any entry in the
> list but the ifindex is already in use. One option would be to fail
> the register call because the user wanted this particular ifindex ..

If you want to do this, it's simpler to have the kernel
track 2 separate indices (the packed index and the sparse snmp-index)
per net_device. Changes to achieve it are non-trivial, of course,
and that's why I'd question how badly this is needed.

the other issue to confront is- what do you want ioctls like SIOCGIFINDEX
to return- the packed one or the sparse one? What about if_nametoindex etc?
If they return the sparse index, can they use it back with existing
ifioctl and other calls?  i.e., API compat will have some rough edges.

--Sowmini