Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2397033rdg; Mon, 16 Oct 2023 03:16:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFx2SdBk+MkP2DC/d70PFla6Qz9KxDW2AvE1RPkuwF70nWVkrwPHsTHM4ITdJ0UZMSJXqot X-Received: by 2002:a05:6358:24aa:b0:13f:2833:bf41 with SMTP id m42-20020a05635824aa00b0013f2833bf41mr35319618rwc.23.1697451381786; Mon, 16 Oct 2023 03:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697451381; cv=none; d=google.com; s=arc-20160816; b=KASOlPZxufbGBcvA5IvvsLtHks5VIOn2kjPmipJ5gX7TNp3I/w5AtfigZ+8BPkMIlX FcSM0Qr3ccKcBNo1XjZjwjzJVWaEjFvOKEIz6MzKE2kvEH9xNpB0ggZ2jtK05SOqLG6r VJCSIgFCgRmGz8av2l345Y0XBpYCyk81NpgsgztT3OGjRtMVWsR1fXFyn9Fgo/CBFV4i NWF0976hbjLcekxjmRC5lWNakEgRyaXsv+cP8zIY67XLG0lxiBkVd9wfJKOXjB9EUPxd Xx5nvjclbOcKfXo0GCiBnept+soOVX3H3DDcMK3PQ5MDzRojsD2oeFJHtOlDmu92j7cX i9Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3CDALhGm3i1PJ9jhn5rXgWop6RzlcpY4kUfxNWLFsNk=; fh=KOk8ism6ibdzPm2slurkjhcldHs0wN5kp3Jp3kQhiJU=; b=bTLhiF5Wi7jemulXl7vxvM987ZFlNOKZJVCmfowhBJcLDhXrOiXrRrYc07TArr+V5B UGr7ILxTuOWGvPi7EOL+HoD5RaeSWjCoUG+xD8GJ5SL4QLggImdn7nU2oNhq4ZYMP1ep /Upw4/08Eji+MJWtIKLXAtJRw1VHCZwjjLPMDfIB2oXte+C4pPA/952X5lIWPbAtQYBu JsNqvo6xael3dM6X3+icrf4dDdXo9dujBtUzOxvNs5TvBEuJgZRfA1y3+xisE1Ur9GsV HQBzcepilORrWxstdWJwF1ech4RNfSn+12CERnAznwx/MWlTybnx3jVX4as4GbP+8A4I x4jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aDt6GKHy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u15-20020a056a00098f00b006b59f4771c5si6582334pfg.277.2023.10.16.03.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:16:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aDt6GKHy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 71F1C8075B12; Mon, 16 Oct 2023 03:15:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbjJPKPT (ORCPT + 99 others); Mon, 16 Oct 2023 06:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbjJPKPQ (ORCPT ); Mon, 16 Oct 2023 06:15:16 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5943B83; Mon, 16 Oct 2023 03:15:15 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-53d9b94731aso7686359a12.1; Mon, 16 Oct 2023 03:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697451314; x=1698056114; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3CDALhGm3i1PJ9jhn5rXgWop6RzlcpY4kUfxNWLFsNk=; b=aDt6GKHywlXN2KE7hm82hQtYBGfiWzM/osYAmiMWjDL74HMSd8RuHzjyl6uAhCvGzr SeN7z/VnycG311EpuCDz7yNM9rkVZKxkmbYfP11PgP2x0sRt9RK6/aA5NTsCz3VpkXAp NB71O7wed/Z9IYd2U6DoGe81Y9ZqoaSVTC6zkXxpxrw9XLPQdxL/Q/l8m/mZ1tYamY0V QVu0w5AcGHinasXPmZU1MK6V30n8ljFm6FL/IvKbWJn6ViyQ4fsndAwpWcKbx50/cNZ3 f8/RTdF4tzQUjSCrh6kDtHg28KHqOXQ0ihhJdlesOrtlQ5qkSxQAIaga55x6fDlugZHT lPfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697451314; x=1698056114; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3CDALhGm3i1PJ9jhn5rXgWop6RzlcpY4kUfxNWLFsNk=; b=jgffc5uv+gOJ3Lh3Sx8O0BbJ568fix2i+Fcgd/mSIFPgy1jzwZRgrwvxC2aD1+Bl/n 1GGr2y4ETSTAbzKps2GMGOl1d/LrVMDfS9djpkEeXHoku/Kmx2BWoyUIbprPBYPBJBCP SBoMS5ZSQVpNAU0QGOMzlzbsa0/oeL1dRqfbSeiwivT1w29tVziz7it/4mMxeAofXIkv eTsZfpQh1FvFRggbOO1nxcdDItoOUAMxTGfbH8djkGUaeVForN29c/xcnuuRMAO19GvX C75lQInV7yXJH5JIPBDFK8fC+AHA7aH93opvPNXWhrXQMmmOq+gtz69KZ33PBdt2hyyK u+jA== X-Gm-Message-State: AOJu0YzQqn2CGwHeXz88MvXpTc7EazXUygyJ7BoSL2BE1cLaFJm88OmJ p9sOG44HmdthVW2wdzFEvXs= X-Received: by 2002:a17:907:1c26:b0:9bf:5df1:38cc with SMTP id nc38-20020a1709071c2600b009bf5df138ccmr4432885ejc.4.1697451313430; Mon, 16 Oct 2023 03:15:13 -0700 (PDT) Received: from skbuf ([188.26.57.160]) by smtp.gmail.com with ESMTPSA id jx17-20020a170907761100b009ad875d12d7sm3744594ejc.210.2023.10.16.03.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:15:13 -0700 (PDT) Date: Mon, 16 Oct 2023 13:15:10 +0300 From: Vladimir Oltean To: Florian Fainelli Cc: Oleksij Rempel , "David S. Miller" , Andrew Lunn , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v3 2/7] net: dsa: microchip: Set unique MAC at startup for WoL support Message-ID: <20231016101510.a6t3nbcelcnsdf53@skbuf> References: <20231013122405.3745475-1-o.rempel@pengutronix.de> <20231013122405.3745475-3-o.rempel@pengutronix.de> <20231013123249.bhigwsezy6afb5qt@skbuf> <188688f2-1028-41ee-ba0a-c52456f63111@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <188688f2-1028-41ee-ba0a-c52456f63111@gmail.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:15:36 -0700 (PDT) On Sun, Oct 15, 2023 at 02:18:43PM -0700, Florian Fainelli wrote: > > > On 10/13/2023 5:32 AM, Vladimir Oltean wrote: > > On Fri, Oct 13, 2023 at 02:24:00PM +0200, Oleksij Rempel wrote: > > > Set a unique global MAC address for each switch on the network at system > > > startup by syncing the switch's global MAC address with the Ethernet > > > address of the DSA master interface. This is crucial for supporting > > > Wake-on-LAN (WoL) functionality, as it requires a unique address for > > > each switch. > > > > > > Although the operation is performed only at system start and won't sync > > > if the master Ethernet address changes dynamically, it lays the > > > groundwork for WoL support by ensuring a unique MAC address for each > > > switch. > > > > > > Signed-off-by: Oleksij Rempel > > > --- > > > > Why not take the MAC address of the user port at ksz9477_set_wol() time, > > and use the existing ksz_switch_macaddr_get() API that was just added so > > that this use case could work? > > Agreed we do that in a number of Ethernet MAC and PHY drivers FWIW > (net_device::dev_addr). > -- > Florian To be clear (to Oleksij), the request is for WoL to use the same runtime management of the global MAC address (ksz_switch_macaddr_get) as HSR, and also extend ksz_port_set_mac_address() to deny address changes to a port with WoL active. Thus, multiple user ports could have WoL enabled as long as they share the same MAC address. MAC address changes are also possible while WoL is not enabled. I guess wol->supported should only get set on those user ports which have the same MAC address as the global MAC address (if a global MAC address is configured), or on all user ports (if there is none).