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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E55ECC433F5 for ; Tue, 26 Apr 2022 14:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DKRfcZV7G5wV8muzFJTUhTXkJM2rE1o7Ibr5/IL+q2o=; b=ZlMjONCSh3wiu1 5lmzpuKovnyNieN4igymedTyxWuFJ8i1hU00sBV0EAE/k55KS/VZz5jVcLYE72GxjvGcv6tPHNdl2 KxAr/BIInES/7Nw61Y9yA117FcrcLLRqevGTD4zlBG30AB2jBD7bHgn+sY8UlDEe9LBY0H5WTB5UY EboV/j9s3h/SMuDdwb/VW3HpFmdiDCrO2TNap0LKvmV05a4ZMS1PPDYSLb7w8zv7flvJCi4GXSz1I LSqshVfhMMuQGC0E8SkZEYgPyLptjDdn9Mdy9E6l/+0VFr4cyflSrue5eF6nUkZ4YUvFMXSmL7kZV FYYsvgNZo2hERxkZXAnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njLlT-00Epr8-8l; Tue, 26 Apr 2022 14:02:03 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njLhI-00EnzR-8y for linux-arm-kernel@lists.infradead.org; Tue, 26 Apr 2022 13:57:46 +0000 Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 6E9B7C0009; Tue, 26 Apr 2022 13:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1650981457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QXillSlDec+QdBFHMoazEsDlgZIJ8YMeOCBMwuPfphY=; b=brrKEe1cOheWxjqRfbu7MAq3yJXJavO8aHcrCe5VVAzM2yOYy/K/h+eccWo7D1Gl1mQh1g 34f6LXnicgZ6ZvQDxNlx+g81sODKX/Yj3vVznMa6DFjBbdvehpqOTjz82hhWV1z4LTRV52 g4bJUjcMPWLwrXoqSf7n1YlEgxAq7bQGgUwJhOYQgY+trLFNE09E0WnT47jnCcOqlhUjAC i2tnWLqwySW0S2F0GXg3Ob/uLVKU/Y6EVWYjG0FJoQC6zRRgUQt742stDIEqL7mHQIZmUe f4FziQHt4KpucEWziEjzQ3lW4+XeVtAG953iVobc/dUtKqa93uh/O9D3k3gKgA== Date: Tue, 26 Apr 2022 15:57:32 +0200 From: Maxime Chevallier To: Florian Fainelli Cc: davem@davemloft.net, Rob Herring , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko Subject: Re: [PATCH net-next 2/5] net: dsa: add out-of-band tagging protocol Message-ID: <20220426155732.223e0446@pc-19.home> In-Reply-To: <68c4710d-013e-85e0-154d-413f4e13b27e@gmail.com> References: <20220422180305.301882-1-maxime.chevallier@bootlin.com> <20220422180305.301882-3-maxime.chevallier@bootlin.com> <68c4710d-013e-85e0-154d-413f4e13b27e@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_065744_651728_544B61FE X-CRM114-Status: GOOD ( 27.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Florian, On Fri, 22 Apr 2022 11:28:30 -0700 Florian Fainelli wrote: Thanks for the review :) > On 4/22/22 11:03, Maxime Chevallier wrote: > > This tagging protocol is designed for the situation where the link > > between the MAC and the Switch is designed such that the Destination > > Port, which is usually embedded in some part of the Ethernet > > Header, is sent out-of-band, and isn't present at all in the > > Ethernet frame. > > > > This can happen when the MAC and Switch are tightly integrated on an > > SoC, as is the case with the Qualcomm IPQ4019 for example, where > > the DSA tag is inserted directly into the DMA descriptors. In that > > case, the MAC driver is responsible for sending the tag to the > > switch using the out-of-band medium. To do so, the MAC driver needs > > to have the information of the destination port for that skb. > > > > This tagging protocol relies on a new set of fields in skb->shinfo > > to transmit the dsa tagging information to and from the MAC driver. > > > > Signed-off-by: Maxime Chevallier > > First off, I am not a big fan of expanding skb::shared_info because > it is sensitive to cache line sizes and is critical for performance > at much higher speeds, I would expect Eric and Jakub to not be > terribly happy about it. No problem, I'm testing with the skb->cb approach as you suggested and see how it goes. > The Broadcom systemport (bcmsysport.c) has a mode where it can > extract the Broadcom tag and put it in front of the actual packet > contents which appears to be very similar here. From there on, you > can have two strategies: > > - have the Ethernet controller mangle the packet contents such that > the QCA tag is located in front of the actual Ethernet frame and > create a new tagging protocol variant for QCA, similar to the > TAG_BRCM versus TAG_BRCM_PREPEND > > - provide the necessary information for the tagger to work using an > out of band mechanism, which is what you have done, in which case, > maybe you can use skb->cb[] instead of using skb::shared_info? One of the reason why I chose the second is to support possible future cases where another controller would face a similar situation, and also make use of the out-of-band tagger. I understand that it's not very elegant in the sense that this breaks the nice tagging model we have, but adding/removing data before the payload also seems convoluted to achieve the same thing :) It seems that this approach comes with a bit of an overhead since it implies mangling the skb a bit, but I've yet to test this myself. That's actually what I wanted your opinion on, it also seems like Andrew likes the idea of putting the tag ahead of the frame to stick with the actual model. I don't have strong feelings myself on the way of doing this, I'm looking for an approach that is efficient but yet easily maintainable. Thanks, Maxime _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel