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 5A9B2C74A5B for ; Thu, 16 Mar 2023 23:19:13 +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:References:In-Reply-To: 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=BSGPdpYDup76oknKN4pTxH5wcWyCkcsQ2axUlJGfkfo=; b=Qn8P5uO0prNxVD EqZlYYwWi/iyemXlHx/NhSkYYcdQ49732mvcRuzHJq4mkOXKuNzL5xlHeLWKx9hXG2p66Pw6jbWox kG17omIBw2il0epGER7ksK+AgZENufhjEYboIZOZqGcY4E1XoqqFZ0Y3cx+ssPWZlf7OHL45hj/ak 24RXhnsvj3mNOoA2H/RoKOParCvI574lvl/YaOOxho9iayaLZKRZSkJhl+C4yz10V9CfcEXF0ytQp tzlp85frQmnuUhfDevbfihyR+wXelzEa/JlUQj/5YOEYXUNjX5CmS56vnHJaMqqgp4oM3Lbwwjcqa ZPZANDKzrXzIuYHJHcUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcwrS-000I7B-2l; Thu, 16 Mar 2023 23:18:18 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcwrP-000I6Z-1h for linux-arm-kernel@lists.infradead.org; Thu, 16 Mar 2023 23:18:16 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C18C96215E; Thu, 16 Mar 2023 23:18:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE9C1C433D2; Thu, 16 Mar 2023 23:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679008694; bh=OYxBo4djlS61XYzgafFcijG0gwXMYYjumjcr57f8sII=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rWb1M0TbcYdWvys6U7qm+pWzcbxM7BHmg+3uLg8AfqIyld4olOVBoV7jkl+r81Jqj f+RYlS2hnjRsQhaxz9CTN25s8fDp/fsMetItOKM8tj+8I64oI3bgs+2g/8CpvLHz+V i2QtxX2WI2LbSernJmYN7v8czmwcu+VELH30cD2EWMDSt/cjjLxP45bEUVDsqO/mDC pW7SpbAbEmFGp9EuTGd4JfmBm1fU7ZDOWfsyPg6pBOfMYFUwqgP4vtvlG7jrH97Xej IlUUblIFivZyHGgsbp2ciNDZtBzbljRkS8veHt81beTxQIGhLQQ5NZykN4zVwtay8L rvOAS06RYJB+Q== Date: Thu, 16 Mar 2023 16:18:11 -0700 From: Jakub Kicinski To: "Russell King (Oracle)" Cc: Andrew Halaney , linux-kernel@vger.kernel.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, vkoul@kernel.org, bhupesh.sharma@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, richardcochran@gmail.com, veekhee@apple.com, tee.min.tan@linux.intel.com, mohammad.athari.ismail@intel.com, jonathanh@nvidia.com, ruppala@nvidia.com, bmasney@redhat.com, andrey.konovalov@linaro.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, ncai@quicinc.com, jsuraj@qti.qualcomm.com, hisunil@quicinc.com Subject: Re: [PATCH net-next 08/11] net: stmmac: Add EMAC3 variant of dwmac4 Message-ID: <20230316161811.64d14cb3@kernel.org> In-Reply-To: References: <20230313165620.128463-1-ahalaney@redhat.com> <20230313165620.128463-9-ahalaney@redhat.com> <20230313173904.3d611e83@kernel.org> <20230316183609.a3ymuku2cmhpyrpc@halaney-x13s> <20230316115234.393bca5d@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230316_161815_666013_760A6BF3 X-CRM114-Status: GOOD ( 21.19 ) 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 Thu, 16 Mar 2023 23:01:13 +0000 Russell King (Oracle) wrote: > What I would say is be careful with that - make sure "struct bla" is > specific to the interface being called and not generic. > > I had that mistake with struct phylink_state... and there is an > endless stream of people who don't seem to bother reading the > documentation, who blindly access whatever members of that they > damn well please because it suits them, even when either they > shouldn't be writing to them, or when phylink doesn't guarantee > their contents, they read them. Right, gotta take it case by case. I really like structs for const capabilities of the driver / device, which need to be communicated to the core. > As a result, I'm now of the opinion that using a struct to pass > arguments is in principle a bad idea. > > There's other reasons why it's a bad idea. Many ABIs are capable of > passing arguments to functions via processor registers. As soon as > one uses a struct, they typically end up being written to memory. > Not only does that potentially cause cache line churn, it also > means that there could be more slow memory accesses that have to be > made at some point, potentially making other accesses slow. > > So, all in all, I'm really not a fan of the struct approach for > all the reasons above. Also true, one has to be careful on the fast paths. There are cases where similar set of arguments is passed multiple functions down. Making the code hard to follow and extend. But you're right, structs will be slower for the most part. For stmmac I figured it can only help. The driver is touched my very many people, it has layers and confusions... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel