SPRACT8 September   2020 66AK2H06 , 66AK2H12 , 66AK2H14

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
    1. 1.1 TI Processor SDK RTOS
    2. 1.2 TI NDK
    3. 1.3 66AK2H Device
    4. 1.4 FTP Offering in TI Processor SDK RTOS
  4. 2Hardware and Software
  5. 3Develop the FTP Server on K2H
    1. 3.1 Reference FTP Server Example
    2. 3.2 Create K2H FTP Server Example
    3. 3.3 Test K2H FTP Server Example
  6. 4Performance Tuning
    1. 4.1 Quick Code Check
      1. 4.1.1 FTP Transmitting Code Check
      2. 4.1.2 FTP Receiving Code Check
      3. 4.1.3 CCS Project Optimization
    2. 4.2 Increase the TCP Buffer Sizes
    3. 4.3 UIA CPU Load Instrumentation
    4. 4.4 What Can We Do on the PC Side?
      1. 4.4.1 TCP Window Scaling Check
      2. 4.4.2 Receive Interrupt Coalescing Check
    5. 4.5 What Else Can We Do on the K2H Side?
      1. 4.5.1 TCP/IP Checksum Offloading Check
      2. 4.5.2 NIMU Driver Efficiency Profiling
      3. 4.5.3 Receive Interrupt Coalescing
    6. 4.6 Final FTP Throughput Results
  7. 5Summary
  8. 6References

FTP Transmitting Code Check

Test result shows that 2,560,000 bytes data is transferred in a short duration. It is good to run a longer transfer with more data for measurement accuracy.

The transmitting is controlled inside ftp_filerout.c file:

int32_t ftp_filerout_read(io_handler_t *ioh, char *path)
{
    …… 
    for (i=0; i<5000;i++)
    {
        send(ioh->data_socket, ioh->DataBuf, DATA_BUFFER_SIZE, 0);
        Task_yield();
    }
    .….
}

The DATA_BUFFER_SIZE is defined as 512. This is how 2,560,000 bytes (5,000 x 512) comes from. The packets captured on the wire show the packet size is 566 bytes, as a result of 54 bytes header (14 bytes Ethernet + 20 bytes IP + 20 bytes TCP) in addition to the 512 bytes data payload. This will not fully utilize the maximum Ethernet packet size which can be up to 1,514 bytes without fragmentation. One may update the DATA_BUFFER_SIZE to 1,460 (=1,514 – 54) and use a larger for() loop, e.g. 200,000 for test. This effectively transmits 292,000,000 bytes data with Maximum Transmission Unit (MTU) size.

Task_yield() is used to yield current task to other tasks with the same priority. It is unnecessary in such a simple test, so it can be commented out to tighten the for() loop.