From: Dominique Martinet <asmadeus@codewreck.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Oliver Neukum <oneukum@suse.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Dominique Martinet <dominique.martinet@atmark-techno.com>,
netdev@vger.kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: usb: usbnet: restore usb%d name exception for local mac addresses
Date: Thu, 5 Dec 2024 18:16:51 +0900 [thread overview]
Message-ID: <Z1Fvg7mJv0elnuPL@codewreck.org> (raw)
In-Reply-To: <5b93b521-4cc8-47d3-844a-33cf6477a016@lunn.ch>
Andrew Lunn wrote on Tue, Dec 03, 2024 at 09:47:57PM +0100:
> On Tue, Dec 03, 2024 at 10:04:55PM +0900, Dominique Martinet wrote:
> > From: Dominique Martinet <dominique.martinet@atmark-techno.com>
> >
> > The previous commit assumed that local addresses always came from the
> > kernel, but some devices hand out local mac addresses so we ended up
> > with point-to-point devices with a mac set by the driver, renaming to
> > eth%d when they used to be named usb%d.
> >
> > Userspace should not rely on device name, but for the sake of stability
> > restore the local mac address check portion of the naming exception:
> > point to point devices which either have no mac set by the driver or
> > have a local mac handed out by the driver will keep the usb%d name.
>
> Are you saying the OTP or NVMEM has a locally administered MAC address
> stored in it?
I'm afraid so... (At least the Gemalto^W Cinterion^W Thales^W Telit
ELS31-J we use on a couple of boards seem to do that, it's soldered on
our boards so I can't swap it out easily to confirm but the mac address
is stable accross reboots)
The good news is that after having been sold at least 4 times it's been
made EOL now, so in another 12-ish years I'll probably be able to ignore
this particular problem :)
> Is there a mechanism to change it?
Looking at some confidential documentation I found on our file server
there seems to be an usb function that contains the mac address and
various ethernet statistics, but it's not clear to me if it's actually
writable or even how to actually use it in practice and it was certainly
not designed with being modified in mind.
(I suspect there should be some vendor AT command that would allow
overriding the setting somewhere but I can't find that either)
OTOH, just changing the mac locally (ip link set usb0 addr
02:12:34:56:78:90) works and dhcp gets me a new IP, so it's not like
overriding it is a problem either.
(interestingly putting the old mac back gets me the old IP back, so
there's a real dhcp server with leases behind this and I suspect I
could just bridge this out and it'd work as expected...)
> The point about locally administered MAC addresses is that they are
> locally administered.
Honest question here our of curiosity, my reading of a few random pages
on the internet is that it would be acceptable for the modem to randomly
generate it?
(under the assumption that e.g. a reset would clear it and get me a new
mac)
Or does it have to be assigned as late as possible, e.g. we'd want linux
to be generating it in this case?
Thanks,
--
Dominique
next prev parent reply other threads:[~2024-12-05 9:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 13:04 [PATCH] net: usb: usbnet: restore usb%d name exception for local mac addresses Dominique Martinet
2024-12-03 14:48 ` Greg KH
2024-12-03 20:47 ` Andrew Lunn
2024-12-04 2:13 ` Jakub Kicinski
2024-12-05 9:16 ` Dominique Martinet [this message]
2024-12-05 14:51 ` Andrew Lunn
2025-03-26 7:27 ` Ahmed Naseef
2025-03-26 11:11 ` Jakub Kicinski
2025-03-26 11:34 ` Dominique Martinet
2025-03-26 11:40 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1Fvg7mJv0elnuPL@codewreck.org \
--to=asmadeus@codewreck.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dominique.martinet@atmark-techno.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).