Commit fdab0e1c authored by Elijah Grubb's avatar Elijah Grubb

Merge remote-tracking branch 'origin/master' into alpine-clientside

parents 86bd03f2 f638e53b
......@@ -4618,6 +4618,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/ubuntu16-ms/GNUmakefile \
tmcc/linux-ms/GNUmakefile \
tmcc/archlinux/GNUmakefile \
tmcc/alpine/GNUmakefile \
tmcc/freebsd5/GNUmakefile tmcc/freebsd5/supfile \
tmcc/freebsd6/GNUmakefile tmcc/freebsd6/supfile \
tmcc/freebsd6/netif-emulab \
......
......@@ -306,6 +306,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/ubuntu16-ms/GNUmakefile \
tmcc/linux-ms/GNUmakefile \
tmcc/archlinux/GNUmakefile \
tmcc/alpine/GNUmakefile \
tmcc/freebsd5/GNUmakefile tmcc/freebsd5/supfile \
tmcc/freebsd6/GNUmakefile tmcc/freebsd6/supfile \
tmcc/freebsd6/netif-emulab \
......
......@@ -36,7 +36,13 @@
/* for setsockopt and stuff */
#include <sys/param.h>
#include <sys/socket.h>
/*
* This ifdef mirrors the one in main.c. Not all libc impls offer the
* sysctl interface; and we only use it in this specific case on FreeBSD.
*/
#if !defined(USESOCKET) && (__FreeBSD_version >= 800000 && __FreeBSD_version < 803000)
#include <sys/sysctl.h>
#endif
#include <sys/time.h>
#include <sys/wait.h>
#ifndef linux
......
......@@ -24,8 +24,16 @@ SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
SYSTEM := $(shell $(SRCDIR)/../../../tmcc/osstuff.sh -o)
TARBALL = iperf-2.0.2.tar.gz
IPERFVERSION = 2.0.2
ifeq ($(SYSTEM),Linux)
OSTAG=$(shell $(SRCDIR)/../../../tmcc/osstuff.sh -t)
ifeq ($(OSTAG),alpine)
IPERFVERSION = 2.0.10
endif
endif
TARBALL = iperf-$(IPERFVERSION).tar.gz
include $(OBJDIR)/Makeconf
......@@ -62,6 +70,7 @@ endif
all: $(TARGETS)
vars:
@echo "IPERFVERSION=$(IPERFVERSION)"
@echo "SYSTEM=$(SYSTEM)"
@echo "ISBROKEN=$(ISBROKEN)"
@echo "TARGETS=$(TARGETS)"
......@@ -75,7 +84,7 @@ include $(TESTBED_SRCDIR)/GNUmakerules
%-recursive: Makefile force
$(MAKE) -f Makefile $@
src/emulab-iperf: iperf-2.0.2 config.status build-iperf
src/emulab-iperf: iperf-$(IPERFVERSION) config.status build-iperf
build-iperf: Makefile
$(MAKE) -f Makefile all
......@@ -90,10 +99,10 @@ client-install: $(ITARGETS)
# Note: GNU make wants to pass options in MAKEFLAGS (w) that are incompatible
# with BSD make. So we just force configure to assume/use gmake for BSD.
config.status:
MAKE=$(MAKE) iperf-2.0.2/configure $(CONFIG_ARGS)
MAKE=$(MAKE) iperf-$(IPERFVERSION)/configure $(CONFIG_ARGS)
iperf-2.0.2:
$(SRCDIR)/iperf-fetch.sh $(SRCDIR) $(TARBALL)
iperf-$(IPERFVERSION):
$(SRCDIR)/iperf-fetch.sh $(SRCDIR) $(TARBALL) $(IPERFVERSION)
clean:
if [ -r Makefile ]; then $(MAKE) -f Makefile clean; fi
......@@ -101,7 +110,7 @@ clean:
reallyclean: clean
rm -rf config.status Makefile compat doc include src \
iperf-2.0.2 $(TARBALL)
iperf-$(IPERFVERSION) $(TARBALL)
Makefile: config.status
......
diff -Nurb include/Settings.hpp include/Settings.hpp
--- include/Settings.hpp 2017-08-08 21:54:14.000000000 -0600
+++ include/Settings.hpp 2017-11-15 09:33:55.118085453 -0700
@@ -139,6 +139,7 @@
int mBufLen; // -l
int mMSS; // -M
int mTCPWin; // -w
+ int mAckTimo; // -A
/* flags is a BitMask of old bools
bool mBufLenSet; // -l
bool mCompat; // -C
@@ -342,7 +343,8 @@
* base flags, keep compatible with older versions
*/
#define HEADER_VERSION1 0x80000000
-#define HEADER_EXTEND 0x40000000
+#define HEADER_EMULAB 0x40000000
+#define HEADER_EXTEND 0x20000000
#define RUN_NOW 0x00000001
// newer flags
#define UNITS_PPS 0x00000001
@@ -429,6 +431,7 @@
int32_t bufferlen;
int32_t mWinBand;
int32_t mAmount;
+ int32_t mAckTimo;
#else
signed int flags : 32;
signed int numThreads : 32;
@@ -436,6 +439,7 @@
signed int bufferlen : 32;
signed int mWinBand : 32;
signed int mAmount : 32;
+ signed int mAckTimo : 32;
#endif
} client_hdr_v1;
diff -Nurb src/Client.cpp src/Client.cpp
--- src/Client.cpp 2017-08-08 21:54:14.000000000 -0600
+++ src/Client.cpp 2017-11-15 09:33:55.118085453 -0700
@@ -886,6 +886,7 @@
int count = 0;
int packetid;
+ int timo = (mSettings->mAckTimo < 0) ? 250 : mSettings->mAckTimo;
while ( count < 10 ) {
count++;
@@ -906,8 +907,8 @@
// wait until the socket is readable, or our timeout expires
FD_ZERO( &readSet );
FD_SET( mSettings->mSock, &readSet );
- timeout.tv_sec = 0;
- timeout.tv_usec = 250000; // quarter second, 250 ms
+ timeout.tv_sec = (timo / 1000);
+ timeout.tv_usec = (timo % 1000) * 1000;
rc = select( mSettings->mSock+1, &readSet, NULL, NULL, &timeout );
FAIL_errno( rc == SOCKET_ERROR, "select", mSettings );
@@ -929,6 +930,6 @@
}
}
- fprintf( stderr, warn_no_ack, mSettings->mSock, count );
+ fprintf( stderr, warn_no_ack, mSettings->mSock, count, timo );
}
// end write_UDP_FIN
diff -Nurb src/Locale.c src/Locale.c
--- src/Locale.c 2017-08-11 12:41:20.000000000 -0600
+++ src/Locale.c 2017-11-15 09:33:55.118085453 -0700
@@ -373,7 +373,7 @@
"WARNING: Path MTU Discovery may not be enabled.\n";
const char warn_no_ack[]=
-"[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
+"[%3d] WARNING: did not receive ack of last datagram after %d tries of %d ms.\n";
const char warn_ack_failed[]=
"[%3d] WARNING: ack of last datagram failed after %d tries.\n";
diff -Nurb src/Settings.cpp src/Settings.cpp
--- src/Settings.cpp 2017-08-11 11:55:44.000000000 -0600
+++ src/Settings.cpp 2017-11-15 09:33:55.118085453 -0700
@@ -114,6 +114,7 @@
{"realtime", no_argument, NULL, 'z'},
// more esoteric options
+{"ack_timeout",required_argument, NULL, 'A'},
{"bind", required_argument, NULL, 'B'},
{"compatibility", no_argument, NULL, 'C'},
{"daemon", no_argument, NULL, 'D'},
@@ -189,7 +190,7 @@
#define SHORT_OPTIONS()
-const char short_options[] = "1b:c:def:hi:l:mn:o:p:rst:uvw:x:y:zB:CDF:IL:M:NP:RS:T:UVWXZ:";
+const char short_options[] = "1b:c:def:hi:l:mn:o:p:rst:uvw:x:y:zA:B:CDF:IL:M:NP:RS:T:UVWXZ:";
/* -------------------------------------------------------------------
* defaults
@@ -237,6 +238,7 @@
//main->mTCPWin = 0; // -w, ie. don't set window
// more esoteric options
+ main->mAckTimo = -1; // -A, -1 means default 250 ms
//main->mLocalhost = NULL; // -B, none
//main->mCompat = false; // -C, run in Compatibility mode
//main->mDaemon = false; // -D, run as a daemon
@@ -538,6 +540,9 @@
// more esoteric options
+ case 'A': // ms of delay between UDP Ack resends
+ mExtSettings->mAckTimo = atoi( optarg );
+ break;
case 'B': // specify bind address
if (mExtSettings->mLocalhost == NULL) {
mExtSettings->mLocalhost = new char[ strlen( optarg ) + 1 ];
@@ -887,6 +892,9 @@
(*client)->mHost, REPORT_ADDRLEN);
}
#endif
+ if ( (flags & HEADER_EMULAB) != 0 ) {
+ (*client)->mAckTimo = ntohl(hdr->base.mAckTimo);
+ }
} else {
*client = NULL;
}
@@ -907,6 +915,9 @@
}
if ( client->mMode != kTest_Normal ) {
flags |= HEADER_VERSION1;
+ if ( hdr->base.mAckTimo >= 0 ) {
+ hdr->base.flags |= htonl(HEADER_EMULAB);
+ }
if ( isBuflenSet( client ) ) {
hdr->base.bufferlen = htonl(client->mBufLen);
} else {
@@ -924,6 +935,9 @@
hdr->base.mAmount = htonl((long)client->mAmount);
hdr->base.mAmount &= htonl( 0x7FFFFFFF );
}
+ if ( hdr->base.mAckTimo >= 0 ) {
+ hdr->base.mAckTimo = htonl(client->mAckTimo);
+ }
if ( client->mMode == kTest_DualTest ) {
flags |= RUN_NOW;
}
diff -Nurb src/main.cpp src/main.cpp
--- src/main.cpp 2017-08-08 21:54:14.000000000 -0600
+++ src/main.cpp 2017-11-15 09:33:55.119085470 -0700
@@ -166,6 +166,11 @@
// read settings from command-line parameters
Settings_ParseCommandLine( argc, argv, ext_gSettings );
+ // if needed, redirect the output into a specified file
+ if ( !isSTDOUT( ext_gSettings ) ) {
+ redirect( ext_gSettings->mOutputFileName );
+ }
+
// Check for either having specified client or server
if ( ext_gSettings->mThreadMode == kMode_Client
|| ext_gSettings->mThreadMode == kMode_Listener ) {
diff -Nurb src/stdio.c src/stdio.c
--- src/stdio.c 2017-08-08 21:54:14.000000000 -0600
+++ src/stdio.c 2017-11-15 09:33:55.119085470 -0700
@@ -264,7 +264,7 @@
return;
}
- fp = freopen(inOutputFileName, "a+", stdout);
+ fp = freopen(inOutputFileName, "a", stdout);
if ( fp == NULL ) {
fprintf(stderr, "redirect stdout failed!\n");
return;
......@@ -22,8 +22,19 @@
# }}}
#
version=2.0.2
srcurl="http://sourceforge.net/projects/iperf/files/iperf/iperf 2.02 source"
if [ -n "$3" ]; then
version="$3"
fi
if [ -z "$version" ]; then
version=2.0.2
fi
# The old versions use this funny old URL, and I can't make any sense of
# why it still works. But of course it doesn't work for new versions.
if [ "$version" = "2.0.2" ]; then
srcurl="http://sourceforge.net/projects/iperf/files/iperf/iperf 2.02 source"
else
srcurl="https://sourceforge.net/projects/iperf2/files/iperf-${version}.tar.gz"
fi
tarball="iperf-$version.tar.gz"
if [ -x /usr/bin/fetch ]; then
......@@ -37,7 +48,7 @@ fi
if [ -n "$1" ]; then srcdir=$1; else srcdir=$PWD ; fi
if [ -n "$2" ]; then tarball=$2; fi
if [ -n "$3" ]; then host=$3; else host=www.emulab.net ; fi
if [ -n "$4" ]; then host=$4; else host=www.emulab.net ; fi
dir=`pwd`
if [ ! -d $dir/iperf-$version/src ]; then
......@@ -67,7 +78,7 @@ if [ ! -d $dir/iperf-$version/src ]; then
srcdir="../$srcdir"
;;
esac
cd iperf-$version && patch -p0 < $srcdir/iperf-patch || {
cd iperf-$version && patch -p0 < $srcdir/iperf-${version}.patch || {
echo "ERROR: iperf-fetch.sh: patch failed"
exit 1
}
......
......@@ -1630,6 +1630,9 @@ start_program(struct proginfo *pinfo, unsigned long token, char *args)
* Exec the shell. We will reap children by catching SIGCHLD and
* causing an Elvin I/O handler to fire.
*/
#ifndef _PATH_CSHELL
#define _PATH_CSHELL "/bin/csh"
#endif
execl(_PATH_CSHELL, "csh", "-f", "-c", pinfo->cmdline, (char *)NULL);
/* Ug */
......
......@@ -42,6 +42,13 @@ ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
SUBDIRS := $(filter-out imagezip frisbee.redux,$(SUBDIRS))
endif
ifeq ($(SYSTEM),Linux)
OSTAG=$(shell $(SRCDIR)/../tmcc/osstuff.sh -t)
ifeq ($(OSTAG),alpine)
SUBDIRS := $(filter-out imagezip frisbee.redux capture,$(SUBDIRS))
endif
endif
all: all-subdirs
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -72,9 +79,11 @@ client-install: client
$(MAKE) -C syncd client-install
$(MAKE) -C dijkstra client-install
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
ifneq ($(OSTAG),alpine)
$(MAKE) -C imagezip client-install
$(MAKE) -C frisbee.redux client-install
$(MAKE) -C capture client-install
endif
endif
$(MAKE) -C genhostsfile client-install
ifeq ($(SYSTEM),FreeBSD)
......
......@@ -71,7 +71,9 @@
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#ifdef __FreeBSD__
#include <sys/sysctl.h>
#endif
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/ethernet.h>
......
......@@ -7183,6 +7183,7 @@ outfiles="$outfiles clientside/GNUmakefile clientside/setversion \
clientside/tmcc/ubuntu16-ms/GNUmakefile \
clientside/tmcc/linux-ms/GNUmakefile \
clientside/tmcc/archlinux/GNUmakefile \
clientside/tmcc/alpine/GNUmakefile \
clientside/tmcc/freebsd5/GNUmakefile clientside/tmcc/freebsd5/supfile \
clientside/tmcc/freebsd6/GNUmakefile clientside/tmcc/freebsd6/supfile \
clientside/tmcc/freebsd6/netif-emulab \
......
......@@ -1512,6 +1512,7 @@ outfiles="$outfiles clientside/GNUmakefile clientside/setversion \
clientside/tmcc/ubuntu16-ms/GNUmakefile \
clientside/tmcc/linux-ms/GNUmakefile \
clientside/tmcc/archlinux/GNUmakefile \
clientside/tmcc/alpine/GNUmakefile \
clientside/tmcc/freebsd5/GNUmakefile clientside/tmcc/freebsd5/supfile \
clientside/tmcc/freebsd6/GNUmakefile clientside/tmcc/freebsd6/supfile \
clientside/tmcc/freebsd6/netif-emulab \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment