diff mbox series

[U-Boot,021/126] sandbox: net: Suppress the MAC-address warnings

Message ID 20190925145750.200592-22-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show
Series x86: Add initial support for apollolake | expand

Commit Message

Simon Glass Sept. 25, 2019, 2:56 p.m. UTC
These warnings appear every thing sandbox is run (see below) and dwarf the
actual useful output. Suppress them.

Hopefully at some point a way can be found to fix the root cause.

U-Boot 2019.10-rc2

Model: sandbox
DRAM:  128 MiB

Warning: host_lo MAC addresses don't match:
Address in ROM is          a6:28:b7:47:28:93
Address in environment is  00:00:11:22:33:44

Warning: host_enp5s0 MAC addresses don't match:
Address in ROM is          a6:28:b7:47:28:93
Address in environment is  00:00:11:22:33:45

Warning: host_eth6 using MAC address from ROM

Warning: host_docker0 MAC addresses don't match:
Address in ROM is          a6:28:b7:47:28:93
Address in environment is  00:00:11:22:33:46

Warning: host_docker_gwbridge using MAC address from ROM

Warning: host_veth1118e68 MAC addresses don't match:
Address in ROM is          a6:28:b7:47:28:93
Address in environment is  00:00:11:22:33:47
WDT:   Not found!
MMC:
In:    cros-ec-keyb
Out:   vidconsole
Err:   vidconsole
Model: sandbox
SCSI:
Net:   eth0: host_lo, eth1: host_enp5s0, eth2: host_eth6, eth3: host_docker0, eth4: host_docker_gwbridge, eth5: host_veth1118e68
Error: eth@10002000 address not set.
, eth-1: eth@10002000
Test 'pmc_base' not found

Warning: host_lo MAC addresses don't match:
Address in ROM is          2a:24:9a:31:90:f8
Address in environment is  00:00:11:22:33:44

Warning: host_enp5s0 MAC addresses don't match:
Address in ROM is          ce:23:d9:74:6f:6c
Address in environment is  00:00:11:22:33:45

Warning: host_eth6 using MAC address from ROM

Warning: host_docker0 MAC addresses don't match:
Address in ROM is          ee:22:1c:3b:be:bc
Address in environment is  00:00:11:22:33:46

Warning: host_docker_gwbridge using MAC address from ROM

Warning: host_veth1118e68 MAC addresses don't match:
Address in ROM is          ae:20:9e:3d:a4:9f
Address in environment is  00:00:11:22:33:47

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 net/eth-uclass.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

Comments

Bin Meng Oct. 5, 2019, 2:10 a.m. UTC | #1
On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
>
> These warnings appear every thing sandbox is run (see below) and dwarf the
> actual useful output. Suppress them.
>
> Hopefully at some point a way can be found to fix the root cause.
>
> U-Boot 2019.10-rc2
>
> Model: sandbox
> DRAM:  128 MiB
>
> Warning: host_lo MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:44
>
> Warning: host_enp5s0 MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:45
>
> Warning: host_eth6 using MAC address from ROM
>
> Warning: host_docker0 MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:46
>
> Warning: host_docker_gwbridge using MAC address from ROM

I am not sure how to reproduce this. Joe, do you know anything?

>
> Warning: host_veth1118e68 MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:47
> WDT:   Not found!
> MMC:
> In:    cros-ec-keyb
> Out:   vidconsole
> Err:   vidconsole
> Model: sandbox
> SCSI:
> Net:   eth0: host_lo, eth1: host_enp5s0, eth2: host_eth6, eth3: host_docker0, eth4: host_docker_gwbridge, eth5: host_veth1118e68
> Error: eth@10002000 address not set.
> , eth-1: eth@10002000
> Test 'pmc_base' not found
>
> Warning: host_lo MAC addresses don't match:
> Address in ROM is          2a:24:9a:31:90:f8
> Address in environment is  00:00:11:22:33:44
>
> Warning: host_enp5s0 MAC addresses don't match:
> Address in ROM is          ce:23:d9:74:6f:6c
> Address in environment is  00:00:11:22:33:45
>
> Warning: host_eth6 using MAC address from ROM
>
> Warning: host_docker0 MAC addresses don't match:
> Address in ROM is          ee:22:1c:3b:be:bc
> Address in environment is  00:00:11:22:33:46
>
> Warning: host_docker_gwbridge using MAC address from ROM
>
> Warning: host_veth1118e68 MAC addresses don't match:
> Address in ROM is          ae:20:9e:3d:a4:9f
> Address in environment is  00:00:11:22:33:47
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  net/eth-uclass.c | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
>

