]> git.hungrycats.org Git - linux/commit
net: stmmac: selftests: Account for the UC filter list for filtering tests
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Wed, 26 Aug 2026 14:04:57 +0000 (16:04 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Aug 2026 17:53:28 +0000 (10:53 -0700)
commitcd8c3b2752c684141eab2282e294cae2971a9759
tree1434c70198829dd1197d5ff129f94792f40170e1
parent2739d6f9a2b8729b0d85cbe0dc93e1d68670b6f2
net: stmmac: selftests: Account for the UC filter list for filtering tests

On dwmac, one of the Unicast filter entries is used to store the local
HW addr. This means that we have to use promisc mode for any kind of
unicast filtering if we only have one slot in our unicast filter.

The number of slots available depends on how the IP is integrated, and
we can't autodiscover how many of these slots we have available, so
the DT property snps,perfect-filter-entries can be used to specify how
many are available.

Most IP variants default to 1 if this isn't specified, which is the case
for the amlogic variants (in this case, S905X3).

The stmmac selftests for UC filtering look if we have enough slots in
the filter to store the dev->uc list, but doesn't account for the
device's own MAC address. The dev->uc list's size we get with
netdev_uc_count() also doesn't account for the HW addr.

As the selftest only requires one available slot, in the case of
single-slot platforms, that means we erroneously consider we have enough
room for the test, when we actually don't, and the filtering test fails.

Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260826140500.616466-6-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c