a-lunev opened a new pull request #971:
URL: https://github.com/apache/incubator-nuttx-apps/pull/971


   ## Summary
   
   This option enables using sendfile() in ftpc binary transfer mode of PUT 
operation.
   If the option is enabled but ASCII transfer mode is activated, ftpc falls 
back to the combination of read() and write().
   Using sendfile() provides a higher performance compared to the combination 
of read() and write().
   
   Also this option is useful for testing / debugging tcp_sendfile() 
functionality of NuttX TCP/IP stack.
   
   Based on the current state of sim:tcpblaster config on my Linux host setup, 
the results are as follows:
   
   1. CONFIG_NET_TCP_WRITE_BUFFERS=n, CONFIG_FTPC_OVER_SENDFILE=n, file size is 
500 KB (or larger), the payload throughput is 50 Kbit/s.
   
   2. CONFIG_NET_TCP_WRITE_BUFFERS=n, CONFIG_FTPC_OVER_SENDFILE=y, file size is 
50000 KB, the payload throughput is 380.2 Mbit/s.
   
   3. CONFIG_NET_TCP_WRITE_BUFFERS=y, CONFIG_FTPC_OVER_SENDFILE=n, file size is 
500 KB (or larger), the payload throughput is 22.3 Kbit/s.
   
   4. CONFIG_NET_TCP_WRITE_BUFFERS=y, CONFIG_FTPC_OVER_SENDFILE=y, file size is 
50000 KB, the payload throughput is 380.2 Mbit/s.
   
   ## Impact
   
   netutils/ftpc
   
   ## Testing
   
   Install and configure vsftpd on Linux host.
   Build NuttX:
   ```
   $ ./tools/configure.sh -l sim:tcpblaster
   $ make menuconfig (enable CONFIG_FTPC_OVER_SENDFILE,
   enable / disable CONFIG_NET_TCP_WRITE_BUFFERS)
   $ make
   ```
   Enable TUN/TAP on Linux host:
   ```
   $ sudo setcap cap_net_admin+ep ./nuttx
   $ sudo ./tools/simhostroute.sh wlan0 on
   ```
   Run NuttX on Linux host:
   ```
   $ ./nuttx
   NuttShell (NSH) NuttX-10.2.0
   nsh> ifconfig eth0 10.0.1.2
   nsh> ifup eth0
   ifup eth0...OK
   ```
   Start Wireshark (or tcpdump) and capture appeared tap0 interface.
   
   Run in NuttX:
   ```
   nsh> dd if=/dev/zero of=/tmp/test.bin count=100000
   nsh> ftpc -4 -n LINUX_HOST_IP_ADDRESS
   NuttX FTP Client:
   login anonymous
   put -b /tmp/test.bin pub/test.bin
   quit
   nsh> poweroff
   ```
   Analyze TCP dump to estimate the performance.
   
   Disable TUN/TAP on Linux host:
   `$ sudo ./tools/simhostroute.sh wlan0 off`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to