Regards,
Bin
Bin Meng Oct. 5, 2019, 2:16 a.m. UTC | #2
Hi Simon,

On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
>
> These warnings appear every thing sandbox is run (see below) and dwarf the
> actual useful output. Suppress them.
>
> Hopefully at some point a way can be found to fix the root cause.

Does removing ethaddr env from SANDBOX_ETH_SETTINGS in sandbox.h fix
this problem?

>
> U-Boot 2019.10-rc2
>
> Model: sandbox
> DRAM:  128 MiB
>
> Warning: host_lo MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:44
>
> Warning: host_enp5s0 MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:45
>
> Warning: host_eth6 using MAC address from ROM
>
> Warning: host_docker0 MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:46
>
> Warning: host_docker_gwbridge using MAC address from ROM
>
> Warning: host_veth1118e68 MAC addresses don't match:
> Address in ROM is          a6:28:b7:47:28:93
> Address in environment is  00:00:11:22:33:47
> WDT:   Not found!
> MMC:
> In:    cros-ec-keyb
> Out:   vidconsole
> Err:   vidconsole
> Model: sandbox
> SCSI:
> Net:   eth0: host_lo, eth1: host_enp5s0, eth2: host_eth6, eth3: host_docker0, eth4: host_docker_gwbridge, eth5: host_veth1118e68
> Error: eth@10002000 address not set.
> , eth-1: eth@10002000
> Test 'pmc_base' not found
>
> Warning: host_lo MAC addresses don't match:
> Address in ROM is          2a:24:9a:31:90:f8
> Address in environment is  00:00:11:22:33:44
>
> Warning: host_enp5s0 MAC addresses don't match:
> Address in ROM is          ce:23:d9:74:6f:6c
> Address in environment is  00:00:11:22:33:45
>
> Warning: host_eth6 using MAC address from ROM
>
> Warning: host_docker0 MAC addresses don't match:
> Address in ROM is          ee:22:1c:3b:be:bc
> Address in environment is  00:00:11:22:33:46
>
> Warning: host_docker_gwbridge using MAC address from ROM
>
> Warning: host_veth1118e68 MAC addresses don't match:
> Address in ROM is          ae:20:9e:3d:a4:9f
> Address in environment is  00:00:11:22:33:47
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  net/eth-uclass.c | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
>

Regards,
Bin
Bin Meng Oct. 5, 2019, 2:26 a.m. UTC | #3
Hi Simon,

On Sat, Oct 5, 2019 at 10:16 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Simon,
>
> On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > These warnings appear every thing sandbox is run (see below) and dwarf the
> > actual useful output. Suppress them.
> >
> > Hopefully at some point a way can be found to fix the root cause.
>
> Does removing ethaddr env from SANDBOX_ETH_SETTINGS in sandbox.h fix
> this problem?

I was able to reproduce this, and confirmed that removing ethaddr*
envs from SANDBOX_ETH_SETTINGS in sandbox.h could fix the issue you
were seeing.

Regards,
Bin
Joe Hershberger Oct. 6, 2019, 1:05 a.m. UTC | #4
Hi Bin,

