]> git.hungrycats.org Git - linux/commitdiff
net: stmmac: dwmac4: Account for the primary MAC address for UC filtering
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Wed, 26 Aug 2026 14:04:55 +0000 (16:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:15 +0000 (13:36 +0200)
[ Upstream commit 82187f42c014d22520b9c3c4e2cfb519223fb29b ]

The same filter slots are used to store the main MAC address as well as
the address for the unicast filter. Let's account for that when deciding
whether or not to use promisc when programming the UC list in hardware.

Fixes: 477286b53f55 ("stmmac: add GMAC4 core support")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260826140500.616466-4-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

index 1f61177ece453ce9ee82caac793ea3a9a974118c..666aed0906b5aa14a36ea0986f10c194f1f42e45 100644 (file)
@@ -515,7 +515,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
        value |= GMAC_PACKET_FILTER_HPF;
 
        /* Handle multiple unicast addresses */
-       if (netdev_uc_count(dev) > hw->unicast_filter_entries) {
+       if (netdev_uc_count(dev) + 1 > hw->unicast_filter_entries) {
                /* Switch to promiscuous mode if more than 128 addrs
                 * are required
                 */