Commit Graph

520 Commits

Author SHA1 Message Date
Jef Poskanzer
0f53b154a3 Improved setnonblocking() to set the flag on or off instead of just on. 2013-03-12 13:05:50 -07:00
Jef Poskanzer
65db384358 Polishing up the iperf3.1 man page. 2013-03-12 12:57:19 -07:00
Jef Poskanzer
3e58754281 Added library man page and examples subdir. 2013-03-11 22:03:36 -07:00
Jef Poskanzer
e96ab74093 Move the JSON initialization/finalization insode the API. 2013-03-08 20:56:52 -08:00
Jef Poskanzer
a5621dd908 Added zerocopy stuff to the API, so that bwctl can use it. 2013-03-06 07:46:28 -08:00
Jef Poskanzer
c57e9f2494 Slight change to net.c routines to better handle writes/sendfiles
to a full socket.
2013-03-04 16:11:03 -08:00
Jef Poskanzer
987b432316 A bunch of changes mixed together in this commit, but the significant
one is the new -Z flag.

- Fixed potential bug in net.c's Nread and Nwrite routines.  If they
had ever needed to loop they would have read/written the wrong address,
due to incorrect pointer arithmetic - sizeof(void) is not 1.  Fix
was to change the type of the buffer pointer to char*, which also
meant adding casts to some callers.

- Better checking for conflicts between command-line flags - now they
should no longer be order-dependent.

- Added a new -Z / --zerocopy flag, to use a "zero copy" method of
sending data, such as sendfile(2) instead of the usual write(2).

