summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2015-02-07 17:11:23 +0000
committerhe <he@pkgsrc.org>2015-02-07 17:11:23 +0000
commit350219c9300ed816111f8ca4db49e8912777d0f8 (patch)
tree427c632030113a117a0e3fce214ec1fa967cbab3
parent486a4abee860476412a3272d3c7efb90481ffda5 (diff)
downloadpkgsrc-350219c9300ed816111f8ca4db49e8912777d0f8.tar.gz
If NetBSD has TCP_INFO, display number of retransmits and the
congestion window on each test interval. Also fix the FreeBSD version to do the same (wrong variable in the tcp_info struct was used...). Bump PKGREVISION.
-rw-r--r--net/iperf3/Makefile3
-rw-r--r--net/iperf3/distinfo5
-rw-r--r--net/iperf3/patches/patch-src_iperf.h16
-rw-r--r--net/iperf3/patches/patch-src_iperf__locale.c18
-rw-r--r--net/iperf3/patches/patch-src_tcp__info.c93
5 files changed, 133 insertions, 2 deletions
diff --git a/net/iperf3/Makefile b/net/iperf3/Makefile
index a5dbfbdcc1e..b86b7fc2330 100644
--- a/net/iperf3/Makefile
+++ b/net/iperf3/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.1 2015/02/02 12:25:20 he Exp $
+# $NetBSD: Makefile,v 1.2 2015/02/07 17:11:23 he Exp $
DISTNAME= iperf-3.0.11
PKGNAME= ${DISTNAME:S/iperf/iperf3/}
+PKGREVISION= 1
CATEGORIES= net benchmarks
MASTER_SITES= http://downloads.es.net/pub/iperf/
diff --git a/net/iperf3/distinfo b/net/iperf3/distinfo
index df786602e72..af8684fe389 100644
--- a/net/iperf3/distinfo
+++ b/net/iperf3/distinfo
@@ -1,9 +1,12 @@
-$NetBSD: distinfo,v 1.1 2015/02/02 12:25:20 he Exp $
+$NetBSD: distinfo,v 1.2 2015/02/07 17:11:23 he Exp $
SHA1 (iperf-3.0.11.tar.gz) = 35e31cc320e4f2264bf51f6ad1e7e0d81341135a
RMD160 (iperf-3.0.11.tar.gz) = eb371c0879fad6f2068a279704d637123bbd9162
Size (iperf-3.0.11.tar.gz) = 424267 bytes
SHA1 (patch-src_cjson.c) = b195f308ea6d7652a5fc65f1031e5642da2e611b
+SHA1 (patch-src_iperf.h) = 8997d314ca46f5af9cc162d28455b98a049e5851
SHA1 (patch-src_iperf__api.h) = e84175a031c5dcde5ade975a3a63c5fad898bf97
+SHA1 (patch-src_iperf__locale.c) = eeb61cb4c8ed2ece42f346405219ec07b752df1e
SHA1 (patch-src_iperf__server__api.c) = 124d2a57ad8d6694a4eea57366e9d88cc4b4a578
+SHA1 (patch-src_tcp__info.c) = 6f0dd37cefc69cfa41712972016ecb996830ef0a
SHA1 (patch-src_units.c) = 95e1e22af16b4996f6ec0e39fc14d137425003a4
diff --git a/net/iperf3/patches/patch-src_iperf.h b/net/iperf3/patches/patch-src_iperf.h
new file mode 100644
index 00000000000..aea2ef5d8aa
--- /dev/null
+++ b/net/iperf3/patches/patch-src_iperf.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_iperf.h,v 1.1 2015/02/07 17:11:23 he Exp $
+
+Add NetBSD support for tcp_info.
+
+--- src/iperf.h.orig 2015-02-07 00:30:32.000000000 +0000
++++ src/iperf.h
+@@ -55,7 +55,8 @@ struct iperf_interval_results
+ int cnt_error;
+
+ int omitted;
+-#if defined(linux) || defined(__FreeBSD__)
++#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++ defined(TCP_INFO)
+ struct tcp_info tcpInfo; /* getsockopt(TCP_INFO) for Linux and FreeBSD */
+ #else
+ /* Just placeholders, never accessed. */
diff --git a/net/iperf3/patches/patch-src_iperf__locale.c b/net/iperf3/patches/patch-src_iperf__locale.c
new file mode 100644
index 00000000000..481856e5bbb
--- /dev/null
+++ b/net/iperf3/patches/patch-src_iperf__locale.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_iperf__locale.c,v 1.1 2015/02/07 17:11:23 he Exp $
+
+Add NetBSD support for tcp_info.
+
+--- src/iperf_locale.c.orig 2015-01-09 17:44:11.000000000 +0000
++++ src/iperf_locale.c
+@@ -355,7 +355,10 @@ const char report_tcpInfo[] =
+ const char report_tcpInfo[] =
+ "event=TCP_Info CWND=%u RCV_WIND=%u SND_SSTHRESH=%u RTT=%u\n";
+ #endif
+-
++#if defined(__NetBSD__)
++const char report_tcpInfo[] =
++"event=TCP_Info CWND=%u RCV_WIND=%u SND_SSTHRESH=%u RTT=%u\n";
++#endif
+
+ #ifdef HAVE_QUAD_SUPPORT
+ #ifdef HAVE_PRINTF_QD
diff --git a/net/iperf3/patches/patch-src_tcp__info.c b/net/iperf3/patches/patch-src_tcp__info.c
new file mode 100644
index 00000000000..27ba4ca9e03
--- /dev/null
+++ b/net/iperf3/patches/patch-src_tcp__info.c
@@ -0,0 +1,93 @@
+$NetBSD: patch-src_tcp__info.c,v 1.1 2015/02/07 17:11:23 he Exp $
+
+Add NetBSD support, conditional on TCP_INFO.
+
+--- src/tcp_info.c.orig 2015-01-09 17:44:11.000000000 +0000
++++ src/tcp_info.c
+@@ -62,7 +62,8 @@
+ int
+ has_tcpinfo(void)
+ {
+-#if defined(linux) || defined(__FreeBSD__)
++#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) \
++ && defined(TCP_INFO)
+ return 1;
+ #else
+ return 0;
+@@ -82,8 +83,9 @@ has_tcpinfo_retransmits(void)
+ return 1;
+ #else
+ #if defined(__FreeBSD__) && __FreeBSD_version >= 600000
+- /* return 1; */
+- return 0; /* FreeBSD retransmit reporting doesn't actually work yet */
++ return 1; /* Should work now */
++#elif defined(__NetBSD__) && defined(TCP_INFO)
++ return 1;
+ #else
+ return 0;
+ #endif
+@@ -94,15 +96,17 @@ has_tcpinfo_retransmits(void)
+ void
+ save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp)
+ {
+-#if defined(linux) || defined(__FreeBSD__)
++#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) \
++ && defined(TCP_INFO)
+ socklen_t tcp_info_length = sizeof(struct tcp_info);
+
+ if (getsockopt(sp->socket, IPPROTO_TCP, TCP_INFO, (void *)&irp->tcpInfo, &tcp_info_length) < 0)
+ iperf_err(sp->test, "getsockopt - %s", strerror(errno));
+
+ if (sp->test->debug) {
+- printf("tcpi_snd_cwnd %u tcpi_snd_mss %u\n",
+- irp->tcpInfo.tcpi_snd_cwnd, irp->tcpInfo.tcpi_snd_mss);
++ printf("tcpi_snd_cwnd %u tcpi_snd_mss %u tcpi_snd_rexmitpack %u\n",
++ irp->tcpInfo.tcpi_snd_cwnd, irp->tcpInfo.tcpi_snd_mss,
++ irp->tcpInfo.tcpi_snd_rexmitpack);
+ }
+
+ #endif
+@@ -114,13 +118,13 @@ get_total_retransmits(struct iperf_inter
+ {
+ #if defined(linux) && defined(TCP_MD5SIG)
+ return irp->tcpInfo.tcpi_total_retrans;
+-#else
+-#if defined(__FreeBSD__) && __FreeBSD_version >= 600000
+- return irp->tcpInfo.__tcpi_retransmits;
++#elif defined(__FreeBSD__) && __FreeBSD_version >= 600000
++ return irp->tcpInfo.tcpi_snd_rexmitpack;
++#elif defined(__NetBSD__) && defined(TCP_INFO)
++ return irp->tcpInfo.tcpi_snd_rexmitpack;
+ #else
+ return -1;
+ #endif
+-#endif
+ }
+
+ /*************************************************************/
+@@ -132,13 +136,13 @@ get_snd_cwnd(struct iperf_interval_resul
+ {
+ #if defined(linux) && defined(TCP_MD5SIG)
+ return irp->tcpInfo.tcpi_snd_cwnd * irp->tcpInfo.tcpi_snd_mss;
+-#else
+-#if defined(__FreeBSD__) && __FreeBSD_version >= 600000
++#elif defined(__FreeBSD__) && __FreeBSD_version >= 600000
++ return irp->tcpInfo.tcpi_snd_cwnd * irp->tcpInfo.tcpi_snd_mss;
++#elif defined(__NetBSD__) && defined(TCP_INFO)
+ return irp->tcpInfo.tcpi_snd_cwnd * irp->tcpInfo.tcpi_snd_mss;
+ #else
+ return -1;
+ #endif
+-#endif
+ }
+
+ #ifdef notdef
+@@ -187,4 +191,8 @@ build_tcpinfo_message(struct iperf_inter
+ sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd,
+ r->tcpInfo.tcpi_rcv_space, r->tcpInfo.tcpi_snd_ssthresh, r->tcpInfo.tcpi_rtt);
+ #endif
++#if defined(__NetBSD__) && defined(TCP_INFO)
++ sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd,
++ r->tcpInfo.tcpi_rcv_space, r->tcpInfo.tcpi_snd_ssthresh, r->tcpInfo.tcpi_rtt);
++#endif
+ }