On 19 Nov 2023, at 13:13, Mina Galić wrote:

> Hi Mike,
>
>> The kernel has a driver name for each interface, which looks like it
>> doesn't change currently in most cases. There is a kernel accessor
>> function, but I don't think it is exported to user space now. It could
>> be, though. Would this be sufficient for your purposes? There is also
>> a unit number, which could also be exported.
>
> As mentioned in my initial post, I'm happy to drop to C where alternatives 
> are infeasible, slow, or otherwise cumbersome, or just plain don't exist.
>
> Here's the code we use to determine boottime: 
> https://github.com/canonical/cloud-init/blob/5496745b394f9b7b9eaf57fd619330d484ce2da8/cloudinit/util.py#L2073-L2105

If I would design it right now, I'd add code to ifconfig to exercise the
new feature, and do something like this:

# ifconfig my-interfacename drivername
igb
#

Unit could be done similarly if needed, or ifconfig could have an
operand that caused both driver and unit to be printed, maybe as
two words (hopefully no spaces in driver names!).

                Mike

>
> Mina

Reply via email to