From: Andrew Lunn <andrew@lunn.ch>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: "Nicolai Buchwitz" <nb@tipi-net.de>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"Jakub Kicinski" <kuba@kernel.org>,
davem@davemloft.net, "Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Russell King" <linux@armlinux.org.uk>,
thomas.petazzoni@bootlin.com,
"Alexis Lothoré" <alexis.lothore@bootlin.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH net-next 1/2] net: stmmac: dwmac4: Read the UC filter size from hardware capabilities
Date: Tue, 1 Sep 2026 14:38:06 +0200 [thread overview]
Message-ID: <96eae005-8be7-4d65-9461-8a8475e38089@lunn.ch> (raw)
In-Reply-To: <b677535a-5395-4703-aa08-a71a6b26ccb6@bootlin.com>
On Tue, Sep 01, 2026 at 09:04:28AM +0200, Maxime Chevallier wrote:
>
>
> On 9/1/26 02:26, Andrew Lunn wrote:
> >> Yeah but dwmac4 has a hash filter, but same as the UC filter it's just not plumbed
> >> in :/
> >>
> >> Let's leave this flag here, hash filter addition for MC filtering is coming-up, so let's not
> >> drop it now only to re-enable it after, one of the other wonderful discoveries found by
> >> running the selftests...
> >
> > I assume you can put a MC address in a perfect match filter? You can
> > perfectly match a multicast address just as well as a unicast address.
> >
> > The hash filter is less accurate, but again can be used to match a
> > unicast or multicast address, and then you need additional filtering
> > in software, which Linux will do.
> >
> > So it seems to me, you should use a perfect match filters if you have
> > one available, independent of unicast or multicast, and only use a
> > hash filter if you have run out of perfect match filters.
>
> That's an interesting point. The HW supports that, we have 3 control knobs
> for that in the MAC_PACKET_FILTER register :
>
> - HPF (bit 10) : Use Hash or Perfect Match for filtering.
> 0 : Match UC and MC against hash filter
> 1 : Match UC and MC according to HMC and HUC
>
> - HMC (bit 2) : Use Hash or Perfect Match for MC filtering
> 0 : Match MC against perfect filter
> 1 : Match MC against Hash table
>
> - HUC (bit 1) : Use Hash of PF for UC filtering
> 0 : Match UC against PF
> 1 : Match UC against Hash table
>
> I don't know though how this all interacts with the primary MAC address. We
> always have one entry in PF for the device's own MAC address, we should
> probably always perfect match that one.
Yes, i agree, the primary should be a perfect match.
> But as the UC Perfect Filter toggle is global for All UC addresses it means
> we're stuck with perfect filter for all UC then ?
> For MC, this is a good point, but I'm worried about the complexity vs gain.
>
> If we consider the 4 dwmac boards I have (may not be a very representative sample),
> we have :
>
> - imx8mp : 64 PF (Perfect Fitler) entries
> - jh7110 : 9 PF entries
> - stm32mp1 : 4 PF entries
> - yt6801 : 1 PF entry
I assume the imx8mp is using bank 1 and back 2? The designers of this
device seem to think the use cases for the device include lots of UC
and MC addresses.
Maybe, reserve bank 0 for UC, but allow both UC and MC in bank 1 and
2? That would allow imx8mp to make use of its hardware in an efficient
way, but it also keeps things simple and efficient for the more
restricted devices like the yt6801 and stm32mp1.
This discussion should however not effect this patchset. This sort of
optimisations can come later.
Andrew
next prev parent reply other threads:[~2026-09-01 12:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 7:01 [PATCH net-next 0/2] net: stmmac: dwmac4: Auto-discover UC filter size Maxime Chevallier
2026-08-31 7:01 ` [PATCH net-next 1/2] net: stmmac: dwmac4: Read the UC filter size from hardware capabilities Maxime Chevallier
2026-08-31 12:04 ` Nicolai Buchwitz
2026-08-31 12:15 ` Maxime Chevallier
2026-08-31 12:26 ` Nicolai Buchwitz
2026-09-01 0:26 ` Andrew Lunn
2026-09-01 7:04 ` Maxime Chevallier
2026-09-01 12:38 ` Andrew Lunn [this message]
2026-09-01 7:08 ` Maxime Chevallier
2026-08-31 7:01 ` [PATCH net-next 2/2] net: stmmac: dwmac4: Use the full perfect filter ability for UC filter Maxime Chevallier
2026-08-31 12:06 ` Nicolai Buchwitz
2026-09-01 0:12 ` Andrew Lunn
2026-09-01 6:37 ` Maxime Chevallier
2026-09-01 12:21 ` Andrew Lunn
2026-09-01 12:27 ` Maxime Chevallier
2026-09-01 12:50 ` Andrew Lunn
2026-09-03 9:00 ` [PATCH net-next 0/2] net: stmmac: dwmac4: Auto-discover UC filter size patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96eae005-8be7-4d65-9461-8a8475e38089@lunn.ch \
--to=andrew@lunn.ch \
--cc=alexandre.torgue@foss.st.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox