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 1815EC47DAF for ; Mon, 22 Jan 2024 17:38:07 +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:In-Reply-To:MIME-Version:References: 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=8t65f+IdZLNaD4FYANw0mNcP+tBZMa6c3AcuZm/2ZUs=; b=iUNOY7eTOUUSlT Af4ns/NyZDaRohmdPgP15J6tHaQSO1/457vlqDQbsUe2gqEP4CLegMUU3VLyu93FiZCkZCm0Mgf8F NJthbAIMSUvGjNpApgPg2ok3dWoS7LXQQHOrJv2k5fdzHJvWcoBjy28Sa+J6OLEytgYTwy3jEql0V oWLSwMVPApS+TH09bFWHoCiyWpTX42+citEhf4CvkShgoacXFRKyxKJAM4d1Oar27hFy2Tr7hQENu +JgJ+y6VuhJvwc/Mgq6mAAn7sJiKzpqhX7Y0z6fPWHPrpX3/sRtVOKV25l5S5kMQf9Xqfs0qud11a E3cR8aDzBrM4rvLwj2vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rRyEu-00DHFq-10; Mon, 22 Jan 2024 17:37:40 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rRyEq-00DHAq-1F for linux-arm-kernel@lists.infradead.org; Mon, 22 Jan 2024 17:37:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Tpq99Xn3oyUQ1UeFUe2J523sJUHds2quY0PBRgIFX08=; b=GxcCDIxdcwixCbMs9SgULyWG0E wCMQM9VlMDAwLQxTgpHTEnRfE7msH3WejKCDAHDyw87vHsUC+aNXNRD5jNUUHo0qapTZA38hZrvJZ 53K0QFJlwd5MNlRh0P8e6SnP37AmP2XpUWXxNWqzhwcI/X3UQ95Ykmav1x5+PGmO4et3HnLPPxJ0m Ovo2XLa+Jaq5M5MgSObj3Z+PHWiB4+DorhpvG0pA59gH/tQGUs3xQUfmp57dswHCfYH54aZiBnGwQ aGo7q/CvW8kcAt7Ga7nDj7uHEPQQsZl1YGmuv0vUAqKgOCyJXWhLwIOjPfq76ejYFSQo4GqGevKVU rqsU1+RQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56168) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rRyEA-0001Ho-0p; Mon, 22 Jan 2024 17:36:54 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rRyE0-0001CD-Mi; Mon, 22 Jan 2024 17:36:44 +0000 Date: Mon, 22 Jan 2024 17:36:44 +0000 From: "Russell King (Oracle)" To: Lei Wei Cc: Luo Jie , agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, p.zabel@pengutronix.de, shannon.nelson@amd.com, anthony.l.nguyen@intel.com, jasowang@redhat.com, brett.creeley@amd.com, rrameshbabu@nvidia.com, joshua.a.hay@intel.com, arnd@arndb.de, geert+renesas@glider.be, neil.armstrong@linaro.org, dmitry.baryshkov@linaro.org, nfraprado@collabora.com, m.szyprowski@samsung.com, u-kumar1@ti.com, jacob.e.keller@intel.com, andrew@lunn.ch, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ryazanov.s.a@gmail.com, ansuelsmth@gmail.com, quic_kkumarcs@quicinc.com, quic_suruchia@quicinc.com, quic_soni@quicinc.com, quic_pavir@quicinc.com, quic_souravp@quicinc.com, quic_linchen@quicinc.com Subject: Re: [PATCH net-next 18/20] net: ethernet: qualcomm: Add PPE MAC support for phylink Message-ID: References: <20240110114033.32575-1-quic_luoj@quicinc.com> <20240110114033.32575-19-quic_luoj@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240122_093736_432443_9EE74660 X-CRM114-Status: GOOD ( 18.86 ) 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 Mon, Jan 22, 2024 at 11:01:26PM +0800, Lei Wei wrote: > > > On 1/10/2024 8:18 PM, Russell King (Oracle) wrote: > > On Wed, Jan 10, 2024 at 07:40:30PM +0800, Luo Jie wrote: > > > @@ -352,6 +1230,12 @@ static int ppe_port_maxframe_set(struct ppe_device *ppe_dev, > > > } > > > static struct ppe_device_ops qcom_ppe_ops = { > > > + .phylink_setup = ppe_phylink_setup, > > > + .phylink_destroy = ppe_phylink_destroy, > > > + .phylink_mac_config = ppe_phylink_mac_config, > > > + .phylink_mac_link_up = ppe_phylink_mac_link_up, > > > + .phylink_mac_link_down = ppe_phylink_mac_link_down, > > > + .phylink_mac_select_pcs = ppe_phylink_mac_select_pcs, > > > .set_maxframe = ppe_port_maxframe_set, > > > }; > > > > Why this extra layer of abstraction? If you need separate phylink > > operations, why not implement separate phylink_mac_ops structures? > > > > This PPE driver will serve as the base driver for higher level drivers > such as the ethernet DMA (EDMA) driver and the DSA switch driver. Why not have the higher level drivers provide a pointer to the appropriate phylink_mac_ops structure? Having extra levels of indirection makes my future maintenance of phylink harder (I'm already bugged by DSA doing this, and it's a right pain.) For example, if one of your higher level drivers needs the mac_prepare or mac_finish functionality, you have to add a shim, extra function pointers and so on. If I need to add an extra parameter to a method, then I have to fix up your shim layer _as well_ as all the called methods - in other words, it adds extra maintenance burden. It also makes detecting whether an implementation provides something or not harder - see the problems when mac_select_pcs() was introduced and rather than testing to see whether the method is populated, we have to call the method with a dummy value to discover whether the sub-driver implements it or not. Honestly, I would really like to get rid of DSA's phylink_mac_ops shim layer. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel