Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp33365lqq; Wed, 12 Jun 2024 15:40:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhcMKdk3sLmQHKh+5OvrK7JYK4/0283jRe+PgInZWbapCIGPtLJP+mF9LHZNQrKaoABl7EMY5BaW7yfyh3ezrSKT2FDHoE/cPwXtGZXg== X-Google-Smtp-Source: AGHT+IGSfkuH/ofYzk/MvrZwAMmdXRZED83/PF5vl5kijiKm9ymx7RMiBu9NI1e6jN+b9Sl4JRQJ X-Received: by 2002:a05:6a00:2e0d:b0:705:aec4:605f with SMTP id d2e1a72fcca58-705c935948dmr1270171b3a.2.1718232037056; Wed, 12 Jun 2024 15:40:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718232037; cv=pass; d=google.com; s=arc-20160816; b=MQ6WMdpsmzQU4fNWO0XaCDeuhzKKASPW8iROb0ORBnv92MSZX4mdSGQe1p2m+ypk4T MmPqNEfhytK5CCcejkLz02vWRxoD90625DgBuMvevdmhRnQkEjmAqwR270R7otqF5ubh UkhXH4KZ0vac1U2+2Qe1qmKJR6QbV7Piy2Wiy10/jez5vVpkiyJ1oRFPyV+340jtbqP/ MgSqDA8+lzUdNcK4iwNtHz5Nlcw6/P5pd0jY8oUK9TUvZilOWq9jjYu587RcYek+l7Kd cAfA/NlOPyUt9v36rZgNy6Cl8kE5vYY0WD0Ckhbs+jW/J0WHjhjgr9erzD3i2e2mzadT k+UQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MsPOlnETfMLsWfJG4LxUIQ4Q97ttuBHiEzDMtNO+4XY=; fh=HhlH5WZSIDYUj1sv/TOvX0ugy4wpnNc1UXYOccVLAh0=; b=yDszB9wbIJmxCxz2sqzYh6Wn9YA93rvAzhJgf+0aplhXHDnjtWxBuv2n1HghOcZw1d XMVSDA2rzHqOM480dbiJrRzRgoP00gd6GzxIHPnMqBLb+6Uuchbpp8dOLjsqbU8ncox8 kvolPZil5uW+rADInY1WizvHzYX+4kyvIBaAMu8ukeVkaH0/scyOiWp9Zq4UxShTTTX5 N+Yvjj/P4n+BuzGEtrceDfjPv4pb2wmAyl1969e/ULtD82QmBhBz324ZzJdP+DVZnYzu t2Sd+5Fb6wXeXYCH/bNNYnGRXafzXtdHxRAyNL2G4Irw3DEmznG7srXJHhRoyvEgtKYV MjYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=0dbDj2M2; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-212332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccb97138si102815b3a.302.2024.06.12.15.40.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 15:40:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=0dbDj2M2; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-212332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3BB65B21008 for ; Wed, 12 Jun 2024 22:40:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2200A12C486; Wed, 12 Jun 2024 22:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="0dbDj2M2" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF44321360; Wed, 12 Jun 2024 22:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718232021; cv=none; b=cjDkcaVes8ikDowcMxM47oV+Ie7LA7P4/NcXYSwo79geqWQpBlmgzCtezkjFf0yVmqS3U5oSIS8ihTifAHftySL4xr7xkhL+supQW8E6CNLmPI+fVkWNXUclqm++gdLNidgZgoppY9Kf9oI96cGwpSzon0r9DucmgBfNZmgHRPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718232021; c=relaxed/simple; bh=rYC+czHxcKQYzM+1xUOS8jIq0Bj1p1M06sPe50hUMaw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DhsjxSlxpQIYUMs0rAu2mr1k9/s6flL8rIODDmaHxk6FMVR+XzjWyuW5Gfrv3tKv9gbMbyINESxVNQg3yZDxC+xznioYPrdiH3mYetrcbw7SzcpfdCIiA5qzjcfOowKUsCxGi0cQC1pgCJFV10xFwPUOqdr+ABniNMRlQpSGyHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=0dbDj2M2; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=MsPOlnETfMLsWfJG4LxUIQ4Q97ttuBHiEzDMtNO+4XY=; b=0dbDj2M2GnzRqlZohCLFCXyshs kz6a08uiUUtFwsKJ4S2VRwr9OPhKpDPxdNxpKu0COUfbC6HjPduXU3Goo3+kZiPcnNdQMdWB7BLlE EAxKVaItgAYvOeTYb8i+SDEJVqxHe+Mw8S1cz5I4tSlQ3jUSgEeEK9rAcHztCh/FLPGc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1sHWdQ-00HVWQ-4G; Thu, 13 Jun 2024 00:40:04 +0200 Date: Thu, 13 Jun 2024 00:40:04 +0200 From: Andrew Lunn To: Siddharth Vadapalli Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, rogerq@kernel.org, danishanwar@ti.com, vladimir.oltean@nxp.com, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, misael.lopez@ti.com, srk@ti.com Subject: Re: [RFC PATCH net-next 01/28] docs: networking: ti: add driver doc for CPSW Proxy Client Message-ID: <1a966d5f-9eca-4d6d-812b-98ac17579cd7@lunn.ch> References: <20240518124234.2671651-1-s-vadapalli@ti.com> <20240518124234.2671651-2-s-vadapalli@ti.com> <642c8217-49fe-4c54-8d62-9550202c02c9@lunn.ch> <6e520ad0-0f9b-4fee-87fe-44477b01912b@ti.com> <287322d3-d3ee-4de6-9189-97067bc4835c@lunn.ch> <3586d2d1-1f03-47b0-94c0-258e48525a9d@ti.com> <77267e15-b986-4b54-9e12-fb9536432ac2@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <77267e15-b986-4b54-9e12-fb9536432ac2@ti.com> > The DMA Channels provide a path to/from CPSW's Host Port for each Host. > > Please refer to the following illustration corresponding to the data > movement from each of the Hosts to the CPSW's Host Port via the ALE and > then out of the MAC Ports: > > ------- --------- --------- CONTROL-PATH > |Linux| |AUTOSAR| | EthFW | ------------- > ------- --------- --------- | > | | | | | | | > DATA TX RX TX RX TX RX | > PATH => | | | | | | | > (DMA) | | | | | | | > | | | | | | | > \ \ \ \ / / | > \ \ \ \ / / | > \ \ \ \ / / | > \ \ \ \ / / | > \ \ \ \ / / | > =============================== | > || CPSW HOST PORT || V > =============================== ----------- > | |CPSW | > TX + RX |CONTROL | > | |REGISTERS| > | ----------- > | > =================== > ||ALE & SWITCH CORE|| > =================== > / | | \ > / | | \ > / | | \ > TX+RX | \ ------- > / | \ \ > / TX+RX TX+RX TX+RX > / | \ \ > ========== ========== ========== ========== > |MAC Port 1| |MAC Port 2| |MAC Port 3| |MAC Port 4| > ========== ========== ========== ========== So, in summary, you have one host port, and on top of that a number of virtual ports. Because of limitations in the ALE, those virtual ports don't work in the same way as real ports, replication is not possible, nor learning for individual virtual ports. The typical 1990 solution to that would be to flood packets to all hosts, and let them filter out the packets they are not interested in. 1990 Ethernet was a shared medium, you expect to see packets for other hosts. But the hardware also cannot do that. So you have to program the classify to augment the ALE, and the classifier is the one that decides which virtual port a packet goes out. But the classifier does not perform learning. You need additional mechanisms to program that classifier. > Host which has registered with that MAC Address "M". This is handled by > EthFw. EthFw doesn't/cannot snoop on all traffic on the Host Port, since > it doesn't lie in between the Host Port and the other Hosts. Rather, it > is quite similar to a Host itself since it also has dedicated TX/RX DMA > Channels to exchange traffic with CPSW. I did not say snoop. I said trap. There is a difference. Snoop would be it sees the packet, as it going by. Trap means it actually gets passed the packet, and it needs to deal with it, decide the outgoing port. So i would trap all broadcast and multicast from the virtual ports to the EthFW. Let the EthFw deal with that traffic, perform learning, and programming the classifier, and flood it out user ports for broadcast, or unicast out specific ports for multicast where IGMP snooping indicates it should go. > Since that is not supported, all > Broadcast/Multicast traffic directed to the Host Port from the Switch Core > is by default placed on the RX DMA Flow corresponding to EthFw. EthFw then > creates copies of these in software and shares them with each Host via > Shared Memory for example. Why shared memory? EthFw needs to be able to direct packets out specific virtual ports otherwise it cannot do {R}STP, PTP, IGMP snooping etc. So it should just pass the packet back to the CPSW, which will hairpin the packet, hit the classifier, and then send it out the correct virtual port to the correct host. > Yes, the Shared Memory path is intended for the low-bandwidth > Broadcast/Multicast traffic from EthFw while the DMA path is dedicated > for high-bandwidth Unicast traffic. The current series implements the > DMA path while the other series you have referred to implements the > Shared Memory path. Both of them together enable the desired functionality. So i think we are agreed a new model is not needed. Linux is just a host connected to a managed switch. Linux has no roll in managing that switch, and has no idea about the ports of that switch. It is just an end system, running end system software. You need a 'MAC' driver in Linux, so Linux sees just a normal network interface. And it must see a single MAC driver, so if you really do need to use shared memory in parallel to DMA, you will need to combine that into one driver. Andrew