Run throughput test using iperf2 TCP on nrf7002 DK

I am attempting to run a throughput test using TCP on the nrf7002 DK as the client and my laptop as the iperf2 server. I am using the sr_coex sample listed in sdk-nrf repo, and modified the following files: src/main.c and prj.conf. In prj.conf I modified the following parameters:

CONFIG_STA_KEY_MGMT_WPA2
CONFIG_STA_SAMPLE_SSID
CONFIG_STA_SAMPLE_PASSWORD
CONFIG_WIFI_ZPERF_PROT_UDP
CONFIG_NET_CONFIG_PEER_IPV4_ADDR

I set CONFIG_WIFI_ZPERF_PROT_UDP to y and the others with my Wifi credentials. I can confirm the Wifi credentials are correct since I was able to perform the throughput test with UDP with no errors.

In the src/main.c file: I changed the following

udp_callback to tcp_callback in line 63,

udp_upload_results_cb to tcp_upload_results_cb in line 303,

udp_callback to tcp_callback in line 332

zperf_udp_upload_async with zperf_tcp_upload_async in line 464

udp_callback to tcp_callback in line 480

After I saved my changes, I used the following commands to build/flash my nrf7002 DK board

west build --pristine  -s <path/to/app> -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=n -Dhci_rpmsg_CONFIG_MPSL_CX=n

west flash --dev-id <DEV_ID>  --hex-file build/zephyr/merged_domains.hex

Both build and flash was successful, I see the throughput test can run, but in the logs I get several messages that look like the following:

<wrn> net_conn: conn_raw_socket: pkt cloning failed, pkt 0x20052cc8 dropped

My question is if there's something else that I need to do to stop getting that error message in order to run a throughput test using TCP

Parents
  • Hi,

    I set CONFIG_WIFI_ZPERF_PROT_UDP to y

    You must set CONFIG_WIFI_ZPERF_PROT_UDP=n to use TCP.

    What command are you using to run iPerf? For TCP you must use the following:

    iperf -s -i 1

    Best regards,
    Marte

  • Thank you for replying. I miswrote the question. I did set CONFIG_WIFI_ZPERF_PROT_UDP to n. The command I used to run iperf I did the following:

    Fullscreen
    1
    iperf -s -i 1 -P 1
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I added the -P flag since I only want iperf to run for one client and exit. When I ran the test and check the logs, I noticed the iperf test starts, but the logs display several of the same messages during the test run:

    <wrn> net_conn: conn_raw_socket: pkt cloning failed, pkt 0x20052cc8 dropped

  • Hi,

    You need to increase the TX and RX buffers.

    CONFIG_NET_PKT_RX_COUNT=32
    CONFIG_NET_PKT_TX_COUNT=32
    CONFIG_NET_BUF_RX_COUNT=32
    CONFIG_NET_BUF_TX_COUNT=64

    This should solve the packet dropped issue.

    Best regards,
    Marte

  • Hello,

    I increased with TX and RX buffers like you suggested, I now get an packet allocation failed error.

    Here is the logs: 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [00:00:00.284,759] <inf> wifi_nrf: qspi_init: QSPI freq = 24 MHz
    [00:00:00.284,790] <inf> wifi_nrf: qspi_init: QSPI latency = 1
    [00:00:00.292,297] <inf> wifi_nrf: zep_shim_pr_info: wifi_nrf_fmac_fw_load: LMAC patches loaded
    [00:00:00.303,161] <inf> wifi_nrf: zep_shim_pr_info: wifi_nrf_fmac_fw_load: LMAC boot check passed
    [00:00:00.306,121] <inf> wifi_nrf: zep_shim_pr_info: wifi_nrf_fmac_fw_load: UMAC patches loaded
    [00:00:00.316,925] <inf> wifi_nrf: zep_shim_pr_info: wifi_nrf_fmac_fw_load: UMAC boot check passed
    [00:00:00.338,928] <inf> wifi_nrf: zep_shim_pr_info: RPU LPM type: HW
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    [00:00:00.453,674] <inf> net_config: net_config_init_by_iface: Initializing network
    [00:00:00.453,674] <inf> net_config: check_interface: Waiting interface 1 (0x20001bc0) to be up...
    [00:00:00.453,704] <inf> net_config: setup_dhcpv4: Running dhcpv4 client...
    [00:00:00.454,620] <inf> coex: main: Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 128 MHz
    [00:00:00.454,711] <inf> wpa_supp: wpa_printf_impl: z_wpas_start: 385 Starting wpa_supplicant thread with debug level: 3
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Here is my prj.conf file

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #
    # Copyright (c) 2022 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_WIFI=y
    CONFIG_WIFI_NRF700X=y
    # Test mode
    CONFIG_TEST_TYPE_WLAN_ONLY=y
    # WPA supplicant
    CONFIG_WPA_SUPP=y
    # System settings
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_NANO=n
    # Networking
    CONFIG_NETWORKING=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    It seems like the program is trying to allocate a packet that is too large.

    packet allocation failed, len=1460

    Increasing CONFIG_WIFI_ZPERF_PKT_SIZE should fix this, for example:

    CONFIG_WIFI_ZPERF_PKT_SIZE=1500

    Best regards,
    Marte

  • When I increased the packet size, i got the following warning message 

    <wrn> net_zperf: tcp_upload: Packet size too large! max size: 1024

    I did somehow get the throughput test to execute with no errors by modifying the iperf command to

    iperf -s -i 1 --len 1024 -w 24k -t 20

    Is it possible to change the prj.conf where I don't have to change the iperf server command?

  • Hi,

    I have asked the development team about this, and will get back to you.

    Best regards,
    Marte

Reply Children
No Data