| Message ID | aa6VEsmBK-S9eNYU@shell.armlinux.org.uk (mailing list archive) |
|---|---|
| Headers |
Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 305FB377ECC for <imx@lists.linux.dev>; Mon, 9 Mar 2026 09:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773049131; cv=none; b=etWC7VSy04q/xkM++o3Pyi/ielH/Z5AvOFNgq+rKE8K80YpFg0PEqBeNeO4P/67COTljCGvlhqk9nAuVnb8QfD9jhmVmPifkQK3Mg8+F8uThIPfAdCdNuYKCibjTlRUcGOanA2PQ3uSj4gksRkQ9jiv2L9srUCzIbrjHFLQo5wU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773049131; c=relaxed/simple; bh=WG8MBAd1Px0KOMzPUr6Up1Cm9AP/gxg7IMkSJts1dd0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=aTOHxg6A1REczOvF6P1n2VcVv7RbOwxcqaR10YMnQu/0M44ArMNdNl+hZBNReCaMZrjIR25EZYmKxtawcfh8yCmi+e5Hq2beuurqKb/fxXVerno7VF2K8UG45SVpuwBCyT0cEKR5HJssOjf/PQmCh1kXqIg8LRRKDcZBL5eJ2Xo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=XNO7P4n+; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="XNO7P4n+" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: 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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ten1uDei4vcUNTz7WaFaOkJ2TgTa4kazv/d2FQhK9d4=; b=XNO7P4n+74b32BXj8s7Erkc6iR C0gpgQ3CyJ/fgq5hADmRh8qc0DZ0ocPWj9/+H2R2K6aahQIQY3QGcjHPlpT5S+gsPrwlQ0dGegv7n qUb6c30OGZObfNHJgOh6lMlcnGBE7UpxUu6sWBr/fRAMdd3VTHiNLGVqh6VYvY9L0fYrIhq0peczM PRu0+AvWHLy/Xxojy3sws3OFrXBGpJLh7gNwGVXAfgIP7PS7oFtxA4v8/o/FFi/bSHhCODOMtvckY WrTniwza8Q9I7GAp99vMPoeGwgAIKWcHUJa05F/iQQR0usv09krwDaD+q90alxeh2zCCSbBsWVkG8 KKWQrpbg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56676) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from <linux@armlinux.org.uk>) id 1vzX4L-000000003TL-1Y7v; Mon, 09 Mar 2026 09:38:33 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from <linux@shell.armlinux.org.uk>) id 1vzX4E-000000004CG-0wpW; Mon, 09 Mar 2026 09:38:26 +0000 Date: Mon, 9 Mar 2026 09:38:26 +0000 From: "Russell King (Oracle)" <linux@armlinux.org.uk> To: Andrew Lunn <andrew@lunn.ch> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>, Andrew Lunn <andrew+netdev@lunn.ch>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Chen-Yu Tsai <wens@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Frank Li <Frank.Li@nxp.com>, imx@lists.linux.dev, Jakub Kicinski <kuba@kernel.org>, Jan Petrous <jan.petrous@oss.nxp.com>, Jonathan Hunter <jonathanh@nvidia.com>, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, Maxime Chevallier <maxime.chevallier@bootlin.com>, Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>, netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, s32@nxp.com, Samuel Holland <samuel@sholland.org>, Sascha Hauer <s.hauer@pengutronix.de>, Yao Zi <me@ziyao.cc> Subject: [PATCH net-next v2 0/7] net: stmmac: start to shrink memory usage Message-ID: <aa6VEsmBK-S9eNYU@shell.armlinux.org.uk> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: <imx.lists.linux.dev> List-Subscribe: <mailto:imx+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:imx+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: Russell King (Oracle) <linux@armlinux.org.uk> Status: O |
| Series |
net: stmmac: start to shrink memory usage
|
|
Message
Russell King (Oracle)
March 9, 2026, 9:38 a.m. UTC
Hi, Start shrinking stmmac's memory usage by avoiding using "int" for members that are only used for 0/1 (boolean) values, or values that can't be larger than 255. In addition, as struct stmmac_dma_cfg is approximately a cache line, shrinks below a cache line as a result of this patch set, and is required, there is no point separately allocating this from struct plat_stmmacenet_data. Embed it into the end of this struct and set the existing pointer to avoid large wide-spread changes. Lastly, add documentation for struct stmmac_dma_cfg, and document the stmmac clocks as best we can given the driver history. v2: - fix error in commit message for patch 5 - fix typo in comment in patch 6 drivers/net/ethernet/stmicro/stmmac/common.h | 4 +- .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 7 +- .../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 +- .../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 8 +- .../net/ethernet/stmicro/stmmac/dwmac-motorcomm.c | 4 - .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 +- drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 4 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac100_core.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 4 +- .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 4 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 227 +++++++++++---------- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 11 +- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 43 ++-- include/linux/stmmac.h | 93 +++++++-- 23 files changed, 239 insertions(+), 200 deletions(-)
Comments
Hi Russell, On Mon, Mar 09, 2026 at 09:38:26AM +0000, Russell King (Oracle) wrote: > Hi, > > Start shrinking stmmac's memory usage by avoiding using "int" for > members that are only used for 0/1 (boolean) values, or values that > can't be larger than 255. > > In addition, as struct stmmac_dma_cfg is approximately a cache line, > shrinks below a cache line as a result of this patch set, and is > required, there is no point separately allocating this from > struct plat_stmmacenet_data. Embed it into the end of this struct > and set the existing pointer to avoid large wide-spread changes. > > Lastly, add documentation for struct stmmac_dma_cfg, and document > the stmmac clocks as best we can given the driver history. > > v2: > - fix error in commit message for patch 5 > - fix typo in comment in patch 6 > No issues found with v1 on QCS9100 Ride R3, so feel free to add: Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com> Ayaan
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Mon, 9 Mar 2026 09:38:26 +0000 you wrote: > Hi, > > Start shrinking stmmac's memory usage by avoiding using "int" for > members that are only used for 0/1 (boolean) values, or values that > can't be larger than 255. > > In addition, as struct stmmac_dma_cfg is approximately a cache line, > shrinks below a cache line as a result of this patch set, and is > required, there is no point separately allocating this from > struct plat_stmmacenet_data. Embed it into the end of this struct > and set the existing pointer to avoid large wide-spread changes. > > [...] Here is the summary with links: - [net-next,v2,1/7] net: stmmac: provide plat_dat->dma_cfg in stmmac_plat_dat_alloc() https://git.kernel.org/netdev/net-next/c/7a6387dec8ce - [net-next,v2,2/7] net: stmmac: convert plat_stmmacenet_data booleans to type bool https://git.kernel.org/netdev/net-next/c/c3d08424e025 - [net-next,v2,3/7] net: stmmac: reorder structs to reduce memory consumption https://git.kernel.org/netdev/net-next/c/3357642e65e9 - [net-next,v2,4/7] net: stmmac: use u8 for ?x_queues_to_use and number_?x_queues https://git.kernel.org/netdev/net-next/c/94808793fed7 - [net-next,v2,5/7] net: stmmac: use u8 for host_dma_width and similar struct members https://git.kernel.org/netdev/net-next/c/758ed85aadd0 - [net-next,v2,6/7] net: stmmac: add documentation for stmmac_dma_cfg members https://git.kernel.org/netdev/net-next/c/9fe167ab790b - [net-next,v2,7/7] net: stmmac: add documentation for clocks https://git.kernel.org/netdev/net-next/c/315bab9411f3 You are awesome, thank you!