- Renumbered error enum to make inserting new ones easier.
2013-03-04 15:55:16 -08:00
Jef Poskanzer
358985eb58 Page-align the read/write buffer. Unclear if this helps, but
it certainly doesn't hurt.
2013-03-01 09:41:33 -08:00
Jef Poskanzer
0da578e79f Improved version of setnonblocking() - still not used. 2013-02-28 11:26:51 -08:00
Jef Poskanzer
6ae6111b27 Show correct error on connect() failure. 2013-02-27 14:35:23 -08:00
Jef Poskanzer
1133dd0b6c Fix long help message to show theactual default values from the .h file.
Correct the default test duration to ten seconds.
2013-02-27 14:22:44 -08:00
Jef Poskanzer
50a45ea47e Add get/set json_output to the API. 2013-02-26 15:54:29 -08:00
Jef Poskanzer
43929b3698 Added "burst mode" to send a bunch of packets in a row without
intervening select() calls.  This increases performance quite a bit.
2013-02-22 15:54:05 -08:00
Jef Poskanzer
231c56296e Comment out the "__attribute__((hot))" declarations because they cause
compiler warnings on older systems.  They probably didn't help
performance anyway. They'll remain in the source as markers.
2013-02-18 14:56:37 -08:00
Jef Poskanzer
3a34e7c11b With the define corrected to long-long, no longer need an explicit cast
in the tmr_create calls.
2013-02-18 10:30:21 -08:00
Jef Poskanzer
e232c5d16e Couple of defines that should be long-longs. 2013-02-18 10:28:17 -08:00
Jef Poskanzer
037c0c2367 Handle timers longer than 2147 seconds (2^31 microseconds). 2013-02-18 09:06:50 -08:00
Jef Poskanzer
ba55284d44 Added some "hot" attributes to mark a few routines that deserve
extra optimization.  Most likely this has no effect.
2013-02-18 07:33:36 -08:00
Jef Poskanzer
63a0b8d5df Branch merge. 2013-02-18 07:21:59 -08:00
Jef Poskanzer
fbaa2467a6 Change the meaning of the combination of -n and -P flags.
Previously, if you used -n to specify a test sending a specified number
of bytes and -P to send multiple streams in parallel, iperf3 would send
that many bytes on each stream.  With this change it just sends the
specified total number of bytes regardless of how many streams are used.
2013-02-18 07:19:59 -08:00
Jef Poskanzer
a5122e8951 Fix a couple problems noted by the C++ compiler. 2013-02-15 09:10:56 -08:00
Jef Poskanzer
96609aecad Makefile tweak to get iperf3_profile to actual generate profiles. 2013-02-12 11:40:16 -08:00
Jef Poskanzer
2724cb3139 Don't need -lm in Makefile any more. 2013-02-11 22:04:52 -08:00
Jef Poskanzer
f19a68d53a Oops, left out the important line from the error routine. 2013-02-07 17:54:52 -08:00
Jef Poskanzer
7ea98727a8 Initialize a couple variables to NULL to get rid of bogus warnings. 2013-02-07 13:39:33 -08:00
Jef Poskanzer
079579187a Portability fix for cJSON. 2013-02-07 13:34:53 -08:00
Jef Poskanzer
eb0206e686 Better handling of non-exit errors in JSON.
Also converted one more error to the unified call.
2013-02-07 13:30:58 -08:00
Jef Poskanzer
bf501899e7 Added fflush to JSON output. 2013-02-07 12:37:10 -08:00
Jef Poskanzer
b5e0751f59 (Mostly) switched error reporting to a single routine that handles JSON mode. 2013-02-07 12:35:17 -08:00
Jef Poskanzer
cda2ce2a7e Fixed cjson.c to no longer require -lm. 2013-02-05 21:18:47 -08:00
Jef Poskanzer
5a561d9d40 Get rid of commented-out obsolete code. If it's needed it's in the
revision history.
2013-02-05 15:38:45 -08:00
Jef Poskanzer
9bfb54c0cc Add -J flag to produce JSON output instead. 2013-02-01 11:42:35 -08:00
Jef Poskanzer
17666b94d9 Updated the man page and help string so they correspond with the code.
This entailed some re-ordering, so the diff is large.
2013-01-28 18:14:34 -08:00
Jef Poskanzer
0569f7d192 Also change iperf.1 to iperf3.1 in the makefile. 2013-01-28 17:33:51 -08:00
Jef Poskanzer
a2adc385e2 Rename iperf.1 to iperf3.1. 2013-01-28 16:52:54 -08:00
Jef Poskanzer
2efc602fb2 The units handling was interpreting capital K/M/G as 1024/1048576/1073741824
and lowercase k/m/g as 1000/1000000/1000000000.  This was deemed to be
too confusing.  Now both capital and lowercase give the powers-of-two version.
2013-01-28 16:52:04 -08:00
Jef Poskanzer
1f4b249abb Better fix for the -u/-l argument parsing mixup. This one avoids
the problem of explicitly setting the UDP block size to the TCP default
and getting ignored.
2013-01-28 14:19:07 -08:00
Jef Poskanzer
1ac282ccdd Raise default UDP block size, for better performance. 2013-01-28 14:04:39 -08:00
Jef Poskanzer
45080fc6b7 Fixed little glitch in argument handling order: "-l nnn -u" was
setting the block size back to the UDP default, while "-u -l nnn"
worked.  Now both orders work.
2013-01-28 11:48:19 -08:00
Jef Poskanzer
6177a7f1f1 Get rid of extra select() calls before reading and writing,
in both client and server.  Instead we pass in and use the
fdsets from the main loop's select().
2013-01-18 10:17:05 -08:00
Jef Poskanzer
d7613a8e9f Allow API client to provide an fd for the client-side control socket. 2012-12-13 09:37:55 -08:00
Jef Poskanzer
5cd3317d98 Get rid of compiler warning. 2012-12-11 22:45:15 -08:00
Jef Poskanzer
88dd44b040 Need a couple more include files to compile on FreeBSD. 2012-12-11 22:41:37 -08:00
Jef Poskanzer
ec2d0670b8 Switched to using a new timer package, adapted from thttpd and http_load. 2012-12-11 22:29:26 -08:00
Jef Poskanzer
9673370f98 Move non-timer routines from timer.[hc] to iperf_util.[hc] 2012-12-05 12:34:58 -08:00
Jef Poskanzer
d6e2781d18 Better detection of when linux has retransmit info in tcp_info. 2012-12-03 22:02:31 -08:00
Jef Poskanzer
9d1fc7c676 Line up output columns better. 2012-12-03 16:20:49 -08:00
Jef Poskanzer
d7ebadafa4 Make the retransmits code compile again on systems without retransmits. 2012-12-03 16:00:14 -08:00
Jef Poskanzer
46baab59e8 Disable retransmit reporting for FreeBSD, it's not actually
implemented in the OS yet.
2012-12-03 15:50:29 -08:00
Jef Poskanzer
acad430d3d Fix retransmit reporting for Linux. 2012-12-03 15:48:54 -08:00