Shifted CCP enabling support to autoconf settings

- Use `./configure --enable-ccp` to enable ccp (disabled by default)
Fixed Mellanox compatbility issue
	- Fixes: #225
master
Asim Jamshed 2019-03-22 20:52:22 -07:00
parent 5a721054e9
commit 8bc045ac19
11 changed files with 1616 additions and 42 deletions

View File

@ -97,7 +97,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = mtcp/src/Makefile apps/example/Makefile \
util/Makefile io_engine/lib/Makefile
apps/perf/Makefile util/Makefile io_engine/lib/Makefile
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@ -158,6 +158,7 @@ CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/apps/example/Makefile.in \
$(top_srcdir)/apps/perf/Makefile.in \
$(top_srcdir)/io_engine/lib/Makefile.in \
$(top_srcdir)/mtcp/src/Makefile.in \
$(top_srcdir)/util/Makefile.in README compile config.guess \
@ -214,6 +215,7 @@ AWK = @AWK@
BC_CHECK = @BC_CHECK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CCP = @CCP@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@ -296,6 +298,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -362,6 +365,8 @@ mtcp/src/Makefile: $(top_builddir)/config.status $(top_srcdir)/mtcp/src/Makefile
cd $(top_builddir) && $(SHELL) ./config.status $@
apps/example/Makefile: $(top_builddir)/config.status $(top_srcdir)/apps/example/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
apps/perf/Makefile: $(top_builddir)/config.status $(top_srcdir)/apps/perf/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
util/Makefile: $(top_builddir)/config.status $(top_srcdir)/util/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
io_engine/lib/Makefile: $(top_builddir)/config.status $(top_srcdir)/io_engine/lib/Makefile.in
@ -538,7 +543,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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@ -564,7 +569,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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -582,7 +587,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -592,7 +597,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac

33
README
View File

