From 6882134e9c697ec1ae3ff2dd4e70db93e216fc33 Mon Sep 17 00:00:00 2001 From: David Bar-On Date: Sat, 16 May 2020 10:57:18 +0300 Subject: [PATCH 1/2] temporary changes to undef congestion control --- configure | 4 +++- src/tcp_info.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 6ad79b056..6424fb937 100755 --- a/configure +++ b/configure @@ -12983,7 +12983,9 @@ fi $as_echo "$iperf3_cv_header_tcp_congestion" >&6; } if test "x$iperf3_cv_header_tcp_congestion" = "xyes"; then -$as_echo "#define HAVE_TCP_CONGESTION 1" >>confdefs.h +# DBO >>> $as_echo "#define HAVE_TCP_CONGESTION 1" >>confdefs.h +$as_echo "#undef HAVE_TCP_CONGESTION 1" >>confdefs.h +# <<< DBO */ fi diff --git a/src/tcp_info.c b/src/tcp_info.c index d63e5b424..06c253ac7 100644 --- a/src/tcp_info.c +++ b/src/tcp_info.c @@ -95,7 +95,7 @@ void save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp) { #if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) && \ - defined(TCP_INFO) + defined(TCP_INFO)/*DBO >>> */ && 0 /*<<socket, IPPROTO_TCP, TCP_INFO, (void *)&irp->tcpInfo, &tcp_info_length) < 0) From de6aba39876ed0396639ea1a4d9628eeceb9960d Mon Sep 17 00:00:00 2001 From: David Bar-On Date: Thu, 3 Dec 2020 00:03:52 +0200 Subject: [PATCH 2/2] Remove debug --- configure | 4 +--- src/iperf_api.c | 13 +++++++++---- src/tcp_info.c | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/configure b/configure index dd287b1cf..72e0113c0 100755 --- a/configure +++ b/configure @@ -13818,9 +13818,7 @@ fi $as_echo "$iperf3_cv_header_tcp_congestion" >&6; } if test "x$iperf3_cv_header_tcp_congestion" = "xyes"; then -# DBO >>> $as_echo "#define HAVE_TCP_CONGESTION 1" >>confdefs.h -$as_echo "#undef HAVE_TCP_CONGESTION 1" >>confdefs.h -# <<< DBO */ +$as_echo "#define HAVE_TCP_CONGESTION 1" >>confdefs.h fi diff --git a/src/iperf_api.c b/src/iperf_api.c index 3657ae14c..15c5bf0bb 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -1539,7 +1539,7 @@ iperf_check_throttle(struct iperf_stream *sp, struct iperf_time *nowP) double seconds; uint64_t bits_per_second; - if (sp->test->done || sp->test->settings->rate == 0 || sp->test->settings->burst != 0) + if (sp->test->done || sp->test->settings->rate == 0) return; iperf_time_diff(&sp->result->start_time_fixed, nowP, &temp_time); seconds = iperf_time_in_secs(&temp_time); @@ -1598,6 +1598,7 @@ iperf_send(struct iperf_test *test, fd_set *write_setP) register int multisend, r, streams_active; register struct iperf_stream *sp; struct iperf_time now; + int no_throttle_check; /* Can we do multisend mode? */ if (test->settings->burst != 0) @@ -1607,8 +1608,11 @@ iperf_send(struct iperf_test *test, fd_set *write_setP) else multisend = 1; /* nope */ + /* Should bitrate throttle be checked for every send */ + no_throttle_check = test->settings->rate != 0 && test->settings->burst == 0; + for (; multisend > 0; --multisend) { - if (test->settings->rate != 0 && test->settings->burst == 0) + if (no_throttle_check) iperf_time_now(&now); streams_active = 0; SLIST_FOREACH(sp, &test->streams, streams) { @@ -1623,7 +1627,8 @@ iperf_send(struct iperf_test *test, fd_set *write_setP) streams_active = 1; test->bytes_sent += r; ++test->blocks_sent; - iperf_check_throttle(sp, &now); + if (no_throttle_check) + iperf_check_throttle(sp, &now); if (multisend > 1 && test->settings->bytes != 0 && test->bytes_sent >= test->settings->bytes) break; if (multisend > 1 && test->settings->blocks != 0 && test->blocks_sent >= test->settings->blocks) @@ -1633,7 +1638,7 @@ iperf_send(struct iperf_test *test, fd_set *write_setP) if (!streams_active) break; } - if (test->settings->burst != 0) { + if (!no_throttle_check) { /* Throttle check if was not checked for each send */ iperf_time_now(&now); SLIST_FOREACH(sp, &test->streams, streams) if (sp->sender) diff --git a/src/tcp_info.c b/src/tcp_info.c index 06c253ac7..d63e5b424 100644 --- a/src/tcp_info.c +++ b/src/tcp_info.c @@ -95,7 +95,7 @@ void save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp) { #if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) && \ - defined(TCP_INFO)/*DBO >>> */ && 0 /*<<socket, IPPROTO_TCP, TCP_INFO, (void *)&irp->tcpInfo, &tcp_info_length) < 0)