From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87CB4C433EF for ; Thu, 4 Nov 2021 11:37:58 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D4472611EF for ; Thu, 4 Nov 2021 11:37:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D4472611EF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 167448367E; Thu, 4 Nov 2021 12:37:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="IlowE8K+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2BA448367E; Thu, 4 Nov 2021 12:37:55 +0100 (CET) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 603C483305 for ; Thu, 4 Nov 2021 12:37:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x731.google.com with SMTP id r8so5307784qkp.4 for ; Thu, 04 Nov 2021 04:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+9S4XhFX59jpb13kuENOqIHya6CMZlql5KHTYa53noM=; b=IlowE8K+qmL8mI2DfukRP9rThwzt8MHX/IugpY9NAiVYE0H6IpuITy40meIqVouSWy zAGowao/BRoaIgv9XaoAOAm9fvLlVlIvZ3htrP7AwtWCSm2lsmw5uOQkgS4lmyUJq7Z5 AjvU1iFWy/DtCMycSjw+2XyqCxxhHhVaBOEkI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+9S4XhFX59jpb13kuENOqIHya6CMZlql5KHTYa53noM=; b=jUesgzwL2OM7/V1fykf2sgLRjVhx+XrD5jfO29v058mCxd04Z+RKboXyZBYD21iYcZ bwYpH7u4/3sep5Zqg4YZhPAQXjjATI5MMkkNGy+W797F0hS7Yuw/VE9bxyG8aGZHuyUv KDsUgIx27FKiqvmLv+IZenxDYnt2MnHlT4Ug61oQsiRzaS//RvKjRsd8/8vJ+sVp5rXN 0BJaykBo59B21p7RhXId3/dHP9r/pamJYT1MYpVQ7T7+RjGL1L/VnbGrXHKVF9WeQ4Rh wWcPrAq/JMzm7Fgotm0hFZsyfuwoyALEnEEefaVH4Qcp7fBfUZsT/Doruyu5AFW9KbPb q/LQ== X-Gm-Message-State: AOAM532nMa391OBtt7Lb6fPJskS1gEl2dH4sZ82kszfNmLvLSgbFjXkm qXRIP2+x4IHaf3DWOj31tOTXww== X-Google-Smtp-Source: ABdhPJzQjX4MDhXWa5DLvMnIkAtbhANdmg1Kx1IofPDE2Khyw3U8zC8Vwdq7IPt+hpSAv73rkh5nOw== X-Received: by 2002:a05:620a:200f:: with SMTP id c15mr216575qka.231.1636025869941; Thu, 04 Nov 2021 04:37:49 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-e134-a4dd-2b9a-4388.res6.spectrum.com. [2603:6081:7b01:cbda:e134:a4dd:2b9a:4388]) by smtp.gmail.com with ESMTPSA id l15sm3724064qtk.41.2021.11.04.04.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 04:37:49 -0700 (PDT) Date: Thu, 4 Nov 2021 07:37:47 -0400 From: Tom Rini To: Michal Simek Cc: Michael Walle , rfried.dev@gmail.com, git@xilinx.com, joe.hershberger@ni.com, sjg@chromium.org, u-boot@lists.denx.de Subject: Re: [PATCH] net: uclass: Save ethernet MAC address when generated Message-ID: <20211104113747.GI24579@bill-the-cat> References: <20211102090015.2395446-1-michael@walle.cc> <20211103165712.GF24579@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LCsrN3C/VUY/ZfAq" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --LCsrN3C/VUY/ZfAq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 04, 2021 at 12:18:46PM +0100, Michal Simek wrote: >=20 >=20 > On 11/3/21 17:57, Tom Rini wrote: > > On Tue, Nov 02, 2021 at 11:27:22AM +0100, Michal Simek wrote: > > >=20 > > >=20 > > > On 11/2/21 10:00, Michael Walle wrote: > > > > > On Fri, Oct 29, 2021 at 2:14 PM Michal Simek wrote: > > > > > >=20 > > > > > > When MAC address is randomly generated it should be also saved = to > > > > > > variables. This step is there when MAC address is passed via pd= ata but not > > > > > > when it is randomly generated. > > > > > >=20 > > > > > > Signed-off-by: Michal Simek > > > > > > --- > > > > > >=20 > > > > > > net/eth-uclass.c | 2 ++ > > > > > > 1 file changed, 2 insertions(+) > > > > > >=20 > > > > > > diff --git a/net/eth-uclass.c b/net/eth-uclass.c > > > > > > index 0da0e85be031..58c308f33276 100644 > > > > > > --- a/net/eth-uclass.c > > > > > > +++ b/net/eth-uclass.c > > > > > > @@ -583,6 +583,8 @@ static int eth_post_probe(struct udevice *d= ev) > > > > > > net_random_ethaddr(pdata->enetaddr); > > > > > > printf("\nWarning: %s (eth%d) using random MA= C address - %pM\n", > > > > > > dev->name, dev_seq(dev), pdata->enetad= dr); > > > > > > + eth_env_set_enetaddr_by_index("eth", dev_seq(de= v), > > > > > > + pdata->enetaddr); > > > > > > #else > > > > > > printf("\nError: %s address not set.\n", > > > > > > dev->name); > > > > > > -- > > > > > > 2.33.1 > > > > > >=20 > > > > > Reviewed-by: Ramon Fried > > > >=20 > > > > Please note, that this will change behavior. Before this commit, the > > > > random mac address was local to u-boot (at least for most network d= rivers). > > > > After this commit, it will also be communicated to linux. > > > >=20 > > > > I'm not sure what to think of this. At the very least, this should = be > > > > documented in the commit message and in the Kconfig help text. > > >=20 > > > Thanks for bringing this up. I have no issue that this address is bei= ng > > > propagated to Linux but others can feel this as an issue. > > > I can definitely extend commit message to say it. > > >=20 > > > I found this via net list command where you can see controllers but y= ou > > > can't see their mac addresses which is IMHO wrong. > >=20 > > So, this causes dhcp to simply timeout for me on a pine64_plus board > > (where yes, I believe we do end up using a random MAC) when running the > > pytest suite. I wonder if this particular change messes up the state > > machine? Checking the dnsmasq logs it looks like U-Boot keeps asking > > and getting a reply, over and over. >=20 > It is just saving that values to variables. If you want to propagete that > values in the stack that's up to your system configuration. >=20 > What state machine are you talking about? I was just making a guess about state machine, given what I had recalled of the network stack before. To be clearer, I bisected down my failure of 3 tests that run "setenv autoload no ; dhcp" and then dhcp timing out, to this commit (in the network PR). --=20 Tom --LCsrN3C/VUY/ZfAq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGDxgcACgkQFHw5/5Y0 tyxftQwAs1J2sFbdjpZSUH6sfF7sL0nexWpfTm3eyWq0JMu2vHixFvcUfNEZAnrL kmfOffiQ5RnHl7cRafcai7JKnz3wmFFd3HGr2uiGOywWRFoNmaKsqz/3tpTQFIcK ARPmZ1Omt5iGT4vXjY3+oFFkdPResQAO6gPOT1mhvshl1Oe+tPd3gigEykvYIgy6 77+UuIWmcgk4i9r/JnLYs6t/B8Yer4GW6QEcCDctyld1nERXZGlgy1riyw11OJ9v sGQszDY9ShYKAhuH4ZNT76meNK4iDtF7Jk84IE21Kl/WYgArQP3PmzUE4Nod6B0l ixWkXRgSQ3n2Cq1knr+4utx2LDV1E1iBNUmVi/j3zb9dfqzW+5BVF6ApeumaHdqt lCWICMYVcaj2qUYYDqhJzGPlJRtHWAzoJpGdNhdIUWh/kEWP8pGPkhVBdrMS4EDE Peovkz2+R2ezUA/pclgh8G5TQd9twl6aYubVA37CY5LcZykUMm8eOV542FH9T8Hp u0tjurQX =wUbz -----END PGP SIGNATURE----- --LCsrN3C/VUY/ZfAq--