- Code sanitization

-> Fixed indentations
	-> Removed compile-time warnings that appeared with gcc-8
	-> Replaced fpritnfs(stderr, ..) with TRACE_DBGs

Signed-off-by: Jamshed <asim@dslohost002.jf.intel.com>
master
Jamshed 2019-06-04 01:17:24 +00:00
parent 242ae4530b
commit efeab20fd2
21 changed files with 1223 additions and 1168 deletions

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -133,7 +133,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
@ -334,8 +334,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -478,7 +478,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -543,7 +546,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@ -569,7 +572,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -587,7 +590,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -597,7 +600,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac

189
aclocal.m4 vendored
View File

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Copyright (C) 2002-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.16.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.16.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
AS_CASE([$CONFIG_FILES],
[*\'*], [eval set x "$CONFIG_FILES"],
[*], [set x $CONFIG_FILES])
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`AS_DIRNAME(["$am_mf"])`
am_filepart=`AS_BASENAME(["$am_mf"])`
AM_RUN_LOG([cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles]) || am_rc=$?
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
AS_UNSET([am_dirpart])
AS_UNSET([am_filepart])
AS_UNSET([am_mf])
AS_UNSET([am_rc])
rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
# This code is only required when automatic dependency tracking is enabled.
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
@ -563,7 +553,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -605,7 +595,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -647,7 +637,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -655,49 +645,42 @@ AC_SUBST([am__leading_dot])])
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
['0:this is the am__doit target'],
[AS_CASE([$s],
[BSD], [am__include='.include' am__quote='"'],
[am__include='include' am__quote=''])])
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
AC_MSG_RESULT([${_am_result}])
AC_SUBST([am__include])])
AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -736,7 +719,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -765,7 +748,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -812,7 +795,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -831,7 +814,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -912,7 +895,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -972,7 +955,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1000,7 +983,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1019,7 +1002,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View File

@ -26,7 +26,9 @@
#include "debug.h"
#define MAX_URL_LEN 128
#define MAX_FILE_LEN 128
#define FILE_LEN 128
#define FILE_IDX 10
#define MAX_FILE_LEN (FILE_LEN + FILE_IDX)
#define HTTP_HEADER_LEN 1024
#define IP_RANGE 1
@ -64,7 +66,7 @@ static int num_cores;
static int core_limit;
/*----------------------------------------------------------------------------*/
static int fio = FALSE;
static char outfile[MAX_FILE_LEN + 1];
static char outfile[FILE_LEN + 1];
/*----------------------------------------------------------------------------*/
static char host[MAX_IP_STR_LEN + 1] = {'\0'};
static char url[MAX_URL_LEN + 1] = {'\0'};
@ -775,7 +777,7 @@ main(int argc, char **argv)
return FALSE;
}
fio = TRUE;
strncpy(outfile, optarg, MAX_FILE_LEN);
strncpy(outfile, optarg, FILE_LEN);
break;
case 'n':
process_cpu = mystrtol(optarg, 10);

View File

@ -15,13 +15,13 @@ the connection:
1. Client initiates connection (receiver listens on `port` and client sends to
`ip:port` for `length` seconds)
- `python recv.py wait [port]`
- `python recv.py wait [ip] [port]`
- `./client send [ip] [port] [length (seconds)]`
2. Receiver initiates connection (client listens on `port`, receiver sends a
start message to `ip:port`, and then client sends back to receiver for `length`
seconds)
- `./client wait [port] [length (seconds)]`
- `./client wait [ip] [port] [length (seconds)]`
- `python recv.py send [ip] [port]`
*NOTE*: If using CCP with mTCP, you will need to ensure that `LD_LIBRARY_PATH`
@ -39,7 +39,7 @@ Setup Notes
===========
0. Ensure the ARP table and routing table are populated correctly and located inside ./config/
1. Build this application by simply running make in this directory (apps/perf)
2. Assuming sender and receiver are on the same network and/or have a very low
@ -54,7 +54,7 @@ Setup Notes
3. Start mTCP perf client in wait mode, listening on, e.g., port 9000 and
sending for 30 seconds:
`sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ./client wait 9000 30`
`sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ./client wait 10.1.1.5 9000 30`
4. Start python receiver in send mode, where client ip is e.g. 10.1.1.5

View File

