Post Go back to editing

LwIP + VDK: How are 11 MB/s throughput possible

Hello,

I'm using VDSP++ 5.00, Update 10 and ADZS-BF548-EZLite Board. I need to send around 11 MB/s in realtime using Ethernet. Ho is this possible?

I used a standard LwIP Application and added the following code:

   while(uiCounter < (100 * 1024 * 1024))

   {

      sent_data = sendto(socket_fd, data_buffer, PACKET_SIZE,0,(struct sockaddr*)&ra,sizeof(ra));

      uiCounter += PACKET_SIZE;

      if(sent_data < 0)

      {

         printf("send failed\n");

         close(socket_fd);

      }

      else

      {

//         printf("Send successful.\n");

      }

   }

This sends 100 MB to PC. I measure the time and can then calculate the time. Bis i get only around  6 MB/s.

What are the best settings for caches/clocks/... to get the maximum performance?

Parents
  • Hi,

    What protocol are you using? e.g. TCP, UDP?

    Is the Blackfin the sender or the receiver (or both) in this scenario?

    We have seen numbers up to 11MBytes/sec, obviously depending on buffer sizes, network activity, available processor bandwidth, etc.

    LwIP can be configured depending on your application requirements. LwIP is statically configurable, and most of the options can be changed in 'lwipopts.h' present in "...\Blackfin\lib\src\lwip\contrib\ports\adsp-blackfin\proj\lwipv4lib\". A modified version, 'lwipopts.big.h', is provided for applications that potentially transfer large amounts of TCP data. Some critical changes in 'lwipopts.big.h' from that of the default 'lwipopts.h' include:

            -RAM size increased from 64K to 1MB

            -TCP window size increased from 8K to 32K

            -Send Queue Length changed from 16 to 256.

    In order to use the 'lwipopts.big.h' you must do the following:

    1)      Create a backup of the original 'lwipopts.h' file, and replace it with a renamed lwipopts.big.h

    2)      Recompile the required LwIP Library, which is located in "...\Blackfin\lib\src\lwip\contrib\ports\ADSP-Blackfin\proj\lwIPv4lib\".

    3)      Create a backup of "...\Blackfin\lib\liblwIPBF5xx.dlb", where "xx" corresponds to the processor in hand.

    4)      Copy 'liblwIPBF53xx.dlb' from the "...\Debug\BF5xx\" directory to "...\Blackfin\lib\"

    5)      Open your application in VisualDSP++. Enlarge the Ethernet Stack size via the define to "#define ETHER_STACK_SIZE 1024*1024*2" in 'lwip_sysboot_threadtype.c'. Your VDK LwIP stack should also be set to at least this value, preferably to 4MB. You will also need to ensure you have enough SDRAM available for this, as the stack is stored in SDRAM.

     

    Also, when creating a new Application you can use the high priority configuration option for better placement of code into L1 memory. This option is available when creating the new LwIP application, by checking the option "Place performance-critical code and data in internal memory". Note that if this option is enabled, the project wizard adds a file "priority.asm" that ensures the Ethernet Drivers, Critical VDK and LwIP libraries get precedence and get placed in L1.

    For existing TCP/IP projects, 'priority.asm' can be added manually. This file is present in the "...\System\SystemBuilder\ProjectTypes\TCPIP_STACK\src\" directory.

    You may also want to take a look at EE-312 "Building Complex VDK/LwIP Applications Using BlackfinRegistered Processors", which details some of the concepts for optimizing an LwIP system.

    http://www.analog.com/ee-notes

    Regards,

    Craig.

Reply
  • Hi,

    What protocol are you using? e.g. TCP, UDP?

    Is the Blackfin the sender or the receiver (or both) in this scenario?

    We have seen numbers up to 11MBytes/sec, obviously depending on buffer sizes, network activity, available processor bandwidth, etc.

    LwIP can be configured depending on your application requirements. LwIP is statically configurable, and most of the options can be changed in 'lwipopts.h' present in "...\Blackfin\lib\src\lwip\contrib\ports\adsp-blackfin\proj\lwipv4lib\". A modified version, 'lwipopts.big.h', is provided for applications that potentially transfer large amounts of TCP data. Some critical changes in 'lwipopts.big.h' from that of the default 'lwipopts.h' include:

            -RAM size increased from 64K to 1MB

            -TCP window size increased from 8K to 32K

            -Send Queue Length changed from 16 to 256.

    In order to use the 'lwipopts.big.h' you must do the following:

    1)      Create a backup of the original 'lwipopts.h' file, and replace it with a renamed lwipopts.big.h

    2)      Recompile the required LwIP Library, which is located in "...\Blackfin\lib\src\lwip\contrib\ports\ADSP-Blackfin\proj\lwIPv4lib\".

    3)      Create a backup of "...\Blackfin\lib\liblwIPBF5xx.dlb", where "xx" corresponds to the processor in hand.

    4)      Copy 'liblwIPBF53xx.dlb' from the "...\Debug\BF5xx\" directory to "...\Blackfin\lib\"

    5)      Open your application in VisualDSP++. Enlarge the Ethernet Stack size via the define to "#define ETHER_STACK_SIZE 1024*1024*2" in 'lwip_sysboot_threadtype.c'. Your VDK LwIP stack should also be set to at least this value, preferably to 4MB. You will also need to ensure you have enough SDRAM available for this, as the stack is stored in SDRAM.

     

    Also, when creating a new Application you can use the high priority configuration option for better placement of code into L1 memory. This option is available when creating the new LwIP application, by checking the option "Place performance-critical code and data in internal memory". Note that if this option is enabled, the project wizard adds a file "priority.asm" that ensures the Ethernet Drivers, Critical VDK and LwIP libraries get precedence and get placed in L1.

    For existing TCP/IP projects, 'priority.asm' can be added manually. This file is present in the "...\System\SystemBuilder\ProjectTypes\TCPIP_STACK\src\" directory.

    You may also want to take a look at EE-312 "Building Complex VDK/LwIP Applications Using BlackfinRegistered Processors", which details some of the concepts for optimizing an LwIP system.

    http://www.analog.com/ee-notes

    Regards,

    Craig.

Children
No Data