]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: reorder structs to reduce memory consumption
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 9 Mar 2026 09:39:28 +0000 (09:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Mar 2026 02:54:06 +0000 (19:54 -0700)
Reorder some of the stmmac structures to allow them to pack better,
thereby using less memory. On aarch64, sizeof(struct stmmac_priv)
was 880, and with this change becomes 816, saving 64 bytes, which
is an 8% saving.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Link: https://patch.msgid.link/E1vzX5E-0000000CVs8-40w4@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/stmmac.h

index 9420da96a4ff2f88d7c222629195fb8782be2c3f..411cdd3ea034223712d3f205e88348a1cdc6aedc 100644 (file)
@@ -108,37 +108,37 @@ struct stmmac_dma_cfg {
 
 #define AXI_BLEN       7
 struct stmmac_axi {
-       bool axi_lpi_en;
-       bool axi_xit_frm;
        u32 axi_wr_osr_lmt;
        u32 axi_rd_osr_lmt;
-       bool axi_kbbe;
        u32 axi_blen_regval;
+       bool axi_lpi_en;
+       bool axi_xit_frm;
+       bool axi_kbbe;
        bool axi_fb;
        bool axi_mb;
        bool axi_rb;
 };
 
 struct stmmac_rxq_cfg {
-       u8 mode_to_use;
        u32 chan;
+       u32 prio;
+       u8 mode_to_use;
        u8 pkt_route;
        bool use_prio;
-       u32 prio;
 };
 
 struct stmmac_txq_cfg {
        u32 weight;
-       bool coe_unsupported;
-       u8 mode_to_use;
        /* Credit Base Shaper parameters */
        u32 send_slope;
        u32 idle_slope;
        u32 high_credit;
        u32 low_credit;
-       bool use_prio;
        u32 prio;
        int tbs_en;
+       bool use_prio;
+       bool coe_unsupported;
+       u8 mode_to_use;
 };
 
 struct stmmac_safety_feature_cfg {