Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2023 14:29:49 -0600
From:      Mike Karels <mike@karels.net>
To:        =?utf-8?q?Mina_Gali=C4=87?= <freebsd@igalic.co>
Cc:        Zhenlei Huang <zlei@FreeBSD.org>, Kyle Evans <kevans@FreeBSD.org>, freebsd-net@freebsd.org
Subject:   Re: How to tell if a network interface was renamed (and from what)
Message-ID:  <31B38FCE-0B67-4122-A202-568150E971E1@karels.net>
In-Reply-To: <rvRLOlpJc9xIf67ZwmZ4Si6TN2VtmIuyuguoQgEk5NTOeqsqkAwB_9KvlMbW6y-npSjCC2lmLVXbD4oIqyKJdDboThcWiehF_hU0L9D6GZc=@igalic.co>
References:  <pdHC0ObBkAbx2HfFIhWYaB5-dmQDEUzNTWvVVJAuJV7FWdWWeSwybVFD-uyBUxPlqDRpAW7D1aAZsbrTxEj9kqsq7ESgO41srPmS-PcXGqw=@igalic.co> <E5F5F61E-3827-404A-A46F-BBCF45A29A82@FreeBSD.org> <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <ptnVEMJ_x48tdYePN4iYRiEW2vWqwulbEOUJ4dQ1cKGkxNXZPPfdEVHdJKNHFfs2onxNipVZKPwDZZKlDv1peS1Xttim1VitMFsdUiTkAKE=@igalic.co> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <rvRLOlpJc9xIf67ZwmZ4Si6TN2VtmIuyuguoQgEk5NTOeqsqkAwB_9KvlMbW6y-npSjCC2lmLVXbD4oIqyKJdDboThcWiehF_hU0L9D6GZc=@igalic.co>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19 Nov 2023, at 15:35, Mina Gali=C4=87 wrote:

> Hi Zhenlei,
>
>
>> Since it is just for physical devices, may I propose to have the drive=
r name in their groups ?
>>
>> So an if_ure interface ue0 will look like:
>>
>> ```
>> ue0: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> =
metric 0 mtu 1500
>>
>> options=3D60009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,RXC=
SUM_IPV6,TXCSUM_IPV6>
>>
>> ether 00:e0:4c:xx:xx:xx
>> media: Ethernet autoselect (1000baseT <full-duplex>)
>>
>> status: active
>> +++ groups: ure
>> nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
>>
>> ```
>>
>> That does not include the unit number. But could be useful to quickly =
get the driver name of physical devices.
>>
>
> Given that currently on FreeBSD the easiest way to tell if something
> is a physical device is by checking the *absence* of groups, this
> would only really be acceptable if we add an "egress" group like
> OpenBSD does, in addition to the driver name.
>
> If we can't do that, then I think Mike's solution with having the
> driver (and unit) as a separate category would be preferable.

I have a proof of concept that makes the presumed original name
(driver name + unit number) available to ifconfig, which prints
the string with everything else in the standard output format.
I don't think that is the right solution, but the other details
should be easy.  I'm tempted to print the driver name and unit
number separately, although possibly as two words using the same
option.  It should probably be an option rather than a keyword,
so something like this:

# ifconfig -N interface-name
igb 1
#

Or the unit number could be on a separate option.

Comments?

		Mike

> Unrelatedly, I don't see anything in ure(4) mentioning that if_ure
> devices will be named "ue".
> Don't we usually  document such deviation from the norm?
>
>
> Kind regards,
>
> Mina



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31B38FCE-0B67-4122-A202-568150E971E1>