On Fri, Oct 4, 2019 at 9:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Simon,
>
> On Sat, Oct 5, 2019 at 10:16 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Hi Simon,
> >
> > On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > These warnings appear every thing sandbox is run (see below) and dwarf the
> > > actual useful output. Suppress them.
> > >
> > > Hopefully at some point a way can be found to fix the root cause.
> >
> > Does removing ethaddr env from SANDBOX_ETH_SETTINGS in sandbox.h fix
> > this problem?
>
> I was able to reproduce this, and confirmed that removing ethaddr*
> envs from SANDBOX_ETH_SETTINGS in sandbox.h could fix the issue you
> were seeing.

While that fixes the issue, it also breaks the unit tests.

> Regards,
> Bin
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Bin Meng Oct. 6, 2019, 3:12 a.m. UTC | #5
Hi Joe,

On Sun, Oct 6, 2019 at 9:05 AM Joe Hershberger <joe.hershberger@ni.com> wrote:
>
> Hi Bin,
>
> On Fri, Oct 4, 2019 at 9:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Hi Simon,
> >
> > On Sat, Oct 5, 2019 at 10:16 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > >
> > > Hi Simon,
> > >
> > > On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > These warnings appear every thing sandbox is run (see below) and dwarf the
> > > > actual useful output. Suppress them.
> > > >
> > > > Hopefully at some point a way can be found to fix the root cause.
> > >
> > > Does removing ethaddr env from SANDBOX_ETH_SETTINGS in sandbox.h fix
> > > this problem?
> >
> > I was able to reproduce this, and confirmed that removing ethaddr*
> > envs from SANDBOX_ETH_SETTINGS in sandbox.h could fix the issue you
> > were seeing.
>
> While that fixes the issue, it also breaks the unit tests.
>

Yes, it fixes sandbox with "-D" but fails with "-T".

Regards,
Bin
Joe Hershberger Oct. 6, 2019, 3:41 a.m. UTC | #6
Hi Bin,

On Sat, Oct 5, 2019 at 9:13 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Joe,
>
> On Sun, Oct 6, 2019 at 9:05 AM Joe Hershberger <joe.hershberger@ni.com> wrote:
> >
> > Hi Bin,
> >
> > On Fri, Oct 4, 2019 at 9:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> > >
> > > Hi Simon,
> > >
> > > On Sat, Oct 5, 2019 at 10:16 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > >
> > > > Hi Simon,
> > > >
> > > > On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> > > > >
> > > > > These warnings appear every thing sandbox is run (see below) and dwarf the
> > > > > actual useful output. Suppress them.
> > > > >
> > > > > Hopefully at some point a way can be found to fix the root cause.
> > > >
> > > > Does removing ethaddr env from SANDBOX_ETH_SETTINGS in sandbox.h fix
> > > > this problem?
> > >
> > > I was able to reproduce this, and confirmed that removing ethaddr*
> > > envs from SANDBOX_ETH_SETTINGS in sandbox.h could fix the issue you
> > > were seeing.
> >
> > While that fixes the issue, it also breaks the unit tests.
> >
>
> Yes, it fixes sandbox with "-D" but fails with "-T".

Maybe we can make it work for both by removing them from the header,
but then setting the needed ethaddr's in the unit tests.

-Joe

> Regards,
> Bin
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Simon Glass Oct. 14, 2019, 8:02 p.m. UTC | #7
Hi,

