[PATCH net-next 0/2] net: stmmac: dwmac4: Auto-discover UC filter size
From: Maxime Chevallier
Date: Mon Aug 31 2026 - 03:04:33 EST
Following my attempts to get clean ethtool selftests runs on stmmac [1],
several issues were found with the unicast filtering.
[1]: https://lore.kernel.org/netdev/20260827134004.45ffb57e@xxxxxxxxxx/
This lead to the discovery that on dwmac4 platforms, the unicast filter
size is always falling back to the default value of 1 entry. On older
variants, the size comes from devicetree.
With a single-entry filter, we directly fallback to unicast promisc as
soon as any entry is added in the dev->uc list.
dwmac4 exposes through the HW_Features0 register the actual size of the
unicast filter, which is made of 3 banks (details in patch 2). Let's use
this feature to grab the filter size.
Results on actual hardware :
- imx8mp : goes from 1 entry to 64
- stm32mp1 : goes from 1 entry to 4
- jh7110 : goes from 1 entry to 9
- yt6801 : still 1 single entry, on extra implemented in HW
Maxime Chevallier (2):
net: stmmac: dwmac4: Read the UC filter size from hardware
capabilities
net: stmmac: dwmac4: Use the full perfect filter ability for UC filter
drivers/net/ethernet/stmicro/stmmac/common.h | 5 ++
drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 6 +-
.../net/ethernet/stmicro/stmmac/dwmac4_core.c | 60 +++++++++++++++----
.../net/ethernet/stmicro/stmmac/dwmac4_dma.c | 2 +
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 39 ++++++++++++
5 files changed, 99 insertions(+), 13 deletions(-)
--
2.55.0