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 DC059C433EF for ; Wed, 17 Nov 2021 12:25:12 +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 BAA1561544 for ; Wed, 17 Nov 2021 12:25:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BAA1561544 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de 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 EF70582F68; Wed, 17 Nov 2021 13:25:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1637151909; bh=aVOFM56N4BVfqxWYhDyicM7YRVO+CAcooYoqosK8wOo=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IvoUuZ6z/9peGc4qh3coivpKFcJmil2RpUQvzIzh3Cn1J0zRjUlKKsc9IbQbBHXw0 /fIg+F/p4TDPO4xpONpvXc5FaJJFFvNizaAUHS2oWsBGS+7d++5HBeA1Q6PS0Sg6Sr IUUCeshWYXaEi6W5rkNHW/Fg4GKUkjrJjn8rA360fT0R3lIn1DE/Ua6aCj1mVQuPSf hELBj+THrgZFUkpiBUKNOzUE/k9mOwuobyXd+/PMk7erAVnNSYTLU28mqGPpk7rUZl DO27Uq1sI5y/HTQkH8UGDr+gK4PbT4rbfE7DIKR+401mgtyTGb4B53LkZsRCvN+8rZ tOo6/6/s/kSOA== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 0349C82A71 for ; Wed, 17 Nov 2021 13:25:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1637151906; bh=aVOFM56N4BVfqxWYhDyicM7YRVO+CAcooYoqosK8wOo=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=R7Y9ZVIuBItHW7DcMkdt69bBHFwVN3eACTLnaJ2r3RokdojPmOnPPAUk5MTrixe2f 5oSjcxVmTRc8J1nUQC0u9j6X9Mdv6ppWXNxUirccljq3NiSRZseDn1F1V2qqd5J5iq DfZ8yQa7BUqPMCHY8cXZStN3gZCdvUBZHzzbrYs4f+l+RBpu1zYGXUdsLw/6A3L33y xCApvzD+sUPuv3kNsnAfF+H2GyND7kqZZZNmnqTNe1fr7/RIcjoKzccDkx2l/GySYO k3c5178wwgo8z+BLjJLba7lK59D1gmamV3LAPsyLD95ryygicnBa0WZyWk/LEiOc6S qjm+qo8fiAoSA== Received: by janitor.denx.de (Postfix, from userid 108) id 95EDBA029A; Wed, 17 Nov 2021 13:25:05 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 6ED74A005A; Wed, 17 Nov 2021 13:24:58 +0100 (CET) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 469141E0CB7; Wed, 17 Nov 2021 13:24:58 +0100 (CET) To: Tom Rini cc: Ramon Fried , Michael Walle , Michal Simek , Grygorii Strashko , git , Joe Hershberger , Simon Glass , U-Boot Mailing List From: Wolfgang Denk Subject: Re: [PATCH] net: uclass: Save ethernet MAC address when generated MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20211117115025.GV24579@bill-the-cat> References: <5fd1c7f2-d37d-3008-06d3-877958aa9757@xilinx.com> <610dcc295f1f9f8eb609269ac5a2e0d8@walle.cc> <97cbcf456d2fa9572ef0d0c9adc7380b@walle.cc> <20211116141855.GD24579@bill-the-cat> <1739526.1637074605@gemini.denx.de> <20211116184146.GF24579@bill-the-cat> <1797888.1637135092@gemini.denx.de> <20211117115025.GV24579@bill-the-cat> Comments: In-reply-to Tom Rini message dated "Wed, 17 Nov 2021 06:50:25 -0500." Date: Wed, 17 Nov 2021 13:24:58 +0100 Message-ID: <1820750.1637151898@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 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 Dear Tom, In message <20211117115025.GV24579@bill-the-cat> you wrote: > > > If the MAC address is not placed in the environment, then how can a > > user query the currently used MAC address? All documentation says > > basically: run "printenv ethaddr". > > Update the documentation and say to use "net list" or read the previous > part of console log that says we're using a random mac in this case? > The more I look here the more I see we're changing part of the API with > the OS, and it's not something that should be done without consulting > the consumers too. Well... "printenv ethaddr" has been here ever since U-Boot (or PPCBoot, as it was still called at that time) got network support. i. e. more than 21 years ago. "net list: has only been added very recently, just 5 months ago in commit 8a3987f47 "cmd: net: add a 'net list' command to list network devs". I bet that an overwhelming majority of users would use "printenv ethaddr" when asked to check the MAC address of a system. > Next, pulling up > https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ethernet-c= > ontroller.yaml > there's two important things. First, there's no way to flag "this is a > random MAC, do not use" (if after all, that's what the user wants, such > as in Michael's case). And second, yes we probably ought to have > enforced "mac-address" being the random one we had been using, all > along. Why would you expect any "do not use" note? Locally adminitered MAC addresses (even when randomly chosen) have been created for good reason, so they should be usable. > So no, in sum, I'm not convinced that the best path forward right here > and now is to put the random MAC in the environment, not correct the now > incorrect help text and not even poke the binding maintainer nor > relevant lists to see how exactly they think it would be best to handle > a locally administered MAC being used as there are both valid use cases > for "use this in the kernel" and "disregard this in the kernel". I'm afraid I do not understand what exactly you are proposing here? But I object to using a MAC address in U-Boot in a way that makes it invisible to the user who uses documented APIs ("printenv ethaddr"). If we use some MAC address, it shall be possible to read it using "printenv ethaddr" and to set it using "setenv ethaddr". Anything else is inconsistent crap. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Success in marriage is not so much finding the right person as it is being the right person.