zephyr/subsys/net/lib/zperf
Florian Grandel 378f0dd29d net: lib: zperf: fix kernel panic due to invalid thread prio
Compiling an application with CONFIG_NET_ZPERF=y leaving
CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY at its default value would
systematically cause a kernel panic during thread initialization.

The Kconfig variable is NUM_PREEMPT_PRIORITIES by default. Application
threads may not define a priority lower than NUM_PREEMPT_PRIORITIES - 1,
though.

This change limits zperf's thread priority to a valid range. It does not
change the default value as it makes sense to default the thread
priority to the lowest possible value (which is NUM_PREEMPT_PRIORITIES)
but Kconfig does not allow for arithmentic. So the combination of
CLAMP() plus the Kconfig default will ensure min priority plus limit the
range to valid values no matter what has been defined as priority in
Kconfig.

Fixes: #59141

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-13 06:58:15 -04:00
..
CMakeLists.txt net: zperf: Make shell dependency optional 2023-01-03 11:02:01 +01:00
Kconfig net: zperf: Make Zperf worker thread stack size configurable 2023-03-20 10:20:00 +00:00
zperf_common.c net: lib: zperf: fix kernel panic due to invalid thread prio 2023-06-13 06:58:15 -04:00
zperf_internal.h net: zperf: Make shell dependency optional 2023-01-03 11:02:01 +01:00
zperf_session.c net: zperf: unify get_session among TCP and UDP 2023-02-28 18:12:52 +01:00
zperf_session.h net: zperf: unify get_session among TCP and UDP 2023-02-28 18:12:52 +01:00
zperf_shell.c net: lib: zperf: Add support to disable Nagle's algorithm 2023-02-20 09:53:43 +01:00
zperf_tcp_receiver.c subsys/net: Labels cannot be applied to declarations 2023-04-05 10:38:34 +02:00
zperf_tcp_uploader.c net: lib: zperf: Add support to disable Nagle's algorithm 2023-02-20 09:53:43 +01:00
zperf_udp_receiver.c net: zperf: Make UDP/TCP servers restartable 2022-12-22 11:05:11 +01:00
zperf_udp_uploader.c net: zperf: Implement asynchronous upload API 2022-12-22 11:05:11 +01:00