]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: Correct usage of maximum queue number macros
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Fri, 21 Feb 2025 05:18:18 +0000 (14:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:13:09 +0000 (11:13 +0200)
[ Upstream commit 352bc4513ec3907db71cb5674fb93a76fc341ca9 ]

The maximum numbers of each Rx and Tx queues are defined by
MTL_MAX_RX_QUEUES and MTL_MAX_TX_QUEUES respectively.

There are some places where Rx and Tx are used in reverse. There is no
issue when the Tx and Rx macros have the same value, but should correct
usage of macros for maximum queue number to keep consistency and prevent
unexpected mistakes.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://patch.msgid.link/20250221051818.4163678-1-hayashi.kunihiko@socionext.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/stmmac.h

index e25db747a81a5bf2c5b11298b3be1ddebfae4f32..c660eb933f24b8b785f032b0bfbf64091bdee28b 100644 (file)
@@ -101,8 +101,8 @@ struct stmmac_rxq_stats {
 /* Updates on each CPU protected by not allowing nested irqs. */
 struct stmmac_pcpu_stats {
        struct u64_stats_sync syncp;
-       u64_stats_t rx_normal_irq_n[MTL_MAX_TX_QUEUES];
-       u64_stats_t tx_normal_irq_n[MTL_MAX_RX_QUEUES];
+       u64_stats_t rx_normal_irq_n[MTL_MAX_RX_QUEUES];
+       u64_stats_t tx_normal_irq_n[MTL_MAX_TX_QUEUES];
 };
 
 /* Extra statistic and debug information exposed by ethtool */
index f05cae103d836c5dace6efff2ded4c73187648a0..dae279ee2c2808608b5eb21b4b8ded437746241b 100644 (file)
@@ -257,7 +257,7 @@ struct stmmac_priv {
        /* Frequently used values are kept adjacent for cache effect */
        u32 tx_coal_frames[MTL_MAX_TX_QUEUES];
        u32 tx_coal_timer[MTL_MAX_TX_QUEUES];
-       u32 rx_coal_frames[MTL_MAX_TX_QUEUES];
+       u32 rx_coal_frames[MTL_MAX_RX_QUEUES];
 
        int hwts_tx_en;
        bool tx_path_in_lpi_mode;
@@ -265,8 +265,7 @@ struct stmmac_priv {
        int sph;
        int sph_cap;
        u32 sarc_type;
-
-       u32 rx_riwt[MTL_MAX_TX_QUEUES];
+       u32 rx_riwt[MTL_MAX_RX_QUEUES];
        int hwts_rx_en;
 
        void __iomem *ioaddr;
@@ -343,7 +342,7 @@ struct stmmac_priv {
        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_TX_QUEUES][IFNAMSIZ + 14];
+       char int_name_rx_irq[MTL_MAX_RX_QUEUES][IFNAMSIZ + 14];
        char int_name_tx_irq[MTL_MAX_TX_QUEUES][IFNAMSIZ + 18];
 
 #ifdef CONFIG_DEBUG_FS