From: Cyril Bur <cyrilbur@gmail.com>
To: miltonm@us.ibm.com
Cc: OpenBMC Patches <openbmc-patches@stwcx.xyz>, openbmc@lists.ozlabs.org
Subject: Re: [PATCH u-boot 5/5] net: aspeednic: Do not fill in a random MAC address
Date: Tue, 15 Mar 2016 11:11:40 +1100 [thread overview]
Message-ID: <20160315111140.38b7562a@camb691> (raw)
In-Reply-To: <1457721644-29871-6-git-send-email-openbmc-patches@stwcx.xyz>
On Fri, 11 Mar 2016 12:40:44 -0600
OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote:
> From: "Milton D. Miller II" <miltonm@us.ibm.com>
>
Hi Milton,
Series looks nice.
One question about this patch, should you also have removed the call to
aspeednick_write_hwaddr() from aspeednic_initialize() since the eth layer will
do it for you? Not a bit deal at all, the eth layer will also detect that it's
been done and just skip it?
> Do not check the u-boot environemnt or fill in a random address
> in the write_hwaddr hook, instead rely on the framework to do so.
>
> The doc/README.ethaddr specifically states that random addresses
> are only to be assigned as part of a emergency such as a netboot
> recovery command.
>
> The upstream commit created a config variable to assign a
> random mac when none is set leaving it zero and that has now
> been backported.
>
> Note: The hardware address is reset to 0 as part of the ethernet
> reset performed at boot. If no valid MAC address is found in
> the environment the hardware will contain zeros and the operating
> system will assign a valid random MAC address if u-boot is
> configured not to.
>
> The net effect is an attempt to use the network will result in
> the ethernet address not set warning being printed if the ethaddr
> variable is not set, and a warning iwth the random mac address
> if the config is set. If a valid ethernet address is set
> in the environment it will be programmed in the hardware and
> used by the operating system.
>
> Signed-off-by: Milton Miller <miltonm@us.ibm.com>
> ---
> drivers/net/aspeednic.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/aspeednic.c b/drivers/net/aspeednic.c
> index 841df8b..e80561f 100644
> --- a/drivers/net/aspeednic.c
> +++ b/drivers/net/aspeednic.c
> @@ -1363,10 +1363,6 @@ static void aspeednic_halt(struct eth_device* dev)
>
> static int aspeednic_write_hwaddr(struct eth_device* dev)
> {
> - if (!eth_getenv_enetaddr_by_index("eth", 0, dev->enetaddr)) {
> - eth_random_enetaddr(dev->enetaddr);
> - }
> -
> OUTL(dev, ((dev->enetaddr[2] << 24) | (dev->enetaddr[3] << 16)
> | (dev->enetaddr[4] << 8) | dev->enetaddr[5]), MAC_LADR_REG);
> OUTL(dev, ((dev->enetaddr[0] << 8) | dev->enetaddr[1]), MAC_MADR_REG);
next prev parent reply other threads:[~2016-03-15 0:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 18:40 [PATCH u-boot 0/5] Only call aspeednic_init when preparing to use network OpenBMC Patches
2016-03-11 18:40 ` [PATCH u-boot 1/5] net: aspeednic: Create aspeed_write_hwaddr from set_mac_address OpenBMC Patches
2016-03-15 0:12 ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 2/5] net: aspeednic: Do not start hardware in initialize OpenBMC Patches
2016-03-15 0:14 ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 3/5] net: aspeednic: Remove extra spaces before assignments OpenBMC Patches
2016-03-15 0:15 ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 4/5] net: Implement random ethaddr fallback in eth.c OpenBMC Patches
2016-03-15 0:21 ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 5/5] net: aspeednic: Do not fill in a random MAC address OpenBMC Patches
2016-03-15 0:11 ` Cyril Bur [this message]
2016-03-15 22:37 ` Milton Miller II
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=20160315111140.38b7562a@camb691 \
--to=cyrilbur@gmail.com \
--cc=miltonm@us.ibm.com \
--cc=openbmc-patches@stwcx.xyz \
--cc=openbmc@lists.ozlabs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.