Skip to content

Commit d4e470f

Browse files
khayash1smb49
authored andcommitted
net: stmmac: Correct usage of maximum queue number macros
BugLink: https://bugs.launchpad.net/bugs/2115678 [ 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> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent d81dcc0 commit d4e470f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/net/ethernet/stmicro/stmmac/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ struct stmmac_rxq_stats {
101101
/* Updates on each CPU protected by not allowing nested irqs. */
102102
struct stmmac_pcpu_stats {
103103
struct u64_stats_sync syncp;
104-
u64_stats_t rx_normal_irq_n[MTL_MAX_TX_QUEUES];
105-
u64_stats_t tx_normal_irq_n[MTL_MAX_RX_QUEUES];
104+
u64_stats_t rx_normal_irq_n[MTL_MAX_RX_QUEUES];
105+
u64_stats_t tx_normal_irq_n[MTL_MAX_TX_QUEUES];
106106
};
107107

108108
/* Extra statistic and debug information exposed by ethtool */

drivers/net/ethernet/stmicro/stmmac/stmmac.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,15 @@ struct stmmac_priv {
257257
/* Frequently used values are kept adjacent for cache effect */
258258
u32 tx_coal_frames[MTL_MAX_TX_QUEUES];
259259
u32 tx_coal_timer[MTL_MAX_TX_QUEUES];
260-
u32 rx_coal_frames[MTL_MAX_TX_QUEUES];
260+
u32 rx_coal_frames[MTL_MAX_RX_QUEUES];
261261

262262
int hwts_tx_en;
263263
bool tx_path_in_lpi_mode;
264264
bool tso;
265265
int sph;
266266
int sph_cap;
267267
u32 sarc_type;
268-
269-
u32 rx_riwt[MTL_MAX_TX_QUEUES];
268+
u32 rx_riwt[MTL_MAX_RX_QUEUES];
270269
int hwts_rx_en;
271270

272271
void __iomem *ioaddr;
@@ -343,7 +342,7 @@ struct stmmac_priv {
343342
char int_name_sfty[IFNAMSIZ + 10];
344343
char int_name_sfty_ce[IFNAMSIZ + 10];
345344
char int_name_sfty_ue[IFNAMSIZ + 10];
346-
char int_name_rx_irq[MTL_MAX_TX_QUEUES][IFNAMSIZ + 14];
345+
char int_name_rx_irq[MTL_MAX_RX_QUEUES][IFNAMSIZ + 14];
347346
char int_name_tx_irq[MTL_MAX_TX_QUEUES][IFNAMSIZ + 18];
348347

349348
#ifdef CONFIG_DEBUG_FS

0 commit comments

Comments
 (0)