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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 515F5C433F5 for ; Mon, 10 Jan 2022 14:04:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37731830DC; Mon, 10 Jan 2022 15:04:01 +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="L0HZZMu6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63FE0830D6; Mon, 10 Jan 2022 15:04:00 +0100 (CET) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 0857D830DC for ; Mon, 10 Jan 2022 15:03: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=trini@konsulko.com Received: by mail-qt1-x836.google.com with SMTP id f17so11978762qtf.8 for ; Mon, 10 Jan 2022 06:03:55 -0800 (PST) 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=0ZIc4sruS2S+hHRaKms7hdrRSu4BKbqchLwUX+p+SbM=; b=L0HZZMu6llsMApDPCdcih3DfP1gMT7T0ltKCfvI8RVVJz2R0XEVDLDL++U1iP2Eu39 Z2wnJb+rPy6wLDdH6P5bPN+gQMQ184QMQG/h9FgambZS7hzFdyG4FmaBE8joM18i/eaj MO/cSA06/CZKaUQx9FUxPNQUimbKDXJYNzyro= 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=0ZIc4sruS2S+hHRaKms7hdrRSu4BKbqchLwUX+p+SbM=; b=kiyS5WsETlBvHN/HGVcI7TjWHi6d7eAhZWwKhULIybNHiroc96hczdDGHprnQ503fd +cfGyAlQREKJDIRGSc7ieVrVYdVsLTnG84p2QuUUxvbKB+FFRDFjlE3FkYvhUfb7ay3M VFlDtdCVdH0t6IAweg/NA8UHRvtsgt258GPnk2owfXTQOv1da7EKfVscRN88iSHq3I9s I2IAYQKTb2l1ILE+wn9LxR8sOsHvo2RAmG0RzJiBQdEdE8ItQXNorVUliiF/aA1hpURJ V64YZSylQNLbpg+xuT2c+lctDeGHks7CATyvVu3pvJKtj5CoTZwj3Bq6TWYkbxOSam54 MyPw== X-Gm-Message-State: AOAM531G2PvDKGSuL7ozj9YYyL1XDUJJxVG43xF+/MIktvGTvutvwdkR gZRAK05lWTilpJDA2dXxW5kBMg== X-Google-Smtp-Source: ABdhPJwirRvMMlHP10uqBBx5JagdJ2nhxRf0DWcsrJl2D3cwBHidSSZFUBJY6b6OlXb270djNYrPew== X-Received: by 2002:ac8:570b:: with SMTP id 11mr67227691qtw.128.1641823434765; Mon, 10 Jan 2022 06:03:54 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-a8d5-21a7-f276-3a4f.res6.spectrum.com. [2603:6081:7b01:cbda:a8d5:21a7:f276:3a4f]) by smtp.gmail.com with ESMTPSA id h7sm1485116qkb.109.2022.01.10.06.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 06:03:54 -0800 (PST) Date: Mon, 10 Jan 2022 09:03:52 -0500 From: Tom Rini To: Michal Simek Cc: Ramon Fried , Michal Simek , U-Boot Mailing List , Wolfgang Denk Subject: Re: [PATCHv3] net: uclass: Save generated ethernet MAC addresses to the environment Message-ID: <20220110140352.GO2773246@bill-the-cat> References: <20211122134548.3310678-1-trini@konsulko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DBuGsi2uG0e/X7y+" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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 --DBuGsi2uG0e/X7y+ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 07, 2022 at 04:08:34PM +0100, Michal Simek wrote: > so 27. 11. 2021 v 20:37 odes=EDlatel Ramon Fried n= apsal: > > > > On Mon, Nov 22, 2021 at 3:45 PM Tom Rini wrote: > > > > > > From: Michal Simek > > > > > > When a MAC address is randomly generated we currently only update the > > > appropriate data structure. For consistency and to re-align with > > > historic usage, it should be also saved to the appropriate environment > > > variable as well. > > > > > > Cc: Wolfgang Denk > > > Signed-off-by: Michal Simek > > > Reviewed-by: Ramon Fried > > > [trini: Update Kconfig, handle legacy networking case as well] > > > Signed-off-by: Tom Rini > > > --- > > > Changes in v3: > > > - Update Kconfig help text with Wolfgang's suggestion > > > - Reword the commit message to hopefully be clearer > > > > > > Changes in v2: > > > - Update Kconfig help text to reflect this change. > > > - Update the legacy path to match. > > > --- > > > net/Kconfig | 9 +++++---- > > > net/eth-uclass.c | 2 ++ > > > net/eth_legacy.c | 2 ++ > > > 3 files changed, 9 insertions(+), 4 deletions(-) > > > > > > diff --git a/net/Kconfig b/net/Kconfig > > > index 7a2d14501881..cabe93c6bd29 100644 > > > --- a/net/Kconfig > > > +++ b/net/Kconfig > > > @@ -27,10 +27,11 @@ config BOOTP_SEND_HOSTNAME > > > 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 wi= ll > > > - not be added to the environment. > > > + Selecting this will allow the Ethernet interface to functio= n even > > > + when the ethaddr variable for that interface is unset. In = this case, > > > + a random MAC address in the locally administered address sp= ace is > > > + generated. It will be saved to the appropriate environment = variable, > > > + too. > > > > > > config NETCONSOLE > > > bool "NetConsole support" > > > 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 *dev) > > > net_random_ethaddr(pdata->enetaddr); > > > printf("\nWarning: %s (eth%d) using random MAC addres= s - %pM\n", > > > dev->name, dev_seq(dev), pdata->enetaddr); > > > + eth_env_set_enetaddr_by_index("eth", dev_seq(dev), > > > + pdata->enetaddr); > > > #else > > > printf("\nError: %s address not set.\n", > > > dev->name); > > > diff --git a/net/eth_legacy.c b/net/eth_legacy.c > > > index f383ccce0b92..e7f53b958b2e 100644 > > > --- a/net/eth_legacy.c > > > +++ b/net/eth_legacy.c > > > @@ -164,6 +164,8 @@ int eth_write_hwaddr(struct eth_device *dev, cons= t char *base_name, > > > net_random_ethaddr(dev->enetaddr); > > > printf("\nWarning: %s (eth%d) using random MAC addres= s - %pM\n", > > > dev->name, eth_number, dev->enetaddr); > > > + eth_env_set_enetaddr_by_index("eth", dev_seq(dev), > > > + pdata->enetaddr); > > > #else > > > printf("\nError: %s address not set.\n", > > > dev->name); > > > -- > > > 2.25.1 > > > > > Acked-by: Ramon Fried >=20 > Ramon/Tom: Did anybody take this patch? Or you want me to take it? I don't think I picked it up, and I'm fine with it coming via your tree. --=20 Tom --DBuGsi2uG0e/X7y+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmHcPMcACgkQFHw5/5Y0 tyyxMwwApXr23NBVV2+U4gMQ0GMZlMkxo5KugCBwwMwCRN3ZhCdaMe5q/NozgRnc jTXhPV8kwSANjSs0y0xcxVwZAbh0QKL6agyowExi73zsFfAmha4p0wtcF5zaciq2 KxB3FEQSHbWyjaqAnOYv5OdkL0coG9tbqiswvo/GaFqHW6RLe9/Sz9MqeMBt1z1x eh4s4k3jStpDNoCfrwE8lemzD41iBqqhxtIv6lt5i9Z81cFqbbhx9qE+16HoXbZC WfV7+APFrBCTvoF8gTEmaAII5VoRpEXuRBeT3XmZFkaW+vco+e3yPC/2zWoFhZPX eiuri61DTQjJlyV9vXjGWzA5VZXRuy9Yg+nEuLSkyzaSavdsrF6qMImhRSj0SeVZ RpNxeokEflzAbZ1LdEPu6+oPDOBKfN+6XR+UI0PeNUHu2MmY+5cmM0sQ6a1kRS+d S8Rgf6jwmUsllhAUd41obZI8qwASao20QPDwDbvb4rZnhk2OsG581fyPTL1N4z32 TP9GSiWF =HnpU -----END PGP SIGNATURE----- --DBuGsi2uG0e/X7y+--