Commit Graph

549 Commits

Author SHA1 Message Date
Bruce A. Mah
e0d039ea3c Add API methods to allow setting the bind_address test parameter.
This is the same functionality as the -B iperf3 command-line option.

Fixes #197.
2014-07-24 09:30:45 -07:00
Bruce A. Mah
bef5ef87f5 Don't try to do IPV6_V6ONLY on OpenBSD either.
setsockopt(3) returns an error if passing 0 to this option (which
we do if no address family is specified when we bind to the wildcard
address, say by invoking "iperf3 -s" with no other options).  This
is because OpenBSD explicitly does not support IPv4-mapped addresses,
so even though the IPV6_V6ONLY socket options exists, it only works
with a non-zero argument.

Fixes #196.
2014-06-16 08:32:18 -07:00
Bruce A. Mah
147d3369a0
Only do the IPV6_V6ONLY setsockopt(3) stuff if that option is available.
Should fix #177, in which compilation failed on older Solaris systems
that didn't have it.  This is a different approach than a patch
suggested in that issue.

Weakly regression-tested on other platforms (test this by specifying
-6, -4, or neither to the server when binding to the wildcard address,
and seeing if a client can connect with various of -6, -4, or neither).
2014-07-21 10:34:06 -07:00
Bruce A. Mah
76b5942f6f
Fix a problem with binding to the wildcard address.
On CentOS 6 and MacOS, if no address family was specified, we'd
get back an IPv4 address from getaddrinfo(3), with the result that
we couldn't accept IPv6 connections in the default server configuration.

There was an earlier attempt at fixing this problem that caused
Issue #193.  This change is a follow-up fix to that issue.

While here, put lots of comments around the fix so we remember
why we're doing these shenanigans.
2014-07-17 17:14:20 -07:00
Bruce A. Mah
5b760eef47
Fix two related bugs with -B and IPv4 addresses.
If specifying -B with an IPv4 literal address or with an FQDN that
resolved to an IPv4 address, but we had not explicitly specified an
address family with -4, we failed to set up the socket correctly
because we assumed binding to an IPv6 address, and instead (after some
error spewage) wound up binding to wildcard address.

The fix in this commit has multiple parts:  First, if the address
family hasn't been explictly specified, don't force AF_INET6 in the
hints to getaddrinfo(3).  AF_UNSPEC should generate the correct
(according to RFC 6724) behavior.

Second, iperf_reset_test() should not discard members that were passed
from command-line parameters, because that alters the behavior of the
iperf3 when it tries to recreate the listening socket.  In the failure
situation described in this issue (and possibly other as well), the
value of -B gets discarded, so on subsequent attempts to set up the
listening socket it just binds to the wildcard address.

While here, fix on-line help related to the -B option to match
reality.

Note that we're not completely in compliance with RFC 6724, which
states that we should actually try all of the addresses in returned by
getaddrinfo(3), rather than just the first one.

Fixes Issue #193.
2014-07-17 14:30:39 -07:00
Bruce A. Mah
fa0e81c853
Fix incorrect help text; "--num" should be "--bytes".
Fixes issue #192.
2014-07-10 09:49:31 -07:00
Bruce A. Mah
6c0147f2fe Remove unnecessary inclusion of <sys/queue.h>, as well as some ifdef-ed
out code that depended on it.

Fixes #180.
2014-06-17 13:15:26 -07:00
Bruce A. Mah
edf9d4e8cf Merge pull request #185 from fornwall/struct-in6_flowlabel_req-already-defined-on-android
in6_flowlabel_req is already defined on Android
2014-06-17 13:00:22 -07:00
Bruce A. Mah
846ddcba74 Merge pull request #184 from fornwall/include-select-h
Include <sys/select.h> for select(2)
2014-06-17 12:49:49 -07:00
Fredrik Fornwall
58fd2c37fc in6_flowlabel_req is already defined on Android 2014-06-16 09:02:44 +02:00
Fredrik Fornwall
1ceacc1362 Include <sys/select.h> for select(2)
The sys/select.h include is the correct one and fixes building on Android.

