Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2706956rdb; Tue, 12 Sep 2023 09:38:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOJi/v7mA3z9hRbnhhWXeEbO2Kw3eH2A3cj7oTmO+HBqjfi+rBLwUF5dNcoJMU/WEEyF/D X-Received: by 2002:a05:6a20:9390:b0:13f:b028:7892 with SMTP id x16-20020a056a20939000b0013fb0287892mr15016864pzh.2.1694536707419; Tue, 12 Sep 2023 09:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694536707; cv=none; d=google.com; s=arc-20160816; b=nVWUcKZC3IpRFYcETLZe2V2zZYvG5+V3OjbuMsMHU+BKuaEHZGK2LqVxTDcZ6ynobF 0plPkj17TTMRmY9BkcCNGXneHTqKWuOrjThH9P7mGctObe+l25pDgcBqPvdmOvYijRH7 X//qGjBgiXuxF5bsNr0HVhedS3JodTFDHoy7byW8i1P2JepqA2YT5leq8Dn2QJ/QmC5K vs6Ip8y+hVBy2TtLYW0Y2jxOoAKDlCMBwmE7xeJJCsWhQEMvaXOWKmX/9jtof6JBG0z5 RKBHLIj4wKt/reRrXTWQw94Y2FEHuDWCjYbBxE7gQFM/MyqqOB6AkBD3UuEc3xIi6Whu 28Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:organization:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=kAO8rV3vrUUn8vnr/0rLlGCFof1rPKUtl5QB+NrrSuI=; fh=2g2uXMCOVfyTah6PvJw/uZI8OKc4sTapjnhODp9WhEw=; b=Y9FpFFTnnPzvr7mDfrNePzjEiLVksolJSphrRFwQLCHR+j/FHDHwLi5BOamO1UkSvR wMTMGX8rlMlpnZnUIw3z9/EEUgiHDXL+W4fcA7lRUO+SYBN/MKKrWctfLLg/EVVJh+DS w4T04hmsq7rj4BEJoKX398Eo+mdQvlI9nc2NcpiNrC723b9STVvvftV9DO1v10YpFOz2 l397lJfxW0ovRHRNwsw0iKSX6KjmcUOkNLUD32HTDHwh+sgNbybVoOHQhFqd9F3xBt6Q t2W16HXm/GcH8oGWFssLiOMRaYsxrDdQ1ojGPbTukfURy1uB/jFcyn5l1eSk+5/6og4D rMzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=CBmPjljg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q136-20020a632a8e000000b00573f99f3d6esi8439214pgq.655.2023.09.12.09.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 09:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=CBmPjljg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 47CE080C77B2; Tue, 12 Sep 2023 08:07:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236194AbjILPHG (ORCPT + 99 others); Tue, 12 Sep 2023 11:07:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236181AbjILPHE (ORCPT ); Tue, 12 Sep 2023 11:07:04 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94BA7CC3; Tue, 12 Sep 2023 08:07:00 -0700 (PDT) Received: from wsk (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 416AB86EF6; Tue, 12 Sep 2023 17:06:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1694531208; bh=kAO8rV3vrUUn8vnr/0rLlGCFof1rPKUtl5QB+NrrSuI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CBmPjljgvxQYrvCjsqWXm9BVcPi9OqZi04b4AdwshjFpI70YFmUABYJ6y77Ml10DI j56B6u/G0WfGoOWOGvxBZI6UbeQTOI7Q7dhykf/BMSmRl1C4Tk/wl2iBWq9Ez22L2g NBjUTijiAwxMX0pggZktBTf8A6D/9889Ko5M9XO67ZJ1P5KXw58eVwLNF8dJUGceVd Xz/1dV4/JPeDfFng942dfvw6R6CHzL0JxniVQx6KiGF3s4cBRmB/jbE92iLtIg8dMn vB/NtuNKkmvfrrWxGgRAJUCPZmjkxlmJ9X+Es/12ccfM+0tgfj14id156SPwtOJJe1 Q+Oy1VFD482lA== Date: Tue, 12 Sep 2023 17:06:41 +0200 From: Lukasz Majewski To: Vladimir Oltean Cc: Tristram.Ha@microchip.com, Eric Dumazet , Andrew Lunn , davem@davemloft.net, Woojung Huh , Oleksij Rempel , Florian Fainelli , Jakub Kicinski , Paolo Abeni , UNGLinuxDriver@microchip.com, Oleksij Rempel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [[RFC PATCH v4 net-next] 0/2] net: dsa: hsr: Enable HSR HW offloading for KSZ9477 Message-ID: <20230912170641.5bfc3cfe@wsk> In-Reply-To: <20230912142644.u4sdkveei3e5hwaf@skbuf> References: <20230911160501.5vc4nttz6fnww56h@skbuf> <20230912101748.0ca4eec8@wsk> <20230912092909.4yj4b2b4xrhzdztu@skbuf> <20230906152801.921664-1-lukma@denx.de> <20230911165848.0741c03c@wsk> <20230911160501.5vc4nttz6fnww56h@skbuf> <20230912101748.0ca4eec8@wsk> <20230912092909.4yj4b2b4xrhzdztu@skbuf> <20230912160326.188e1d13@wsk> <20230912160326.188e1d13@wsk> <20230912142644.u4sdkveei3e5hwaf@skbuf> Organization: denx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/XGZYAjXanzDzdalXDjH+rp9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 08:07:29 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 fry.vger.email --Sig_/XGZYAjXanzDzdalXDjH+rp9 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Vladimir, > On Tue, Sep 12, 2023 at 04:03:26PM +0200, Lukasz Majewski wrote: > > > In any case, as long as it's the DSA master's address that we > > > program to hardware, then I see it as inevitable to add a new > > > struct dsa_switch_ops :: master_addr_change() function =20 > >=20 > > Please correct my understanding. The above change would affect the > > whole DSA subsystem. It would require to have the core DSA modified > > and would affect its operation? =20 >=20 > Uhm, yes, that would be the idea. If we were going to track changes to > the DSA master's MAC address, we should do it from the DSA framework > which has the existing netdev notifier listener infrastructure in > place. >=20 > > > Or you can argue that dragging the DSA master into the discussion > > > about how we should program REG_SW_MAC_ADDR_0 is a complication. =20 > >=20 > > Yes, it is IMHO the complication. =20 >=20 > Ok, it's a point of view. >=20 > > git grep -n "REG_SW_MAC_ADDR_0" > > drivers/net/dsa/microchip/ksz8795_reg.h:326:#define > > REG_SW_MAC_ADDR_0 0x68=20 > > drivers/net/dsa/microchip/ksz9477.c:1194: > > ksz_write8(dev, REG_SW_MAC_ADDR_0 + i, > >=20 > > drivers/net/dsa/microchip/ksz9477_reg.h:169:#define > > REG_SW_MAC_ADDR_0 0x0302 > >=20 > > In the current net-next the REG_SW_MAC_ADDR_0 is altered used (the > > only usage are now with mine patches on ksz9477). > >=20 > > To sum up: > >=20 > > 1. Up till now in (net-next) REG_SW_MAC_ADDR_0 is ONLY declared for > > Microchip switches. No risk for access - other than HSR patches. =20 >=20 > I know (except for Oleksij's WoL patches, which will eventually be > resubmitted). Are we debating about some possible impact on patches which were posted and (in a near future?) would be reposted? >=20 > > 2. The MAC address alteration of DSA master and propagation to > > slaves is a generic DSA bug. =20 >=20 > Which can be/will be fixed. The diff I've included in the question to > Jakub closes it, in fact. Ok. >=20 > > Considering the above - the HSR implementation is safe (to the > > extend to the whole DSA subsystem current operation). Am I correct? > > =20 >=20 > If we exclude the aforementioned bug (which won't be a bug forever), > there still exists the case where the MAC address of a DSA user port > can be changed. The HSR driver has a NETDEV_CHANGEADDR handler for > this as well, and updates its own MAC address to follow the port. If > that is allowed to happen after the offload, currently it will break > the offload. But then we can have struct ksz_device extended with bitmask - hw_mac_addr_ports, which could be set to ports (WoL or HSR) when REG_MAC_ADDR_0 is written. If WoL would like to alter it after it was written by HSR, then the error is presented (printed) to the user and we return. The same would be with HSR altering the WoL's MAC in-device setup. The HSR or WoL can be added without issues (the first one which is accepted). Then the second feature would need to implement this check. Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/XGZYAjXanzDzdalXDjH+rp9 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmUAfoIACgkQAR8vZIA0 zr3OWQf+OU0d++AGcr9DO/5c9XDot4JfUCMuN2rGlna5MYir6nOvPMSXVLboFqEG BejwbfiWa7o1OVVXvnbvNN1K+v1Bf1Puz9x9VBNpvUCNulPVfuuAbgeK/8noNerh P1ugl4aZPu2paOFaCaXnhuGeM6Zv5RBkEybo75PXgSnZNUjAm12WUjqfdw7FqLOc +iqInlXdnTbQZX5FA7hryxmwGoJj/9seRrlK7DxYyxFJ29k0/OBJ6CygmE5NYzlb SlJrKpC1Oo6aAdDy8XEaYJPMu/QR+/p6czVXZQ3bSV1Q8r22bfIHpGd/NoLhy39C zhB04X3y5LykB70wuqakCbqmWyCz1A== =FKeJ -----END PGP SIGNATURE----- --Sig_/XGZYAjXanzDzdalXDjH+rp9--