@ -27,6 +27,39 @@ created a new LKM dpdk-iface-kmod. We also
modified mk/rte.app.mk file to ease the compilation process of mTCP applications.
We recommend using our package for DPDK installation.
=======================================================================
CCP support
=======================================================================
Using CCP(https://ccp-project.github.io/) for congestion control (disabled by
default), requires building and running a CCP algorithm. If you would like to
enable CCP (ie. use the internal implementation of Reno), simply run configure
script with --enable-ccp option.
1. Install Rust. Any installation method should be fine. We recommend using
rustup:
curl https://sh.rustup.rs -sSf | sh -- -y -v --default-toolchain nightly
2. Build a CCP algorithm. The generic-cong-avoid(https://github.com/ccp-project/generic-cong-avoid)
package implements standard TCP Reno and Cubic, so this is probably best to
start with. The same steps can be followed to build any of the other
algorithms hosted in the ccp-project(https://github.com/ccp-project) organization, such as
bbr(https://github.com/ccp-project/bbr).
git clone https://github.com/ccp-project/generic-cong-avoid.git
cd generic-cong-avoid
cargo +nightly build
3. Later, after you've built mTCP and started an mTCP application (such as
epserver or perf), you must start the CCP binary you just built. If you
try to start the CCP process *before* running an mTCP application, it will
report a "connection refused" error.
cd generic-cong-avoid
sudo ./target/debug/reno --ipc unix
========================================================================
INCLUDED DIRECTORIES
========================================================================

View File

@ -31,8 +31,8 @@ installation.
Using [CCP](https://ccp-project.github.io/) for congestion control (disabled by
default), requires building and running a CCP algorithm. If you would like to
enable CCP (ie. use the internal implementation of Reno), simply set
the `USE_CCP` flag to `TRUE` in `mtcp/src/include/mtcp.h`.
enable CCP (ie. use the internal implementation of Reno), simply run configure
script with --enable-ccp option.
1. Install Rust. Any installation method should be fine. We recommend using
rustup:

View File

@ -68,10 +68,12 @@ else
export HIDE=
endif
ifeq ($(CCP), 1)
# LIBCCP
LIBCCP=${MTCP_FLD}/src/libccp
LIBS += -L$(LIBCCP) -lccp
INC += -I$(LIBCCP)
endif
all: epserver epwget

View File

@ -66,10 +66,12 @@ else
export HIDE=
endif
ifeq ($(CCP), 1)
# LIBCCP
LIBCCP=${MTCP_FLD}/src/libccp
LIBS += -L$(LIBCCP) -lccp
INC += -I$(LIBCCP)
endif
all: client

1512
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -106,6 +106,15 @@ then
fi
fi
dnl Example of default-disabled feature
AC_ARG_ENABLE([ccp],
AS_HELP_STRING([--enable-ccp], [Enable Congestion Control Plane (CCP)]))
if test "x$enable_lro" = "xyes"
then
AC_SUBST(CCP, 1)
fi
dnl Example of default-enabled feature
AC_ARG_ENABLE([hwcsum],
AS_HELP_STRING([--disable-hwcsum], [Disable h/w-based checksum offloading (for relevant NICs)]))

View File

@ -9,6 +9,7 @@ ENFORCE_RX_IDLE=@ENFORCE_RX_IDLE@
NETMAP=@NETMAP@
ONVM=@ONVM@
LRO=@LRO@
CCP=@CCP@
HWCSUM=@HWCSUM@
MTCP_LIB_DIR=../lib
MTCP_LIB=libmtcp.a
@ -55,6 +56,10 @@ ifeq ($(LRO),1)
GCC_OPT += -DENABLELRO
endif
ifeq ($(CCP),1)
GCC_OPT += -DUSE_CCP
endif
ifeq ($(HWCSUM),0)
GCC_OPT += -DDISABLE_HWCSUM
endif
@ -109,9 +114,11 @@ else
INC += -DDISABLE_DPDK
endif
ifeq ($(CCP), 1)
LIBCCP_PATH=./libccp
CCP_LIBS = -L$(LIBCCP_PATH) -lccp
CCP_INC = -I$(LIBCCP_PATH)
endif
### SOURCE CODE ###
SRCS = core.c tcp_stream.c config.c api.c eventpoll.c socket.c pipe.c \
@ -119,7 +126,11 @@ SRCS = core.c tcp_stream.c config.c api.c eventpoll.c socket.c pipe.c \
arp.c timer.c cpu.c rss.c addr_pool.c fhash.c memory_mgt.c logger.c debug.c \
tcp_rb_frag_queue.c tcp_ring_buffer.c tcp_send_buffer.c tcp_sb_queue.c tcp_stream_queue.c \
psio_module.c io_module.c dpdk_module.c netmap_module.c onvm_module.c icmp.c \
pacing.c clock.c ccp.c
pacing.c clock.c
ifeq ($(CCP), 1)
SRCS += ccp.c
endif
OBJS = $(patsubst %.c,%.o,$(SRCS))
DEPS = $(patsubst %.c,.%.d,$(SRCS))
@ -133,15 +144,21 @@ else
endif
### GOALS ###
ifeq ($(CCP), 1)
all: default libccp
else
all: default
endif
default: $(OBJS) $(MTCP_HDR)
mkdir -p $(MTCP_LIB_DIR)
ar rvs $(MTCP_LIB_DIR)/$(MTCP_LIB) $(OBJS)
ifeq ($(CCP), 1)
libccp:
$(MAKE) -C ./libccp
endif
$(OBJS): %.o: %.c Makefile
$(MSG) " CC $<"
$(HIDE) $(GCC) $(CFLAGS) $(GCC_OPT) $(INC) -c $< -o $@

View File

@ -8,10 +8,9 @@
#include "tcp_stream.h"
#include "debug.h"
#include "clock.h"
#if USE_CCP
#include "ccp.h"
#include "libccp/ccp.h"
#if USE_CCP
/*----------------------------------------------------------------------------*/
static inline void get_stream_from_ccp(

View File

@ -54,7 +54,7 @@
#define RATE_LIMIT_ENABLED FALSE
#define PACING_ENABLED FALSE
#define USE_CCP FALSE
/* Only use rate limiting if using CCP */
#if USE_CCP
#undef RATE_LIMIT_ENABLED

View File

@ -118,41 +118,40 @@ probe_all_rte_devices(char **argv, int *argc, char *dev_name_list)
exit(EXIT_FAILURE);
}
fd = open(DEV_PATH, O_RDONLY);
if (fd == -1) {
if (fd != -1) {
TRACE_ERROR("Error opening dpdk-face!\n");
exit(EXIT_FAILURE);
}
dev_token = strtok_r(dev_tokenizer, delim, &saveptr);
while (dev_token != NULL) {
strcpy(pd.ifname, dev_token);
if (ioctl(fd, FETCH_PCI_ADDRESS, &pd) == -1) {
TRACE_DBG("Could not find pci info on dpdk "
"device: %s. Is it a dpdk-attached "
"interface?\n", dev_token);
goto loop_over;
dev_token = strtok_r(dev_tokenizer, delim, &saveptr);
while (dev_token != NULL) {
strcpy(pd.ifname, dev_token);
if (ioctl(fd, FETCH_PCI_ADDRESS, &pd) == -1) {
TRACE_DBG("Could not find pci info on dpdk "
"device: %s. Is it a dpdk-attached "
"interface?\n", dev_token);
goto loop_over;
}
argv[*argc] = strdup("-w");
argv[*argc + 1] = calloc(PCI_LENGTH, 1);
if (argv[*argc] == NULL ||
argv[*argc + 1] == NULL) {
TRACE_ERROR("Memory allocation error!\n");
exit(EXIT_FAILURE);
}
sprintf(argv[*argc + 1], PCI_DOM":"PCI_BUS":"
PCI_DEVICE"."PCI_FUNC,
pd.pa.domain, pd.pa.bus, pd.pa.device,
pd.pa.function);
*argc += 2;
if (pd.numa_socket > numa_id) numa_id = pd.numa_socket;
loop_over:
dev_token = strtok_r(NULL, delim, &saveptr);
}
argv[*argc] = strdup("-w");
argv[*argc + 1] = calloc(PCI_LENGTH, 1);
if (argv[*argc] == NULL ||
argv[*argc + 1] == NULL) {
TRACE_ERROR("Memory allocation error!\n");
exit(EXIT_FAILURE);
}
sprintf(argv[*argc + 1], PCI_DOM":"PCI_BUS":"
PCI_DEVICE"."PCI_FUNC,
pd.pa.domain, pd.pa.bus, pd.pa.device,
pd.pa.function);
*argc += 2;
if (pd.numa_socket > numa_id) numa_id = pd.numa_socket;
loop_over:
dev_token = strtok_r(NULL, delim, &saveptr);
close(fd);
free(dev_tokenizer);
}
/* add the terminating "" sequence */
argv[*argc] = end;
close(fd);
free(dev_tokenizer);
return numa_id;
}