-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/lwip: Add thread safety check when using DEVELHELP #16259
Conversation
Still looking for a review of this. |
Sorry, was very busy the last few month. I will have a look ASAP! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc says LWIP_TCPIP_CORE_LOCKING
needs to be set to 1
for this feature to be used. So wouldn't it be more sensible to make the #ifdef DEVELHELP
s #if IS_ACTIVE(LWIP_TCPIP_CORE_LOCKING)
instead and set LWIP_TCPIP_CORE_LOCKING == 1
when DEVELHELP
is defined in lwipopts.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. I ran tests/lwip
on native
. The remaining tests should run on Murdock.
Please squash |
I bisected the failing test on |
Contribution description
When
DEVELHELP
is enabled, add checks that unprotected lwip functions are called correctly:The check is a macro to preserve the file/line of where it fired, to simplify debugging.
Adds locking to some calls in sock implementation to make it safe.
Having this enabled will make it harder to add new unsafe code.
Netif handling has already been made safe in the switch to
netifapi
functions for dhcp and netif link up/down.Testing procedure
All lwip tests still work.
When calling
dhcp_start
instead of netifapi version in pkg/lwip/contrib/lwip.c, the following failure occurs (when IPv4 enabled) on native:Assertion "Core lock held" failed at [...]/RIOT/build/pkg/lwip/src/core/ipv4/dhcp.c:742
Sending data with lwip sock still works when manually using test commands on
tests/lwip
Issues/PRs references
None