public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Wolfgang Denk <wd@denx.de>, Ramon Fried <rfried.dev@gmail.com>
Cc: 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: Tue, 16 Nov 2021 13:41:46 -0500	[thread overview]
Message-ID: <20211116184146.GF24579@bill-the-cat> (raw)
In-Reply-To: <1739526.1637074605@gemini.denx.de>

[-- Attachment #1: Type: text/plain, Size: 2406 bytes --]

On Tue, Nov 16, 2021 at 03:56:45PM +0100, Wolfgang Denk wrote:
> Dear Tom,
> 
> In message <20211116141855.GD24579@bill-the-cat> you wrote:
> > 
> > So, to quote lib/Kconfig:
> > config NET_RANDOM_ETHADDR
> >         bool "Random ethaddr if unset"
> >         help
> >           Selecting this will allow the Ethernet interface to function
> >           even when the ethaddr variable for that interface is unset.
> >           A new MAC address will be generated on every boot and it will
> >           not be added to the environment.
> 
> This description is at least incomplete, because it makes no
> difference between the persistent copy of the environment and it's
> in-memory copy.  For network to function, I think the MAC address
> must be stored in the in-memory copy of the environment.

Well, networking has been working with NET_RANDOM_ETHADDR not updating
the environment, with caveats that user display information that reads
from the environment rather than ->enetaddr.  In so far as the
networking stack cares, ->enetaddr is what matters.  We look at the
environment for a MAC, and if it doesn't match the HW we use environment
MAC, but warn.

Now, I think RFC7042 is the current correct and relevant RFC here and it
doesn't mention persistence.  So I don't see a clear external authority
on if locally administered MAC addresses like this should be persistent
or not in this manner.

> > We need either a re-spin or follow-up as we're changing the documented
> > behavior.  And as I mentioned in the other thread related on-going
> > thread, perhaps "ethmacskip" should play a role in preserving existing
> > behavior?
> 
> We have way too many ways to do the same thing - nearly, just a
> little different :-(

Well, in this case I'm not sure that's the right problem to point at.
We can just set ethmacskip as a bit of corner-case functionality and
move on.

Because honestly, the more I read this, the more I think
https://patchwork.ozlabs.org/project/uboot/patch/20211115121152.3470910-1-michael@walle.cc/
is essentially the right direction.  There's no reason for 'net list' to
be using the environment here when ->enetaddr is what's being used by
the stack.  The use case of "I want to make my locally administered MAC
persist because my USB ethernet adapter lacks a MAC address" is solved
via the environment already.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2021-11-16 18:42 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 [this message]
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
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=20211116184146.GF24579@bill-the-cat \
    --to=trini@konsulko.com \
    --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=u-boot@lists.denx.de \
    --cc=wd@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