-
Notifications
You must be signed in to change notification settings - Fork 3k
LwIP: make TCPIP_THREAD_PRIO configurable #10980
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
Conversation
@vmedcy, thank you for your changes. |
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.
I'm a bit wary that if you find yourself needing to change priority you may have worse problems - I usually find thread priority isn't the answer. But may as well let people fiddle.
Just editorial suggestions.
features/lwipstack/mbed_lib.json
Outdated
@@ -120,6 +120,10 @@ | |||
"help": "Stack size for lwip TCPIP thread", | |||
"value": 1200 | |||
}, | |||
"tcpip-thread-priority": { | |||
"help": "priority of lwip TCPIP thread", | |||
"value": 24 |
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.
I'd prefer this to be set by name - make it "osPriorityNormal"
. 24
is a bit vague.
Strings work fine here - a JSON string becomes C token(s). (If you wanted a C string you'd need to do "\"string\""
).
features/lwipstack/mbed_lib.json
Outdated
@@ -120,6 +120,10 @@ | |||
"help": "Stack size for lwip TCPIP thread", | |||
"value": 1200 | |||
}, | |||
"tcpip-thread-priority": { | |||
"help": "priority of lwip TCPIP thread", |
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.
"Priority of..."
(capital)
features/lwipstack/lwipopts.h
Outdated
@@ -111,7 +111,11 @@ | |||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8) | |||
#endif | |||
|
|||
#ifdef MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY |
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.
Could we add a comment with the default value.
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.
Actually, I'd kind of prefer not to have a default value here. This isn't a case where we need null
in the JSON to mean "do something sensible".
We could just put the "osPriorityNormal"
in the default JSON file, and have no #ifdef
here.
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.
Yes I am fine with "osPriorityNormal" in the default mbed_lib.json, with no #ifdef in header file.
changes done based on review for ARMmbed#10980
I would like to have better understanding why this fixes any problems. Having need to touch priorities to get some platforms to pass tests is a symptom of unstable platforms. Not a proper fix. Network stack interfaces in Mbed OS effectively operate in event-based system. Unless other drivers consume 100% of CPU, then there should be eventually enough time to pass data through network stack. Having a need to raise network stack priority to high sounds like platform has busy-loops running on normal priority threads. |
Hi Seppo, Cypress needs the LwIP TCP IP Thread priority configurable to set it to osPriorityHigh for some high throughput applicaitons such as iperf ( where the Throughput is sent at high rate of the order 40Mbps) from remote PC to Device. We have several threads most importantly we have internal thread which gets signalled when SDIO IRQ is triggerred this is responsible for reading SDIO bus data from WLAN chip and this thread allocates its memory for the packet using pbuf ( LWIP buffer), this thread runs at osPriorityHigh, the LWIP threads gets data (UDP traffic) and it keeps the data in pbuf ( RAW pool) until the application reads the data, now if the application is slower running at lower priority then we see the LWIP TCP IP priroity running at < osPriorityHigh running out of its memory pool buffers. Thanks |
Ah, so effectively you are just optimising the throughput of the system. |
I'll start the CI tests. |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Allow targets override TCPIP_THREAD_PRIO from features/lwipstack/mbed_lib.json.
Some PSoC 6 applications require TCPIP_THREAD_PRIO=osPriorityHigh to operate correctly.
Pull request type
Reviewers
Release Notes