[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250523221938.2980773-1-nikunj.kela@sima.ai>
Date: Fri, 23 May 2025 15:19:38 -0700
From: Nikunj Kela <nikunj.kela@...a.ai>
To: andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com
Cc: rmk+kernel@...linux.org.uk,
0x1207@...il.com,
netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Nikunj Kela <nikunj.kela@...a.ai>
Subject: [PATCH] net: stmmac: set multicast filter to zero if feature is unsupported
Hash based multicast filtering is an optional feature. Currently,
driver overrides the value of multicast_filter_bins based on the hash
table size. If the feature is not supported, hash table size reads 0
however the value of multicast_filter_bins remains set to default
HASH_TABLE_SIZE which is incorrect. Let's override it to 0 if the
feature is unsupported.
Signed-off-by: Nikunj Kela <nikunj.kela@...a.ai>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 085c09039af4..ccea9f811a05 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7241,6 +7241,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
(BIT(priv->dma_cap.hash_tb_sz) << 5);
priv->hw->mcast_bits_log2 =
ilog2(priv->hw->multicast_filter_bins);
+ } else {
+ priv->hw->multicast_filter_bins = 0;
+ priv->hw->mcast_bits_log2 = 0;
}
/* TXCOE doesn't work in thresh DMA mode */
--
2.34.1
Powered by blists - more mailing lists