net: stmmac: move MSI data out of struct stmmac_priv
Subsystems (4)
PATCH v2 1/1 net: stmmac: move MSI data out of struct stmmac_priv
Only three platforms supprt MSIs, which means having all the strings and interrupt arrays always allocated wastes space. None of this data is performance critical - this data is only used when requesting and releasing the MSI interrupts.
Move the MSI data out of struct stmmac_priv into its own separately allocated structure, and move its initialisation to a separate function.
This removes 768 bytes from struct stmmac_priv.
---
v2: fix AI review comments in stmmac_free_irq() and resolve the 80 column wrap.
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 31 +++--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 102 +++++++++++------- 2 files changed, 81 insertions(+), 52 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac.h +18 -13
@@ -243,6 +243,23 @@ struct stmmac_est {u32 max_sdu[MTL_MAX_TX_QUEUES ]; }; +struct stmmac_msi { +int sfty_ce_irq; +int sfty_ue_irq; +int rx_irq[MTL_MAX_RX_QUEUES ]; +int tx_irq[MTL_MAX_TX_QUEUES ]; + +/*irq name */ +char int_name_mac[IFNAMSIZ +9 ]; +char int_name_wol[IFNAMSIZ +9 ]; +char int_name_lpi[IFNAMSIZ +9 ]; +char int_name_sfty[IFNAMSIZ +10 ]; +char int_name_sfty_ce[IFNAMSIZ +10 ]; +char int_name_sfty_ue[IFNAMSIZ +10 ]; +char int_name_rx_irq[MTL_MAX_RX_QUEUES ][IFNAMSIZ +14 ]; +char int_name_tx_irq[MTL_MAX_TX_QUEUES ][IFNAMSIZ +18 ]; +}; +struct stmmac_priv {/* Frequently used values are kept adjacent for cache effect */ u32 tx_coal_frames[MTL_MAX_TX_QUEUES ];
@@ -329,19 +346,7 @@ struct stmmac_priv {unsigned long active_vlans[BITS_TO_LONGS (VLAN_N_VID )];unsigned int num_double_vlans;int sfty_irq; -int sfty_ce_irq; -int sfty_ue_irq; -int rx_irq[MTL_MAX_RX_QUEUES ]; -int tx_irq[MTL_MAX_TX_QUEUES ]; -/*irq name */ -char int_name_mac[IFNAMSIZ +9 ]; -char int_name_wol[IFNAMSIZ +9 ]; -char int_name_lpi[IFNAMSIZ +9 ]; -char int_name_sfty[IFNAMSIZ +10 ]; -char int_name_sfty_ce[IFNAMSIZ +10 ]; -char int_name_sfty_ue[IFNAMSIZ +10 ]; -char int_name_rx_irq[MTL_MAX_RX_QUEUES ][IFNAMSIZ +14 ]; -char int_name_tx_irq[MTL_MAX_TX_QUEUES ][IFNAMSIZ +18 ]; +struct stmmac_msi *msi;#ifdef CONFIG_DEBUG_FS struct dentry *dbgfs_dir;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +63 -39
217 lines not on this page · raw message
Signature · 1 line
2.47.3
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Fri, 13 Mar 2026 11:51:58 +0000 you wrote:
Only three platforms supprt MSIs, which means having all the strings and interrupt arrays always allocated wastes space. None of this data is performance critical - this data is only used when requesting and releasing the MSI interrupts.
Move the MSI data out of struct
stmmac_privinto its own separately allocated structure, and move its initialisation to a separate function.[...]
Here is the summary with links:
- [net-next,v2] net: stmmac: move MSI data out of struct stmmac_priv
https://git.kernel.org/netdev/net-next/c/dab177cbea34
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html