public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: Tom Rini <trini@konsulko.com>
Cc: Ramon Fried <rfried.dev@gmail.com>,
	Michael Walle <michael@walle.cc>,
	Michal Simek <michal.simek@xilinx.com>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	git <git@xilinx.com>, Joe Hershberger <joe.hershberger@ni.com>,
	Simon Glass <sjg@chromium.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH] net: uclass: Save ethernet MAC address when generated
Date: Wed, 17 Nov 2021 16:56:27 +0100	[thread overview]
Message-ID: <1836596.1637164587@gemini.denx.de> (raw)
In-Reply-To: <20211117123548.GX24579@bill-the-cat>

Dear Tom,

In message <20211117123548.GX24579@bill-the-cat> you wrote:
> 
> > Why would you expect any "do not use" note?  Locally adminitered MAC
> > addresses (even when randomly chosen) have been created for good
> > reason, so they should be usable.
>
> Because as been noted in either this thread, or the other long thread,
> the user does not want to confuse Linux with this emergency random MAC?

Classical answer: Don't do it, then.

If the user does not want to pass a MAC address to Linux, he should
simply not do it.  Deleting "ethaddr" from the environment should be
all that's needed.  [And if this does not work, then I consider this
a bug that should be fixed.]

> > I'm afraid I do not understand what exactly you are proposing here?
>
> I'm objecting to changing our long standing behavior of NOT
> automatically passing the random MAC to the OS.  That has always been
> user opt-in by using tools/gen_eth_addr and "setenv ethaddr ... ;
> saveenv".  Especially since I don't know how many of those 200+ boards
> that enable CONFIG_NET_RANDOM_ETHADDR today are "enabled, but never
> used" vs "enabled, random MAC in U-Boot since we don't care/didn't
> notice, real MAC in Linux".  So yes, another worry is that we have a
> class of boards in U-Boot where a random MAC is fine enough since it's
> rarely used/needed, but Linux can get the real MAC and now we'll be
> blowing that away.  Or maybe we just have a ton of boards that
> copypasta'd that option in and didn't really think why.

Unfortunately we can only speculate about that [my guess is that
most of them are just copy/paste while brain in low power mode].

> > But I object to using a MAC address in U-Boot in a way that makes it
> > invisible to the user who uses documented APIs ("printenv ethaddr").
>
> Well, that's the API we've had for over 10 years, and it was a common
> problem in those earlier days with lots of SBCs where it was cheap to
> toss in a USB eth controller that didn't store a MAC anywhere.  Now
> we're I believe hitting this due to FPGA stuff.

CONFIG_NET_RANDOM_ETHADDR has been added in 2015 with commit bef1014
"net: Implement random ethaddr fallback in eth.c"; from the changes
then I'm not sure if this was even USB related.

> > If we use some MAC address, it shall be possible to read it using
> > "printenv ethaddr" and to set it using "setenv ethaddr".  Anything
> > else is inconsistent crap.
>
> Well, we've been inconsistent about the former for forever and there's
> a lot of implications to changing it now.

Yes.  However, being bug-compatible is something we should not rate
too high.

[non-random signature used]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"The net result is a system that is not only binary  compatible  with
4.3  BSD, but is even bug for bug compatible in almost all features."
- Avadit  Tevanian,  Jr.,  "Architecture-Independent  Virtual  Memory
Management  for  Parallel  and  Distributed  Environments:  The  Mach
Approach"

  reply	other threads:[~2021-11-17 15:56 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 11:14 [PATCH] net: uclass: Save ethernet MAC address when generated Michal Simek
2021-11-01 20:25 ` Ramon Fried
2021-11-02  9:00   ` Michael Walle
2021-11-02 10:27     ` Michal Simek
2021-11-03 16:57       ` Tom Rini
2021-11-04 11:18         ` Michal Simek
2021-11-04 11:37           ` Tom Rini
2021-11-04 11:43             ` Michal Simek
2021-11-04 12:59               ` Tom Rini
2021-11-04 13:06                 ` Michal Simek
2021-11-04  2:09       ` Grygorii Strashko
2021-11-04 11:16         ` Michal Simek
2021-11-04 12:27           ` Michael Walle
2021-11-04 13:15             ` Michal Simek
2021-11-04 13:40               ` Michael Walle
2021-11-04 21:00                 ` Ramon Fried
2021-11-09 13:55                   ` Michael Walle
2021-11-11  9:10                     ` Michael Walle
2021-11-16 14:18                       ` Tom Rini
2021-11-16 14:56                         ` Wolfgang Denk
2021-11-16 18:41                           ` Tom Rini
2021-11-17  7:44                             ` Wolfgang Denk
2021-11-17 11:50                               ` Tom Rini
2021-11-17 12:24                                 ` Wolfgang Denk
2021-11-17 12:35                                   ` Tom Rini
2021-11-17 15:56                                     ` Wolfgang Denk [this message]
2021-11-17 16:15                                       ` Tom Rini
2021-11-18  7:08                                         ` Wolfgang Denk
2021-11-18  9:46                                           ` Wolfgang Denk
2021-11-18 14:51                                             ` Tom Rini
2021-11-18 16:29                                           ` Tom Rini
2021-11-18 19:04                                             ` Wolfgang Denk
2021-11-18 19:54                                               ` Tom Rini
2021-11-19 12:30                                                 ` Michal Simek
2021-11-20 15:56                                                   ` Tom Rini

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=1836596.1637164587@gemini.denx.de \
    --to=wd@denx.de \
    --cc=git@xilinx.com \
    --cc=grygorii.strashko@ti.com \
    --cc=joe.hershberger@ni.com \
    --cc=michael@walle.cc \
    --cc=michal.simek@xilinx.com \
    --cc=rfried.dev@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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