9 Replies Latest reply on Jun 10, 2019 12:56 AM by AxLi_1746341

    iperf with LWIP/FreeRTOS

    NiMc_1688136

      I can only run UDP with iperf and LWIP in SDK 6.2.1. If i attempt to run TCP mode, the system crashes with an assert in the network stack:

       

      CYW43907

       

      Function: low_level_output

      Line: 202

      Thread: tcpip_thread

      LWIP_ASSERT( "No chained buffers", ( ( p->next == NULL ) && ( ( p->tot_len == p->len ) ) ) );

       

      Any ideas for a fix to allow TCP and lwip?

       

      With UDP, the transmit buffer is limited to 4.28KB which appears to negatively impact the throuhhput result but I cannot change it with the -w arugment so i guess it is based on a LWIP configuration? Anyone know where to change this?

        • 1. Re: iperf with LWIP/FreeRTOS
          NiMc_1688136

          Per #1, the console test app in 6.2.1 works with TCP. Strange that it works here and not in my application, both are running FreeRTOS and LWIP.

           

          Per #2, in the console app, the UDP buffer size is 14.3 KBytes so this seems like defines in the console makefile setup this.

          • 2. Re: iperf with LWIP/FreeRTOS
            NiMc_1688136

            Higher UDP throughput is working by pulling some defines from the console makefile for the CYW43907

            GLOBAL_DEFINES += TX_PACKET_POOL_SIZE=40 \

                              RX_PACKET_POOL_SIZE=40 \

                              WICED_TCP_TX_DEPTH_QUEUE=32 \

                              WICED_ETHERNET_DESCNUM_TX=32 \

                              WICED_ETHERNET_DESCNUM_RX=8 \

                              WICED_ETHERNET_RX_PACKET_POOL_SIZE=40+WICED_ETHERNET_DESCNUM_RX \

                              WICED_TCP_WINDOW_SIZE=32768

             

            TCP with IPERF is still failing on my end. I have asserts enabled to catch fatal errors in the network stack but maybe the no chained buffer assert is not fatal

            • 3. Re: iperf with LWIP/FreeRTOS
              RaktimR_11

              I checked the test.console example in SDK 6.2.1 with FreeRTOS/LwIP combination. I don't seem to hit any asserts with tcp with iperf.

               

              Platform CYW943907AEVAL1F initialised
              Started FreeRTOS v9.0.0
              WICED_core Initialized
              Initialising LwIP v2.0.3
              DHCP CLIENT hostname WICED IP
              WWD SoC.43909 interface initializing with US/0
              WLAN MAC Address : A4:08:EA:D9:D4:E6
              WLAN Firmware    : wl0: Feb 26 2019 18:16:13 version 7.15.168.126 (r711020) FWID 01-bc2dab52
              WLAN CLM        : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2019-02-26 18:10:19
              Console app
              > iperf -v
              iperf version 2.1.0 (20 Feb 2012) single threaded
              >
              >
              >
              > join CY-IOT-HOTSPOT wpa2 12345678
              Joining : CY-IOT-HOTSPOT
              Successfully joined : CY-IOT-HOTSPOT
              Setting IPv6 link-local address
              Obtaining IPv4 address via DHCP
              Waiting for IPv6 address validation
              IPv6 Network ready IP: FE80::A608:EAFF:FED9:D4E6
              IPv4 Network ready IP: 10.40.2.18
              >
              >
              >
              >
              >
              > iperf -c 10.40.2.166
              ------------------------------------------------------------
              Client connecting to 10.40.2.166, TCP port 5001
              TCP window size: 35.6 KByte (default)
              ------------------------------------------------------------
              [ ID] Interval      Transfer    Bandwidth
              [  0]  0.0-10.0 sec  11.2 MBytes  9.38 Mbits/sec
              

              Could you please provide a stripped down version of your application so that we can reproduce this on our end?

               

              To increase the throughput; i.e window size tunables are located in console.mk for iperf as you have already found out.

              1 of 1 people found this helpful
              • 4. Re: iperf with LWIP/FreeRTOS
                NiMc_1688136

                Thanks for the feedback.

                 

                Did you run the project in a debug build? Typically the asserts are disabled in normal builds but enabled in debug. In my application i have enabled asserts in normal builds so they can be logged and then reset the processor.

                • 5. Re: iperf with LWIP/FreeRTOS
                  RaktimR_11

                  I checked it in the debug build only hoping to see the assert. Is there anything else that you think might be differing in our setups (or some piece of assert enabled etc)?

                  • 6. Re: iperf with LWIP/FreeRTOS
                    AxLi_1746341

                    Raktim Roy wrote:

                     

                    I checked the test.console example in SDK 6.2.1 with FreeRTOS/LwIP combination. I don't seem to hit any asserts with tcp with iperf.

                    1. Platform CYW943907AEVAL1F initialised 
                    2. Started FreeRTOS v9.0.0 
                    3. WICED_core Initialized 
                    4. Initialising LwIP v2.0.3 
                    5. DHCP CLIENT hostname WICED IP 
                    6. WWD SoC.43909 interface initializing with US/0 
                    7. WLAN MAC Address : A4:08:EA:D9:D4:E6 
                    8. WLAN Firmware    : wl0: Feb 26 2019 18:16:13 version 7.15.168.126 (r711020) FWID 01-bc2dab52 
                    9. WLAN CLM        : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2019-02-26 18:10:19 

                    The WLAN firmwaree shows you tested a newer sdk version rather than sdk-6.2.1.

                    • 7. Re: iperf with LWIP/FreeRTOS
                      NiMc_1688136

                      Good catch axel.lin_1746341

                       

                      RaktimR_11, are you testing with 6.2.1 or the latest internal branch that will become the SDK (6.4)?

                      • 8. Re: iperf with LWIP/FreeRTOS
                        RaktimR_11

                        I am testing in SDK 6.2.1. Please check the log below but I am not seeing any asserts. The firmware/ blob file was different in the earlier log. Thanks for pointing that out.

                        Starting WICED vWiced_006.002.001.0013
                        Platform CYW943907AEVAL1F initialised
                        Started FreeRTOS v9.0.0
                        Initialising LwIP v2.0.3
                        DHCP CLIENT hostname WICED IP
                        WWD SoC.43909 interface initializing with US/0
                        WLAN MAC Address : A4:08:EA:D9:D4:E6
                        WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905
                        WLAN CLM        : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15
                        Init took ~449 ms
                        Console app
                        > wl ver
                        7.16 RC99.19
                        wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905
                        >
                        >
                        >
                        >
                        > join CY-IOT-HOTSPOT wpa2 10t12356b1
                        Successfully joined : CY-IOT-HOTSPOT
                        Setting IPv6 link-local address
                        Obtaining IPv4 address via DHCP
                        Waiting for IPv6 address validation
                        IPv6 Network ready IP: FE80::A608:EAFF:FED9:D4E6
                        IPv4 Network ready IP: 10.40.2.180
                        >
                        >
                        > iperf -c 10.40.2.164
                        ------------------------------------------------------------
                        Client connecting to 10.40.2.164, TCP port 5001
                        TCP window size: 24.6 KByte (default)
                        ------------------------------------------------------------
                        [ ID] Interval      Transfer    Bandwidth
                        [  0]  0.0-10.0 sec  1.33 MBytes  1.11 Mbits/sec
                        
                        1 of 1 people found this helpful
                        • 9. Re: iperf with LWIP/FreeRTOS
                          AxLi_1746341

                          Raktim Roy wrote:

                           

                          I am testing in SDK 6.2.1. Please check the log below but I am not seeing any asserts. The firmware/ blob file was different in the earlier log. Thanks for pointing that out.

                          1. Starting WICED vWiced_006.002.001.0013 

                          Your SDK 6.2.1 (vWiced_006.002.001.0013) is different from the public download sdk-6.2.1 (vWiced_006.002.001.0002).

                          Anyway, I just want to point out that you had better use the same sdk to reproduce the user reported issue.

                           

                          BTW, I remember that I observed the same assert.