See e.g. http://pubs.opengroup.org/onlinepubs/009604599/functions/pselect.html
2014-06-16 08:59:08 +02:00
Bruce A. Mah
188f8eb69d
Regen. 2014-06-12 11:54:21 -07:00
Bruce A. Mah
a134ba0a02
Fix a bug in the structure of the --json output.
The various "connected" structures were just dumped into the "start"
structure.  This caused problems if there were multiple connections
(i.e. multiple parallel streams), because the "connected" structures
would overwrite themselves.  Instead, make these structures members
of a "connected" array.

This is technically an incompatible API change, but the prior behavior
was unusable.

Discovered and fix suggested by:	@i2aaron
2014-06-12 11:38:43 -07:00
Bruce A. Mah
b3903f4ca2 Revert "Explicitly run ldconfig after "make install"."
This reverts commit 72d410561e.
2014-06-11 13:25:19 -07:00
Bruce A. Mah
23c1008132 Be more tolerant of certain autoconf-defined variables not being
available.

This can happen if needing to regenerate the autoconf goop on an
older system (such as CentOS 6), where PACKAGE_URL doesn't get
defined.
2014-06-11 12:01:35 -07:00
Bruce A. Mah
265c54a01f
Fix programming misteak.
Part of issue #160, pointed out by @i2aaron.
2014-06-11 09:55:31 -07:00
Bruce A. Mah
c5e1205e49
Fix build on Fedora 21.
An open(2) call had two arguments instead of the required three.
While here, replace a hard-coded mode in a different open(2) call
with symbolic constants for readability.

Fixes #183.

Submitted by @ssahani.
2014-06-09 13:41:30 -07:00
Bruce A. Mah
552e943a65
Consolidate multiple (not current) copies of the author list into
the GitHub Pages documentation and attempt to make current.
2014-06-09 10:18:50 -07:00
Bruce A. Mah
ba8d6e6246
Implement a --get-server-output flag that allows the client to
retrieve (most of) the output emitted by the server.

If the server was invoked with the --json flag, the output will be in
JSON, otherwise it will be in the human-readable format.

If the client was invoked with the --json flag, the output will be
contained within the JSON output structure, otherwise it will be
appended (in whatever format) to the bottom of the human-readable
output.

Because of the sequencing of the output generation and display, the
server-side output includes only the starting output, interval
statistics and summaries, but not the overall summaries.  (The overall
summaries were already displayed in the client's output.)

Towards issue #160.
2014-06-05 09:48:55 -07:00
Bruce A. Mah
94c0bfffcb Another try at portability. Don't do -Werror. While probably
the best thing to do from a code hygeine standpoint, it's too
painful to try to get right for now.

Fixes #174 (second try).
2014-05-19 15:22:08 -07:00
Bruce A. Mah
8de51b589f
Portability fixes for Solaris Sun Studio and MacOS.
Only do -Wall by default if on GCC (or something that looks like
GCC, such as clang/llvm).

Turn on -Werror so we can get some better error-checking, but
we also need -Wno-deprecated-declarations at least for MacOS,
because daemon(3) is deprecated starting with MacOS 10.5.

Fixes #174 (I think).

Submitted by:	@marksolaris
2014-05-19 15:02:02 -07:00
Bruce A. Mah
426221a327
Check HAVE_STDINT_H before trying to include <stdint.h>.
Partial fix for compilation on some Solaris versions.  Fixes #175.

Submitted by:	@marksolaris
2014-05-19 10:15:36 -07:00
Bruce A. Mah
df1a7a2194
Regen. 2014-05-12 15:50:20 -07:00
Bruce A. Mah
72d410561e Explicitly run ldconfig after "make install".
This might address Issue #153.
2014-05-12 15:48:49 -07:00
Bruce A. Mah
aac3bd9e45 Merge branch 'master' of github.com:/esnet/iperf 2014-05-12 14:28:36 -07:00
Bruce A. Mah
ef3eae69bf
Add reverse member to start.test_start JSON, which is 1 in --reverse mode.
This lets us tell easily from the JSON output whether a test was run in
--reverse mode or not.  Resolves #167 (one comment made in that issue
anyway).
2014-05-12 14:27:01 -07:00
Bruce A. Mah
c8a98bd371
Increase maximum test running time to 1 day.
Fixes #166.
2014-05-09 14:08:05 -07:00
Bruce A. Mah
daff72b682
Add PACKAGE_URL to help message. 2014-05-05 15:32:57 -07:00
Bruce A. Mah
4318163373
Point to GitHub Pages. 2014-05-05 15:28:05 -07:00
carlsborg
78525e4629 fix sendfile ifdef check 2014-05-05 04:00:46 +01:00
Bruce A. Mah
81dbb9e2e1 More consistent documentation for the statistics gathering and
printing functions.
2014-05-02 12:41:07 -07:00
Bruce A. Mah
f9820fd6c0 Fix a comment. 2014-05-02 12:10:43 -07:00
Bruce A. Mah
6edfd8d65c
Use AM_MAINTAINER_MODE and regenerate autotools / libtool goop
using recent versions.

Resolves #161.
2014-05-02 11:32:12 -07:00
Bruce A. Mah
6b16244baa Make sockets for non-UDP tests non-blocking (rather than all sender
side sockets).  This is reported to fix some oddities after a recent
change in this area.

Somewhat related to Issue #125.

Submitted by:	@i2aaron
2014-04-25 13:23:13 -07:00
Bruce A. Mah
f8401dfb3a Take out some debugging goop. 2014-04-25 13:11:15 -07:00
Bruce A. Mah
bf219a4d51 Fix a problem where CPU time was computed wrong.
This definitely affected FreeBSD, which breaks POSIX.1 by not
setting CLOCKS_PER_SEC to 1000000 (see clock(3)).  At this point
I can't tell if any other platforms were affected by this.
2014-04-25 12:50:15 -07:00
Bruce A. Mah
fa2752296a Regen. 2014-04-24 10:25:36 -07:00
Bruce A. Mah
d141c52dab Get the iperf version number from autoconf, don't track the tagging date.
These simplify the release process because they eliminate a manual
file-editing step.
2014-04-24 10:23:31 -07:00
Bruce A. Mah
cbacc1d670
Only set sockets to non-blocking mode on the sending side of the
transfer.

Note that the sender can either be the client or the server depending
on whether --reverse is used.

This fixes some problems with UDP transfers getting severely confused
and (wrongly) complaining about packets arriving out of order.

Related to issue #125.
2014-04-23 15:01:27 -07:00
Bruce A. Mah
721ffc1bc5 Fix rookie C mistake committed in revision d076653b as part of
Issue #99.

This caused random output to be displayed on the client's stdout in
--json mode.

Pointed out by:	@bltierney
Pointy hat to:	@bmah888
2014-04-22 10:09:00 -07:00
Bruce A. Mah
081ba8e4e9
Commit a version of the patch for #125 for testing.
Originally submitted by:	@i2aaron
2014-04-16 16:23:13 -07:00
Bruce A. Mah
9ac254da7d Fix build on systems without sendfile(2).
Tested on:	OpenBSD 5.4
2014-04-15 02:51:54 -07:00
Bruce A. Mah
de542356af Regen. 2014-04-14 14:49:39 -07:00
Bruce A. Mah
7f6360334d
Fix potential compile error observed on MacOS 10.8. 2014-04-14 14:45:09 -07:00
Bruce A. Mah
3f8c33cd76
Better sendfile / zerocopy detection.
There's still a bunch of OS-dependent fu because every platform that
supports sendfile(2) does it differently.
2014-04-14 14:16:07 -07:00
Bruce A. Mah
3e9b0eb334
Recent feature detection changes have gotten the -C (TCP congestion
algorithm selection) option to work on FreeBSD for free, starting with
FreeBSD 9.  Update various documentation places to note this.  One
specifies the congestion algorithm in the same was on Linux, although
the names of the algorithms are (at least in the general case) different.
"sysctl net.inet.tcp.cc" on FreeBSD provides a list of available
algorithms, which are implemented as loadable kernel modules.

Rename the --linux-congestion long option to --congestion (retaining
the old option as a deprecated synonym).
2014-04-14 13:43:02 -07:00
Bruce A. Mah
a57bcc2d77 Regen. 2014-04-14 13:37:47 -07:00
Bruce A. Mah
40050b7bee
Fix breakage due to iperf.h depending on the autoconf config.h file but
not including it.

To fix this required us to change config.h to iperf_config.h (to
avoid potential filename collisions with this generic name).  Then
iperf.h could include this.

Adjust the existing header file inclusions to track this, and also
canonicalize their inclusion to be at the top of *.c files.
2014-04-14 13:33:33 -07:00
Bruce A. Mah
75ee0f4f26 Regen. 2014-04-14 10:49:59 -07:00
Bruce A. Mah
40a1faf332 Improve detection of CPU affinity support (for FreeBSD and Linux).
As with several other recent commits, don't check explicitly for an
OS platform, but rather detect the various API bits that are used
to implement CPU affinity setting.
2014-04-14 10:45:46 -07:00
Bruce A. Mah
5976bac34e Merge remote branch 'origin/master' into feature/sctp-build-fixes 2014-04-10 15:01:26 -07:00
Bruce A. Mah
5a657ae894
Get rid of this obsolete file. 2014-04-10 11:33:11 -07:00
Bruce A. Mah
cbc17310cd Get a missed HAVE_TCP_CONGESTION change. 2014-04-10 11:24:47 -07:00
Bruce A. Mah
b904a787af Regen. 2014-04-10 11:22:49 -07:00
Bruce A. Mah
4155c45471 Improve detection of IPv6 flowlabel support (Linux only).
We check at configure-time to see if IPV6_FLOWLABEL_MGR is defined
in <linux/in.6>, if it is we set a HAVE_FLOWLABEL CPP symbol to
turn on conditional compilation of the support for this feature.
2014-04-10 11:20:36 -07:00
Bruce A. Mah
8cb96d1405 Regen. 2014-04-10 10:55:26 -07:00
Bruce A. Mah
c550ef4605 Non-platform-specific detection of TCP_CONGESTION socket option.
Rather than checking for anything Linux-specific at configure-time,
see if TCP_CONGESTION is defined in <netinet/tcp.h> and if so define
a CPP variable HAVE_TCP_CONGESTION, which we then use to enable
conditional compilation of the code for this feature.
2014-04-10 10:53:18 -07:00
Bruce A. Mah
e90f34f61a Merge remote-tracking branch 'origin/master' into feature/sctp-build-fixes 2014-04-09 13:55:03 -07:00
Bruce A. Mah
449f47e4ef
Use the PACKAGE_BUGREPORT and PACKAGE_STRING macros from automake
in --help and --version.  Notably this provides the correct URL
for the bugtracker.
2014-04-09 13:29:03 -07:00
Bruce A. Mah
cfed9382b7
Get rid of definitions of ntohll and htonll that were broken on FreeBSD.
These macros were never used anywhere in iperf3 anyways, and
conflicted with macro definitions that were in FreeBSD's system
headers.

Bump copyright date and add a comment to inclusion guard while here.
2014-04-09 11:28:02 -07:00
Bruce A. Mah
cd81de3c0a
Rework detection / enabling of SCTP support.
Rather than doing checks for platforms that we believe support SCTP,
instead look for an indication (notably the presence of <netinet/sctp.h>)
that it's supported.  This makes the conditionals for SCTP more obvious.
In addition, it opens up the possibility that SCTP might work on some
new OS that's not FreeBSD or Linux.

This change may force some additional build-time requirements on Linux,
such as lksctp-tools-devel on CentOS / Fedora or libsctp-dev on
Ubuntu.

Committing this first cut for review and to enable testing on multiple
platforms.  So far this works correctly on Linux (SCTP support) and
MacOS (no SCTP support).
2014-04-09 10:29:16 -07:00
Bruce A. Mah
2939863b1a
Resolves #147.
Squashed commit of the following:

commit 23ef0d047fb5396df671be9245f7872153fc299c
Author: Bruce A. Mah <bmah@es.net>
Date:   Mon Apr 7 13:35:29 2014 -0700

    Add a few API calls to the client-side example program so we can
    exercise recently-added JSON-related functionality.

commit 5f8301e8d0380133d533da9b2e39ca4ac522e1c3
Author: Bruce A. Mah <bmah@es.net>
Date:   Mon Apr 7 13:16:39 2014 -0700

    Revert part of earlier change.

    We still want to save the JSON for libiperf consumers that might want it,
    but preserve the prior behavior of writing that JSON to stdout.  This
    maintains (roughly) the behavior of older libiperf, in which libiperf
    consumers (such as the iperf3 executable) do not need to explicitly print
    the JSON if that's all they're doing with it.

commit 173dcdb05867af00103205bfe39d1b71e18689e9
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue Mar 25 13:55:45 2014 -0700

    Update manpage for newly-added library calls.

    Bump document date while here.

    Part of Issue #147.

commit 51a275de9463febc440d41cee9d971fcd381e01c
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue Mar 25 13:30:09 2014 -0700

    Allow consumers of libiperf3 to get the JSON output for a just-completed test.

    This changes the behavior of iperf_json_finish() so that it no longer
    outputs JSON output, but saves the rendered output in a NUL-terminated
    string buffer.  After calling iperf_run_server() or iperf_run_client(),
    the client application should check iperf_get_test_json_output() to see
    if it returns a non-NULL pointer.  If so, there is JSON data available
    for it to print or otherwise consume.  The buffer is automatically
    deallocated when the containing iperf_test structure is deallocated
    with iperf_free_test().

    Also adds a new API call iperf_get_test_outfile() to find the output
    FILE* structure.

    Modifies the iperf3 application to use the new API.  Users of iperf3
    will not notice any functional change.

    No effect in "normal" output mode (non-JSON).
2014-04-07 14:12:47 -07:00
Bruce A. Mah
73936538a7
Minor style fixes, no functional change.
Related to Issue #155.
2014-03-25 13:05:03 -07:00
Aeneas Jaißle
ce38fb1029 Prevent possible buffer overflow in iperf_error.c 2014-03-25 14:09:21 +01:00
Bruce A. Mah
2808a0b6c4 Fix a crash that can be triggered by libiperf3 clients that don't use
iperf_parse_arguments().  Basically we need to initialize the
output stream in the iperf_test structure regardless of whether
iperf_parse_arguments() gets called; some programs (in particular
the programs in the examples/ directory and bwctl) don't do this
(and indeed should not need to).

This problem was introduced in the solution for Issue #119; the fix
needs to be merged to any codeline where fixes for Issue #119 go.
2014-03-20 10:24:25 -07:00
Bruce A. Mah
5d2f2cf983 Regen. 2014-03-20 09:58:27 -07:00
Bruce A. Mah
974c88e8d9
Include summary structures in JSON even if there's only one stream.
This makes consuming the JSON easier and more consistent.

Resolves #151.

Submitted by:	@i2aaron
2014-03-18 09:44:37 -07:00
Bruce A. Mah
3fa8072e9b Fix a call to iprintf(), also fix sequencing of some output flushes.
Related to Issue #119.
2014-03-14 15:48:31 -07:00
Bruce A. Mah
aeb6938d5a
Support --logfile argument to make all output go to a file.
This works for both client and server side (in the case of the server,
either for daemon or non-daemon mode).

Consistifies a few places that were using printf instead of iprintf.

Fixes Issue 119.
2014-03-14 14:23:38 -07:00
Bruce A. Mah
7af6d5a2f9
In debug mode, print out SO_SNDBUF when setting up each socket
(regardless of whether this was set explicitly or not).
2014-03-06 15:11:25 -08:00
Bruce A. Mah
dc1dd2dc7d Regen to pick up changes from issue #146. 2014-03-04 14:34:40 -08:00
Bruce A. Mah
3c4ef74e5e
Build libiperf3 as both a shared library and a static library by default.
Use --disable-static or --disable-shared to build only one flavor
of libraries.

Tested on MacOS, FreeBSD, and CentOS 6 Linux.

Resolves #146.

Originally submitted by:	@i2aaron
2014-03-04 14:31:35 -08:00
Bruce A. Mah
103838183a Update version and bug-report fields in AC_INIT and regen files. 2014-02-27 22:40:01 -08:00
Bruce A. Mah
70e4b713b7
Update URLs pointing to Google Code to use GitHub.
While here, update a couple of dates in manpages.
2014-02-27 21:56:53 -08:00
Bruce A. Mah
91d5d5e717 Increase buffer size for formatted numeric quantities, to avoid truncation.
This can happen if the user forces a particular output format that leads
to many digits (6 or more) being printed.  The new buffer size is probably
larger than it needs to be, but better safe than sorry.

Fixes Issue 142.
2014-02-21 14:24:56 -08:00
Bruce A. Mah
a3736b64e7 Don't append a colon and two spaces to title in --json output.
Resolves Issue 139.
2014-02-21 13:24:38 -08:00
Bruce A. Mah
f2c4e2b5bd Provide an API call in libiperf to set the test unit format.
Resolves Issue 144.

Submitted by:	 AaronMatthewBrown
2014-02-21 13:07:55 -08:00
Bruce A. Mah
3eaf324ab3 Remove incorrect references to multicast from -B documentation.
(This is partially because iperf3 doesn't do multicast, yet.)

Also it's not specifically a client-side option, so relocate it in
the manpage.
2014-02-14 14:58:01 -08:00
Bruce A. Mah
ede8dabb83 Set the default message size for SCTP to 64KB.
This makes SCTP with default parameters work on CentOS 6; formerly
it was just using the TCP default (128KB) and failing with
a "message too long" error.  It might be possible to fix this with
some manipulation of other default values, so that TCP and SCTP
can use the same default message size, but I haven't figure out
what this would be.

This ties up one loose end from Issue 131.
2014-02-14 14:06:08 -08:00
Bruce A. Mah
60bd98a538 Add SCTP support with the --sctp flag (Linux and FreeBSD only).
Note this option only has a long option flag; we're running out of
letters for short options.

Based heavily on a patch submitted in Issue 131 (SCTP support for
iperf); I added support for FreeBSD and did some other packaging and
documentation improvements.

We probably shouldn't tie SCTP support to looking specifically for
Linux or FreeBSD; we probably leave support enabled all the time if
possible, possibly with some configure-time checks.
2014-02-14 11:52:16 -08:00
Bruce A. Mah
d076653bd4 Output TCP snd_cwnd (on platforms supporting it) in normal output.
We were computing and printing this in JSON output mode anyway; this
change just exposes this quantity in a human-friendly manner (better
than the first attempt at this) when doing normal output.

Resolves Issue 99 (Additional TCP_INFO items).
2014-02-14 11:17:43 -08:00
Bruce A. Mah
4addea8502 Fix unfiled bug that could break TCP tests under some circumstances.
The bug and solution are very similar to Issue 126 (fixed in
d7e0c1445c0a).  Basically a setsockopt(IPV6_V6ONLY) call had a bogus
level argument, but we never checked the return value so we never
noticed this.

As with the prior issue, the fix is to unbreak the setsockopt() call,
and add some error checking to detect future breakage.

This bug was on a codepath that only got called if non-default values
were set for the socket buffer size, the MSS, or the NODELAY parameter.
It might have affected some FreeBSD tests, but really only got noticed
when debugging some other code that was (probably) cut-and-pasted
from this code.
2014-02-04 15:05:39 -08:00
Bruce A. Mah
9a829841eb Replace system("uname -a") with call to uname(3).
Slightly reworked version of a patch that was...

Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-30 15:15:53 -08:00
Bruce A. Mah
441d8b75a0 Add support for writing the PID to a file in server mode.
This is specified with the -I or --pidfile option.

Issue:		120 (PID file support)
2014-01-24 16:42:10 -08:00
Bruce A. Mah
09f54a4f44 Fix warning on platforms that don't support processor affinity.
No functional change.
2014-01-21 15:03:29 -08:00
Bruce A. Mah
723f2f7b2a Fix an abort observed on MacOS X 10.9 (but applicable to other platforms).
mapped_v4_to_regular_v4() committed the sin of doing strcpy(3) on
overlapping buffers.  This caused an abort on MacOS X 10.9.  Fix this
to use memcpy(3) instead, which handles overlapping buffers correctly.

Issue:		135 (Crash on OS X when using IP address)
2014-01-21 12:59:47 -08:00
Bruce A. Mah
0ff7575499 Fix build on Linux distros that don't support TCP_CONGESTION.
Apparently older kernels don't support TCP_CONGESTION, so we can't
just test for defined(linux) to know if we can use this sockopt or not.
This change unbreaks the build on (notably) CentOS 5.
2014-01-16 10:43:08 -08:00
Bruce A. Mah
7234074fe8 Whoops. Forgot to document the -d flag properly. Do this. 2014-01-15 12:01:22 -08:00
Bruce A. Mah
cf59099b49 Add support for a -d debug flag to enable debugging output.
Mostly intended for developer use.  At the moment there are no public
uses for this flag.
2014-01-15 10:27:33 -08:00
Bruce A. Mah
deefb95fea Add FreeBSD support for -A (set CPU affinity).
Mostly this change consists of adding FreeBSD-specific code to handle
this feature.  The concepts and system calls are very similar to what's
already done for Linux.  One difference is that on FreeBSD, the CPU
affinity mask is saved before -A processing and restored afterwards.
This causes a slight change to the function signatures for
iperf_setaffinity() and iperf_clearaffinity() (these functions
however are not documented as a part of the libiperf3 API).

Slightly improve some of the documentation for the -A command line
option, to hopefully stave off some of the questions about this
feature.

Mostly based on a submitted patch.

Issue:          128 (better error message for CPU affinity failure)
Submitted by:   Susant Sahani <ssahani@redhat.com>
2014-01-13 10:58:47 -08:00
Bruce A. Mah
55a453c2a1 Clean up some memory leaks in iperf_new_stream error handling.
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-13 09:27:42 -08:00
Bruce A. Mah
49f74e582c Prepare for iperf3 3.0.1. 2014-01-10 13:22:11 -08:00
Bruce A. Mah
c04bdcb9d0 Second try at printing statistics when processes are interrupted.
When the client process gets interrupted, both the client and server
dump out accumulated interval statistics, as well as a partial set of
summary statistics (basically each side dumps what it has, but without
the exchange of information that usually happens at the end of a
normal run).

If the server process gets interrupted, the server dumps out its
accumulated interval and summary statistics as above.  The client does
this as well in the -R case, but exits with a "Broken pipe" in the non
-R case (this behavior was present all along; it was not introduced in
this change).  More investigation will be needed to understand the
client behavior.

Bump copyright dates in a few places.

Issue:		132 (signal handler for API calls)
Discussed with:	aaron@internet2.edu
2014-01-07 16:06:27 -08:00
Bruce A. Mah
a898ff8b8e If the client gets interrupted / signaled, dump JSON output.
Issue:		132 (signal handler for API calls)
2014-01-06 12:18:21 -08:00
Bruce A. Mah
ac0786c828 Fix typos: s/exitting/exiting/
Bump a couple of copyright dates while here.
2014-01-03 11:24:06 -08:00
Bruce A. Mah
c7ddebaa6c Fix memory leaks in iperf_reset_test().
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-03 11:19:26 -08:00
Bruce A. Mah
0b9ba1005a Fix a server side crash with -P and -R.
The problem was a mangled printf format string, which I introduced in
616ac79bd80b.

Issue:		129 (iperf3 hangs with -R and -Z flags)
2014-01-03 10:33:28 -08:00
Bruce A. Mah
0fdda50c64 Fix a deadlock leading to a hang in -R mode.
In -R mode, the test consists of the server sending to the client
until the client tells it to stop by setting the test state to
TEST_END via the control socket.  However once the client changes the
test state, it stopped reading the incoming test data from the server.
In many (but not all) scenarios this could result in the server
filling up its send window (thus blocking on writes) before the
TEST_END message arrived from the client.  At this point the server
was hanging waiting for the client to drain its data connection(s),
and the client was waiting for the server to send a state change
message for EXCHANGE_RESULTS.

Bump copyright date while here.

This fix handles at least part of...

Issue:		129 (iperf3 hangs with -R and -Z flags)
2014-01-03 10:06:16 -08:00
Bruce A. Mah
48e66b9b9a Improve error message for TCP congestion algorithm setting failure.
Also remove a couple of places where we were saving and restoring errno
where we didn't need to.

Submitted by:	Susant Sahani <ssahani@redhat.com>
Issue:		121 (TCP congestion control algorithm support for client)
2014-01-02 13:49:56 -08:00
Bruce A. Mah
7da3d76096 Fix another minor memory leak.
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-02 13:26:51 -08:00