Skip to content

Commit aaebe38

Browse files
nxf58150aescolar
authored andcommitted
net: Increase net_mgmt task priority
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 <[email protected]>
1 parent 83812f2 commit aaebe38

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

samples/net/wifi/boards/frdm_rw612.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY=3
7575
CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=3
7676
CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO=y
7777
CONFIG_NET_CONTEXT_PRIORITY=y
78+
CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM=y
79+
CONFIG_NET_MGMT_THREAD_PRIORITY=3
7880

7981
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
8082
CONFIG_WIFI_NM_WPA_SUPPLICANT_CLI=y

samples/net/wifi/boards/rd_rw612_bga.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY=3
7474
CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=3
7575
CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO=y
7676
CONFIG_NET_CONTEXT_PRIORITY=y
77+
CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM=y
78+
CONFIG_NET_MGMT_THREAD_PRIORITY=3
7779

7880
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
7981
CONFIG_WIFI_NM_WPA_SUPPLICANT_CLI=y

subsys/net/ip/Kconfig.mgmt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,14 @@ config NET_DEBUG_MGMT_EVENT_STACK
133133
help
134134
Add debug messages output on how much Net MGMT event stack is used.
135135

136+
config NET_MGMT_THREAD_PRIO_CUSTOM
137+
bool "Customize net mgmt thread priority"
138+
139+
if NET_MGMT_THREAD_PRIO_CUSTOM
140+
config NET_MGMT_THREAD_PRIORITY
141+
int "Priority of net_mgmt thread"
142+
default NUM_PREEMPT_PRIORITIES
143+
144+
endif # NET_MGMT_THREAD_PRIO_CUSTOM
145+
136146
endif # NET_MGMT_EVENT

subsys/net/ip/net_mgmt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ void net_mgmt_event_init(void)
413413
mgmt_rebuild_global_event_mask();
414414

415415
#if defined(CONFIG_NET_MGMT_EVENT_THREAD)
416-
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
416+
#if defined(CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM)
417+
#define THREAD_PRIORITY CONFIG_NET_MGMT_THREAD_PRIORITY
418+
#elif defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
417419
/* Lowest priority cooperative thread */
418420
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
419421
#else

0 commit comments

Comments
 (0)