Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3556338pxv; Mon, 28 Jun 2021 07:19:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4beEcY2uldDU1oGosIFfyDXUX+24OXO0YURIhsHruDDXtM4GVHCf5bJ7nuCSmLh8C17fU X-Received: by 2002:a02:8521:: with SMTP id g30mr23600677jai.113.1624889977853; Mon, 28 Jun 2021 07:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624889977; cv=none; d=google.com; s=arc-20160816; b=Fq2q3NR4CSr5oLi5sNKLcPtAvijLbjJdbNDWk0HbFtKi+9gsARDHDK40iBy8/VDUVs R7TzVH4Um2fnbDaiKmsjPkdeFplDXNXQ0n0xryn2okEZsJ9LITGbzofo1QURUNIl7sID 5s0I+GBmH05oT3Yrc9Emz8pn5g/xG22RfmyQc7JM1P036o8wa3fR9Uw5DFH2fuTisMjT 5DRLWT0MWm1R0aIW+CV+q+40pP53SjihxSp5QIfRCzesf5cnoFNDhcDe8zg9jM0HAQPa Vjoe/uv2UJCNPsYx6h8MaA1ELp51iYkoOOrFBIzcgczwN0enaYAxoJgUuNuPRD8gJsFz 2Wew== 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=rEHKnpCCOjhwWxcMc4pBrXRlstTD75NAJKi157PQKUU=; b=BiXhmO4noT/qOwYuJeE5/2kTP0xI9KBQQjGaFFgao6DqwsH6MASKaQJ93lwqMK9tTW 8Hur2QJCB4JVMSh5DiImnvFVNvycR6WH1DdBQXOf+xSLXAF5IZbZ5cLwnGDPPQKWPs6M MNm7UvAxAmNhyjR2865FE2keaW616VnMboKJRbRnk/0jTS8QrFER5Bw++kRKhs89UrMJ W1Sd9QED/GCth7G36ZVZc/xf1RjMCuM3dKUdDl3o2i162taDpNLEB7s3wj8yBmITUffg su0U5134avx6bpN1FfqEzrLqnusOMUvnOcj7pHbilrfFMGr2kkHSflyNZRfTGjTvavjA lBJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=iHZCYUic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si19762833jav.63.2021.06.28.07.19.24; Mon, 28 Jun 2021 07:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=iHZCYUic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbhF1OPt (ORCPT + 99 others); Mon, 28 Jun 2021 10:15:49 -0400 Received: from phobos.denx.de ([85.214.62.61]:51236 "EHLO phobos.denx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbhF1OPs (ORCPT ); Mon, 28 Jun 2021 10:15:48 -0400 Received: from ktm (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 3D93582D99; Mon, 28 Jun 2021 16:13:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1624889601; bh=rEHKnpCCOjhwWxcMc4pBrXRlstTD75NAJKi157PQKUU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iHZCYUicoJ4sCMdzXa3p2o73NMx0MVeumWQhMDaSusFaxu8myswuUWQCYDPLByMHg 1yhoEy0UopUwD/HGc2hcFruNkh7PYhQn7Lxcm4qcvpN9JAjI8j0a6ztTrtXJhNFYuF c9Tpp3fNniAcBYmo3RRL4F596MIWnpwutZ4yerDw+K4ERxcQhKTLJzJCyA1pEPnIb8 RAec3Xu0YvGYt0SYyTSMwRyk1aP3cX0dx6E6o/DDS0JyVQmPFC/R9T7YT2YfLhLydo jW+SutmF52Gp89FI3mw7I4QsFMfuJSvBZGiQbYxHBZKQwkfbS7HLxRYJx18ZCD3CCG dPA/w3A7/5FSw== Date: Mon, 28 Jun 2021 16:13:14 +0200 From: Lukasz Majewski To: Vladimir Oltean Cc: Andrew Lunn , "David S . Miller" , Jakub Kicinski , Madalin Bucur , Nicolas Ferre , Joakim Zhang , Florian Fainelli , netdev@vger.kernel.org, Arnd Bergmann , Mark Einon , NXP Linux Team , linux-kernel@vger.kernel.org Subject: Re: [RFC 2/3] net: Provide switchdev driver for NXP's More Than IP L2 switch Message-ID: <20210628161314.37223141@ktm> In-Reply-To: <20210628124835.zbuija3hwsnh2zmd@skbuf> References: <20210623133704.334a84df@ktm> <20210624125304.36636a44@ktm> <20210624163542.5b6d87ee@ktm> <20210625115935.132922ff@ktm> <20210628140526.7417fbf2@ktm> <20210628124835.zbuija3hwsnh2zmd@skbuf> Organization: denx.de X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/iX6di2EciPiCLEusLdw9kdi"; protocol="application/pgp-signature" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/iX6di2EciPiCLEusLdw9kdi Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Vladimir, > On Mon, Jun 28, 2021 at 02:05:26PM +0200, Lukasz Majewski wrote: > > Hi Andrew, > > =20 > > > > I do believe that I can just extend the L2 switch driver > > > > (fec_mtip.c file to be precise) to provide full blown L2 switch > > > > functionality without touching the legacy FEC more than in this > > > > patch set. > > > > > > > > Would you consider applying this patch series then? =20 > > > > > > What is most important is the ABI. If something is merged now, we > > > need to ensure it does not block later refactoring to a clean new > > > driver. The DT binding is considered ABI. So the DT binding needs > > > to be like a traditional switchdev driver. Florian already > > > pointed out, you can use a binding very similar to DSA. > > > ti,cpsw-switch.yaml is another good example. =20 > > > > The best I could get would be: > > > > ð_switch { > > compatible =3D "imx,mtip-l2switch"; > > reg =3D <0x800f8000 0x400>, <0x800fC000 0x4000>; > > > > interrupts =3D <100>; > > status =3D "okay"; > > > > ethernet-ports { > > port1@1 { > > reg =3D <1>; > > label =3D "eth0"; > > phys =3D <&mac0 0>; > > }; > > > > port2@2 { > > reg =3D <2>; > > label =3D "eth1"; > > phys =3D <&mac1 1>; > > }; > > }; > > }; > > > > Which would abuse the "phys" properties usages - as 'mac[01]' are > > referring to ethernet controllers. > > > > On TI SoCs (e.g. am33xx-l4.dtsi) phys refer to some separate driver > > responsible for PHY management. On NXP this is integrated with FEC > > driver itself. =20 >=20 > If we were really honest, the binding would need to be called >=20 > port@0 { > puppet =3D <&mac0>; > }; >=20 > port@1 { > puppet =3D <&mac1>; > }; >=20 > which speaks for itself as to why accepting "puppet master" drivers is > not really very compelling. I concur with the recommendation given by > Andrew and Florian to refactor FEC as a multi-port single driver. Ok. >=20 > > > > > > So before considering merging your changes, i would like to see a > > > usable binding. > > > > > > I also don't remember seeing support for STP. Without that, your > > > network has broadcast storm problems when there are loops. So i > > > would like to see the code needed to put ports into blocking, > > > listening, learning, and forwarding states. > > > > > > Andrew =20 >=20 > I cannot stress enough how important it is for us to see STP support > and consequently the ndo_start_xmit procedure for switch ports. Ok. > Let me see if I understand correctly. When the switch is enabled, eth0 > sends packets towards both physical switch ports, and eth1 sends > packets towards none, but eth0 handles the link state of switch port > 0, and eth1 handles the link state of switch port 1? Exactly, this is how FEC driver is utilized for this switch.=20 Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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_/iX6di2EciPiCLEusLdw9kdi Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmDZ2PoACgkQAR8vZIA0 zr0aUAf9E5BRJ+WcI/6OphC0Lod4LCdW059FQBJGB/ZGFNjGvhtHJ0tfumTNCZjH lIYBW5IiH3uMKa8LmkqYMJ9jwN0thh/ms+Sis1x7lcQLSEJ182rWh9Ox7KkU8iJK ig5bj2SLsYOZZ4vypt/XqDBpTkSNeFpn0GCx0DtkxR5Idgu29fO5+e3BGDW2+YFv KqRMCE+GirfG92vYLv7lrlvjQpaDr/p6jwkjJLFjHrjnTZ6FzsPsCkCD6DxH2p/D DTrLWcCfUdZi7W0+QdzsB0l51qkwonPvo5jwLb1meP2wQtTnRIFevQE8VxJLfNyE gBXDQruPm0kIQbWQwUO7GsGsokLGfw== =n4Sd -----END PGP SIGNATURE----- --Sig_/iX6di2EciPiCLEusLdw9kdi--