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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 A3F39C433E0 for ; Sun, 28 Mar 2021 17:51:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 687036198F for ; Sun, 28 Mar 2021 17:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbhC1Rro (ORCPT ); Sun, 28 Mar 2021 13:47:44 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:51966 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbhC1Rrc (ORCPT ); Sun, 28 Mar 2021 13:47:32 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lQZVY-00DUY2-U4; Sun, 28 Mar 2021 19:47:28 +0200 Date: Sun, 28 Mar 2021 19:47:28 +0200 From: Andrew Lunn To: Sunil Kovvuri Cc: Hariprasad Kelam , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kuba@kernel.org" , "davem@davemloft.net" , Sunil Kovvuri Goutham , Linu Cherian , Geethasowjanya Akula , Jerin Jacob Kollanukkaran , Subbaraya Sundeep Bhatta Subject: Re: [net-next PATCH 0/8] configuration support for switch headers & phy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > The usecase is simple, unlike DSA tag, this 4byte FDSA tag doesn't > have a ethertype, > so HW cannot recognize this header. If such packers arise, then HW parsing will > fail and RSS will not work. > > Hypothetically if we introduce some communication between MAC driver > and DSA driver, > wouldn't that also become specific to the device, what generic usecase > that communication > will have ? Hi Sunil We need to be careful with wording. Due to history, the Linux kernel uses dsa to mean any driver to control an Ethernet switch. It does not imply the {E}DSA protocol used by Marvell switches, or even that the switch is a Marvell switch. netdev_uses_dsa(ndev) will tell you if the MAC is being used to connect to a switch. It is set by the Linux DSA core when the switch cluster is setup. That could be before or after the MAC is configured up, which makes it a bit hard to use, since you don't have a clear indicator when to evaluate to determine if you need to change your packet parsing. netdev_uses_dsa() looks at ndev->dsa_ptr. This is a pointer to the structure which represents the port on the switch the MAC is connected to. In Linux DSA terms, this is the CPU port. You can follow dsa_ptr->tag_ops which gives you the tagger operations, i.e. those used to add and remove the header/trailer. One member of that is proto. This contains the tagging protocol, so EDSA, DSA, or potentially FDSA, if that is ever supported. And this is all within the core DSA code, so is generic. It should work for any tagging protocol used by any switch which Linux DSA supports. So actually, everything you need is already present, you don't need a private flag. But adding a notifier that the MAC has been connected to a switch and ndev->dsa_ptr is set would be useful. We could maybe use NETDEV_CHANGE for that, or NETDEV_CHANGELOWERSTATE, since the MAC is below the switch slave interfaces. Andrew