This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit fb0567f443ddc5ec993f17d19f4e794d8da4a1bb
Author: zhangkai25 <[email protected]>
AuthorDate: Tue Aug 4 17:10:00 2026 +0800

    netutils/iperf: make traffic/report task priority and stack configurable
    
    The priority and stack size of the iperf_traffic and iperf_report
    threads were hardcoded as macros in iperf.c (100/5120 and 101/8192).
    Different boards have different memory budgets and scheduling
    requirements, and tuning these values previously required patching
    iperf.c itself.
    
    Introduce four new Kconfig options under NETUTILS_IPERF:
    
      - NETUTILS_IPERF_TRAFFIC_PRIORITY   (default 100)
      - NETUTILS_IPERF_TRAFFIC_STACKSIZE  (default 5120)
      - NETUTILS_IPERF_REPORT_PRIORITY    (default 101)
      - NETUTILS_IPERF_REPORT_STACKSIZE   (default 8192)
    
    The IPERF_*_TASK_PRIORITY / IPERF_*_TASK_STACK macros in iperf.c now
    resolve to the corresponding CONFIG_* symbols. Defaults are preserved,
    so boards that do not override these options behave exactly as before.
    
    Signed-off-by: zhangkai25 <[email protected]>
    Assisted-by: Kiro:claude-opus-4
---
 netutils/iperf/Kconfig | 26 ++++++++++++++++++++++++++
 netutils/iperf/iperf.c |  8 ++++----
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/netutils/iperf/Kconfig b/netutils/iperf/Kconfig
index b4e9b4b05..69165bc14 100644
--- a/netutils/iperf/Kconfig
+++ b/netutils/iperf/Kconfig
@@ -50,6 +50,32 @@ config NETUTILS_IPERF_STACKSIZE
        int "iperf stack size"
        default DEFAULT_TASK_STACKSIZE
 
+config NETUTILS_IPERF_TRAFFIC_PRIORITY
+       int "iperf traffic task priority"
+       default 100
+       ---help---
+               Priority of the iperf traffic worker thread that performs the
+               actual send/recv on the socket.
+
+config NETUTILS_IPERF_TRAFFIC_STACKSIZE
+       int "iperf traffic task stack size"
+       default 5120
+       ---help---
+               Stack size (bytes) of the iperf traffic worker thread.
+
+config NETUTILS_IPERF_REPORT_PRIORITY
+       int "iperf report task priority"
+       default 101
+       ---help---
+               Priority of the iperf report thread that periodically prints
+               throughput statistics.
+
+config NETUTILS_IPERF_REPORT_STACKSIZE
+       int "iperf report task stack size"
+       default 8192
+       ---help---
+               Stack size (bytes) of the iperf report thread.
+
 config NETUTILS_IPERFTEST_DEVNAME
        string "iperf Network device"
        default "wlan0" if DRIVERS_IEEE80211
diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c
index 90e4e1caa..94f91d297 100644
--- a/netutils/iperf/iperf.c
+++ b/netutils/iperf/iperf.c
@@ -46,11 +46,11 @@
  ****************************************************************************/
 
 #define IPERF_TRAFFIC_TASK_NAME      "iperf_traffic"
-#define IPERF_TRAFFIC_TASK_PRIORITY  100
-#define IPERF_TRAFFIC_TASK_STACK     5120
+#define IPERF_TRAFFIC_TASK_PRIORITY  CONFIG_NETUTILS_IPERF_TRAFFIC_PRIORITY
+#define IPERF_TRAFFIC_TASK_STACK     CONFIG_NETUTILS_IPERF_TRAFFIC_STACKSIZE
 #define IPERF_REPORT_TASK_NAME       "iperf_report"
-#define IPERF_REPORT_TASK_PRIORITY   101
-#define IPERF_REPORT_TASK_STACK      8192
+#define IPERF_REPORT_TASK_PRIORITY   CONFIG_NETUTILS_IPERF_REPORT_PRIORITY
+#define IPERF_REPORT_TASK_STACK      CONFIG_NETUTILS_IPERF_REPORT_STACKSIZE
 
 #define IPERF_UDP_TX_LEN             (1472)
 #define IPERF_UDP_RX_LEN             (16 << 10)

Reply via email to