-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Create dedicated heap for supplicant #92438
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
base: main
Are you sure you want to change the base?
Conversation
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 project with PR revision Note: This message is automatically posted and updated by the Manifest GitHub Action. |
335be08
to
f1e8b0b
Compare
Create dedicated heap for supplicant operations and define the heap size. Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Pull in changes for dedicated heap for supplicant operations. Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
f1e8b0b
to
67ff9c4
Compare
|
config WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP | ||
bool "Use Zephyr kernel heap for Wi-Fi driver" | ||
default y | ||
help | ||
Enable this option to use K_HEAP for memory allocations in supplicant. | ||
|
||
if !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP | ||
config WIFI_NM_WPA_SUPPLICANT_HEAP | ||
int "Dedicated memory pool for wpa_supplicant" | ||
def_int 66560 if WIFI_NM_HOSTAPD_AP | ||
def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS | ||
def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE | ||
def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP | ||
# 30K is mandatory, but might need more for long duration use cases | ||
def_int 30000 | ||
endif # !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP | ||
|
||
if WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP | ||
config HEAP_MEM_POOL_ADD_SIZE_HOSTAP | ||
def_int 66560 if WIFI_NM_HOSTAPD_AP | ||
def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS | ||
def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE | ||
def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP | ||
# 30K is mandatory, but might need more for long duration use cases | ||
def_int 30000 | ||
endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP | ||
|
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.
You can de-duplicate this by something like:
+config WIFI_NM_WPA_SUPPLICANT_HEAP_SIZE
+ int
+ default 66560 if WIFI_NM_HOSTAPD_AP
+ default 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
+ default 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
+ default 41808 if WIFI_NM_WPA_SUPPLICANT_AP
+ # 30K is mandatory, but might need more for long duration use cases
+ default 30000
+
if !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
config WIFI_NM_WPA_SUPPLICANT_HEAP
int "Dedicated memory pool for wpa_supplicant"
- def_int 66560 if WIFI_NM_HOSTAPD_AP
- def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
- def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
- def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
- # 30K is mandatory, but might need more for long duration use cases
- def_int 30000
+ default WIFI_NM_WPA_SUPPLICANT_HEAP_SIZE
+ help
+ Dedicated memory pool size for wpa_supplicant.
endif # !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
if WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
config HEAP_MEM_POOL_ADD_SIZE_HOSTAP
- def_int 66560 if WIFI_NM_HOSTAPD_AP
- def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
- def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
- def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
- # 30K is mandatory, but might need more for long duration use cases
- def_int 30000
+ int
+ default WIFI_NM_WPA_SUPPLICANT_HEAP_SIZE
+ help
+ Additional heap size for wpa_supplicant when using global heap.
endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
Create dedicated heap for supplicant operations. Currently, WPA supplicant uses the k_malloc, which is shared across various subsystems, and we cannot enforce a minimum availability. Using a dedicated HEAP that can be pre-allocated solves this by always having necessary memory .
Introduce an option for user to choose between dedicated heap and system heap.