Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3076204pxf; Sun, 28 Mar 2021 10:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF9+yKvl1732HKds11ubkicT+evUAeBQ4GcxUrD5811AxdNt4HwR5GXAI3fHnD6VFpq4qu X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr24935332ejb.273.1616953748657; Sun, 28 Mar 2021 10:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616953748; cv=none; d=google.com; s=arc-20160816; b=LKy0In7Q5QOd+fzLo+TbKBkeYhdexCtR+PvA9aa+/hvfHsDAlGVU2+pYMD46XTWKRx jynKOCqH0Wd745eVALl7+2sIAaVRU9ZTXiV8oShsJIAycYEAJfgApeVhsynFTisthpCu RYcOEJdDHpt8ipASbgunYeDCrRR6Td9yUXMytHaIRqEOdui1KlGVFGbQR/CnqU5YCwMp zbtQP+mcBXVRBsotuIBTH8aF7/SgKNheaT/9l75jr6tZmTYp5kvHE/xzS6ou/+AfaQCG 1Qkk9sOX61MfbYEJ8gQ4nrSzzNZyfaL0kyiuSgJcd/tje+A/22ys4kADB4EcgCsOfPMo 3GMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nBaQagowiaXoGgbGgBtNxP76a/nfrnLjKxEKq9V+OCc=; b=dM4+rkHY/I2255bztMbcrQNQ2fyTv0jMnrsNjORkhgc9aWy2wKbgwM2dIyAEJsctRp 2xpXJtG0AuTbh6QxL0r6UfNOjSfcxBW6+Ys2FnTrnTb1U2SBBXgk3te1BxC5/IV2XHXz o9X0fx7kr1jiJEML05VVgVB2T3YVs+i9fzxXxI11gUAVZQpJNFMSXMq0bxyiV/PWMP0s On4J7yh/3T0AAsda+/3uDU9JDWQ3dffIW2HnMOvPc230KozEN8DpblNz/pkT18sT1ENx 4cxdMGE89t0JyzDMhXxY71j5ul3lvwxIJN2plHGpDumsy8XXbcBbCuInJdcd+u4sALRG 6d4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s6si11838532ejq.79.2021.03.28.10.48.44; Sun, 28 Mar 2021 10:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbhC1Rro (ORCPT + 99 others); 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: linux-kernel@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