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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 675DAC63777 for ; Fri, 27 Nov 2020 00:05:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F905221F1 for ; Fri, 27 Nov 2020 00:05:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UrYc7x34" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F905221F1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=G3Eu8Fc3Okq7WTNxCnYKaFl0bLPLZU3I1/zq7gUib7g=; b=UrYc7x34S99X84TJog6fSMi0h QrkiX+0+o/sS+BxNq/8+kRBAaJ6L0LNIm1tNGUyT+SERoQXsvsHBpWPe+ZHib8TDNcIgaR2AYMQda HwZWlSPEpFB9Ri9tWY3hNX538qUdqQ3RnniRljM8yzVqvtmjGM4wmQKjECGklAOGbTMogMkkUQ8sJ h4cjYaDVdtqtWaN0JsHhUtCYE3gYq+/Eje81lBTPSALw+JNvT+Ns+pWcfhFNcjkX2y4yNaSByCrjh lk/6ZXjh6XxdlNJko+zWbvH028TdRzoUybMQykOWILNnecbsgaODm3vQM3xrhgi0N189Q85iEObDU pl4sWWsjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiRF4-00083T-Ms; Fri, 27 Nov 2020 00:04:02 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiRF0-000824-A8 for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2020 00:04:00 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Chvx85kW4z1qsbb; Fri, 27 Nov 2020 01:03:55 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Chvx73rCDz1tw7Q; Fri, 27 Nov 2020 01:03:55 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id nkfY3urtl9Ut; Fri, 27 Nov 2020 01:03:53 +0100 (CET) X-Auth-Info: w/AIwljvO5wRb6uUR6m8k1KWAhfud0ug1INt3CjFse4= Received: from jawa (89-64-5-98.dynamic.chello.pl [89.64.5.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 27 Nov 2020 01:03:53 +0100 (CET) Date: Fri, 27 Nov 2020 01:03:25 +0100 From: Lukasz Majewski To: Andrew Lunn Subject: Re: [RFC 0/4] net: l2switch: Provide support for L2 switch on i.MX28 SoC Message-ID: <20201127010325.5d929362@jawa> In-Reply-To: <20201126144546.GN2075216@lunn.ch> References: <20201125232459.378-1-lukma@denx.de> <20201126000049.GL2073444@lunn.ch> <20201126031021.GK2075216@lunn.ch> <20201126111014.5a6a2049@jawa> <20201126144546.GN2075216@lunn.ch> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201126_190359_173773_B3311A04 X-CRM114-Status: GOOD ( 35.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Florian Fainelli , Fugang Duan , stefan.agner@toradex.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, krzk@kernel.org, Vivien Didelot , NXP Linux Team , Fabio Estevam , Jakub Kicinski , Vladimir Oltean , Shawn Guo , "David S . Miller" , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============7185466893940630358==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7185466893940630358== Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/FdLy3aP3LgVUNklxQHOQ5Ay"; protocol="application/pgp-signature" --Sig_/FdLy3aP3LgVUNklxQHOQ5Ay Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Andrew, > > > What is not yet clear to me is how you direct frames out specific > > > interfaces. This is where i think we hit problems. I don't see a > > > generic mechanism, which is probably why Lukasz put tagger as > > > None. =20 > >=20 > > I've put the "None" tag just to share the "testable" RFC code. =20 >=20 > Tagging is a core feature of DSA. Without being able to direct a > packet out a specific port, it is not really a DSA driver. It is also > core requirement of integrating a switch into Linux. A DSA driver, or > a pure switchdev driver expects to be able to forward frames out > specific ports. Please find my answer, which I gave to Vladimir in the other mail (you were CC'ed). As a backup plan - the vlan tagging may be worth to investigate. >=20 > > It is possible to "tag" frames - at least from the manual [0]: > > Chapter: "29.4.9.2 Forced Forwarding". > >=20 > > With using register HW_ENET_SWI_FORCE_FWD_P0 > > 29.9.34 ENET SWI Enable forced forwarding for a frame processed > > from port 0 (HW_ENET_SWI_FORCE_FWD_P0) > >=20 > > One can "tag" the packet going from port0 (internal one from SoC) > > to be forwarded to port1 (ENET-MAC0) or port2 (ENET-MAC1). > >=20 > > According to the legacy driver [1]: > > "* It only replace the MAC lookup function, > > * all other filtering(eg.VLAN verification) act as normal" =20 >=20 > This might solve your outgoing frame problems. But you need to dive > deep into how the FEC driver works, especially in a DSA like > setup.=20 Agree. > The normal path would be, the slave interface passes a frame to > the tagger driver, living in net/dsa/tag_*.c. Normally, it adds a > header/trailer which the switch looks at. It then hands to packet over > to the master Ethernet driver, which at some point will send the > frame. Because the frame is self contained, we don't care what that > ethernet driver actually does. It can add it to a queue and send it > later. It can look at the QoS tags and send it with low priority after > other frames, or could put it to the head of the queue and send it > before other frames etc. >=20 Thanks for the explanation. > Since you don't have self contained frames, this is a problem. After > writing to this register, you need to ensure what is transmitted next > is the specific frame you intend. It cannot be added to an existing > queue etc. You need to know when the frame has been sent, so you can > re-write this register for the next frame. This needs to be assessed as the documentation is very vague. I'm wondering how MTIP/NXP recommends usage of ESW_FFEN register. >=20 > This is why i said i don't know if the DSA architecture will work. You > need a close coupling between the tagger setting the force bits, and > the DMA engine sending the frame. Maybe it would be just enough to program the ESW_FFEN register when ENET descriptor is programmed for DMA? Earlier we would append the superfluous tag in the tag_*.c ? >=20 > The other option is you totally ignore most of this and statically > assign VLANs. Frames sent with VLAN 1 are forwarded out port 1. Frames > sent with VLAN 2 are sent out port 2. You need the port to > append/strip these VLAN tags for ingress/egress. tag_8021q.c gives you > some code to help with this. But can you still use the hardware to > switch frames between ports 1 and 2 without them going via the CPU? Yes, it is possible to switch frames between ENET-MAC{01} ports without any interaction from CPU. >=20 > Andrew. 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_/FdLy3aP3LgVUNklxQHOQ5Ay Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl/AQk0ACgkQAR8vZIA0 zr2ooAf9FWuBH85pjbUd2qGgJB64pBsMMQaZ5zrchOozm0aNKEC2tK9dRYhYtV66 6F2vIL1dxnpCAWQyDP6L01HgsW0IjH23J9RWmeNQVv+wZzwXdsFyercQ063qVfKK gWXvdOTmBKG/mTLxkrhIkkuVz+P//uTsOXtmMS0GmpAZ5SWV8YbLIANEmm010ISg M6KMOi8LIvDXdrj/XCGxnLQu4yWEClMcha70GnvuWsHOyGUtnJHeSS1l6OgOUfHI BxxfDffF517G2BPQBtJCAjpNUTEtqeKnhLZPtbs3h0I1mKO3AB71o9fGYJk5/H+t EVwhvFDG9/wN83w/4kYhalzqUGPgaA== =yAuL -----END PGP SIGNATURE----- --Sig_/FdLy3aP3LgVUNklxQHOQ5Ay-- --===============7185466893940630358== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7185466893940630358==--