Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp965476pxb; Fri, 22 Apr 2022 15:29:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFQ4vVNIhk0kYYQTVvMnR55yaFuApvVy4d5sTS5JaMmurbmrGP5MDpGOZOkB2fiZKeqP2X X-Received: by 2002:a17:902:bc8c:b0:156:bc64:fa47 with SMTP id bb12-20020a170902bc8c00b00156bc64fa47mr6597424plb.135.1650666570538; Fri, 22 Apr 2022 15:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650666570; cv=none; d=google.com; s=arc-20160816; b=Be8njIFU+b3javgBiectbfTGhg7mwTb/7Wh9cnc22Q7fQM3nTsbmgfKhm19YFQPz9T FoPkMHhXJFPwUJN6aTRokg9fTTkl4TgFmTw6miTcFKoWtj9+Fxp8kyLEqhT8jkqCue7G GQq48wlzupnQFfUI2pqOXd+s6L6vc8rtFEKeR5fSKOiXHHERqx22ZUsgK7Av9enOZ+1W pbrKyVXqaRmjrhNn9u7w3FFqEEm9WxVaf6R8MIooxctCLKlYPw2ZRxfg72KQwRF/hDXG rlTZ1o3VhHstGtf/GmJWa73WqWbhUmXjWq4tR2nh4BuFBe3uHfZRSFQhK8tOQ/8TbTGu esTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VZJZWU/RxygMbphG0Oj9zjd06v34ardwpbG1ITBoIDw=; b=PZUsMscobqG+flVQ96iJkWY3Q7J1PyLXkaCUn2WCi9KFJ5KIeHa7iE5jaC3FoG/e3h nkEvlE7AKCN9EbXXFOca3L9xra6J5Lke4MRwqkJ+B9/WXCJxhH8kd5xyNoNFbPP2MFlR Xb2R/xlUe9TWK/rPO1H2zgPII/LCHgJMW8xIdyWuxUzQtpLokzZLzhbYsglH/Q7EmjlC aLhxDv7NhzOjPQrck+ODVoxCDo7IZPN7bP7eDyf9k7GVzbLzfOZF8XOn7uJE/ZEtrnYK lTZ2aGV67cFueO1T/6oYh1XZVSvX9xqpNuTX30hvacqt9NnolWD0zbM789bYC9ACSqE9 z/bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YZrWTzrq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l13-20020a056a0016cd00b0050a8f87bf96si9763947pfc.293.2022.04.22.15.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YZrWTzrq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F242F3F7B9D; Fri, 22 Apr 2022 13:36:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbiDVSxj (ORCPT + 99 others); Fri, 22 Apr 2022 14:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbiDVSxc (ORCPT ); Fri, 22 Apr 2022 14:53:32 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 986191FC1E2; Fri, 22 Apr 2022 11:46:28 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id p21so9523789ioj.4; Fri, 22 Apr 2022 11:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=VZJZWU/RxygMbphG0Oj9zjd06v34ardwpbG1ITBoIDw=; b=YZrWTzrqWk1rSABVylk7srJID3fDK9uMYJG42OPvae8wfCRKj7ksYtYZn7xN0yrP8i e41Zp35cubbwqYSgd29HYOnVMmbr5qt6fEZ8X/yNW7wvKE6Of2E2X84vq2sbLpm0v1ft 7Yc10MU2AuvdmmQhwLN/afW/ybLHkuYWzff9R78t3w/+XyhG60uKEsY2w5UdcUX6Fu2J LMy2HV3lFWnIFWErseiwxIAg5WQVCIyoHpY/usBPF0WEoB6IZcWuDlIdWhOUBNbbC3U9 o1RNHfw+J/BuziFmLiNgBRaa2DJDNESPnhnvUgumXYSBsoCUt6ByYC2DxaEy9zCJP3wE T5/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=VZJZWU/RxygMbphG0Oj9zjd06v34ardwpbG1ITBoIDw=; b=kHZH3WGNLzMYnQKcX8w+DjR3WAXSQpLinbGqW5w6I+rEOnh/ZT64SWJeh7jkE1ri7j /iwRNcrdmd97m71ku5XJFNqyrMxi6BVVW0jGxKaXVSnV2t/66ka04Vp2aLIlErHhVgnC +OGvv8fw17i7m7UnCgvFD+rYGoa0L5jQWh1QsUVIZKmhT+BvANvGQQcij+xy6Orper7K Hoaqy2IDoz/f2oXlF2a5CklBXkODa3cwecJP86EFBqxjZBptJ6DFmqGf2c8UORPPtNe0 dUeTaKqxyUz+Z5fYw8btueZwrfZzPwxp0xeb5xwicVl13DuW/pb/jgOjet2PpmGBtzu5 9sZQ== X-Gm-Message-State: AOAM532BUKYCl2ZIoeMNB2cEkA9lRvdRRPihzegTQz15+rknz0Fo4eYD LjU777hxgeqezvjk64N+zI41Sghjp+I= X-Received: by 2002:a65:41c3:0:b0:363:5711:e234 with SMTP id b3-20020a6541c3000000b003635711e234mr5039062pgq.386.1650652113575; Fri, 22 Apr 2022 11:28:33 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id b17-20020a056a000a9100b004e1b7cdb8fdsm3593300pfl.70.2022.04.22.11.28.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 11:28:32 -0700 (PDT) Message-ID: <68c4710d-013e-85e0-154d-413f4e13b27e@gmail.com> Date: Fri, 22 Apr 2022 11:28:30 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH net-next 2/5] net: dsa: add out-of-band tagging protocol Content-Language: en-US To: Maxime Chevallier , davem@davemloft.net, Rob Herring Cc: 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 References: <20220422180305.301882-1-maxime.chevallier@bootlin.com> <20220422180305.301882-3-maxime.chevallier@bootlin.com> From: Florian Fainelli In-Reply-To: <20220422180305.301882-3-maxime.chevallier@bootlin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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? -- Florian