@ -24,346 +24,350 @@
#include "http_parsing.h"
#include "debug.h"
#define MAX_CPUS 16
#define MAX_CPUS 16
#define MAX_URL_LEN 128
#define MAX_FILE_LEN 128
#define HTTP_HEADER_LEN 1024
#define MAX_URL_LEN 128
#define MAX_FILE_LEN 128
#define HTTP_HEADER_LEN 1024
#define IP_RANGE 1
#define MAX_IP_STR_LEN 16
#define IP_RANGE 1
#define MAX_IP_STR_LEN 16
#define BUF_SIZE (32*1024)
#define BUF_SIZE (32 * 1024)
#define CALC_MD5SUM FALSE
#define CALC_MD5SUM FALSE
#define TIMEVAL_TO_MSEC(t) ((t.tv_sec * 1000) + (t.tv_usec / 1000))
#define TIMEVAL_TO_USEC(t) ((t.tv_sec * 1000000) + (t.tv_usec))
#define TS_GT(a,b) ((int64_t)((a)-(b)) > 0)
#ifndef TRUE
#define TRUE (1)
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#define FALSE (0)
#endif
#define CONCURRENCY 1
#define BUF_LEN 8192
#define MAX_FLOW_NUM (10000)
#define MAX_EVENTS (30000)
#define CONCURRENCY 1
#define BUF_LEN 8192
#define MAX_FLOW_NUM (10000)
#define MAX_EVENTS (30000)
#define DEBUG(fmt, args...) fprintf(stderr, "[DEBUG] " fmt "\n", ## args)
#define ERROR(fmt, args...) fprintf(stderr, fmt "\n", ## args)
#define SAMPLE(fmt, args...) fprintf(stdout, fmt "\n", ## args)
#define SEND_MODE 1
#define WAIT_MODE 2
#define DEBUG(fmt, args...) fprintf(stderr, "[DEBUG] " fmt "\n", ## args)
#define ERROR(fmt, args...) fprintf(stderr, fmt "\n", ## args)
#define SAMPLE(fmt, args...) fprintf(stdout, fmt "\n", ## args)
#define SEND_MODE 1
#define WAIT_MODE 2
/*----------------------------------------------------------------------------*/
struct thread_context
{
int core;
mctx_t mctx;
int core;
mctx_t mctx;
};
void SignalHandler(int signum)
/*----------------------------------------------------------------------------*/
void
SignalHandler(int signum)
{
ERROR("Received SIGINT");
exit(-1);
ERROR("Received SIGINT");
exit(-1);
}
void print_usage(int mode) {
if (mode == SEND_MODE || mode == 0) {
ERROR("(client initiates) usage: ./client send [ip] [port] [length (seconds)]");
}
if (mode == WAIT_MODE || mode == 0) {
ERROR("(server initiates) usage: ./client wait [length (seconds)]");
}
}
int main(int argc, char **argv)
/*----------------------------------------------------------------------------*/
void
print_usage(int mode)
{
int ret, i, c;
if (mode == SEND_MODE || mode == 0) {
ERROR("(client initiates) usage: ./client send [ip] [port] [length (seconds)]");
}
if (mode == WAIT_MODE || mode == 0) {
ERROR("(server initiates) usage: ./client wait [length (seconds)]");
}
}
/*----------------------------------------------------------------------------*/
int
main(int argc, char **argv)
{
int ret, i, c;
//mtcp
mctx_t mctx;
struct mtcp_conf mcfg;
struct thread_context *ctx;
struct mtcp_epoll_event *events;
struct mtcp_epoll_event ev;
int core = 0;
int ep_id;
//mtcp
mctx_t mctx;
struct mtcp_conf mcfg;
struct thread_context *ctx;
struct mtcp_epoll_event *events;
struct mtcp_epoll_event ev;
int core = 0;
int ep_id;
// sockets
struct sockaddr_in saddr, daddr;
int sockfd;
int backlog = 3;
// sockets
struct sockaddr_in saddr, daddr;
int sockfd;
int backlog = 3;
// counters
int sec_to_send;
int wrote = 0,
read = 0,
bytes_sent = 0,
events_ready = 0,
nevents = 0,
sent_close = 0;
// counters
int sec_to_send;
int wrote = 0,
read = 0,
bytes_sent = 0,
events_ready = 0,
nevents = 0,
sent_close = 0;
// time
double elapsed_time = 0.0;
struct timeval t1, t2;
struct timespec ts_start, now;
time_t end_time;
// time
double elapsed_time = 0.0;
struct timeval t1, t2;
struct timespec ts_start, now;
time_t end_time;
// send buffer
char buf[BUF_LEN];
char rcvbuf[BUF_LEN];
// send buffer
char buf[BUF_LEN];
char rcvbuf[BUF_LEN];
// args
int mode = 0;
// args
int mode = 0;
if (argc < 2) {
print_usage(0);
return -1;
}
if (argc < 2) {
print_usage(0);
return -1;
}
if (strncmp(argv[1], "send", 4) == 0) {
if (argc < 5) {
print_usage(SEND_MODE);
return -1;
}
if (strncmp(argv[1], "send", 4) == 0) {
if (argc < 5) {
print_usage(SEND_MODE);
return -1;
}
mode = SEND_MODE;
DEBUG("Send mode");
mode = SEND_MODE;
DEBUG("Send mode");
// Parse command-line args
daddr.sin_family = AF_INET;
daddr.sin_addr.s_addr = inet_addr(argv[2]);;
daddr.sin_port = htons(atoi(argv[3]));
sec_to_send = atoi(argv[4]);
// Parse command-line args
daddr.sin_family = AF_INET;
daddr.sin_addr.s_addr = inet_addr(argv[2]);;
daddr.sin_port = htons(atoi(argv[3]));
sec_to_send = atoi(argv[4]);
} else if (strncmp(argv[1], "wait", 4) == 0) {
if (argc < 4) {
print_usage(WAIT_MODE);
return -1;
}
mode = WAIT_MODE;
DEBUG("Wait mode");
saddr.sin_family = AF_INET;
saddr.sin_addr.s_addr = inet_addr("10.1.1.5");//INADDR_ANY;
saddr.sin_port = htons(atoi(argv[2]));
sec_to_send = atoi(argv[3]);
} else {
ERROR("Unknown mode \"%s\"", argv[1]);
print_usage(0);
}
if (mode == 0) {
return -1;
}
} else if (strncmp(argv[1], "wait", 4) == 0) {
if (argc < 4) {
print_usage(WAIT_MODE);
return -1;
}
mode = WAIT_MODE;
DEBUG("Wait mode");
saddr.sin_family = AF_INET;
saddr.sin_addr.s_addr = inet_addr(argv[2]);
saddr.sin_port = htons(atoi(argv[3]));
sec_to_send = atoi(argv[4]);
} else {
ERROR("Unknown mode \"%s\"", argv[1]);
print_usage(0);
}
if (mode == 0) {
return -1;
}
// This must be done before mtcp_init
mtcp_getconf(&mcfg);
mcfg.num_cores = 1;
mtcp_setconf(&mcfg);
// Seed RNG
srand(time(NULL));
// This must be done before mtcp_init
mtcp_getconf(&mcfg);
mcfg.num_cores = 1;
mtcp_setconf(&mcfg);
// Seed RNG
srand(time(NULL));
// Init mtcp
DEBUG("Initializing mtcp...\n");
if (mtcp_init("client.conf")) {
ERROR("Failed to initialize mtcp.\n");
return -1;
}
// Init mtcp
DEBUG("Initializing mtcp...\n");
if (mtcp_init("client.conf")) {
ERROR("Failed to initialize mtcp.\n");
return -1;
}
// Default simple config, this must be done after mtcp_init
mtcp_getconf(&mcfg);
mcfg.max_concurrency = 3 * CONCURRENCY;
mcfg.max_num_buffers = 3 * CONCURRENCY;
mtcp_setconf(&mcfg);
// Default simple config, this must be done after mtcp_init
mtcp_getconf(&mcfg);
mcfg.max_concurrency = 3 * CONCURRENCY;
mcfg.max_num_buffers = 3 * CONCURRENCY;
mtcp_setconf(&mcfg);
// Catch ctrl+c to clean up
mtcp_register_signal(SIGINT, SignalHandler);
// Catch ctrl+c to clean up
mtcp_register_signal(SIGINT, SignalHandler);
DEBUG("Creating thread context...");
mtcp_core_affinitize(core);
ctx = (struct thread_context *) calloc(1, sizeof(struct thread_context));
if (!ctx) {
ERROR("Failed to create context.");
perror("calloc");
return -1;
}
ctx->core = core;
ctx->mctx = mtcp_create_context(core);
if (!ctx->mctx) {
ERROR("Failed to create mtcp context.");
return -1;
}
mctx = ctx->mctx;
DEBUG("Creating thread context...");
mtcp_core_affinitize(core);
ctx = (struct thread_context *) calloc(1, sizeof(struct thread_context));
if (!ctx) {
ERROR("Failed to create context.");
perror("calloc");
return -1;
}
ctx->core = core;
ctx->mctx = mtcp_create_context(core);
if (!ctx->mctx) {
ERROR("Failed to create mtcp context.");
return -1;
}
mctx = ctx->mctx;
if (mode == SEND_MODE) {
// Create pool of TCP source ports for outgoing conns
DEBUG("Creating pool of TCP source ports...");
mtcp_init_rss(mctx, INADDR_ANY, IP_RANGE, daddr.sin_addr.s_addr, daddr.sin_port);
}
if (mode == SEND_MODE) {
// Create pool of TCP source ports for outgoing conns
DEBUG("Creating pool of TCP source ports...");
mtcp_init_rss(mctx, INADDR_ANY, IP_RANGE, daddr.sin_addr.s_addr, daddr.sin_port);
}
DEBUG("Creating epoller...");
ep_id = mtcp_epoll_create(ctx->mctx, mcfg.max_num_buffers);
events = (struct mtcp_epoll_event *) calloc(mcfg.max_num_buffers, sizeof(struct mtcp_epoll_event));
if (!events) {
ERROR("Failed to allocate events.");
return -1;
}
DEBUG("Creating epoller...");
ep_id = mtcp_epoll_create(ctx->mctx, mcfg.max_num_buffers);
events = (struct mtcp_epoll_event *) calloc(mcfg.max_num_buffers, sizeof(struct mtcp_epoll_event));
if (!events) {
ERROR("Failed to allocate events.");
return -1;
}
DEBUG("Creating socket...");
sockfd = mtcp_socket(mctx, AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
ERROR("Failed to create socket.");
return -1;
}
DEBUG("Creating socket...");
sockfd = mtcp_socket(mctx, AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
ERROR("Failed to create socket.");
return -1;
}
ret = mtcp_setsock_nonblock(mctx, sockfd);
if (ret < 0) {
ERROR("Failed to set socket in nonblocking mode.");
return -1;
}
ret = mtcp_setsock_nonblock(mctx, sockfd);
if (ret < 0) {
ERROR("Failed to set socket in nonblocking mode.");
return -1;
}
ev.events = MTCP_EPOLLIN;
ev.data.sockid = sockfd;
mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_ADD, sockfd, &ev);
ev.events = MTCP_EPOLLIN;
ev.data.sockid = sockfd;
mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_ADD, sockfd, &ev);
if (mode == WAIT_MODE) {
ret = mtcp_bind(mctx, sockfd, (struct sockaddr *)&saddr, sizeof(struct sockaddr_in));
if (ret < 0) {
ERROR("Failed to bind to the listening socket.");
}
if (mode == WAIT_MODE) {
ret = mtcp_bind(mctx, sockfd, (struct sockaddr *)&saddr, sizeof(struct sockaddr_in));
if (ret < 0) {
ERROR("Failed to bind to the listening socket.");
}
ret = mtcp_listen(mctx, sockfd, backlog);
if (ret < 0) {
ERROR("Failed to listen: %s", strerror(errno));
}
ret = mtcp_listen(mctx, sockfd, backlog);
if (ret < 0) {
ERROR("Failed to listen: %s", strerror(errno));
}
while (1) { // loop until connected to a server, break when we can send
nevents = mtcp_epoll_wait(mctx, ep_id, events, MAX_EVENTS, -1);
if (nevents < 0) {
if (errno != EINTR) {
perror("mtcp_epoll_wait");
}
return -1;
}
while (1) { // loop until connected to a server, break when we can send
nevents = mtcp_epoll_wait(mctx, ep_id, events, MAX_EVENTS, -1);
if (nevents < 0) {
if (errno != EINTR) {
perror("mtcp_epoll_wait");
}
return -1;
}
for (i = 0; i < nevents; i++) {
if (events[i].data.sockid == sockfd) {
c = mtcp_accept(mctx, sockfd, NULL, NULL);
if (c >= 0) {
if (c >= MAX_FLOW_NUM) {
ERROR("Invalid socket id %d.", c);
}
DEBUG("Accepted new connection");
} else {
ERROR("mtcp_accept() %s", strerror(errno));
}
mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_DEL, sockfd, &ev);
sockfd = c;
ev.events = MTCP_EPOLLIN | MTCP_EPOLLOUT;
ev.data.sockid = sockfd;
mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_ADD, sockfd, &ev);
goto end_wait_loop;
} else {
ERROR("Received event on unknown socket.");
}
}
}
}
for (i = 0; i < nevents; i++) {
if (events[i].data.sockid == sockfd) {
c = mtcp_accept(mctx, sockfd, NULL, NULL);
if (c >= 0) {
if (c >= MAX_FLOW_NUM) {
ERROR("Invalid socket id %d.", c);
}
DEBUG("Accepted new connection");
} else {
ERROR("mtcp_accept() %s", strerror(errno));
}
mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_DEL, sockfd, &ev);
sockfd = c;
ev.events = MTCP_EPOLLIN | MTCP_EPOLLOUT;
ev.data.sockid = sockfd;
mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_ADD, sockfd, &ev);
goto end_wait_loop;
} else {
ERROR("Received event on unknown socket.");
}
}
}
}
end_wait_loop:
if (mode == SEND_MODE) {
DEBUG("Connecting socket...");
ret = mtcp_connect(mctx, sockfd, (struct sockaddr *)&daddr, sizeof(struct sockaddr_in));
if (ret < 0) {
ERROR("mtcp_connect failed.");
if (errno != EINPROGRESS) {
perror("mtcp_connect");
mtcp_close(mctx, sockfd);
return -1;
}
}
DEBUG("Connection created.");
}
if (mode == SEND_MODE) {
DEBUG("Connecting socket...");
ret = mtcp_connect(mctx, sockfd, (struct sockaddr *)&daddr, sizeof(struct sockaddr_in));
if (ret < 0) {
ERROR("mtcp_connect failed.");
if (errno != EINPROGRESS) {
perror("mtcp_connect");
mtcp_close(mctx, sockfd);
return -1;
}
}
DEBUG("Connection created.");
}
clock_gettime(CLOCK_MONOTONIC, &ts_start);
end_time = ts_start.tv_sec + sec_to_send;
clock_gettime(CLOCK_MONOTONIC, &ts_start);
end_time = ts_start.tv_sec + sec_to_send;
memset(buf, 0x90, sizeof(char) * BUF_LEN);
buf[BUF_LEN-1] = '\0';
memset(buf, 0x90, sizeof(char) * BUF_LEN);
buf[BUF_LEN-1] = '\0';
while (1) {
wrote = mtcp_write(ctx->mctx, sockfd, buf, BUF_LEN);
bytes_sent += wrote;
if (wrote > 0) {
gettimeofday(&t1, NULL);
break;
}
}
while (1) {
wrote = mtcp_write(ctx->mctx, sockfd, buf, BUF_LEN);
bytes_sent += wrote;
if (wrote > 0) {
gettimeofday(&t1, NULL);
break;
}
}
//ev.events = MTCP_EPOLLIN | MTCP_EPOLLOUT;
//mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_ADD, sockfd, &ev);
//
//ev.events = MTCP_EPOLLIN | MTCP_EPOLLOUT;
//mtcp_epoll_ctl(mctx, ep_id, MTCP_EPOLL_CTL_ADD, sockfd, &ev);
//
while (1) { // check time
events_ready = mtcp_epoll_wait(ctx->mctx, ep_id, events, mcfg.max_num_buffers, -1);
for (int i=0; i < events_ready; i++) {
assert(sockfd == events[i].data.sockid);
if (events[i].events & MTCP_EPOLLIN) {
read = mtcp_read(ctx->mctx, sockfd, rcvbuf, BUF_LEN);
if (read <= 0) {
continue;
} else {
DEBUG("Got FIN-ACK from receiver (%d bytes): %s", read, rcvbuf);
goto stop_timer;
}
} else if (events[i].events == MTCP_EPOLLOUT) {
//if (bytes_sent < sec_to_send) {
clock_gettime(CLOCK_MONOTONIC, &now);
if (now.tv_sec < end_time) {
wrote = mtcp_write(ctx->mctx, sockfd, buf, BUF_LEN);
bytes_sent += wrote;
//DEBUG("wrote %d, total %d", wrote, bytes_sent);
} else if (!sent_close) {
memset(buf, 0x96, sizeof(char) * BUF_LEN);
mtcp_write(ctx->mctx, sockfd, buf, 1);
DEBUG("Done writing... waiting for FIN-ACK");
sent_close = 1;
}
}
}
}
while (1) { // check time
events_ready = mtcp_epoll_wait(ctx->mctx, ep_id, events, mcfg.max_num_buffers, -1);
for (int i = 0; i < events_ready; i++) {
assert(sockfd == events[i].data.sockid);
if (events[i].events & MTCP_EPOLLIN) {
read = mtcp_read(ctx->mctx, sockfd, rcvbuf, BUF_LEN);
if (read <= 0) {
continue;
} else {
DEBUG("Got FIN-ACK from receiver (%d bytes): %s", read, rcvbuf);
goto stop_timer;
}
} else if (events[i].events == MTCP_EPOLLOUT) {
//if (bytes_sent < sec_to_send) {
clock_gettime(CLOCK_MONOTONIC, &now);
if (now.tv_sec < end_time) {
wrote = mtcp_write(ctx->mctx, sockfd, buf, BUF_LEN);
bytes_sent += wrote;
//DEBUG("wrote %d, total %d", wrote, bytes_sent);
} else if (!sent_close) {
memset(buf, 0x96, sizeof(char) * BUF_LEN);
mtcp_write(ctx->mctx, sockfd, buf, 1);
DEBUG("Done writing... waiting for FIN-ACK");
sent_close = 1;
}
}
}
}
stop_timer:
gettimeofday(&t2, NULL);
gettimeofday(&t2, NULL);
DEBUG("Done reading. Closing socket...");
mtcp_close(mctx, sockfd);
DEBUG("Socket closed.");
DEBUG("Done reading. Closing socket...");
mtcp_close(mctx, sockfd);
DEBUG("Socket closed.");
printf("\n\n");
elapsed_time = (t2.tv_sec - t1.tv_sec) * 1.0;
elapsed_time += (t2.tv_usec - t1.tv_usec) / 1000000.0;
printf("Time elapsed: %f\n", elapsed_time);
printf("Total bytes sent: %d\n", bytes_sent);
printf("Throughput: %.3fMbit/sec\n", ((bytes_sent * 8.0 / 1000000.0) / elapsed_time));
printf("\n\n");
elapsed_time = (t2.tv_sec - t1.tv_sec) * 1.0;
elapsed_time += (t2.tv_usec - t1.tv_usec) / 1000000.0;
printf("Time elapsed: %f\n", elapsed_time);
printf("Total bytes sent: %d\n", bytes_sent);
printf("Throughput: %.3fMbit/sec\n", ((bytes_sent * 8.0 / 1000000.0) / elapsed_time));
mtcp_destroy_context(ctx->mctx);
free(ctx);
mtcp_destroy();
mtcp_destroy_context(ctx->mctx);
free(ctx);
mtcp_destroy();
return 0;
return 0;
}

