]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: stmmac: xgmac: Not all Unicast addresses may be available
authorJose Abreu <Jose.Abreu@synopsys.com>
Mon, 30 Sep 2019 08:19:05 +0000 (10:19 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 17:46:16 +0000 (18:46 +0100)
BugLink: https://bugs.launchpad.net/bugs/1850456
[ Upstream commit 9a2ae7b3960eb2426a8560cbc3251e3453230d21 ]

Some setups may not have all Unicast addresses filters available. Let's
check this before trying to setup filters.

Fixes: 0efedbf11f07 ("net: stmmac: xgmac: Fix XGMAC selftests")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

index 85c68b7ee8c6a557cb8a306d5bbb6ae633432c0b..46d74f407aab6f1586238228f093f88bf516f896 100644 (file)
@@ -370,7 +370,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw,
        dwxgmac2_set_mchash(ioaddr, mc_filter, mcbitslog2);
 
        /* Handle multiple unicast addresses */
-       if (netdev_uc_count(dev) > XGMAC_ADDR_MAX) {
+       if (netdev_uc_count(dev) > hw->unicast_filter_entries) {
                value |= XGMAC_FILTER_PR;
        } else {
                struct netdev_hw_addr *ha;