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 AA16EC433EF for ; Mon, 15 Nov 2021 14:58:08 +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 D38FA61BFB for ; Mon, 15 Nov 2021 14:58:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D38FA61BFB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.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 067C0836D9; Mon, 15 Nov 2021 15:58:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.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=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="P5G7ivyL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C2FAE836D9; Mon, 15 Nov 2021 15:58:03 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::601]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1125283458 for ; Mon, 15 Nov 2021 15:57:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cyiNtAlJ7w5tKcu1Ft2efEUYVd0WRW1MewDZooq52TO3R9X0i94EHx8lONlBntdYrEsLr4xKr2KESBXvgIQZDShQs9E58JVpIheYYESsa0bzvIDDQOe9/i2t0NrsMhT2WwWFRpaFFwDWXUd4YZlKAnS8I4AQjl6Tgn++/KXoN6GGrOkP3x/h4RuGDCWvr3loy1Xv6GCtVkbGNYip/zXqBlaqBy7JhD+LcRDReXxyXvIMDge2udbtkjfie928kbt6jPtFUpNepdKcfokV0fseJ3iFDqmdhDBy5bEVC8eb/GxeMcE+gN6M42sdcRNQfiONDDwmeu8Evq10eLIxfV7SLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FkuOoIvnje0EyYh/D7GjAYHXFL3WW7yGJU5i8KXQBC4=; b=AOPwAg/ptgzE5dmqzXIOtS+XakooVPKnv72pA+9eJY2Zy+pN+jHI1aHfOPd0txdTlhLyWjxOlMEeKKnhERSvIxX0vctku7I5b7cyHQ8dZuoN8FRKNiZ+jV9CsTeR329+ne8YtVEtdMetUucywlgJZ9XP0g4UDhpq3dp6vK99aYojwSFgeMb3nwbDK9bXkM9aTFzkKB1n2WKdp6Gtlal9QrSb7LophmloUzOlCt0Nin1lrloRCtqbPW5nl9b5Z7l1YpzV63/zwsumKc7dsZhb3fmgrspaeh8nCtsWzkE8KhMUfTpf9mWmfji8KGPXICaFBgivjHmQonCjY+3CVLCBog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=walle.cc smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FkuOoIvnje0EyYh/D7GjAYHXFL3WW7yGJU5i8KXQBC4=; b=P5G7ivyLCuFR02rwzkikoUX8N9XhLEVvLx0uLg1GP2BstjqdxIZ+dnLKJzMsUn9wTROh5JJaiX1nwJNj1BtHw+VWgLosXZcSq3AmaxYq7lT7HI5kwHquc2jslzWjm5qPJjgwPEnstkZHmvjOej4ia7BuIBh/eHisqvbg91DgNrY= Received: from SN1PR12CA0065.namprd12.prod.outlook.com (2603:10b6:802:20::36) by CO6PR02MB7793.namprd02.prod.outlook.com (2603:10b6:303:a0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Mon, 15 Nov 2021 14:57:57 +0000 Received: from SN1NAM02FT0014.eop-nam02.prod.protection.outlook.com (2603:10b6:802:20:cafe::b5) by SN1PR12CA0065.outlook.office365.com (2603:10b6:802:20::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.27 via Frontend Transport; Mon, 15 Nov 2021 14:57:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0014.mail.protection.outlook.com (10.97.4.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4690.15 via Frontend Transport; Mon, 15 Nov 2021 14:57:55 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 15 Nov 2021 06:57:54 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Mon, 15 Nov 2021 06:57:54 -0800 Envelope-to: michael@walle.cc, wd@denx.de, marex@denx.de, u-boot@lists.denx.de, grygorii.strashko@ti.com, fried.dev@gmail.com, joe.hershberger@ni.com, sjg@chromium.org, trini@konsulko.com Received: from [10.254.241.49] (port=58614) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mmdQg-0007pE-AL; Mon, 15 Nov 2021 06:57:54 -0800 Message-ID: <2a51974b-41cf-56e4-c9c9-e6b699f27f5c@xilinx.com> Date: Mon, 15 Nov 2021 15:57:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH RFC] cmd: fix net list command Content-Language: en-US To: Michael Walle , Wolfgang Denk CC: Marek Vasut , , Grygorii Strashko , Michal Simek , , , , Tom Rini References: <20211115121152.3470910-1-michael@walle.cc> <32aff992-c84b-7b71-b412-7594c2a7d20e@denx.de> <257391f0-9d69-62cc-2353-8f4fc0751d7d@denx.de> <1646331.1636986670@gemini.denx.de> From: Michal Simek In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: feb5f61e-4c08-4d5e-4196-08d9a8484ea1 X-MS-TrafficTypeDiagnostic: CO6PR02MB7793: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cRs5hoDlOZaAI3InXRsJ1IRBcoo9+1g9ICC3ErNsVfI+K9cMl7EjzlRbevPUr7GJpPDl62LoeMvUmO1qJWhuSjvlxEwdIxqWcER0OwTgGESjc2OWw/lTx0AcShdd51OQBJxmaO4WbOUpKWR8ddhMT3PY6ORkRstLd7acewHOdOVcZCV5sZplue9qiqdZXxk0B5opezrNzBFS27JldBJNfVPsmefYdaAmsiIFllb9OxgKOKOJw8MeEARFjeTLsA4jc0/fK1N0cFjiF8kzpEz0OiO9zZSooxJEh0B2ZzrqgOm2aGRCSSQIVK088hS1fo+YhxbzIJ4V7JrO1nbRf4Z6qXh3iMt6cyjSJagw5nzL33XtlKFBPoF2eGquKbTbQ5eNbARTT4At+ZM+EEbag9o+Zrv9cr5flrlhK8DB/BW7Wed0wrEInukFMUYwt54ih5LsQ7mUBfeiX2yQ97/MUBIyIeuXp6WF72qpbF1Hphl2M7T9p+RKDSOxfALII+dkm8gpkDHtIFLTw6YFzvlTP36C/dJs4Z5gZx0ejaJZnQJ6f4s6CbK7zAr34EXFU7Bp/nCWFYkcamw8nU206RBRfof8h4bEPsbXwwHCZECRCaAfCJN4kc+iqoS2bVIZTpqpFGksTFJPic5TOGPls7TpAPtEFMZtlaIUaCrEO/o4QTy43I5W5qNuLyQwOdtrl9YBMDtNahdnPqXvKp7qF46wk4F+Wc3vHlFTAScqWa6luKiMfiWKf+nPwR292zoTYEulp4zsZZRtLVYET3sJtMHruoLMLDXs6mqsALXzcijv5n9ZK4oVMATlyK77ku3pd5mHhB7p1DuhE0mJcEUzkN8B5HwB9CUp0o/lJsVBVa5IgmRGYWQ= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(36840700001)(46966006)(70206006)(31696002)(8936002)(186003)(316002)(4001150100001)(6666004)(47076005)(508600001)(8676002)(83380400001)(26005)(336012)(7636003)(110136005)(54906003)(70586007)(5660300002)(4326008)(356005)(426003)(82310400003)(44832011)(966005)(31686004)(53546011)(36906005)(36860700001)(36756003)(2616005)(2906002)(9786002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2021 14:57:55.9128 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: feb5f61e-4c08-4d5e-4196-08d9a8484ea1 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0014.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR02MB7793 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 On 11/15/21 15:52, Michael Walle wrote: > Hi, > > Am 2021-11-15 15:31, schrieb Wolfgang Denk: >> In message you wrote: >>> >>> And again you're masking the error and possible fixes by linux itself. >>> Seems like this isn't an argument. >> >> Respecting the explicit will of the user (i. e using what he >> configured in U-Boot and passed to the kernel) is not an error.  it >> is intended and documented behaviour. > > What is the will of the user in this case? It is the will of the > developer to make the board more robust. That is, if there is > for whatever reason no valid ethernet address found, then there > will be one generated. That is the sole purpose of the config > option in question (or maybe I used it completely wrong). So from > a user perspective, this shouldn't even happen and I doubt he is > even aware that there will be a random one. (I saw Tom's mail and > I'm not talking about the USB adapters where this might be the > normal case.) I might come from a different perspective, but > users ususally don't look at the serial output. Instead they > look at the kernel log. And there will be not the slightest > error, because u-boot will happily fix the missing MAC address > with a random one. > >>> Sorry, if the original intention was to make "net list" work >>> correctly, then why is there now such a huge fuzz around that >>> CONFIG_NET_RANDOM_ETHADDR config option and why can't we just >>> fix the error with "net list" and leave the behavior like it >>> was for years. >> >> Maybe you explain what exactly the ``error with "net list"'' is, > > Michal mentioned it here [1]. > >> considering the fact that it is U-Boot which determins the >> "correct" MAC address and passes it to Linux.  And if the user >> configures U-Boot such that a random MAC address is used, then this >> _is_ the correct MAC address, as normally (*) U-Boot is just a tool >> that does what the user requests. > > Only that the user doesn't do it but the board developer/OEM. I.e. > there is no valid MAC address to pass to linux. It is really just > for having netconsole running (or maybe you'll need networking for > to rescue your failed EEPROM or whatever). > > I think, we have to distiguish between two use cases here: >  (1) make networking in u-boot work "somehow", to have a last >      resort recovery, esp. required for netconsole where >      the user cannot set the mac address by hand. >  (2) normal use case, where drivers simply doesn't have any >      other source for the mac address and need to fall back >      to a random one. > > I agree, for (2) the mac address should be passed to linux. But for > (1) it shouldn't because it will just mask the error and any fall > back mechanisms in linux. > > -michael > > [1] > https://lore.kernel.org/u-boot/07b688d8-f05f-d11e-5e3e-e5454e1c9af0@xilinx.com/ As we discussed in previous thread. I think there shouldn't be a problem when u-boot passes random mac address (in whatever way) but if Linux driver know how to get correct one it should be tried first. If that pass you will get new one. If not you will use the one passed from u-boot. And it is up to board designer to decide when it is the right time. I can imagine that it can be the part of kernel driver or can be purely done in user space. Thanks, Michal