From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 18 Oct 2018 19:43:44 -0600 Subject: [U-Boot] Errors when starting sandbox In-Reply-To: References: Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Joe, On 1 October 2018 at 16:01, Joe Hershberger wrote: > > On Mon, Oct 1, 2018 at 4:27 PM, Simon Glass wrote: > > Hi Joe, > > > > On 1 October 2018 at 15:14, Joe Hershberger wrote: > >> > >> Hi Simon, > >> > >> On Mon, Oct 1, 2018 at 12:32 PM, Simon Glass wrote: > >> > Hi Joe, > >> > > >> > When I start sandbox now I see these errors every time. It is possible > >> > to fix this? > >> > > >> > $ u-boot -D > >> > ... > >> > Warning: host_lo MAC addresses don't match: > >> > Address in ROM is ea:06:97:67:f4:b6 > >> > Address in environment is 00:00:11:22:33:44 > >> > > >> > Warning: host_eth0 MAC addresses don't match: > >> > Address in ROM is ea:06:97:67:f4:b6 > >> > Address in environment is 00:00:11:22:33:45 > >> > > >> > Warning: host_enp0s31f6 using MAC address from ROM > >> > > >> > Warning: host_eth6 MAC addresses don't match: > >> > Address in ROM is ea:06:97:67:f4:b6 > >> > Address in environment is 00:00:11:22:33:46 > >> > > >> > Warning: host_docker_gwbridge using MAC address from ROM > >> > > >> > Warning: host_docker0 MAC addresses don't match: > >> > Address in ROM is ca:07:52:28:25:66 > >> > Address in environment is 00:00:11:22:33:47 > >> > > >> > Warning: host_veth1f6bcd2 using MAC address from ROM > >> > >> These are warnings based on commit b96ced9cdb6 (sandbox: eth-raw: Make > >> random MAC addresses available to eth-raw). Because we don't know the > >> number of interfaces that exist on the given host when we write the > >> sandbox.dts, we override the MAC addresses with random ones. In the > >> normal case (real hardware), we would warn, since the hardware should > >> know its interfaces. > >> > >> Do you have a proposed different approach? I don't like the idea of > >> adding sandbox checks in the core code that prints this warning, and > >> it also doesn't seem like a great idea to add a hook that doesn't warn > >> just for sandbox. > >> > >> I'm happy to work on this, but I didn't address it at the time because > >> I didn't see a clear way to do it that didn't degrade the code in > >> order to remove warnings in sandbox. > > > > Can we make it so that the addresses do actually match in sandbox? > > The issue is that the eth(N)?addr lives in the default env and the > interfaces are discovered by drivers/net/sandbox-raw-bus.c. Currently > we make sure we don't "run out" of addresses defined in the env by > using a randomly generated one instead. Unfortunately, the env is > shared with all modes of sandbox, so while the addresses are not > shared when running sandbox.dts, they are required when running > test.dts. > > Thoughts? > How about a device-tree property that is only present in the test DT, to control the behaviour? Regards, Simon