On Sat, 5 Oct 2019 at 20:42, Joe Hershberger <joe.hershberger@ni.com> wrote:
>
> Hi Bin,
>
> On Sat, Oct 5, 2019 at 9:13 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Hi Joe,
> >
> > On Sun, Oct 6, 2019 at 9:05 AM Joe Hershberger <joe.hershberger@ni.com> wrote:
> > >
> > > Hi Bin,
> > >
> > > On Fri, Oct 4, 2019 at 9:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > >
> > > > Hi Simon,
> > > >
> > > > On Sat, Oct 5, 2019 at 10:16 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > > >
> > > > > Hi Simon,
> > > > >
> > > > > On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> > > > > >
> > > > > > These warnings appear every thing sandbox is run (see below) and dwarf the
> > > > > > actual useful output. Suppress them.
> > > > > >
> > > > > > Hopefully at some point a way can be found to fix the root cause.
> > > > >
> > > > > Does removing ethaddr env from SANDBOX_ETH_SETTINGS in sandbox.h fix
> > > > > this problem?
> > > >
> > > > I was able to reproduce this, and confirmed that removing ethaddr*
> > > > envs from SANDBOX_ETH_SETTINGS in sandbox.h could fix the issue you
> > > > were seeing.
> > >
> > > While that fixes the issue, it also breaks the unit tests.
> > >
> >
> > Yes, it fixes sandbox with "-D" but fails with "-T".
>
> Maybe we can make it work for both by removing them from the header,
> but then setting the needed ethaddr's in the unit tests.

It looks like I can get most of the way there with this change, but I
still need to supress one warning.

Plus it breaks the tests, perhaps because the env vars are set after
net is inited.

WIll send an updated patch.

Regards,
Simon
diff mbox series

Patch

diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index 3bd98b01ad3..67a7062e9d8 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -485,6 +485,12 @@  static int eth_post_probe(struct udevice *dev)
 	struct eth_device_priv *priv = dev->uclass_priv;
 	struct eth_pdata *pdata = dev->platdata;
 	unsigned char env_enetaddr[ARP_HLEN];
+	/*
+	 * These warnings always appear on sandbox and are not useful. They have
+	 * been here for some time and the issue has not been resolved. So for
+	 * now, disable them.
+	 */
+	bool show_warnings = !IS_ENABLED(CONFIG_SANDBOX);
 
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 	struct eth_ops *ops = eth_get_ops(dev);
@@ -526,29 +532,33 @@  static int eth_post_probe(struct udevice *dev)
 	if (!is_zero_ethaddr(env_enetaddr)) {
 		if (!is_zero_ethaddr(pdata->enetaddr) &&
 		    memcmp(pdata->enetaddr, env_enetaddr, ARP_HLEN)) {
-			printf("\nWarning: %s MAC addresses don't match:\n",
-			       dev->name);
-			printf("Address in ROM is          %pM\n",
-			       pdata->enetaddr);
-			printf("Address in environment is  %pM\n",
-			       env_enetaddr);
+			if (show_warnings) {
+				printf("\nWarning: %s MAC addresses don't match:\n",
+				       dev->name);
+				printf("Address in ROM is          %pM\n",
+				       pdata->enetaddr);
+				printf("Address in environment is  %pM\n",
+				       env_enetaddr);
+			}
 		}
 
 		/* Override the ROM MAC address */
 		memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN);
 	} else if (is_valid_ethaddr(pdata->enetaddr)) {
 		eth_env_set_enetaddr_by_index("eth", dev->seq, pdata->enetaddr);
-		printf("\nWarning: %s using MAC address from ROM\n",
-		       dev->name);
+		if (show_warnings)
+			printf("\nWarning: %s using MAC address from ROM\n",
+			       dev->name);
 	} else if (is_zero_ethaddr(pdata->enetaddr) ||
 		   !is_valid_ethaddr(pdata->enetaddr)) {
 #ifdef CONFIG_NET_RANDOM_ETHADDR
 		net_random_ethaddr(pdata->enetaddr);
-		printf("\nWarning: %s (eth%d) using random MAC address - %pM\n",
-		       dev->name, dev->seq, pdata->enetaddr);
+		if (show_warnings)
+			printf("\nWarning: %s (eth%d) using random MAC address - %pM\n",
+			       dev->name, dev->seq, pdata->enetaddr);
 #else
-		printf("\nError: %s address not set.\n",
-		       dev->name);
+		if (show_warnings)
+			printf("\nError: %s address not set.\n", dev->name);
 		return -EINVAL;
 #endif
 	}