Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multicast filter support to STM32 EMAC #408

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

multiplemonomials
Copy link
Collaborator

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

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

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.


@multiplemonomials multiplemonomials merged commit 2fd9d83 into master Dec 30, 2024
52 checks passed
@multiplemonomials multiplemonomials deleted the dev/stm32-emac-mcast-filter branch December 30, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants