Skip to content

Conversation

@WatcherOfTheSkies
Copy link
Contributor

PLEASE NOTE the following text from the iperf3 license. Submitting a
pull request to the iperf3 repository constitutes "[making]
Enhancements available...publicly":

You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to Lawrence Berkeley National
Laboratory, without imposing a separate written license agreement for such
Enhancements, then you hereby grant the following license: a non-exclusive,
royalty-free perpetual license to install, use, modify, prepare derivative
works, incorporate into other computer software, distribute, and sublicense
such enhancements or derivative works thereof, in binary and source code form.

The complete iperf3 license is available in the LICENSE file in the
top directory of the iperf3 source tree.

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    master

  • Issues fixed (if any):
    It's just good management to set a file descriptor to -1 when it's been closed.

  • Brief description of code changes (suitable for use as a commit message):
    All the FDs which are global have been set to -1 after closing.

@WatcherOfTheSkies
Copy link
Contributor Author

My test seems to be OK...

./src/iperf3 -c localhost -V -t 5 -T test1
test1: iperf 3.20+
test1: test1: Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64
Control connection MSS 32732
test1: Time: Thu, 01 Jan 1970 00:30:14 GMT
test1: Connecting to host localhost, port 5201
test1: Cookie: dap67v5if7oefignr7g3pqbznzvnxwo2pnjk
test1: TCP MSS: 32732 (default)
test1: [ 5] local ::1 port 39548 connected to ::1 port 5201
test1: Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0 seconds, 5 second test, tos 0
test1: [ ID] Interval Transfer Bitrate Retr Cwnd
test1: [ 5] 0.00-1.00 sec 1.15 GBytes 9.87 Gbits/sec 0 1.31 MBytes
test1: [ 5] 1.00-2.00 sec 1.17 GBytes 10.1 Gbits/sec 0 1.31 MBytes
test1: [ 5] 2.00-3.00 sec 1.20 GBytes 10.3 Gbits/sec 0 1.31 MBytes
test1: [ 5] 3.00-4.00 sec 1.13 GBytes 9.70 Gbits/sec 0 1.31 MBytes
test1: [ -1] 4.00-5.00 sec 1.18 GBytes 10.1 Gbits/sec 0 1.31 MBytes
test1: - - - - - - - - - - - - - - - - - - - - - - - - -
test1: Test Complete. Summary Results:
test1: [ ID] Interval Transfer Bitrate Retr
test1: [ -1] 0.00-5.00 sec 5.88 GBytes 10.1 Gbits/sec 0 sender
test1: [ -1] 0.00-5.01 sec 5.88 GBytes 10.1 Gbits/sec receiver
test1: CPU Utilization: local/sender 98.9% (2.1%u/96.8%s), remote/receiver 90.2% (3.3%u/86.9%s)
test1: snd_tcp_congestion cubic
test1: rcv_tcp_congestion cubic
test1:
test1: iperf Done.

@WatcherOfTheSkies
Copy link
Contributor Author

Hi. Does your install include sudo ldconfig after sudo make install?. Thanks!

@WatcherOfTheSkies
Copy link
Contributor Author

Further testing shows that...

./test_commands.sh localhost

works on a Raspberry Pi but not on Ubuntu as per your tests.

@davidBar-On
Copy link
Contributor

Note also that even in the successful tests, the Socket ID in the last lines of the statistics reports is "-1". E.g. from the build-test-macos-ish:

Starting Test: protocol: UDP, 1 streams, 16312 byte blocks, omitting 0 seconds, 5 second test, tos 0
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  7]   0.00-1.05   sec   127 KBytes   992 Kbits/sec  8  
[  7]   1.05-2.00   sec   143 KBytes  1.24 Mbits/sec  9  
[  7]   2.00-3.07   sec   127 KBytes   976 Kbits/sec  8  
[  7]   3.07-4.07   sec   127 KBytes  1.04 Mbits/sec  8  
[ -1]   4.07-5.02   sec   127 KBytes  1.11 Mbits/sec  8  
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[ -1]   0.00-5.02   sec   653 KBytes  1.07 Mbits/sec  0.000 ms  0/41 (0%)  sender
[ -1]   0.00-5.02   sec   653 KBytes  1.07 Mbits/sec  0.878 ms  0/41 (0%)  receiver

@WatcherOfTheSkies
Copy link
Contributor Author

Note also that even in the successful tests, the Socket ID in the last lines of the statistics reports is "-1". E.g. from the build-test-macos-ish:

Starting Test: protocol: UDP, 1 streams, 16312 byte blocks, omitting 0 seconds, 5 second test, tos 0
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  7]   0.00-1.05   sec   127 KBytes   992 Kbits/sec  8  
[  7]   1.05-2.00   sec   143 KBytes  1.24 Mbits/sec  9  
[  7]   2.00-3.07   sec   127 KBytes   976 Kbits/sec  8  
[  7]   3.07-4.07   sec   127 KBytes  1.04 Mbits/sec  8  
[ -1]   4.07-5.02   sec   127 KBytes  1.11 Mbits/sec  8  
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[ -1]   0.00-5.02   sec   653 KBytes  1.07 Mbits/sec  0.000 ms  0/41 (0%)  sender
[ -1]   0.00-5.02   sec   653 KBytes  1.07 Mbits/sec  0.878 ms  0/41 (0%)  receiver

Good spot! I'm working on a fix.

The management of test->ctrl_sck isn't quite right. It appears to be closing too early and setting it to -1 has exposed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants