Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/tcp/sendfile: removed excessive overwrites of conn->sndseq #5297

Conversation

a-lunev
Copy link
Contributor

@a-lunev a-lunev commented Jan 20, 2022

Summary

conn->sndseq was updated in multiple places that was unreasonable and complicated.
This PR is similar to the corresponding PR for tcp_send_unbuffered (#5102)

Impact

TCP

Testing

Build NuttX:

$ ./tools/configure.sh -l sim:tcpblaster
$ make menuconfig
(enable/disable CONFIG_NETUTILS_NETCAT_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 netcat server on Linux host:
$ netcat -l -p 31337

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=1000
nsh> netcat LINUX_HOST_IP_ADDRESS 31337 /tmp/test.bin

Observe TCP dump.

Shutdown NuttX:
nsh> poweroff

Disable TUN/TAP on Linux host:
$ sudo ./tools/simhostroute.sh wlan0 off

net/tcp/tcp_input.c Outdated Show resolved Hide resolved
@a-lunev a-lunev force-pushed the tcp_sendfile_sndseq_control_optimization branch from bf83a13 to 6772557 Compare January 21, 2022 12:05
(conn->sndseq was updated in multiple places that was unreasonable and complicated).
This optimization is the same as it was done for tcp_send_unbuffered.
@a-lunev a-lunev force-pushed the tcp_sendfile_sndseq_control_optimization branch from 6772557 to 759219b Compare January 21, 2022 14:58
@a-lunev
Copy link
Contributor Author

a-lunev commented Jan 21, 2022

Force-pushed to restart as ci issue is fixed.

@xiaoxiang781216 xiaoxiang781216 merged commit eec9413 into apache:master Jan 21, 2022
@a-lunev a-lunev deleted the tcp_sendfile_sndseq_control_optimization branch January 21, 2022 17:14
@jerpelea jerpelea added this to To-Add in Release Notes - 10.3.0 Mar 15, 2022
@jerpelea jerpelea moved this from To-Add to Minor in Release Notes - 10.3.0 Mar 17, 2022
@jerpelea jerpelea moved this from Minor to added in Release Notes - 10.3.0 Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants