Add multicast filter support to STM32 EMAC #408
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
This MR adds multicast filtering support to all STM32 MCUs that support Ethernet. It's an offshoot from my ongoing branch to rewrite the STM32 EMAC code (which is making progress, but slooooowly).
STM32 MCUs have both a "perfect" multicast filter and a hash filter. The perfect filter can match up to 3 mcast addresses exactly, while the hash filter matches mcast MAC addresses using a 64-entry hash table. The hash table method is obviously limited -- if you subscribe to, say, 32 MAC addresses using the hash table, you will have a 50% false positive rate for all other MAC addresses. So, this driver uses the perfect filter for the first 3 MAC addresses, then the hash table for any additional MACs.
By default, 8 addresses are supported, but this can be increased via the
stm32-emac.max-mcast-subscribes
JSON option.Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
Tested this on my branch on STM32H743 and it passed the multicast filter test. Sadly this test cannot be run on STM32H7 on master, because the current STM32H7 eth MAC driver is hardcoded to use LwIP only.