From 3e9b0eb334781971dca88bf975ef1a63fb307a67 Mon Sep 17 00:00:00 2001 From: "Bruce A. Mah" Date: Mon, 14 Apr 2014 13:43:02 -0700 Subject: [PATCH] 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). --- src/iperf3.1 | 7 +++++-- src/iperf_api.c | 1 + src/locale.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/iperf3.1 b/src/iperf3.1 index 588ef3b..5cf92b8 100644 --- a/src/iperf3.1 +++ b/src/iperf3.1 @@ -149,8 +149,11 @@ period. .BR -T ", " --title " \fIstr\fR" Prefix every output line with this string. .TP -.BR -C ", " --linux-congestion " \fIalgo\fR" -Set the congestion control algorithm (linux only). +.BR -C ", " --congestion " \fIalgo\fR" +Set the congestion control algorithm (Linux and FreeBSD only). An +older +.B --linux-congestion +synonym for this flag is accepted but is deprecated. .SH AUTHORS Iperf was originally written by Mark Gates and Alex Warshavsky. diff --git a/src/iperf_api.c b/src/iperf_api.c index dc62ff7..e6bc671 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -574,6 +574,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) #endif /* HAVE_CPU_AFFINITY */ {"title", required_argument, NULL, 'T'}, #if defined(HAVE_TCP_CONGESTION) + {"congestion", required_argument, NULL, 'C'}, {"linux-congestion", required_argument, NULL, 'C'}, #endif /* HAVE_TCP_CONGESTION */ #if defined(HAVE_SCTP) diff --git a/src/locale.c b/src/locale.c index adc0d16..164400d 100644 --- a/src/locale.c +++ b/src/locale.c @@ -106,7 +106,7 @@ const char usage_longstr[] = "Usage: iperf [-s|-c host] [options]\n" " -w, --window #[KMG] TCP window size (socket buffer size)\n" " -B, --bind bind to a specific interface\n" #if defined(HAVE_TCP_CONGESTION) - " -C, --linux-congestion set TCP congestion control algorithm (Linux only)\n" + " -C, --congestion set TCP congestion control algorithm (Linux and FreeBSD only)\n" #endif /* HAVE_TCP_CONGESTION */ " -M, --set-mss # set TCP maximum segment size (MTU - 40 bytes)\n" " -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n"