From nobody Mon Nov 20 20:29:49 2023 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SYzdX3gg3z51pY3 for ; Mon, 20 Nov 2023 20:29:52 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SYzdX1Md6z3VTV; Mon, 20 Nov 2023 20:29:52 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 3AKKToQx072621; Mon, 20 Nov 2023 14:29:50 -0600 (CST) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1700512190; bh=yIYIS8QLm1MG/yWW10EiOxvX2lONVybHMSylx0mOKaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hzrG5O9j3IPXAchTKMy5ssQZgVGIZdgSz1ufG/X0zNIgywu3+MSTm6+09qnXfq9DY mMoh5D/bnnMDb+txK22PjZeDAoJcaTVbWFxJ6Mr3YfQO+9s0Vu2EiO1icv2oHs1VyZ NoR/FSCiqI5dUSttSjduGlagCm5UsMy9EgrV3kfitVpsFjjp23JUdHAKfU4d+P8Bhg YImOOrFreEvruyR5iBhJLqmKiluMZnqnCSmeCCA7hisnENJG/g4fU1FtEG2eb4CFx5 tKUSC2vJsCo7wbbis2pBYiRiWUhRb0iLwRhLk0LpHn+uHoMw2jS8YHALvs4GlCV9E2 HIg+AUfdtjGow== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id YRqIAL7BW2WrGwEAs/W3XQ (envelope-from ); Mon, 20 Nov 2023 14:29:50 -0600 From: Mike Karels To: =?utf-8?q?Mina_Gali=C4=87?= Cc: Zhenlei Huang , Kyle Evans , freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Date: Mon, 20 Nov 2023 14:29:49 -0600 X-Mailer: MailMate (1.14r5964) Message-ID: <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> In-Reply-To: References: <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Queue-Id: 4SYzdX1Md6z3VTV 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 = metric 0 mtu 1500 >> >> options=3D60009b >> >> ether 00:e0:4c:xx:xx:xx >> media: Ethernet autoselect (1000baseT ) >> >> status: active >> +++ groups: ure >> nd6 options=3D23 >> >> ``` >> >> 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