Skip to content

Commit

Permalink
net: Increase net_mgmt task priority
Browse files Browse the repository at this point in the history
Originally, the net_mgmt task priority is very low. Based on roaming
implementation, roaming is triggered in net_mgmt task. When running UDP
test while doing roaming, the net_mgmt task won't have much chance to
run and roaming can't be triggered.
Increase it to 3, which is same value of supplicant task.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
  • Loading branch information
nxf58150 committed Sep 27, 2024
1 parent 251a48e commit d6ac766
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions samples/net/wifi/boards/rd_rw612_bga.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY=3
CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=3
CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO=y
CONFIG_NET_CONTEXT_PRIORITY=y
CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM=y
CONFIG_NET_MGMT_THREAD_PRIORITY=3

CONFIG_WIFI_NM_WPA_SUPPLICANT=y
CONFIG_WIFI_NM_WPA_SUPPLICANT_CLI=y
Expand Down
10 changes: 10 additions & 0 deletions subsys/net/ip/Kconfig.mgmt
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@ config NET_DEBUG_MGMT_EVENT_STACK
help
Add debug messages output on how much Net MGMT event stack is used.

config NET_MGMT_THREAD_PRIO_CUSTOM
bool "Customize net mgmt thread priority"

if NET_MGMT_THREAD_PRIO_CUSTOM
config NET_MGMT_THREAD_PRIORITY
int "Priority of net_mgmt thread"
default NUM_PREEMPT_PRIORITIES

endif # NET_MGMT_THREAD_PRIO_CUSTOM

endif # NET_MGMT_EVENT
4 changes: 3 additions & 1 deletion subsys/net/ip/net_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@ void net_mgmt_event_init(void)
mgmt_rebuild_global_event_mask();

#if defined(CONFIG_NET_MGMT_EVENT_THREAD)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM)
#define THREAD_PRIORITY CONFIG_NET_MGMT_THREAD_PRIORITY
#elif defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
/* Lowest priority cooperative thread */
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
#else
Expand Down

0 comments on commit d6ac766

Please sign in to comment.