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

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: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260826140500.616466-3-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/dwmac1000_core.c

index 5bf717188c92dfb0d62faaad44c61ba89b9079f0..8a786bececdad8fea5b3b166f66f8277b41ac583 100644 (file)
@@ -187,7 +187,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
        dwmac1000_set_mchash(ioaddr, mc_filter, mcbitslog2);
 
        /* Handle multiple unicast addresses (perfect filtering) */
-       if (netdev_uc_count(dev) > perfect_addr_number)
+       if (netdev_uc_count(dev) + 1 > perfect_addr_number)
                /* Switch to promiscuous mode if more than unicast
                 * addresses are requested than supported by hardware.
                 */