pkg/lwip: Add thread safety check when using DEVELHELP#16259
pkg/lwip: Add thread safety check when using DEVELHELP#16259miri64 merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
Still looking for a review of this. |
Sorry, was very busy the last few month. I will have a look ASAP! |
miri64
left a comment
There was a problem hiding this comment.
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 DEVELHELPs #if IS_ACTIVE(LWIP_TCPIP_CORE_LOCKING) instead and set LWIP_TCPIP_CORE_LOCKING == 1 when DEVELHELP is defined in lwipopts.h?
miri64
left a comment
There was a problem hiding this comment.
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
DEVELHELPis 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
netifapifunctions for dhcp and netif link up/down.Testing procedure
All lwip tests still work.
When calling
dhcp_startinstead 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:742Sending data with lwip sock still works when manually using test commands on
tests/lwipIssues/PRs references
None