From 3cf93444c5dbb52d66b3f2fd5c6cb3c57804e5f6 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sun, 19 Jan 2025 00:20:31 +0530 Subject: [PATCH 1/3] samples: wifi: sta: Improve the default performance This is a public facing Wi-Fi sample, so, improve the default perfomance to be suitable for all platforms, Zperf should give 4-5Mbps of UDP. Signed-off-by: Chaitanya Tata --- samples/wifi/sta/prj.conf | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/samples/wifi/sta/prj.conf b/samples/wifi/sta/prj.conf index 4d313e4f7b67..a438c852cca6 100644 --- a/samples/wifi/sta/prj.conf +++ b/samples/wifi/sta/prj.conf @@ -26,14 +26,13 @@ CONFIG_NET_UDP=y CONFIG_NET_TCP=y CONFIG_NET_DHCPV4=y -CONFIG_NET_PKT_RX_COUNT=8 -CONFIG_NET_PKT_TX_COUNT=8 +CONFIG_NET_PKT_RX_COUNT=16 +CONFIG_NET_PKT_TX_COUNT=16 # Below section is the primary contributor to SRAM and is currently # tuned for performance, but this will be revisited in the future. -CONFIG_NET_BUF_RX_COUNT=8 -CONFIG_NET_BUF_TX_COUNT=16 -CONFIG_NRF70_RX_NUM_BUFS=16 +CONFIG_NET_BUF_RX_COUNT=16 +CONFIG_NET_BUF_TX_COUNT=32 CONFIG_HEAP_MEM_POOL_SIZE=120000 CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y CONFIG_NET_TC_TX_COUNT=1 From 4ed421abab44d6df8cd9cbdd6960d683849d965a Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sun, 19 Jan 2025 00:22:01 +0530 Subject: [PATCH 2/3] samples: wifi: sta: Reduce RAM usage In few experiments, it was found that we only 75000 heap for driver, this reduced 15000 RAM. Signed-off-by: Chaitanya Tata --- samples/wifi/sta/prj.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/wifi/sta/prj.conf b/samples/wifi/sta/prj.conf index a438c852cca6..5a0d3a111f6b 100644 --- a/samples/wifi/sta/prj.conf +++ b/samples/wifi/sta/prj.conf @@ -28,12 +28,13 @@ CONFIG_NET_DHCPV4=y CONFIG_NET_PKT_RX_COUNT=16 CONFIG_NET_PKT_TX_COUNT=16 +CONFIG_NRF70_RX_NUM_BUFS=16 # Below section is the primary contributor to SRAM and is currently # tuned for performance, but this will be revisited in the future. CONFIG_NET_BUF_RX_COUNT=16 CONFIG_NET_BUF_TX_COUNT=32 -CONFIG_HEAP_MEM_POOL_SIZE=120000 +CONFIG_HEAP_MEM_POOL_SIZE=105000 CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y CONFIG_NET_TC_TX_COUNT=1 From c7924d7151ce513187f68977fac604c653f04fc0 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sun, 19 Jan 2025 00:32:44 +0530 Subject: [PATCH 3/3] samples: wifi: sta: Add Zperf overlay This overlay is used to run Zperf benchmarks, the network buffer and heap paramters are not overridden to make it easier to collect memory footprints. Signed-off-by: Chaitanya Tata --- .../releases/release-notes-changelog.rst | 4 +++- samples/wifi/sta/README.rst | 12 ++++++++++++ samples/wifi/sta/overlay-zperf.conf | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 samples/wifi/sta/overlay-zperf.conf diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 8b9df4478333..45f063be8a0f 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -434,7 +434,9 @@ Zigbee samples Wi-Fi samples ------------- -|no_changes_yet_note| +* :ref:`wifi_station_sample` sample: + + * Added an ``overlay-zperf.conf`` overlay for :ref:`performance benchmarking and memory footprint analysis `. Other samples ------------- diff --git a/samples/wifi/sta/README.rst b/samples/wifi/sta/README.rst index 7066f24b526a..f8028412df7c 100644 --- a/samples/wifi/sta/README.rst +++ b/samples/wifi/sta/README.rst @@ -224,6 +224,18 @@ The average current consumption in an idle case can be around ~1-2 mA in the nRF See :ref:`app_power_opt` for more information on power management testing and usage of the PPK2. +.. _wifi_sta_performance_testing_memory_footprint: + +Performance testing and memory footprint analysis +************************************************* + +The sample can be used to test the performance of the Wi-Fi connection. +The performance tuning is done to achieve a trade-off between memory usage and performance. + +You can use the at :file:`overlay-zperf.conf` file to run the performance test. +The default build, without the overlay, is used for memory footprint testing and analysis. +The overlay must be enabled to run the performance test corresponding to the memory footprints. + Dependencies ************ diff --git a/samples/wifi/sta/overlay-zperf.conf b/samples/wifi/sta/overlay-zperf.conf new file mode 100644 index 000000000000..bbb9c5a55431 --- /dev/null +++ b/samples/wifi/sta/overlay-zperf.conf @@ -0,0 +1,17 @@ +CONFIG_NET_ZPERF=y +# Mimic real-world conditions +CONFIG_NET_ZPERF_MAX_PACKET_SIZE=1500 +CONFIG_NRF70_QSPI_LOW_POWER=n +# Debug +CONFIG_NRF70_UTIL=y +CONFIG_SHELL=y +CONFIG_SHELL_STACK_SIZE=4600 +CONFIG_NET_SHELL=y +CONFIG_SHELL_GETOPT=y +CONFIG_SHELL_CMDS_RESIZE=n +CONFIG_NRF70_UTIL=y +CONFIG_NET_L2_WIFI_SHELL=y +CONFIG_NET_STATISTICS=y +CONFIG_NET_STATISTICS_WIFI=y +CONFIG_NET_STATISTICS_USER_API=y +CONFIG_SYS_HEAP_RUNTIME_STATS=y