View File

@ -52,9 +52,9 @@ def server(mode):
port = None
if mode == "wait":
port = eval(sys.argv[2])
port = eval(sys.argv[3])
s = socket(AF_INET, SOCK_STREAM)
s.bind(('10.1.1.6', port))
s.bind((sys.argv[2], port))
s.listen(1)
print 'Server ready...'
while 1:
@ -85,7 +85,7 @@ def main():
else:
mode = sys.argv[1]
if mode == "wait":
if len(sys.argv) != 3:
if len(sys.argv) != 4:
usage()
elif mode == "send":
if len(sys.argv) != 4:

13
compile
View File

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

645
configure vendored
View File

@ -638,7 +638,6 @@ am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
am__untar
@ -729,7 +728,8 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
SHELL
am__quote'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@ -4359,6 +4359,8 @@ main ()
if (*(data + i) != *(data3 + i))
return 14;
close (fd);
free (data);
free (data3);
return 0;
}
_ACEOF
@ -4598,7 +4600,7 @@ fi
fi
am__api_version='1.15'
am__api_version='1.16'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -5024,45 +5026,45 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
{ echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
(${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
case $?:`cat confinc.out 2>/dev/null` in #(
'0:this is the am__doit target') :
case $s in #(
BSD) :
am__include='.include' am__quote='"' ;; #(
*) :
am__include='include' am__quote='' ;;
esac ;; #(
*) :
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf
esac
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
$as_echo "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
@ -5175,8 +5177,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
@ -5355,7 +5357,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -6089,7 +6091,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF
@ -6702,29 +6704,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`$as_dirname -- "$am_mf" ||
$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -6742,53 +6750,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
am_filepart=`$as_basename -- "$am_mf" ||
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
{ echo "$as_me:$LINENO: cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles" >&5
(cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
}
;;
@ -7554,7 +7557,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF
@ -8168,29 +8171,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`$as_dirname -- "$am_mf" ||
$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -8208,53 +8217,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
am_filepart=`$as_basename -- "$am_mf" ||
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
{ echo "$as_me:$LINENO: cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles" >&5
(cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
}
;;
@ -9024,7 +9028,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF
@ -9639,29 +9643,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`$as_dirname -- "$am_mf" ||
$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -9679,53 +9689,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
am_filepart=`$as_basename -- "$am_mf" ||
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
{ echo "$as_me:$LINENO: cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles" >&5
(cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
}
;;
@ -10499,7 +10504,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF
@ -11115,29 +11120,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`$as_dirname -- "$am_mf" ||
$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -11155,53 +11166,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
am_filepart=`$as_basename -- "$am_mf" ||
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
{ echo "$as_me:$LINENO: cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles" >&5
(cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
}
;;
@ -11979,7 +11985,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF
@ -12596,29 +12602,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`$as_dirname -- "$am_mf" ||
$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -12636,53 +12648,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
am_filepart=`$as_basename -- "$am_mf" ||
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
{ echo "$as_me:$LINENO: cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles" >&5
(cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
}
;;

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2014-09-12.12; # UTC
scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -271,15 +271,18 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@ -288,6 +291,11 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
@ -324,14 +332,16 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
@ -434,8 +444,8 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
@ -500,9 +510,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

16
missing
View File

@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2013-10-28.13; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -101,9 +101,9 @@ else
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@ -98,18 +98,11 @@ INC += -I$(PS_DIR)/include
# CFLAGS for DPDK-related compilation
ifeq ($(DPDK), 1)
# !!! FROM UPSTREAM
include $(RTE_SDK)/mk/rte.vars.mk
CFLAGS+=@CFLAGS@
ifeq ($(ENFORCE_RX_IDLE), 1)
INC += -DENFORCE_RX_IDLE -DRX_IDLE_THRESH=@RX_IDLE_THRESH@
endif
# !!! NEEDED FOR DPDK-17.08, MIGHT NEED TO UNCOMMENT LATER
#DPDK_MACHINE_FLAGS = $(shell cat @DPDKLIBPATH@/include/cflags.txt)
#INC += ${DPDK_MACHINE_FLAGS} -I${DPDK_INC} -include $(DPDK_INC)/rte_config.h
else
INC += -DDISABLE_DPDK
endif

View File

@ -12,234 +12,249 @@
#include "ccp.h"
#include "libccp/ccp.h"
/*----------------------------------------------------------------------------*/
static inline void get_stream_from_ccp(
tcp_stream **stream,
struct ccp_connection *conn
) {
*stream = (tcp_stream *) ccp_get_impl(conn);
static inline void
get_stream_from_ccp(tcp_stream **stream, struct ccp_connection *conn)
{
*stream = (tcp_stream *) ccp_get_impl(conn);
}
static inline void get_mtcp_from_ccp(
mtcp_manager_t *mtcp
) {
*mtcp = (mtcp_manager_t) ccp_get_global_impl();
/*----------------------------------------------------------------------------*/
static inline void
get_mtcp_from_ccp(mtcp_manager_t *mtcp)
{
*mtcp = (mtcp_manager_t) ccp_get_global_impl();
}
/*----------------------------------------------------------------------------*/
/* Function handlers passed to libccp */
/*----------------------------------------------------------------------------*/
static void _dp_set_cwnd(struct ccp_datapath *dp, struct ccp_connection *conn, uint32_t cwnd) {
tcp_stream *stream;
get_stream_from_ccp(&stream, conn);
uint32_t new_cwnd = MAX(cwnd, TCP_INIT_CWND * stream->sndvar->mss);
static void
_dp_set_cwnd(struct ccp_datapath *dp, struct ccp_connection *conn, uint32_t cwnd)
{
tcp_stream *stream;
get_stream_from_ccp(&stream, conn);
uint32_t new_cwnd = MAX(cwnd, TCP_INIT_CWND * stream->sndvar->mss);
// (time_ms) (rtt) (curr_cwnd_pkts) (new_cwnd_pkts) (ssthresh)
if (cwnd != stream->sndvar->cwnd) {
CCP_PROBE("%lu %d %d->%d (ss=%d)\n",
now_usecs() / 1000,
stream->rcvvar->srtt * 125,
stream->sndvar->cwnd / stream->sndvar->mss,
new_cwnd / stream->sndvar->mss,
stream->sndvar->ssthresh / stream->sndvar->mss
);
}
stream->sndvar->cwnd = new_cwnd;
// (time_ms) (rtt) (curr_cwnd_pkts) (new_cwnd_pkts) (ssthresh)
if (cwnd != stream->sndvar->cwnd) {
CCP_PROBE("%lu %d %d->%d (ss=%d)\n",
now_usecs() / 1000,
stream->rcvvar->srtt * 125,
stream->sndvar->cwnd / stream->sndvar->mss,
new_cwnd / stream->sndvar->mss,
stream->sndvar->ssthresh / stream->sndvar->mss
);
}
stream->sndvar->cwnd = new_cwnd;
}
static void _dp_set_rate_abs(struct ccp_datapath *dp, struct ccp_connection *conn, uint32_t rate) {
tcp_stream *stream;
get_stream_from_ccp(&stream, conn);
/*----------------------------------------------------------------------------*/
static void
_dp_set_rate_abs(struct ccp_datapath *dp, struct ccp_connection *conn, uint32_t rate)
{
tcp_stream *stream;
get_stream_from_ccp(&stream, conn);
#if PACING_ENABLED || RATE_LIMIT_ENABLED
#if RATE_LIMIT_ENABLED
#if RATE_LIMIT_ENABLED
stream->bucket->rate = rate;
#endif
#if PACING_ENABLED
#endif
#if PACING_ENABLED
stream->pacer->rate_bps = rate;
#endif
#endif
#else
TRACE_ERROR("unable to set rate, both PACING and RATE_LIMIT are disabled. enable one to use rates.\n");
TRACE_ERROR("unable to set rate, both PACING and RATE_LIMIT are disabled."
" Enable one to use rates.\n");
#endif
}
static void _dp_set_rate_rel(struct ccp_datapath *dp, struct ccp_connection *conn, uint32_t factor) {
tcp_stream *stream;
get_stream_from_ccp(&stream, conn);
/*----------------------------------------------------------------------------*/
static void
_dp_set_rate_rel(struct ccp_datapath *dp, struct ccp_connection *conn, uint32_t factor)
{
tcp_stream *stream;
get_stream_from_ccp(&stream, conn);
#if PACING_ENABLED || RATE_LIMIT_ENABLED
#if RATE_LIMIT_ENABLED
#if RATE_LIMIT_ENABLED
stream->bucket->rate *= (factor / 100);
#endif
#if PACING_ENABLED
stream->pacer->rate_bps *= (factor / 100);
#endif
#else
TRACE_ERROR("unable to set rate, both PACING and RATE_LIMIT are disabled. enable one to use rates.\n");
#endif
#if PACING_ENABLED
stream->pacer->rate_bps *= (factor / 100);
#endif
#else
TRACE_ERROR("unable to set rate, both PACING and RATE_LIMIT are disabled."
" Enable one to use rates.\n");
#endif
}
/*----------------------------------------------------------------------------*/
int
_dp_send_msg(struct ccp_datapath *dp, struct ccp_connection *conn, char *msg, int msg_size)
{
mtcp_manager_t mtcp;
get_mtcp_from_ccp(&mtcp);
int _dp_send_msg(struct ccp_datapath *dp, struct ccp_connection *conn, char *msg, int msg_size) {
mtcp_manager_t mtcp;
get_mtcp_from_ccp(&mtcp);
int ret = send(mtcp->to_ccp, msg, msg_size, 0);
if (ret < 0) {
TRACE_ERROR("failed to send msg to ccp: %s\n", strerror(errno));
}
return ret;
int ret = send(mtcp->to_ccp, msg, msg_size, 0);
if (ret < 0) {
TRACE_ERROR("failed to send msg to ccp: %s\n", strerror(errno));
}
return ret;
}
/*----------------------------------------------------------------------------*/
/* Connect to CCP process via unix sockets */
/*----------------------------------------------------------------------------*/
void setup_ccp_connection(mtcp_manager_t mtcp) {
mtcp_thread_context_t ctx = mtcp->ctx;
// TODO do we need a socket per core?
int cpu = ctx->cpu;
//char cpu_str[2] = "";
int recv_sock;
int path_len;
int ret;
struct sockaddr_un local;
void
setup_ccp_connection(mtcp_manager_t mtcp)
{
mtcp_thread_context_t ctx = mtcp->ctx;
// TODO do we need a socket per core?
int cpu = ctx->cpu;
//char cpu_str[2] = "";
int recv_sock;
int path_len;
int ret;
struct sockaddr_un local;
// Make sure unix socket path exists
ret = mkdir(CCP_UNIX_BASE, 0755);
if (ret < 0 && errno != EEXIST) {
TRACE_ERROR("failed to create path for ccp unix socket (%d): %s\n", ret, strerror(errno));
}
ret = mkdir(CCP_UNIX_BASE CCP_ID, 0755);
if (ret < 0 && errno != EEXIST) {
TRACE_ERROR("failed to create path for ccp unix socket (%d): %s\n", ret, strerror(errno));
}
if ((recv_sock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
TRACE_ERROR("failed to create unix recv socket for ccp comm\n");
exit(-1);
}
local.sun_family = AF_UNIX;
strcpy(local.sun_path, FROM_CCP_PATH);
unlink(local.sun_path);
path_len = strlen(local.sun_path) + sizeof(local.sun_family);
if (bind(recv_sock, (struct sockaddr *)&local, path_len) == -1) {
TRACE_ERROR("(cpu %d) failed to bind to unix://%s because %s\n", cpu, FROM_CCP_PATH, strerror(errno));
exit(-1);
}
mtcp->from_ccp = recv_sock;
// Make sure unix socket path exists
ret = mkdir(CCP_UNIX_BASE, 0755);
if (ret < 0 && errno != EEXIST) {
TRACE_ERROR("Failed to create path for ccp unix socket (%d): %s\n",
ret, strerror(errno));
}
ret = mkdir(CCP_UNIX_BASE CCP_ID, 0755);
if (ret < 0 && errno != EEXIST) {
TRACE_ERROR("Failed to create path for ccp unix socket (%d): %s\n",
ret, strerror(errno));
}
if ((recv_sock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
TRACE_ERROR("Failed to create unix recv socket for ccp comm\n");
exit(EXIT_FAILURE);
}
local.sun_family = AF_UNIX;
strcpy(local.sun_path, FROM_CCP_PATH);
unlink(local.sun_path);
path_len = strlen(local.sun_path) + sizeof(local.sun_family);
if (bind(recv_sock, (struct sockaddr *)&local, path_len) == -1) {
TRACE_ERROR("(Cpu %d) failed to bind to unix://%s because %s\n",
cpu, FROM_CCP_PATH, strerror(errno));
exit(EXIT_FAILURE);
}
mtcp->from_ccp = recv_sock;
struct ccp_datapath dp = {
.set_cwnd = &_dp_set_cwnd,
.set_rate_abs = &_dp_set_rate_abs,
.set_rate_rel = &_dp_set_rate_rel,
.send_msg = &_dp_send_msg,
.now = &now_usecs,
.since_usecs = &time_since_usecs,
.after_usecs = &time_after_usecs,
.impl = mtcp
};
if (ccp_init(&dp) < 0) {
TRACE_ERROR("failed to initialize ccp connection map\n");
exit(-1);
}
struct ccp_datapath dp = {
.set_cwnd = &_dp_set_cwnd,
.set_rate_abs = &_dp_set_rate_abs,
.set_rate_rel = &_dp_set_rate_rel,
.send_msg = &_dp_send_msg,
.now = &now_usecs,
.since_usecs = &time_since_usecs,
.after_usecs = &time_after_usecs,
.impl = mtcp
};
if (ccp_init(&dp) < 0) {
TRACE_ERROR("Failed to initialize ccp connection map\n");
exit(EXIT_FAILURE);
}
}
void setup_ccp_send_socket(mtcp_manager_t mtcp) {
int send_sock;
int path_len;
struct sockaddr_un remote;
if ((send_sock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
TRACE_ERROR("failed to create unix send socket for ccp comm\n");
exit(-1);
}
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, TO_CCP_PATH);//TODO:CCP
path_len = strlen(remote.sun_path) + sizeof(remote.sun_family);
if (connect(send_sock, (struct sockaddr *)&remote, path_len) == -1) {
TRACE_ERROR("failed to connect to unix://%s because %s\n", TO_CCP_PATH, strerror(errno));
exit(-1);
}
mtcp->to_ccp = send_sock;
/*----------------------------------------------------------------------------*/
void
setup_ccp_send_socket(mtcp_manager_t mtcp)
{
int send_sock;
int path_len;
struct sockaddr_un remote;
if ((send_sock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
TRACE_ERROR("failed to create unix send socket for ccp comm\n");
exit(EXIT_FAILURE);
}
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, TO_CCP_PATH);//TODO:CCP
path_len = strlen(remote.sun_path) + sizeof(remote.sun_family);
if (connect(send_sock, (struct sockaddr *)&remote, path_len) == -1) {
TRACE_ERROR("failed to connect to unix://%s because %s\n", TO_CCP_PATH, strerror(errno));
exit(EXIT_FAILURE);
}
mtcp->to_ccp = send_sock;
}
void destroy_ccp_connection(mtcp_manager_t mtcp) {
ccp_free();
close(mtcp->from_ccp);
close(mtcp->to_ccp);
/*----------------------------------------------------------------------------*/
void
destroy_ccp_connection(mtcp_manager_t mtcp)
{
ccp_free();
close(mtcp->from_ccp);
close(mtcp->to_ccp);
}
/*----------------------------------------------------------------------------*/
/* Should be called when a new connection is created */
/*----------------------------------------------------------------------------*/
void ccp_create(mtcp_manager_t mtcp, tcp_stream *stream) {
struct ccp_datapath_info info = {
.init_cwnd = TCP_INIT_CWND, // TODO maybe multiply by mss?
.mss = stream->sndvar->mss,
.src_ip = stream->saddr,
.src_port = stream->sport,
.dst_ip = stream->daddr,
.dst_port = stream->dport,
.congAlg = "reno"
};
stream->ccp_conn = ccp_connection_start((void *) stream, &info);
if (stream->ccp_conn == NULL) {
TRACE_ERROR("failed to initialize ccp_connection")
} else {
TRACE_CCP("ccp.create(%d)\n", dp->index);
}
void
ccp_create(mtcp_manager_t mtcp, tcp_stream *stream)
{
struct ccp_datapath_info info = {
.init_cwnd = TCP_INIT_CWND, // TODO maybe multiply by mss?
.mss = stream->sndvar->mss,
.src_ip = stream->saddr,
.src_port = stream->sport,
.dst_ip = stream->daddr,
.dst_port = stream->dport,
.congAlg = "reno"
};
stream->ccp_conn = ccp_connection_start((void *) stream, &info);
if (stream->ccp_conn == NULL) {
TRACE_ERROR("failed to initialize ccp_connection")
} else {
TRACE_CCP("ccp.create(%d)\n", dp->index);
}
}
/* Should be called on each ACK */
/*----------------------------------------------------------------------------*/
uint32_t last_drop_t = 0;
void ccp_cong_control(mtcp_manager_t mtcp, tcp_stream *stream,
uint32_t ack, uint64_t bytes_delivered, uint64_t packets_delivered)
void
ccp_cong_control(mtcp_manager_t mtcp, tcp_stream *stream,
uint32_t ack, uint64_t bytes_delivered, uint64_t packets_delivered)
{
uint64_t rin = bytes_delivered, //* S_TO_US, // TODO:CCP divide by snd_int_us
rout = bytes_delivered; // * S_TO_US; // TODO:CCP divide by rcv_int_us
struct ccp_connection *conn = stream->ccp_conn;
struct ccp_primitives *mmt = &conn->prims;
uint64_t rin = bytes_delivered, //* S_TO_US, // TODO:CCP divide by snd_int_us
rout = bytes_delivered; // * S_TO_US; // TODO:CCP divide by rcv_int_us
struct ccp_connection *conn = stream->ccp_conn;
struct ccp_primitives *mmt = &conn->prims;
//log_cwnd_rtt(stream);
//log_cwnd_rtt(stream);
mmt->bytes_acked = bytes_delivered;
mmt->packets_acked = packets_delivered;
mmt->snd_cwnd = stream->sndvar->cwnd;
mmt->rtt_sample_us = stream->rcvvar->srtt * 125;
mmt->bytes_in_flight = 0; // TODO
mmt->packets_in_flight = 0; // TODO
mmt->rate_outgoing = rin;
mmt->rate_incoming = rout;
mmt->bytes_acked = bytes_delivered;
mmt->packets_acked = packets_delivered;
mmt->snd_cwnd = stream->sndvar->cwnd;
mmt->rtt_sample_us = stream->rcvvar->srtt * 125;
mmt->bytes_in_flight = 0; // TODO
mmt->packets_in_flight = 0; // TODO
mmt->rate_outgoing = rin;
mmt->rate_incoming = rout;
#if TCP_OPT_SACK_ENABLED
mmt->bytes_misordered = stream->rcvvar->sacked_pkts * 1448;
mmt->packets_misordered = stream->rcvvar->sacked_pkts;
mmt->bytes_misordered = stream->rcvvar->sacked_pkts * 1448;
mmt->packets_misordered = stream->rcvvar->sacked_pkts;
#endif
/*
if (last_drop_t == 0 || _dp_since_usecs(last_drop_t) > 25000) {
mmt->lost_pkts_sample = 0;
last_drop_t = now_usecs();
}
*/
/*
if (last_drop_t == 0 || _dp_since_usecs(last_drop_t) > 25000) {
mmt->lost_pkts_sample = 0;
last_drop_t = now_usecs();
}
*/
//fprintf(stderr, "mmt: %u %u\n", conn->prims.packets_misordered, conn->prims.lost_pkts_sample);
//fprintf(stderr, "mmt: %u %u\n", conn->prims.packets_misordered, conn->prims.lost_pkts_sample);
if (conn != NULL) {
//fprintf(stderr, " lost_pkts=%u\n", mmt->lost_pkts_sample);
ccp_invoke(conn);
conn->prims.was_timeout = false;
conn->prims.bytes_misordered = 0;
conn->prims.packets_misordered = 0;
conn->prims.lost_pkts_sample = 0;
if (conn != NULL) {
//fprintf(stderr, " lost_pkts=%u\n", mmt->lost_pkts_sample);
ccp_invoke(conn);
conn->prims.was_timeout = false;
conn->prims.bytes_misordered = 0;
conn->prims.packets_misordered = 0;
conn->prims.lost_pkts_sample = 0;
#if TCP_OPT_SACK_ENABLED
stream->rcvvar->sacked_pkts = 0;
stream->rcvvar->sacked_pkts = 0;
#endif
} else {
TRACE_ERROR("ccp_connection not initialized\n")
}
} else {
TRACE_ERROR("ccp_connection not initialized\n");
}
}
#if TCP_OPT_SACK_ENABLED
@ -250,62 +265,63 @@ uint32_t last_tri_dupack_seq = 0;
/* Should be called for any other connection event other than ACK */
/*----------------------------------------------------------------------------*/
void ccp_record_event(mtcp_manager_t mtcp, tcp_stream *stream, uint8_t event_type, uint32_t val) {
void
ccp_record_event(mtcp_manager_t mtcp, tcp_stream *stream, uint8_t event_type, uint32_t val)
{
#ifdef DBGCCP
unsigned long now = (unsigned long)(now_usecs());
unsigned long now = (unsigned long)(now_usecs());
#endif
int i;
int i;
switch(event_type) {
switch(event_type) {
case EVENT_DUPACK:
#if TCP_OPT_SACK_ENABLED
#else
// use num dupacks as a proxy for sacked
stream->ccp_conn->prims.bytes_misordered += val;
stream->ccp_conn->prims.packets_misordered++;
// use num dupacks as a proxy for sacked
stream->ccp_conn->prims.bytes_misordered += val;
stream->ccp_conn->prims.packets_misordered++;
#endif
break;
break;
case EVENT_TRI_DUPACK:
#if TCP_OPT_SACK_ENABLED
if (val > window_edge_at_last_loss) {
TRACE_CCP("%lu tridup ack=%u\n",
now / 1000,
val - stream->sndvar->iss
);
for (i=0; i < MAX_SACK_ENTRY; i++) {
window_edge_at_last_loss = MAX(
window_edge_at_last_loss,
stream->rcvvar->sack_table[i].right_edge
);
}
last_tri_dupack_seq = val;
last_loss = now_usecs();
stream->ccp_conn->prims.lost_pkts_sample++;
}
if (val > window_edge_at_last_loss) {
TRACE_CCP("%lu tridup ack=%u\n",
now / 1000,
val - stream->sndvar->iss
);
for (i = 0; i < MAX_SACK_ENTRY; i++) {
window_edge_at_last_loss = MAX(
window_edge_at_last_loss,
stream->rcvvar->sack_table[i].right_edge
);
}
last_tri_dupack_seq = val;
last_loss = now_usecs();
stream->ccp_conn->prims.lost_pkts_sample++;
}
#else
// only count as a loss if we haven't already seen 3 dupacks for
// this seq number
if (last_tri_dupack_seq != val) {
TRACE_CCP("%lu tridup ack=%d\n",
now / 1000,
val// - stream->sndvar->iss
);
stream->ccp_conn->prims.lost_pkts_sample++;
last_tri_dupack_seq = val;
}
// only count as a loss if we haven't already seen 3 dupacks for
// this seq number
if (last_tri_dupack_seq != val) {
TRACE_CCP("%lu tridup ack=%d\n",
now / 1000,
val// - stream->sndvar->iss
);
stream->ccp_conn->prims.lost_pkts_sample++;
last_tri_dupack_seq = val;
}
#endif
break;
break;
case EVENT_TIMEOUT:
//stream->ccp_conn->prims.was_timeout = true;
break;
//stream->ccp_conn->prims.was_timeout = true;
break;
case EVENT_ECN:
TRACE_ERROR("ecn is not currently supported!\n");
break;
TRACE_ERROR("ecn is not currently supported!\n");
break;
default:
TRACE_ERROR("unknown record event type %d!\n", event_type);
break;
}
TRACE_ERROR("unknown record event type %d!\n", event_type);
break;
}
}
/*----------------------------------------------------------------------------*/
#endif

View File

@ -1,49 +1,55 @@
#include "clock.h"
/*----------------------------------------------------------------------------*/
uint64_t init_time_ns = 0;
uint32_t last_print = 0;
/*----------------------------------------------------------------------------*/
uint64_t
now_usecs()
{
struct timespec now;
uint64_t now_ns, now_us;
uint64_t now_usecs() {
struct timespec now;
uint64_t now_ns, now_us;
clock_gettime(CLOCK_MONOTONIC, &now);
clock_gettime(CLOCK_MONOTONIC, &now);
now_ns = (1000000000L * now.tv_sec) + now.tv_nsec;
if (init_time_ns == 0) {
init_time_ns = now_ns;
}
now_ns = (1000000000L * now.tv_sec) + now.tv_nsec;
if (init_time_ns == 0) {
init_time_ns = now_ns;
}
now_us = ((now_ns - init_time_ns) / 1000) & 0xffffffff;
return now_us;
now_us = ((now_ns - init_time_ns) / 1000) & 0xffffffff;
return now_us;
}
uint64_t time_since_usecs(uint64_t then) {
return now_usecs() - then;
/*----------------------------------------------------------------------------*/
uint64_t
time_since_usecs(uint64_t then) {
return now_usecs() - then;
}
uint64_t time_after_usecs(uint64_t usecs) {
return now_usecs() + usecs;
/*----------------------------------------------------------------------------*/
uint64_t
time_after_usecs(uint64_t usecs) {
return now_usecs() + usecs;
}
/*----------------------------------------------------------------------------*/
#define SAMPLE_FREQ_US 10000
void log_cwnd_rtt(void *vs) {
tcp_stream *stream = (tcp_stream *)vs;
unsigned long now = (unsigned long)(now_usecs());
if (time_since_usecs(last_print) > SAMPLE_FREQ_US) {
fprintf(stderr, "%lu %d %d/%d\n",
now / 1000,
stream->rcvvar->srtt * 125,
stream->sndvar->cwnd / stream->sndvar->mss,
stream->sndvar->peer_wnd / stream->sndvar->mss
);
void
log_cwnd_rtt(void *vs) {
tcp_stream *stream = (tcp_stream *)vs;
unsigned long now = (unsigned long)(now_usecs());
if (time_since_usecs(last_print) > SAMPLE_FREQ_US) {
fprintf(stderr, "%lu %d %d/%d\n",
now / 1000,
stream->rcvvar->srtt * 125,
stream->sndvar->cwnd / stream->sndvar->mss,
stream->sndvar->peer_wnd / stream->sndvar->mss
);
#if RATE_LIMIT_ENABLED
PrintBucket(stream->bucket);
PrintBucket(stream->bucket);
#endif
#if PACING_ENABLED
PrintPacer(stream->pacer);
PrintPacer(stream->pacer);
#endif
last_print = now;
}
last_print = now;
}
}
/*----------------------------------------------------------------------------*/

View File

@ -38,7 +38,7 @@ struct mtcp_config CONFIG = {
.tcp_timewait = TCP_TIMEWAIT,
.num_mem_ch = 0,
#if USE_CCP
.cc = "reno\n",
.cc = "reno\n",
#endif
#ifdef ENABLE_ONVM
.onvm_inst = (uint16_t) -1,

View File

@ -8,7 +8,8 @@
#include "logger.h"
/*----------------------------------------------------------------------------*/
void flush_log_data(mtcp_manager_t mtcp)
void
flush_log_data(mtcp_manager_t mtcp)
{
int ret = 0;
if (mtcp->w_buffer) {

View File

@ -63,6 +63,7 @@
// off for production use
// #define DBGCCP // ccp debug messages
// #define PROBECCP // print all cwnd changes, similar to tcpprobe output
#define CC_NAME 20
#endif
#define LOCK_STREAM_QUEUE FALSE
@ -190,7 +191,7 @@ struct mtcp_config
uint16_t onvm_dest;
#endif
#if USE_CCP
char cc[1024];
char cc[CC_NAME];
#endif
};
/*----------------------------------------------------------------------------*/

View File

@ -1,88 +1,106 @@
#include "pacing.h"
#include "clock.h"
/*----------------------------------------------------------------------------*/
#if RATE_LIMIT_ENABLED
token_bucket *NewTokenBucket() {
token_bucket *bucket;
bucket = malloc(sizeof(token_bucket));
if (bucket) {
fprintf(stderr, "created bucket!\n");
}
bucket->rate = 0;
bucket->burst = 14480;
bucket->tokens = bucket->burst;
bucket->last_fill_t = now_usecs();
return bucket;
token_bucket *
NewTokenBucket()
{
token_bucket *bucket;
bucket = malloc(sizeof(token_bucket));
if (bucket == NULL)
return NULL;
bucket->rate = 0;
bucket->burst = 14480;
bucket->tokens = bucket->burst;
bucket->last_fill_t = now_usecs();
return bucket;
}
void _refill_bucket(token_bucket *bucket) {
uint32_t elapsed = time_since_usecs(bucket->last_fill_t);
double new_tokens = (bucket->rate / 1000000.0) * elapsed;
double prev_tokens = bucket->tokens;
bucket->tokens = MIN(bucket->burst, bucket->tokens + new_tokens);
if (bucket->tokens > prev_tokens) {
bucket->last_fill_t = now_usecs();
} else {
//fprintf(stderr, "elapsed=%lu new=%f\n", time_since_usecs(bucket->last_fill_t), new_tokens);
}
/*----------------------------------------------------------------------------*/
void
_refill_bucket(token_bucket *bucket)
{
uint32_t elapsed = time_since_usecs(bucket->last_fill_t);
double new_tokens = (bucket->rate / 1000000.0) * elapsed;
double prev_tokens = bucket->tokens;
bucket->tokens = MIN(bucket->burst, bucket->tokens + new_tokens);
if (bucket->tokens > prev_tokens) {
bucket->last_fill_t = now_usecs();
} else {
//fprintf(stderr, "elapsed=%lu new=%f\n", time_since_usecs(bucket->last_fill_t), new_tokens);
}
}
/*----------------------------------------------------------------------------*/
int
SufficientTokens(token_bucket *bucket, uint64_t new_bits)
{
double new_bytes = (new_bits / 8.0);
int SufficientTokens(token_bucket *bucket, uint64_t new_bits) {
double new_bytes = (new_bits / 8.0);
//fprintf(stderr, "checking for %ld tokens\n", new_bits);
//fprintf(stderr, "checking for %ld tokens\n", new_bits);
_refill_bucket(bucket);
_refill_bucket(bucket);
if (bucket->tokens >= new_bytes) {
bucket->tokens -= new_bytes;
return 0;
}
if (bucket->tokens >= new_bytes) {
bucket->tokens -= new_bytes;
return 0;
}
return -1;
return -1;
}
void PrintBucket(token_bucket *bucket) {
fprintf(stderr, "[rate=%.3f tokens=%f last=%u]\n",
bucket->rate / 1000000.0,
bucket->tokens,
bucket->last_fill_t);
/*----------------------------------------------------------------------------*/
void
PrintBucket(token_bucket *bucket)
{
fprintf(stderr, "[rate=%.3f tokens=%f last=%u]\n",
bucket->rate / 1000000.0,
bucket->tokens,
bucket->last_fill_t);
}
#endif
/*----------------------------------------------------------------------------*/
#endif /* !RATE_LIMIT_ENABLED */
#if PACING_ENABLED
packet_pacer *NewPacketPacer() {
packet_pacer *pacer;
pacer = malloc(sizeof(packet_pacer));
pacer->rate_bps = 0;
pacer->extra_packets = 1;
pacer->next_send_time = 0;
return pacer;
/*----------------------------------------------------------------------------*/
packet_pacer *
NewPacketPacer()
{
packet_pacer *pacer;
pacer = malloc(sizeof(packet_pacer));
if (pacer == NULL)
return NULL;
pacer->rate_bps = 0;
pacer->extra_packets = 1;
pacer->next_send_time = 0;
return pacer;
}
/*----------------------------------------------------------------------------*/
#define PACKET_SIZE 1500
int CanSendNow(packet_pacer *pacer) {
if (pacer->rate_bps == 0) {
return TRUE;
}
int
CanSendNow(packet_pacer *pacer)
{
if (pacer->rate_bps == 0) {
return TRUE;
}
uint32_t now = now_usecs();
if (now >= pacer->next_send_time) {
pacer->next_send_time = now + (int)(PACKET_SIZE / (pacer->rate_bps / 8000000.0));
pacer->extra_packets = 1;
//fprintf(stderr, "now=%u, next=%u\n", now, pacer->next_send_time);
uint32_t now = now_usecs();
if (now >= pacer->next_send_time) {
pacer->next_send_time = now + (int)(PACKET_SIZE / (pacer->rate_bps / 8000000.0));
pacer->extra_packets = 1;
//fprintf(stderr, "now=%u, next=%u\n", now, pacer->next_send_time);
return TRUE;
} else if (pacer->extra_packets) {
pacer->extra_packets--;
return TRUE;
} else {
return FALSE;
}
return TRUE;
} else if (pacer->extra_packets) {
pacer->extra_packets--;
return TRUE;
} else {
return FALSE;
}
}
void PrintPacer(packet_pacer *pacer) {
//fprintf(stderr, "[rate=%u next_time=%u]\n", pacer->rate_bps, pacer->next_send_time);
/*----------------------------------------------------------------------------*/
void
PrintPacer(packet_pacer *pacer)
{
//fprintf(stderr, "[rate=%u next_time=%u]\n", pacer->rate_bps, pacer->next_send_time);
}
#endif
/*----------------------------------------------------------------------------*/
#endif /* !PACING_ENABLED */

View File

@ -386,7 +386,8 @@ ProcessACK(mtcp_manager_t mtcp, tcp_stream *cur_stream, uint32_t cur_ts,
if (cur_stream->rcvvar->dup_acks + 1 > cur_stream->rcvvar->dup_acks) {
cur_stream->rcvvar->dup_acks++;
#if USE_CCP
ccp_record_event(mtcp, cur_stream, EVENT_DUPACK, (cur_stream->snd_nxt - ack_seq));
ccp_record_event(mtcp, cur_stream, EVENT_DUPACK,
(cur_stream->snd_nxt - ack_seq));
#endif
}
dup = TRUE;
@ -395,15 +396,20 @@ ProcessACK(mtcp_manager_t mtcp, tcp_stream *cur_stream, uint32_t cur_ts,
}
if (!dup) {
if (cur_stream->rcvvar->dup_acks >= 3) {
TRACE_DBG("passed dup_acks, ack=%u, snd_nxt=%u, last_ack=%u len=%u wl2=%u peer_wnd=%u right=%u\n", ack_seq-sndvar->iss, cur_stream->snd_nxt-sndvar->iss, cur_stream->rcvvar->last_ack_seq-sndvar->iss, payloadlen, cur_stream->rcvvar->snd_wl2-sndvar->iss, sndvar->peer_wnd / sndvar->mss, right_wnd_edge - sndvar->iss);
TRACE_DBG("passed dup_acks, ack=%u, snd_nxt=%u, last_ack=%u len=%u wl2=%u peer_wnd=%u right=%u\n",
ack_seq-sndvar->iss, cur_stream->snd_nxt-sndvar->iss, cur_stream->rcvvar->last_ack_seq-sndvar->iss,
payloadlen, cur_stream->rcvvar->snd_wl2-sndvar->iss, sndvar->peer_wnd / sndvar->mss,
right_wnd_edge - sndvar->iss);
}
cur_stream->rcvvar->dup_acks = 0;
cur_stream->rcvvar->last_ack_seq = ack_seq;
}
if(cur_stream->wait_for_acks) {
TRACE_DBG("got ack, but waiting to send... ack=%u, snd_next=%u cwnd=%u\n", ack_seq-sndvar->iss, cur_stream->snd_nxt-sndvar->iss, sndvar->cwnd / sndvar->mss);
}
if(cur_stream->wait_for_acks) {
TRACE_DBG("got ack, but waiting to send... ack=%u, snd_next=%u cwnd=%u\n",
ack_seq-sndvar->iss, cur_stream->snd_nxt-sndvar->iss,
sndvar->cwnd / sndvar->mss);
}
/* Fast retransmission */
if (dup && cur_stream->rcvvar->dup_acks == 3) {
@ -427,10 +433,6 @@ ProcessACK(mtcp_manager_t mtcp, tcp_stream *cur_stream, uint32_t cur_ts,
"ack_seq: %u, snd_una: %u\n",
ack_seq, sndvar->snd_una);
}
//cur_stream->snd_nxt = ack_seq;
//cur_stream->wait_for_acks = TRUE;
//cur_stream->seq_at_last_loss = ack_seq;
sndvar->missing_seq = ack_seq;
}
@ -471,7 +473,8 @@ ProcessACK(mtcp_manager_t mtcp, tcp_stream *cur_stream, uint32_t cur_ts,
#if RECOVERY_AFTER_LOSS
/* updating snd_nxt (when recovered from loss) */
if (TCP_SEQ_GT(ack_seq, cur_stream->snd_nxt) || (cur_stream->wait_for_acks && TCP_SEQ_GT(ack_seq, cur_stream->seq_at_last_loss)
if (TCP_SEQ_GT(ack_seq, cur_stream->snd_nxt) ||
(cur_stream->wait_for_acks && TCP_SEQ_GT(ack_seq, cur_stream->seq_at_last_loss)
#if TCP_OPT_SACK_ENABLED
&& cur_stream->rcvvar->sacked_pkts == 0
#endif

View File

@ -496,7 +496,8 @@ FlushTCPSendingBuffer(mtcp_manager_t mtcp, tcp_stream *cur_stream, uint32_t cur_
len = sndvar->sndbuf->len - (seq - sndvar->sndbuf->head_seq);
// Without this, mm continually drops packets (not sure why, bursting?) -> mtcp sees lots of losses -> throughput dies
if(cur_stream->wait_for_acks && TCP_SEQ_GT(cur_stream->snd_nxt, cur_stream->rcvvar->last_ack_seq)) {
if(cur_stream->wait_for_acks &&
TCP_SEQ_GT(cur_stream->snd_nxt, cur_stream->rcvvar->last_ack_seq)) {
goto out;
}
@ -530,7 +531,7 @@ FlushTCPSendingBuffer(mtcp_manager_t mtcp, tcp_stream *cur_stream, uint32_t cur_
#if TCP_OPT_SACK_ENABLED
if (SeqIsSacked(cur_stream, seq)) {
//fprintf(stderr, "!! SKIPPING %u\n", seq - sndvar->iss);
TRACE_DBG("!! SKIPPING %u\n", seq - sndvar->iss);
cur_stream->snd_nxt += len;
continue;
}

View File

@ -373,10 +373,10 @@ CreateTCPStream(mtcp_manager_t mtcp, socket_map_t socket, int type,
stream->bucket = NewTokenBucket();
#endif
#if PACING_ENABLED
stream->pacer = NewPacketPacer();
stream->pacer = NewPacketPacer();
#endif
#if USE_CCP
ccp_create(mtcp, stream);
ccp_create(mtcp, stream);
#endif
UNUSED(da);

View File

@ -92,91 +92,97 @@ ParseTCPTimestamp(tcp_stream *cur_stream,
}
#if TCP_OPT_SACK_ENABLED
/*----------------------------------------------------------------------------*/
int SeqIsSacked(tcp_stream *cur_stream, uint32_t seq) {
uint8_t i;
uint32_t left, right;
for (i=0; i < MAX_SACK_ENTRY; i++) {
left = cur_stream->rcvvar->sack_table[i].left_edge;
right = cur_stream->rcvvar->sack_table[i].right_edge;
if (seq >= left && seq < right) {
//fprintf(stderr, "Found seq=%u in (%u,%u)\n", seq - cur_stream->sndvar->iss, left - cur_stream->sndvar->iss, right - cur_stream->sndvar->iss);
return TRUE;
}
}
return FALSE;
int
SeqIsSacked(tcp_stream *cur_stream, uint32_t seq)
{
uint8_t i;
uint32_t left, right;
for (i = 0; i < MAX_SACK_ENTRY; i++) {
left = cur_stream->rcvvar->sack_table[i].left_edge;
right = cur_stream->rcvvar->sack_table[i].right_edge;
if (seq >= left && seq < right) {
//fprintf(stderr, "Found seq=%u in (%u,%u)\n", seq - cur_stream->sndvar->iss, left - cur_stream->sndvar->iss, right - cur_stream->sndvar->iss);
return TRUE;
}
}
return FALSE;
}
/*----------------------------------------------------------------------------*/
void
_update_sack_table(tcp_stream *cur_stream, uint32_t left_edge, uint32_t right_edge)
{
uint8_t i, j;
uint32_t newly_sacked = 0;
long int ld, rd, lrd, rld;
for (i = 0; i < MAX_SACK_ENTRY; i++) {
ld = (long int) left_edge - cur_stream->rcvvar->sack_table[i].left_edge;
rd = (long int) right_edge - cur_stream->rcvvar->sack_table[i].right_edge;
// if block already in table, don't need to do anything
if (ld == 0 && rd == 0) {
return;
}
void _update_sack_table(tcp_stream *cur_stream, uint32_t left_edge, uint32_t right_edge) {
uint8_t i, j;
uint32_t newly_sacked = 0;
long int ld, rd, lrd, rld;
for (i=0; i < MAX_SACK_ENTRY; i++) {
ld = (long int) left_edge - cur_stream->rcvvar->sack_table[i].left_edge;
rd = (long int) right_edge - cur_stream->rcvvar->sack_table[i].right_edge;
// if block already in table, don't need to do anything
if (ld == 0 && rd == 0) {
return;
}
lrd = (long int) left_edge - cur_stream->rcvvar->sack_table[i].right_edge;
rld = (long int) right_edge - cur_stream->rcvvar->sack_table[i].left_edge;
lrd = (long int) left_edge - cur_stream->rcvvar->sack_table[i].right_edge;
rld = (long int) right_edge - cur_stream->rcvvar->sack_table[i].left_edge;
// if block does not overlap i at all, skip
if (lrd > 0 || rld < 0) {
continue;
}
// if block does not overlap i at all, skip
if (lrd > 0 || rld < 0) {
continue;
}
// left_edge is further left than i.left_edge
if (ld < 0) {
newly_sacked += (-ld);
// expand i to account for this extra space, and merge with any
// blocks whose right_edge = i.left (i.e. blocks are touching)
cur_stream->rcvvar->sack_table[i].left_edge = left_edge;
for (j=0; j < MAX_SACK_ENTRY; j++) {
if (cur_stream->rcvvar->sack_table[j].right_edge == left_edge) {
cur_stream->rcvvar->sack_table[i].left_edge = cur_stream->rcvvar->sack_table[j].right_edge;
cur_stream->rcvvar->sack_table[j].left_edge = 0;
cur_stream->rcvvar->sack_table[j].right_edge = 0;
break;
}
}
}
// right edge is further right than i.right_edge
if (rd > 0) {
newly_sacked += rd;
// expand i to account for this extra space, and merge with any
// blocks whose left_edge = i.right (i.e. blocks are touching)
cur_stream->rcvvar->sack_table[i].right_edge = right_edge;
for (j=0; j < MAX_SACK_ENTRY; j++) {
if (cur_stream->rcvvar->sack_table[j].left_edge == right_edge) {
cur_stream->rcvvar->sack_table[i].right_edge = cur_stream->rcvvar->sack_table[j].left_edge;
cur_stream->rcvvar->sack_table[j].left_edge = 0;
cur_stream->rcvvar->sack_table[j].right_edge = 0;
break;
}
}
}
}
if (newly_sacked == 0) {
cur_stream->rcvvar->sack_table
[cur_stream->rcvvar->sacks].left_edge = left_edge;
cur_stream->rcvvar->sack_table
[cur_stream->rcvvar->sacks].right_edge = right_edge;
cur_stream->rcvvar->sacks++;
newly_sacked = (right_edge - left_edge);
}
// left_edge is further left than i.left_edge
if (ld < 0) {
newly_sacked += (-ld);
// expand i to account for this extra space, and merge with any
// blocks whose right_edge = i.left (i.e. blocks are touching)
cur_stream->rcvvar->sack_table[i].left_edge = left_edge;
for (j=0; j < MAX_SACK_ENTRY; j++) {
if (cur_stream->rcvvar->sack_table[j].right_edge == left_edge) {
cur_stream->rcvvar->sack_table[i].left_edge = cur_stream->rcvvar->sack_table[j].right_edge;
cur_stream->rcvvar->sack_table[j].left_edge = 0;
cur_stream->rcvvar->sack_table[j].right_edge = 0;
break;
}
}
}
// right edge is further right than i.right_edge
if (rd > 0) {
newly_sacked += rd;
// expand i to account for this extra space, and merge with any
// blocks whose left_edge = i.right (i.e. blocks are touching)
cur_stream->rcvvar->sack_table[i].right_edge = right_edge;
for (j=0; j < MAX_SACK_ENTRY; j++) {
if (cur_stream->rcvvar->sack_table[j].left_edge == right_edge) {
cur_stream->rcvvar->sack_table[i].right_edge = cur_stream->rcvvar->sack_table[j].left_edge;
cur_stream->rcvvar->sack_table[j].left_edge = 0;
cur_stream->rcvvar->sack_table[j].right_edge = 0;
break;
}
}
}
}
if (newly_sacked == 0) {
cur_stream->rcvvar->sack_table
[cur_stream->rcvvar->sacks].left_edge = left_edge;
cur_stream->rcvvar->sack_table
[cur_stream->rcvvar->sacks].right_edge = right_edge;
cur_stream->rcvvar->sacks++;
newly_sacked = (right_edge - left_edge);
}
//fprintf(stderr, "SACK (%u,%u)->%u/%u\n", left_edge, right_edge, newly_sacked, newly_sacked / 1448);
cur_stream->rcvvar->sacked_pkts += (newly_sacked / cur_stream->sndvar->mss);
//fprintf(stderr, "SACK (%u,%u)->%u/%u\n", left_edge, right_edge, newly_sacked, newly_sacked / 1448);
cur_stream->rcvvar->sacked_pkts += (newly_sacked / cur_stream->sndvar->mss);
return;
return;
}
int GenerateSACKOption(tcp_stream *cur_stream, uint8_t *tcpopt) {
// TODO
/*----------------------------------------------------------------------------*/
int
GenerateSACKOption(tcp_stream *cur_stream, uint8_t *tcpopt)
{
// TODO
return 0;
}
/*----------------------------------------------------------------------------*/
void
ParseSACKOption(tcp_stream *cur_stream,
uint32_t ack_seq, uint8_t *tcpopt, int len)