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 4499BC433FE for ; Tue, 15 Nov 2022 11:51:41 +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:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6XzAH7KHsEowuunl+n1l9XC2bxvlp1JqvSmEGgJ7ljY=; b=x61Po1kWoYjb97 vvqEYc+a31YcvQ90KLrOFdJMEk2Kwkv3T4uJV3hm2hj7fcXcPRVvCmNZCF2ST0+4Ag4ugfMVAd4Re 1X1NrRcNMbkkTEWJGdOR8uWQWDJjlZbjg1kxtfi/EHxOPDA1Dno2/wZ2v49zpfNyQ77gg/LkLXVnu JDviaqowYOU3IC41paarBCw9O6DpLt71EO4relvcTyq9pCpBNDcyhn3eqI6gP0G4n677Xda/LOVOq hq2DBvVdWc1Z3wWIMdKw5/G5pAx6B5tI+XcaagtrNq2W53rVUk/Te/xJpa5x3GQRmygWqGziTSE4r AMpdqdyBkj8dKN1eO77w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouuSb-00AjSi-MW; Tue, 15 Nov 2022 11:50:38 +0000 Received: from mail-dbaeur03on2085.outbound.protection.outlook.com ([40.107.104.85] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouuSY-00AjNR-BY for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 11:50:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1EbvD+sC1Y2zqNq2Kt8dbx7v4r6nyp48c9qZr0+JcsdQieHNODPtHUb7zBxmg7Vbx+wixG8eo1DLKr+qLs4HF9K7TBUXluI+rULW7Jj3T+vDrNAQqV8FYg0DANVx4QFOi121rRoxzSlYtyeYcam7WWwtshMY4IKth7SGUhdpBGqsPruhO3JBubqkZDRBtjMjZ8bds32z3C8smES2nk/eb0vMGxrBHgd51p6/j4qx8wY6ybyi1a3NHH6BHjgqaXOwtbWkB1qUumdkS6iB9f85BcNrbr82CGpO7LsfHxnKCS51xWU7M/TQ6yFs13rSVKHoBImZhpyCWQfO8hpnIXoQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gTEe9UHRnlI5S24R6QSgzGWVL4tEL0FlhSlwW0E/unA=; b=EmE7PW+sJ4i5z1rCWIBPyNtm5P/RXBLv//H5moksvX7wNOc2+dXAiyyn9ncQ7oI6e/apnMFGs4+byh8qutXjuFDFoXRC4scz5AOiKCnCF5tW+sKVmtxowVyhgsLKNSrsXZR16NW+yPVSPQ2QYPTf/PQ7bQ0YSfvj4kY9+L+0qnyhLmhvuyFcTSEVvmpuysHkudnP/3mcnOwLJzVLYYhNb/PGGjZ+H7mqYBg/2y4zgjmdGbaoLe+20ua1Yj1u2odTdiXkk0wLLvHDI1SyEmiQsWRVz7MgrR0murZQstqYmsGeIlpCq8bCLeeeOL4TPwaway3VoO7jSf4sX2uzWL9XBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gTEe9UHRnlI5S24R6QSgzGWVL4tEL0FlhSlwW0E/unA=; b=b3M9QV9yVMlKrUlm+QR2Jgh4w8wXy+h48O8vyBYVlW/MOQGGkCeBQGAlvZN6bx4HDdfJgfGucVUb2euC9rri5BbmKyMRvmJqavBXUI0KAD3XNQahXSwdMKx6TkuivnleJ2qNB5dzlPD5qdvJKo9ShjWJTEm99+U5pH2SXim+MMQ= Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VE1PR04MB7312.eurprd04.prod.outlook.com (2603:10a6:800:1a5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.15; Tue, 15 Nov 2022 11:50:24 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::9317:77dc:9be2:63b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::9317:77dc:9be2:63b%7]) with mapi id 15.20.5813.018; Tue, 15 Nov 2022 11:50:24 +0000 From: Vladimir Oltean To: Maxime Chevallier CC: Felix Fietkau , Jakub Kicinski , "davem@davemloft.net" , Rob Herring , Krzysztof Kozlowski , Eric Dumazet , Paolo Abeni , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "thomas.petazzoni@bootlin.com" , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "linux-arm-kernel@lists.infradead.org" , Luka Perkov , Robert Marko , Andy Gross , Bjorn Andersson , Konrad Dybcio Subject: Re: [PATCH net-next v8 3/5] net: dsa: add out-of-band tagging protocol Thread-Topic: [PATCH net-next v8 3/5] net: dsa: add out-of-band tagging protocol Thread-Index: AQHY8HTAfetHoGxM5E6HcRPQNrr8s64vpgIAgAOCEwCAAdB8gIAK0AQAgAAnZIA= Date: Tue, 15 Nov 2022 11:50:23 +0000 Message-ID: <20221115115023.hgc4ynrx3kylf6p3@skbuf> References: <20221104174151.439008-1-maxime.chevallier@bootlin.com> <20221104174151.439008-4-maxime.chevallier@bootlin.com> <20221104200530.3bbe18c6@kernel.org> <20221107093950.74de3fa1@pc-8.home> <6b38ec27-65a3-c973-c5e1-a25bbe4f6104@nbd.name> <20221115102924.1329b49f@pc-7.home> In-Reply-To: <20221115102924.1329b49f@pc-7.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR04MB5136:EE_|VE1PR04MB7312:EE_ x-ms-office365-filtering-correlation-id: fee7cfb2-fb1c-4d52-c98a-08dac6ff94ae x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vFjxmK1Q4wfoLxPD559rkOJE6yAGYhc9qKBQGcnJi6nNOFQtE+uAksFJQ4FfhO9M3nWoi1zugnYxqilF14AolVpF4xuCFyDdVTBPzGgcr92uiUJmbk1l4R+ywBRXFDTzszMRKOx/EZWFgQsiIHdQCACcJf2Q3TQGNgk4cYd88GQ1eXgwPbXbTZnWJBXcqp/WQB9rQIJBhvfC7X9byRNNk1ZlAgAMp56ciiXKPES8CJt875RvNsl/bldUxvPyrFJ2RhH1gjhC0BZVX0LbrMLbuY6dVUiTy9cTBSBCHogG1U7vGaof+4vOUM9VSpJvDfnHJ42FG1I2yh+OFrcA69fkkvmv1QOd+e+78BlZidlGNeWjn7Pwt/efZxeWqAIyvubhMEuggSU4eaa1wLuPzPMxgauUxwD1Fxw/+Yt+Ao8lVFHL9pcMxPZB4QHQFDiJMiTs+tpqOh5nQo+PnQYpM/KmlMG8By6kkALkzNanm+Qo8ofos63IxavpvyE1b1FK0vJIkRMi+RNXAGpCQGlJxmQmaCo0Q87k1ZPq5q+R9ohYGCkCY/jY/X2sxVivBQ3Wlo/4ed5Y5QKk0hPu6ioKFaZAiOlIRhRcUFH5G99UpE7OqL5TtjJyLmEpQR0mrmDqh4otA5GOZC044Gohp2Xgrbn3DEubBWeHs13oL95KwDdhaP0Q0FPjCIqOooIKs3ZfCnP9QHm9oecKok0lNNCduHqNT024pvlXYjUuLwrl+mrAWDuqTxJHE5JyjpfMghaiW6X6dckS0OINAdohdQpnFut5WFr9iOsVeqbaILoXl1zeL3M5OSXePltvbQ3hraPLJmx/9ePT2QzopSlU8mtCF/qfug== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(4636009)(396003)(366004)(346002)(39860400002)(376002)(136003)(451199015)(316002)(7416002)(8936002)(5660300002)(44832011)(64756008)(66476007)(66556008)(66446008)(41300700001)(4326008)(76116006)(8676002)(66946007)(38070700005)(966005)(54906003)(6916009)(71200400001)(122000001)(478600001)(6486002)(86362001)(6512007)(6506007)(26005)(9686003)(2906002)(186003)(1076003)(33716001)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mLsDYzuAc+uubG/CtMAhBZ4qyw1b+8Xd4RBLdMh6l/cpxmYeLKyJbSxR73FB?= =?us-ascii?Q?hUvq6ZHeibc8h6i4eogAiilRCciYWpx6BSuunSVVAZW8W6VvtR3luAKc/sOs?= =?us-ascii?Q?bQ1maCQAGg3wDf9InPhTBDuqGxQwFLsHS46FH7RTU+LnezCss0VuAZuLDzxx?= =?us-ascii?Q?8lhqGLflQJdG3R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Q?3VXbMZ7Y8KEPPjE9TQSRH/n7cHtPxrIrpr00YJRSFIDqrKqEQAui0g/jm1jL?= =?us-ascii?Q?6ADTMBNYvKwT7rLtn3A5wBjoJS8oe4HvjnpLArl/Ulf6foBovv3iIt67opNw?= =?us-ascii?Q?VpEipkH/QhS1jZIUmFiMs0m0tRCuSX/5bgcBHwVKttoxU4kpO4gbYDdRujeJ?= =?us-ascii?Q?jzX9ny/Cj0HZ7OuNxJWsuT6UaMQ8HooIRuCqH+AKAETt8gyYkTApx/pjcyC/?= =?us-ascii?Q?wrYNF+uSpTJ/8aZl0IaQuRbZXphls72zZRygTgkSLQ+f4HdRg/qBuBTrXXl6?= =?us-ascii?Q?hKretIEKC+O+EE2XdEPzo/U8y6Osyv+Z7QcnL30siuTw0Eu7KD5ooPr3kiRo?= =?us-ascii?Q?uV5mUo9eOUA2qmCFNiQGc2aM+BQxE5wYBGS5HfRyjebDaaiQTBsDfSXXn2K5?= =?us-ascii?Q?x1hVEalRfu7/58BGvwRORvijXZgdZZS80ETp15sCnLpCPDa8prRUfMDzdJEE?= =?us-ascii?Q?idCS/7pfef8RF9Tcui3sP0pWJvFahCgFwLtxmrzHI0rFx3CNgZLgH43MiEij?= =?us-ascii?Q?aQ=3D=3D?= Content-ID: <89071461ED882A48874503FE5BDEB161@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fee7cfb2-fb1c-4d52-c98a-08dac6ff94ae X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Nov 2022 11:50:23.9320 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vynkhPU1ILOLR1MfVtC5n6NPNjJ5ERUkHMQUo4RNaDantaZc2pBRm/rRdebd1tKp0+zQDgDwRw9qVvYIJMaQcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7312 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221115_035034_433358_1D1D7E4C X-CRM114-Status: GOOD ( 36.05 ) 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 On Tue, Nov 15, 2022 at 10:29:24AM +0100, Maxime Chevallier wrote: > Hello everyone, > > Felix, thanks for the feedback ! > > On Tue, 8 Nov 2022 13:22:17 +0100 > Felix Fietkau wrote: > > [...] > > > FYI, I'm currently working on hardware DSA untagging on the mediatek > > mtk_eth_soc driver. On this hardware, I definitely need to keep the > > custom DSA tag driver, as hardware untagging is not always available. > > For the receive side, I came up with this patch (still untested) for > > using METADATA_HW_PORT_MUX. > > It has the advantage of being able to skip the tag protocol rcv ops > > call for offload-enabled packets. > > > > Maybe for the transmit side we could have some kind of netdev feature > > or capability that indicates offload support and allows skipping the > > tag xmit function as well. > > In that case, ipqess could simply use a no-op tag driver. > > If I'm not mistaken, Florian also proposed a while ago an offload > mechanism for taggin/untagging : > > https://lore.kernel.org/lkml/1438322920.20182.144.camel@edumazet-glaptop2.roam.corp.google.com/T/ > > It uses some of the points you're mentionning, such as the netdev > feature :) > > All in all, I'm still a bit confused about the next steps. If I can > summarize a bit, we have a lot of approaches, all with advantages and > inconvenients, I'll try to summarize the state : > > - We could simply use the skb extensions as-is, rename the tagger > something like "DSA_TAG_IPQDMA" and consider this a way to perform > tagging on this specific class of hardware, without trying too hard > to make it generic. For Felix, using skb extensions would be inconvenient, since it would involve per packet allocations which are now avoided with the metadata dsts. > - We could try to move forward with this mechanism of offloading > tagging and untagging from the MAC driver, this would address > Florian's first try at this, Felix's use-case and would fit well the > IPQESS case Someone would need to take things from where Felix left them: https://patchwork.kernel.org/project/netdevbpf/patch/20221114124214.58199-2-nbd@nbd.name/ and add TX tag offloading support as well. Here there would need to be a mechanism through which DSA asks "hey, this is my tagging protocol, can the master offload it in the TX direction or am I just going to push the tag into the packet?". I tried to sketch here something along those lines: https://patchwork.kernel.org/project/netdevbpf/patch/20221109163426.76164-10-nbd@nbd.name/#25084481 > - There's the option discussed by Vlad and Jakub to add several > frontends, one being a switchev driver, here I'm a bit lost TBH, if > we go this way I could definitely use a few pointers from Vlad :) The assumption being here that there is more functionality to cover by the metadata dst than a port mux. I'm really not clear what is the hardware design truly, hopefully you could give more details about that. The mechanism is quite simple, it's not rocket science. Take something like a bridge join operation, the proposal is to do something like this: dsa_slave_netdevice_event (net/dsa/slave.c) | v dsa_slave_changeupper (net/dsa/slave.c) | v dsa_port_bridge_join ocelot_netdevice_event (net/dsa/port.c) (drivers/net/ethernet/mscc/ocelot_net.c) | | v v dsa_switch_bridge_join ocelot_netdevice_changeupper (net/dsa/switch.c) (drivers/net/ethernet/mscc/ocelot_net.c) | | v v felix_bridge_join ocelot_netdevice_bridge_join (drivers/net/dsa/ocelot/felix.c) (drivers/net/ethernet/mscc/ocelot_net.c) | | | | +---------------------+---------------------+ | v ocelot_port_bridge_join (drivers/net/ethernet/mscc/ocelot.c) with you maintaining the entire right branch that represents the switchdev frontend, and more or less duplicates part of DSA. The advantage of this approach is that you can register your own NAPI handler where you can treat packets in whichever way you like, and have your own ndo_start_xmit. This driver would treat the aggregate of the ess DMA engine and the ipq switch as a single device, and expose it as a switch with DMA, basically. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel