From 4cd3ac8d2028781288e0d01dcef6d79c712eccec Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Wed, 2 Nov 2022 21:17:38 +0100 Subject: [PATCH 01/50] README: remove travis badge for now --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 39415647..c1d42a2b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Virtualized TCP Acceleration Service -[![Build Status](https://travis-ci.org/tcp-acceleration-service/tas.svg?branch=master)](https://travis-ci.org/tcp-acceleration-service/tas) [![Documentation Status](https://readthedocs.org/projects/tas/badge/?version=latest)](https://tas.readthedocs.io/en/latest/?badge=latest) From 4e865eb6c5037a961939bfd8575bd43b1176d011 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Thu, 21 Jul 2022 22:39:45 +0200 Subject: [PATCH 02/50] Makefile: disable Werror by default --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3ff8e5a9..9f77c600 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CPPFLAGS += -Iinclude/ CPPFLAGS += $(EXTRA_CPPFLAGS) -CFLAGS += -std=gnu99 -O3 -g -Wall -Werror -march=native -fno-omit-frame-pointer -Wno-address-of-packed-member +CFLAGS += -std=gnu99 -O3 -g -Wall -march=native -fno-omit-frame-pointer CFLAGS += $(EXTRA_CFLAGS) CFLAGS_SHARED += $(CFLAGS) -fPIC LDFLAGS += -pthread -g From 666fc8c6b0d43d1ec20eab05072f984023e0b70c Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Thu, 21 Jul 2022 22:40:49 +0200 Subject: [PATCH 03/50] tas/fast: rename qman_ -> tas_qman_ to avoid dpdk namespace collision Some library in dpdk seems to use qman as the function prefix and at least one of the functions is named identically, so we get linker errors with those dpdk versions. --- tas/fast/fast_flows.c | 10 +++++----- tas/fast/fastemu.c | 9 ++++----- tas/fast/internal.h | 8 ++++---- tas/fast/qman.c | 11 ++++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tas/fast/fast_flows.c b/tas/fast/fast_flows.c index ee924c7a..1bf4dea2 100644 --- a/tas/fast/fast_flows.c +++ b/tas/fast/fast_flows.c @@ -129,7 +129,7 @@ int fast_flows_qman(struct dataplane_context *ctx, uint32_t vm_id, uint32_t queu } /* clear queue manager queue */ - if (qman_set(&ctx->qman, vm_id, flow_id, 0, 0, 0, + if (tas_qman_set(&ctx->qman, vm_id, flow_id, 0, 0, 0, QMAN_SET_RATE | QMAN_SET_MAXCHUNK | QMAN_SET_AVAIL) != 0) { fprintf(stderr, "flast_flows_qman: qman_set clear failed, UNEXPECTED\n"); @@ -218,7 +218,7 @@ int fast_flows_qman_fwd(struct dataplane_context *ctx, avail = tcp_txavail(fs, NULL); /* re-arm queue manager */ - if (qman_set(&ctx->qman, vm_id, flow_id, fs->tx_rate, avail, TCP_MSS, + if (tas_qman_set(&ctx->qman, vm_id, flow_id, fs->tx_rate, avail, TCP_MSS, QMAN_SET_RATE | QMAN_SET_MAXCHUNK | QMAN_SET_AVAIL) != 0) { fprintf(stderr, "fast_flows_qman_fwd: qman_set failed, UNEXPECTED\n"); @@ -623,7 +623,7 @@ int fast_flows_packet(struct dataplane_context *ctx, new_avail = tcp_txavail(fs, NULL); if (new_avail > old_avail) { /* update qman queue */ - if (qman_set(&ctx->qman, fs->vm_id, flow_id, fs->tx_rate, new_avail - + if (tas_qman_set(&ctx->qman, fs->vm_id, flow_id, fs->tx_rate, new_avail - old_avail, TCP_MSS, QMAN_SET_RATE | QMAN_SET_MAXCHUNK | QMAN_ADD_AVAIL) != 0) { @@ -745,7 +745,7 @@ int fast_flows_bump(struct dataplane_context *ctx, uint32_t flow_id, /* update queue manager queue */ if (old_avail < new_avail) { - if (qman_set(&ctx->qman, fs->vm_id, flow_id, fs->tx_rate, new_avail - + if (tas_qman_set(&ctx->qman, fs->vm_id, flow_id, fs->tx_rate, new_avail - old_avail, TCP_MSS, QMAN_SET_RATE | QMAN_SET_MAXCHUNK | QMAN_ADD_AVAIL) != 0) { @@ -822,7 +822,7 @@ void fast_flows_retransmit(struct dataplane_context *ctx, uint32_t flow_id) /* update queue manager */ if (new_avail > old_avail) { - if (qman_set(&ctx->qman, fs->vm_id, flow_id, fs->tx_rate, new_avail - old_avail, + if (tas_qman_set(&ctx->qman, fs->vm_id, flow_id, fs->tx_rate, new_avail - old_avail, TCP_MSS, QMAN_SET_RATE | QMAN_SET_MAXCHUNK | QMAN_ADD_AVAIL) != 0) { fprintf(stderr, "flast_flows_bump: qman_set 1 failed, UNEXPECTED\n"); diff --git a/tas/fast/fastemu.c b/tas/fast/fastemu.c index d1c24884..7424e909 100644 --- a/tas/fast/fastemu.c +++ b/tas/fast/fastemu.c @@ -144,8 +144,7 @@ int dataplane_context_init(struct dataplane_context *ctx) } /* initialize queue manager */ - if (qman_thread_init(ctx) != 0) - { + if (tas_qman_thread_init(ctx) != 0) { fprintf(stderr, "initializing qman thread failed\n"); return -1; } @@ -238,7 +237,7 @@ void dataplane_loop(struct dataplane_context *ctx) if (!was_idle) ctx->loadmon_cyc_busy += cyc - prev_cyc; - ts = qman_timestamp(cyc); + ts = tas_qman_timestamp(cyc); STATS_TS(start); @@ -299,7 +298,7 @@ static void dataplane_block(struct dataplane_context *ctx, uint32_t ts) return; } - max_timeout = qman_next_ts(&ctx->qman, ts); + max_timeout = tas_qman_next_ts(&ctx->qman, ts); ret = rte_epoll_wait(RTE_EPOLL_PER_THREAD, event, 2, max_timeout == (uint32_t)-1 ? -1 : max_timeout / 1000); @@ -608,7 +607,7 @@ static unsigned poll_qman(struct dataplane_context *ctx, uint32_t ts) max = bufcache_prealloc(ctx, max, &handles); /* poll queue manager */ - ret = qman_poll(ctx, max, vq_ids, fq_ids, q_bytes); + ret = tas_qman_poll(ctx, max, vq_ids, fq_ids, q_bytes); if (ret <= 0) { diff --git a/tas/fast/internal.h b/tas/fast/internal.h index 72eec789..7c6ea5b6 100644 --- a/tas/fast/internal.h +++ b/tas/fast/internal.h @@ -68,13 +68,13 @@ extern volatile unsigned fp_scale_to; #define IDXLIST_INVAL (-1U) /** Qman functions */ -int qman_thread_init(struct dataplane_context *ctx); +int tas_qman_thread_init(struct dataplane_context *ctx); int qman_poll(struct dataplane_context *ctx, unsigned num, unsigned *vm_id, unsigned *q_ids, uint16_t *q_bytes); -int qman_set(struct qman_thread *t, uint32_t vm_id, uint32_t flow_id, uint32_t rate, +int tas_qman_set(struct qman_thread *t, uint32_t vm_id, uint32_t flow_id, uint32_t rate, uint32_t avail, uint16_t max_chunk, uint8_t flags); -uint32_t qman_timestamp(uint64_t tsc); -uint32_t qman_next_ts(struct qman_thread *t, uint32_t cur_ts); +uint32_t tas_qman_timestamp(uint64_t tsc); +uint32_t tas_qman_next_ts(struct qman_thread *t, uint32_t cur_ts); /** Helper functions for unit tests */ uint32_t qman_vm_get_avail(struct dataplane_context *ctx, uint32_t vm_id); void qman_free_vm_cont(struct dataplane_context *ctx); diff --git a/tas/fast/qman.c b/tas/fast/qman.c index eeeed644..8480ae24 100644 --- a/tas/fast/qman.c +++ b/tas/fast/qman.c @@ -178,7 +178,7 @@ static inline uint32_t flow_queue_new_ts(struct qman_thread *t, struct flow_queu /*****************************************************************************/ /* Top level queue manager */ -int qman_thread_init(struct dataplane_context *ctx) +int tas_qman_thread_init(struct dataplane_context *ctx) { struct qman_thread *t = &ctx->qman; @@ -195,7 +195,7 @@ int qman_thread_init(struct dataplane_context *ctx) return 0; } -int qman_poll(struct dataplane_context *ctx, unsigned num, unsigned *vm_ids, +int tas_qman_poll(struct dataplane_context *ctx, unsigned num, unsigned *vm_ids, unsigned *q_ids, uint16_t *q_bytes) { int ret; @@ -207,7 +207,7 @@ int qman_poll(struct dataplane_context *ctx, unsigned num, unsigned *vm_ids, return ret; } -int qman_set(struct qman_thread *t, uint32_t vm_id, uint32_t flow_id, uint32_t rate, +int tas_qman_set(struct qman_thread *t, uint32_t vm_id, uint32_t flow_id, uint32_t rate, uint32_t avail, uint16_t max_chunk, uint8_t flags) { int ret; @@ -216,7 +216,7 @@ int qman_set(struct qman_thread *t, uint32_t vm_id, uint32_t flow_id, uint32_t r return ret; } -uint32_t qman_next_ts(struct qman_thread *t, uint32_t cur_ts) +uint32_t tas_qman_next_ts(struct qman_thread *t, uint32_t cur_ts) { struct vm_queue *vq; struct flow_qman *fqman; @@ -260,7 +260,7 @@ uint32_t qman_next_ts(struct qman_thread *t, uint32_t cur_ts) return -1; } -uint32_t qman_timestamp(uint64_t cycles) +uint32_t tas_qman_timestamp(uint64_t cycles) { static uint64_t freq = 0; @@ -579,6 +579,7 @@ int flowcont_init(struct vm_queue *vq) static inline int flow_qman_poll(struct qman_thread *t, struct vm_queue *vqueue, struct flow_qman *fqman, unsigned num, unsigned *q_ids, uint16_t *q_bytes) + { unsigned x, y; uint32_t ts = timestamp(); From 7bdcf726431beb40e68d11a90390b409f4c9d072 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Thu, 23 Sep 2021 09:04:22 +0200 Subject: [PATCH 04/50] Makefile: use pkg-config for dpdk flags Previously we had the flags hard-coded in the makefile, which is tricky with different DPDK versions. pkg-config is only used if the DPDK flags are not manually set beforehand, so this behavior can be overridden. --- Makefile | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 9f77c600..3a8e472e 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ LDFLAGS += $(EXTRA_LDFLAGS) LDLIBS += -lm -lpthread -lrt -ldl LDLIBS += $(EXTRA_LDLIBS) +PKG_CONFIG ?= pkg-config PREFIX ?= /usr/local SBINDIR ?= $(PREFIX)/sbin LIBDIR ?= $(PREFIX)/lib @@ -22,38 +23,9 @@ INCDIR ?= $(PREFIX)/include ############################################################################## # DPDK configuration -# Prefix for dpdk -RTE_SDK ?= /usr/ -# mpdts to compile -DPDK_PMDS ?= ixgbe i40e tap virtio - -DPDK_CPPFLAGS += -I$(RTE_SDK)/include -I$(RTE_SDK)/include/dpdk \ - -I$(RTE_SDK)/include/x86_64-linux-gnu/dpdk/ -DPDK_LDFLAGS+= -L$(RTE_SDK)/lib/ -DPDK_LDLIBS+= \ - -Wl,--whole-archive \ - $(addprefix -lrte_pmd_,$(DPDK_PMDS)) \ - -lrte_eal \ - -lrte_mempool \ - -lrte_mempool_ring \ - -lrte_hash \ - -lrte_ring \ - -lrte_kvargs \ - -lrte_ethdev \ - -lrte_mbuf \ - -lnuma \ - -lrte_bus_pci \ - -lrte_pci \ - -lrte_cmdline \ - -lrte_timer \ - -lrte_net \ - -lrte_kni \ - -lrte_bus_vdev \ - -lrte_gso \ - -Wl,--no-whole-archive \ - -ldl \ - $(EXTRA_LIBS_DPDK) - +DPDK_CPPFLAGS ?= $(shell $(PKG_CONFIG) --cflags libdpdk) +DPDK_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs-only-l libdpdk) +DPDK_LDLIBS ?= $(shell $(PKG_CONFIG) --libs-only-L --libs-only-other libdpdk) ############################################################################## From 28d22875560f308964dc9266fc006433182bd61e Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Thu, 21 Jul 2022 22:43:32 +0200 Subject: [PATCH 05/50] Makefile: use --static and --libs for pkg-config with dpdk --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3a8e472e..0d0ae80c 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,7 @@ INCDIR ?= $(PREFIX)/include # DPDK configuration DPDK_CPPFLAGS ?= $(shell $(PKG_CONFIG) --cflags libdpdk) -DPDK_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs-only-l libdpdk) -DPDK_LDLIBS ?= $(shell $(PKG_CONFIG) --libs-only-L --libs-only-other libdpdk) +DPDK_LDLIBS ?= $(shell $(PKG_CONFIG) --static --libs libdpdk) ############################################################################## From 82ee9afdf3a8317a491bb3bf995b3da7c1fc9ce7 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Thu, 21 Jul 2022 22:45:52 +0200 Subject: [PATCH 06/50] Makefile: disable address-of-packed-member warning in newer gccs --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0d0ae80c..bfb87c45 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ CPPFLAGS += -Iinclude/ CPPFLAGS += $(EXTRA_CPPFLAGS) CFLAGS += -std=gnu99 -O3 -g -Wall -march=native -fno-omit-frame-pointer +CFLAGS += -Wno-address-of-packed-member CFLAGS += $(EXTRA_CFLAGS) CFLAGS_SHARED += $(CFLAGS) -fPIC LDFLAGS += -pthread -g From aeffc1027c8e8307e69a2d0157cbdd390a5e655f Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Thu, 21 Jul 2022 22:34:27 +0200 Subject: [PATCH 07/50] tas/fast: replace deprecated macro wtih RTE_LCORE_FOREACH_WORKER(i) --- tas/tas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tas/tas.c b/tas/tas.c index c7042c22..a8309c02 100644 --- a/tas/tas.c +++ b/tas/tas.c @@ -221,7 +221,7 @@ static int start_threads(void) } /* start common threads */ - RTE_LCORE_FOREACH_SLAVE(core) { + RTE_LCORE_FOREACH_WORKER(core) { if (threads_launched < fp_cores_max) { arg = (void *) (uintptr_t) threads_launched; if (rte_eal_remote_launch(common_thread, arg, core) != 0) { From 27427533ace48572c91fcae2ff053c102492e222 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Wed, 2 Nov 2022 16:16:20 +0100 Subject: [PATCH 08/50] README: update with new dpdk instructions --- README.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c1d42a2b..a1ab0fbb 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,36 @@ virtualized environments. ## Building Requirements: * vTAS is built on top of Intel DPDK for direct access to the NIC. We have - tested this version with dpdk versions (17.11.9, 18.11.5, 19.11). + tested this version with dpdk version 21. -Assuming that dpdk is installed in `~/dpdk-inst` vTAS can be built as follows: +Assuming that dpdk is installed through the system package manager, the +following suffices to build TAS: ``` -make RTE_SDK=~/dpdk-inst +make ``` This will build the vTAS service (binary `tas/tas`), client libraries (in `lib/`), and a few debugging tools (in `tools/`). + +### Using Separate DPDK Build + +The Makefile uses `pkg-config` to locate the dpdk libraries and headers. If you +want to build TAS against a non-system dpdk version, the +`PKG_CONFIG_PATH` environmental variable can point pkg-config to the right dpdk +location. For example, with dpdk installed in `/local/antoinek/dpdk` I set + +``` +PKG_CONFIG_PATH=/local/antoinek/dpdk/usr/local/lib/x86_64-linux-gnu/pkgconfig/ +``` + +Instead of manually exporting the environment variable every time, it can also +be set by creating a `Makefile.local` file including the following line: + +``` +PKG_CONFIG= PKG_CONFIG_PATH=/local/antoinek/dpdk/usr/local/lib/x86_64-linux-gnu/pkgconfig/ pkg-config +``` + ## Running Before running vTAS the following steps are necessary: From 540893da6ae95d936ad8c041c55e2fa76c66b127 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Tue, 5 Oct 2021 22:13:38 +0200 Subject: [PATCH 09/50] tas: ensure accept requests are processed in order --- tas/slow/internal.h | 5 ++++- tas/slow/tcp.c | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tas/slow/internal.h b/tas/slow/internal.h index d489cd3c..81cd5e45 100644 --- a/tas/slow/internal.h +++ b/tas/slow/internal.h @@ -589,8 +589,11 @@ struct listener { uint16_t *backlog_fgs; /**@}*/ - /** List of waiting connections from accept calls */ + /** List of waiting connections from accept calls (head) */ struct connection *wait_conns; + /** List of waiting connections from accept calls (tail) */ + struct connection *wait_conns_last; + /** Listener port */ uint16_t port; /** Flags: see #nicif_connection_flags */ diff --git a/tas/slow/tcp.c b/tas/slow/tcp.c index 9fe8b7bc..7e608677 100644 --- a/tas/slow/tcp.c +++ b/tas/slow/tcp.c @@ -298,6 +298,7 @@ int tcp_listen(struct app_context *ctx, uint64_t opaque, uint16_t local_port, lst->opaque = opaque; lst->port = local_port; lst->wait_conns = NULL; + lst->wait_conns_last = NULL; lst->backlog_len = backlog; lst->backlog_pos = 0; lst->backlog_used = 0; @@ -339,8 +340,14 @@ int tcp_accept(struct app_context *ctx, uint64_t opaque, conn->flags = listen->flags; conn->cnt_tx_pending = 0; - conn->ht_next = listen->wait_conns; - listen->wait_conns = conn; + conn->ht_next = NULL; + if (listen->wait_conns == NULL) { + listen->wait_conns = conn; + listen->wait_conns_last = conn; + } else { + listen->wait_conns_last->ht_next = conn; + listen->wait_conns_last = conn; + } if (listen->backlog_used > 0) { listener_accept(listen); @@ -960,6 +967,9 @@ static void listener_accept(struct listener *l) } l->wait_conns = c->ht_next; + if (l->wait_conns == NULL) { + l->wait_conns_last = NULL; + } conn_register(c); nbqueue_enq(&conn_async_q, &c->comp.el); From c16173ea92deef6345eb28d9d3eeab629e91dff7 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Tue, 5 Oct 2021 22:19:21 +0200 Subject: [PATCH 10/50] lib/sockets: fix spurious wakeups and accepts returning nothing --- lib/sockets/context.c | 21 +--- lib/sockets/control.c | 230 +++++++++++++++++++++++------------------ lib/sockets/internal.h | 18 ++-- tas/config.c | 1 + 4 files changed, 142 insertions(+), 128 deletions(-) diff --git a/lib/sockets/context.c b/lib/sockets/context.c index 651cd494..94e0587d 100644 --- a/lib/sockets/context.c +++ b/lib/sockets/context.c @@ -192,20 +192,6 @@ static inline void ev_listen_open(struct flextcp_context *ctx, static inline void ev_listen_newconn(struct flextcp_context *ctx, struct flextcp_event *ev) { - struct flextcp_listener *l; - struct socket *s; - - l = ev->ev.listen_newconn.listener; - s = (struct socket *) - ((uint8_t *) l - offsetof(struct socket, data.listener.l)); - - socket_lock(s); - - assert(s->type == SOCK_LISTENER); - - flextcp_epoll_set(s, EPOLLIN); - - socket_unlock(s); } static inline void ev_listen_accept(struct flextcp_context *ctx, @@ -218,13 +204,13 @@ static inline void ev_listen_accept(struct flextcp_context *ctx, s = (struct socket *) ((uint8_t *) c - offsetof(struct socket, data.connection.c)); - socket_lock(s); - assert(s->type == SOCK_CONNECTION); - assert(s->data.connection.status == SOC_CONNECTING); sl = s->data.connection.listener; assert(sl != NULL); + socket_lock(sl); + socket_lock(s); + assert(s->data.connection.status == SOC_CONNECTING); flextcp_epoll_set(sl, EPOLLIN); if (ev->ev.listen_accept.status == 0) { @@ -236,6 +222,7 @@ static inline void ev_listen_accept(struct flextcp_context *ctx, } socket_unlock(s); + socket_unlock(sl); } static inline void ev_conn_open(struct flextcp_context *ctx, diff --git a/lib/sockets/control.c b/lib/sockets/control.c index 8f6f4635..c930c629 100644 --- a/lib/sockets/control.c +++ b/lib/sockets/control.c @@ -364,11 +364,60 @@ int tas_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) return ret; } +/** Enqueue accept requests for backlog. Lock on s has to be held. */ +static int enqueue_accept(struct flextcp_context *ctx, struct socket *s) +{ + int newfd; + struct socket *ns; + struct socket_listen *l = &s->data.listener; + struct socket_backlog *bl; + + /* try to fill backlog */ + while (l->backlog_num != l->backlog_len) { + /* allocate socket structure */ + if ((newfd = flextcp_fd_salloc(&ns)) < 0) { + break; + } + + ns->type = SOCK_CONNECTION; + ns->flags = 0; + ns->data.connection.status = SOC_CONNECTING; + ns->data.connection.listener = s; + ns->data.connection.rx_len_1 = 0; + ns->data.connection.rx_len_2 = 0; + ns->data.connection.ctx = ctx; + + bl = l->backlog + ((l->backlog_next + l->backlog_num) % l->backlog_len); + bl->s = ns; + bl->fd = newfd; + + /* send accept request to kernel */ + if (flextcp_listen_accept(ctx, &l->l, &ns->data.connection.c) != 0) + { + /* TODO: check error code... */ + flextcp_fd_close(newfd); + break; + } + + socket_unlock(ns); + l->backlog_num = l->backlog_num + 1; + } + + if (l->backlog_num == 0) { + errno = ENOBUFS; + return -1; + } + + return 0; +} + int tas_listen(int sockfd, int backlog) { struct socket *s; + struct socket_backlog *bl; + struct socket_listen *l; struct flextcp_context *ctx; - int ret = 0, block; + int block; uint32_t flags = 0; if (flextcp_fd_slookup(sockfd, &s) != 0) { @@ -379,16 +428,14 @@ int tas_listen(int sockfd, int backlog) /* socket already used */ if (s->type != SOCK_SOCKET) { errno = EOPNOTSUPP; - ret = -1; - goto out; + goto err; } /* socket not bound */ /* TODO: technically sohuld probably bind to an ephemeral port */ if ((s->flags & SOF_BOUND) != SOF_BOUND) { errno = EADDRINUSE; - ret = -1; - goto out; + goto err; } /* pass on reuseport flags */ @@ -401,21 +448,28 @@ int tas_listen(int sockfd, int backlog) backlog = 8; } + if ((bl = calloc(backlog, sizeof(*bl))) == NULL) { + errno = ENOMEM; + goto err; + } + /* open flextcp listener */ ctx = flextcp_sockctx_get(); if (flextcp_listen_open(ctx, &s->data.listener.l, ntohs(s->addr.sin_port), backlog, flags)) { - /* TODO */ + free (bl); errno = ECONNREFUSED; - ret = -1; - goto out; + goto err_bl; } s->type = SOCK_LISTENER; - s->data.listener.backlog = backlog; - s->data.listener.status = SOL_OPENING; - s->data.listener.pending = NULL; + l = &s->data.listener; + l->backlog = bl; + l->backlog_len = backlog; + l->backlog_next = 0; + l->backlog_num = 0; + l->status = SOL_OPENING; /* wait for listen to complete */ block = 0; @@ -430,29 +484,41 @@ int tas_listen(int sockfd, int backlog) /* check whether listen failed */ if (s->data.listener.status == SOL_FAILED) { - /* TODO */ errno = ENOBUFS; - ret = -1; - goto out; + goto err_bl; + } + + /* enqueue accepts */ + if (enqueue_accept(ctx, s)) { + goto err_close; } -out: flextcp_fd_srelease(sockfd, s); - return ret; + return 0; + +err_close: + /* TODO: close listener */ +err_bl: + free(bl); +err: + flextcp_fd_srelease(sockfd, s); + return -1; } int tas_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) { struct socket *s, *ns; + struct socket_listen *sl; struct flextcp_context *ctx; - struct socket_pending *sp, *spp; + struct socket_backlog *bl; int ret = 0, nonblock = 0, cloexec = 0, newfd, block; if (flextcp_fd_slookup(sockfd, &s) != 0) { errno = EBADF; return -1; } + sl = &s->data.listener; /* validate flags */ if ((flags & SOCK_NONBLOCK) == SOCK_NONBLOCK) { @@ -477,112 +543,72 @@ int tas_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, } ctx = flextcp_sockctx_get(); - - /* lookup pending connection for this context/thread */ - for (sp = s->data.listener.pending; sp != NULL; sp = sp->next) { - if (sp->ctx == ctx) { - break; - } - } - - /* if there is no pending request, send out a request */ - if (sp == NULL) { - if ((sp = malloc(sizeof(*sp))) == NULL) { - errno = ENOMEM; - ret = -1; - goto out; - } - - /* allocate socket structure */ - if ((newfd = flextcp_fd_salloc(&ns)) < 0) { - free(sp); - ret = -1; - goto out; - } - - ns->type = SOCK_CONNECTION; - ns->flags = (nonblock ? SOF_NONBLOCK : 0) | (cloexec ? SOF_CLOEXEC : 0); - ns->data.connection.status = SOC_CONNECTING; - ns->data.connection.listener = s; - ns->data.connection.rx_len_1 = 0; - ns->data.connection.rx_len_2 = 0; - ns->data.connection.ctx = ctx; - - sp->fd = newfd; - sp->s = ns; - sp->ctx = ctx; - sp->next = NULL; - - /* send accept request to kernel */ - if (flextcp_listen_accept(ctx, &s->data.listener.l, - &ns->data.connection.c) != 0) - { - /* TODO */ + block = 0; + while (1) { + /* grab next pending accept */ + if (sl->backlog_num == 0 && enqueue_accept(ctx, s)) { errno = ENOBUFS; ret = -1; - free(sp); - flextcp_fd_close(newfd); - free(s); goto out; } + bl = sl->backlog + sl->backlog_next; + ns = bl->s; + newfd = bl->fd; - /* append entry to pending list */ - spp = s->data.listener.pending; - if (spp == NULL) { - s->data.listener.pending = sp; + socket_lock(ns); + if (ns->data.connection.status != SOC_CONNECTING) { + /* connection is ready */ + break; } else { - while (spp->next != NULL) { - spp = spp->next; - } - spp->next = sp; - } - } else { - ns = sp->s; - newfd = sp->fd; - } + /* connection is still pending */ + socket_unlock(ns); - /* check if connection is still pending */ - if (ns->data.connection.status == SOC_CONNECTING) { - flextcp_epoll_clear(s, EPOLLIN); - if ((s->flags & SOF_NONBLOCK) == SOF_NONBLOCK) { - /* if non-blocking, just return */ - errno = EAGAIN; - ret = -1; - flextcp_fd_srelease(newfd, ns); - goto out; - } else { - /* if this is blocking, wait for connection to complete */ - block = 0; - do { - socket_unlock(ns); + if ((s->flags & SOF_NONBLOCK) == SOF_NONBLOCK) { + /* if non-blocking, just return */ + errno = EAGAIN; + ret = -1; + goto out; + } else { + /* if this is blocking, wait for a connection to complete */ socket_unlock(s); + if (block) flextcp_context_wait(ctx, -1); flextcp_sockctx_poll(ctx); block = 1; + socket_lock(s); - socket_lock(ns); - } while (ns->data.connection.status == SOC_CONNECTING); + } } } /* connection is opened now */ assert(ns->data.connection.status == SOC_CONNECTED); - /* remove entry from pending list */ - if (s->data.listener.pending == sp) { - s->data.listener.pending = sp->next; + if (cloexec) + ns->flags |= SOF_CLOEXEC; + if (nonblock) + ns->flags |= SOF_NONBLOCK; + + /* remove this connection from backlog now */ + sl->backlog_next = (sl->backlog_next + 1) % sl->backlog_len; + --sl->backlog_num; + + flextcp_fd_srelease(newfd, ns); + + /* refill backlog */ + enqueue_accept(ctx, s); + + /* clear epollin on listening socket if no more connections */ + if (!sl->backlog_num) { + flextcp_epoll_clear(s, EPOLLIN); } else { - spp = s->data.listener.pending; - assert(spp != NULL); - while (spp->next != sp) { - assert(spp->next != NULL); - spp = spp->next; - } - spp->next = sp->next; + struct socket *next = sl->backlog[sl->backlog_next].s; + socket_lock(next); + if (next->data.connection.status == SOC_CONNECTING) + flextcp_epoll_clear(s, EPOLLIN); + socket_unlock(next); } - free(sp); - flextcp_fd_srelease(newfd, ns); // fill in addr if given if(addr != NULL) { diff --git a/lib/sockets/internal.h b/lib/sockets/internal.h index 6dffd380..431996c5 100644 --- a/lib/sockets/internal.h +++ b/lib/sockets/internal.h @@ -70,13 +70,6 @@ enum conn_stflags { CSTF_TXCLOSED_ACK = 4, }; -struct socket_pending { - struct socket *s; - struct flextcp_context *ctx; - struct socket_pending *next; - int fd; -}; - struct socket_conn { struct flextcp_connection c; uint8_t status; @@ -91,10 +84,17 @@ struct socket_conn { int move_status; }; +struct socket_backlog { + struct socket *s; + int fd; +}; + struct socket_listen { struct flextcp_listener l; - struct socket_pending *pending; - int backlog; + struct socket_backlog *backlog; + int backlog_len; + int backlog_next; + int backlog_num; uint8_t status; }; diff --git a/tas/config.c b/tas/config.c index aaaea9a8..5c0a9497 100644 --- a/tas/config.c +++ b/tas/config.c @@ -505,6 +505,7 @@ int config_parse(struct configuration *c, int argc, char *argv[]) case CP_FP_NO_INTS: c->fp_interrupts = 0; c->fp_poll_interval_tas = UINT32_MAX; + c->fp_poll_interval_app = UINT32_MAX; break; case CP_FP_NO_XSUMOFFLOAD: c->fp_xsumoffload = 0; From c9c1e8f1030fddeeeb797521261824ce1c54082d Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Tue, 5 Oct 2021 22:20:19 +0200 Subject: [PATCH 11/50] lib/sockets: ignore TCP_DEFER_ACCEPT option --- lib/sockets/control.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sockets/control.c b/lib/sockets/control.c index c930c629..8baae030 100644 --- a/lib/sockets/control.c +++ b/lib/sockets/control.c @@ -851,7 +851,8 @@ int tas_setsockopt(int sockfd, int level, int optname, const void *optval, } else if (level == SOL_SOCKET && optname == SO_PRIORITY) { /* ignore silently */ } else if (level == IPPROTO_TCP && (optname == TCP_KEEPIDLE || - optname == TCP_KEEPINTVL || optname == TCP_KEEPCNT)) { + optname == TCP_KEEPINTVL || optname == TCP_KEEPCNT || + optname == TCP_DEFER_ACCEPT)) { /* ignore silently */ } else if (level == SOL_SOCKET && optname == SO_LINGER) { fprintf(stderr, "flextcp setsockopt: SO_LINGER not implemented\n"); From 430e693d28c723be0caa41f962855153ac70e6c4 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Tue, 5 Oct 2021 22:20:54 +0200 Subject: [PATCH 12/50] lib/sockets: do not return error for SO_LINGER --- lib/sockets/control.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/sockets/control.c b/lib/sockets/control.c index 8baae030..00dc4c42 100644 --- a/lib/sockets/control.c +++ b/lib/sockets/control.c @@ -855,10 +855,7 @@ int tas_setsockopt(int sockfd, int level, int optname, const void *optval, optname == TCP_DEFER_ACCEPT)) { /* ignore silently */ } else if (level == SOL_SOCKET && optname == SO_LINGER) { - fprintf(stderr, "flextcp setsockopt: SO_LINGER not implemented\n"); - errno = ENOPROTOOPT; - ret = -1; - goto out; + fprintf(stderr, "flextcp setsockopt: warning SO_LINGER not implemented\n"); } else { /* unknown option */ fprintf(stderr, "flextcp setsockopt: unknown level optname combination " From aaa7bf6f7f775155310a2f230aa464adac190bd4 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Sun, 15 Jan 2023 21:46:29 +0100 Subject: [PATCH 13/50] tas/fast: replace depracated RX/TX offload flags PKT_TX_ -> RTE_MBUF_F_TX_ PKT_RX_ -> RTE_MBUF_F_RX_ --- tas/fast/network.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tas/fast/network.h b/tas/fast/network.h index 8df48ca4..cf624ff4 100644 --- a/tas/fast/network.h +++ b/tas/fast/network.h @@ -180,7 +180,8 @@ static inline uint16_t network_buf_tcpxsums(struct network_buf_handle *bh, uint8 /*mb->l2_len = l2l; mb->l3_len = l3l; mb->l4_len = 0;*/ - mb->ol_flags = PKT_TX_IPV4 | PKT_TX_IP_CKSUM | PKT_TX_TCP_CKSUM; + mb->ol_flags = RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM | + RTE_MBUF_F_TX_TCP_CKSUM; return network_ip_phdr_xsum(ip_s, ip_d, ip_proto, l3_paylen); } @@ -189,7 +190,8 @@ static inline int network_buf_flowgroup(struct network_buf_handle *bh, uint16_t *fg, uint16_t core) { struct rte_mbuf *mb = (struct rte_mbuf *) bh; - if (!(mb->ol_flags & PKT_RX_RSS_HASH)) { + + if (!(mb->ol_flags & RTE_MBUF_F_RX_RSS_HASH)) { *fg = core; return 0; } From bea808b60c51622117d86e18c257a831ace7187d Mon Sep 17 00:00:00 2001 From: Rajath Shashidhara Date: Tue, 22 Jun 2021 18:31:49 +0000 Subject: [PATCH 14/50] init flow steering even when autoscaling disabled Signed-off-by: Rajath Shashidhara --- tas/fast/network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tas/fast/network.c b/tas/fast/network.c index f49e9c88..25ac4310 100644 --- a/tas/fast/network.c +++ b/tas/fast/network.c @@ -270,6 +270,7 @@ int network_thread_init(struct dataplane_context *ctx) } } + /* setting up RETA failed */ if (reta_setup() != 0) { fprintf(stderr, "RETA setup failed\n"); goto error_tx_queue; From 9ba189cd6bdcaac737b33a056f9c8bd742abda94 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Mon, 16 Jan 2023 20:51:43 +0100 Subject: [PATCH 15/50] tests/full: update for dpdk versions 21+ Explicitly disable PCI and telemetry through EAL parameters. Also mount tmpfs for /var/run where EAL tries to create sockets etc. --- tests/full/fulltest.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/full/fulltest.c b/tests/full/fulltest.c index bba8be07..a37ec165 100644 --- a/tests/full/fulltest.c +++ b/tests/full/fulltest.c @@ -104,6 +104,7 @@ static pid_t start_tas(void) "--fp-no-autoscale", "--fp-no-hugepages", "--dpdk-extra=--vdev", "--dpdk-extra=eth_tap0,iface=vethtas1", "--dpdk-extra=--no-shconf", "--dpdk-extra=--no-huge", + "--dpdk-extra=--no-pci", "--dpdk-extra=--no-telemetry", "--ip-addr=192.168.1.1/24", readyfdopt, NULL); perror("exec failed"); @@ -221,6 +222,12 @@ static int run_child(int (*tas_entry)(void *), int (*linux_entry)(void *), return 1; } + /* dpdk stores control files/sockets in /var/run */ + if (mount("tmpfs", "/var/run", "tmpfs", 0, "") != 0) { + perror("mounting /var/run failed"); + return 1; + } + umask(0022); /* start tas */ From c9c1188b388af26b055944d6ce018d13270b2c99 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Mon, 16 Jan 2023 21:07:59 +0100 Subject: [PATCH 16/50] tests: add full netperf test (currently still broken) --- tests/full/netperf/rules.mk | 51 +++++++++++++++++++++++++++++++++++++ tests/full/rules.mk | 3 +++ 2 files changed, 54 insertions(+) create mode 100644 tests/full/netperf/rules.mk diff --git a/tests/full/netperf/rules.mk b/tests/full/netperf/rules.mk new file mode 100644 index 00000000..b39d9e90 --- /dev/null +++ b/tests/full/netperf/rules.mk @@ -0,0 +1,51 @@ +include mk/subdir_pre.mk + +ft_netperf_parentdir := $(TEST_DISTFILES)/full-netperf + +################################### +# Build netperf + +ft_netperf_ver := 2.7.0 +ft_netperf_tar := $(ft_netperf_parentdir)/netperf-$(ft_netperf_ver).tar.gz +ft_netperf_build := $(ft_netperf_parentdir)/netperf-netperf-$(ft_netperf_ver) +ft_netperf_server := $(ft_netperf_build)/src/netserver +ft_netperf_client := $(ft_netperf_build)/src/netperf + +# Download netperf tarball +$(ft_netperf_tar): + mkdir -p $(dir $@) + wget -O $@ https://github.com/HewlettPackard/netperf/archive/refs/tags/netperf-$(ft_netperf_ver).tar.gz + +# Extract netperf tarball +$(ft_netperf_build): $(ft_netperf_tar) + tar xf $< -C $(ft_netperf_parentdir) + touch $(@) + +# Build netperf +$(ft_netperf_server) $(ft_netperf_client): $(ft_netperf_build) + (cd $(ft_netperf_build) && ./configure CFLAGS=-fcommon) + $(MAKE) -C $(ft_netperf_build) + touch $(ft_netperf_server) $(ft_netperf_client) + +################################### + +tests-full-netperf: $(ft_netperf_server) $(ft_netperf_client) +tests-full: tests-full-netperf + +run-tests-full-netperf-server: tests-full-netperf test-full-wrapdeps + $(FTWRAP) -d 500 \ + -P '$(ft_netperf_server)' \ + -c '$(ft_netperf_client) -H $$TAS_IP -l 100 -t TCP_STREAM' + +run-tests-full-netperf-client: tests-full-netperf test-full-wrapdeps + $(FTWRAP) -d 500 \ + -C '$(ft_netperf_server)' \ + -p '$(ft_netperf_client) -H $$LINUX_IP -l 100 -t TCP_STREAM' + +run-tests-full-netperf: run-tests-full-netperf-server run-tests-full-netperf-client +run-tests-full: run-tests-full-netperf + +.PHONY: tests-full-netperf run-tests-full-netperf \ + run-tests-full-netperf-server run-tests-full-netperf-client + +include mk/subdir_post.mk diff --git a/tests/full/rules.mk b/tests/full/rules.mk index cb077cd7..1b995f3d 100644 --- a/tests/full/rules.mk +++ b/tests/full/rules.mk @@ -39,6 +39,9 @@ include $(dir)/rules.mk dir := $(d)/lighttpd include $(dir)/rules.mk +dir := $(d)/netperf +include $(dir)/rules.mk + ######################### DEPS += $(FULLTEST_OBJS:.o=.d) $(FTWRAP_OBJS:.o=.d) From 1453518005500ae6e3ff10130863fdc71eff44d0 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Mon, 16 Jan 2023 23:46:06 +0100 Subject: [PATCH 17/50] lib/sockets: hardcode getopt(SOL_TCP, TCP_INFO / TCP_MAXSEG) Prints warning but does not return correct value. --- lib/sockets/control.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/sockets/control.c b/lib/sockets/control.c index 00dc4c42..e971eedd 100644 --- a/lib/sockets/control.c +++ b/lib/sockets/control.c @@ -775,6 +775,15 @@ int tas_getsockopt(int sockfd, int level, int optname, void *optval, errno = ENOPROTOOPT; ret = -1; goto out; + } else if (level == SOL_TCP && optname == TCP_MAXSEG) { + fprintf(stderr, "flextcp getsockopt: warning TCP_MAXSEG hardcoded\n"); + res = 1460; + } else if (level == SOL_TCP && optname == TCP_INFO) { + fprintf(stderr, "flextcp getsockopt: warning TCP_INFO hardcoded\n"); + len = MIN(*optlen, sizeof(struct tcp_info)); + memset(optval, 0, len); + *optlen = len; + goto out; } else { /* unknown option */ fprintf(stderr, "flextcp getsockopt: unknown level optname combination " From 6100514e96a4437b290422a01b553e9a6a8118aa Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Mon, 16 Jan 2023 23:49:13 +0100 Subject: [PATCH 18/50] tests/full/netperf: add patch for tolerating short send() Netperf assumes that any send not returning the full amount has failed. According to the socket spec this is definitely broken. While we could implement this behavior in our libsocket, that may well cause performance issues for other cases. So for now, we patch netperf. --- tests/full/netperf/netperf-shortsend.patch | 70 ++++++++++++++++++++++ tests/full/netperf/rules.mk | 2 + 2 files changed, 72 insertions(+) create mode 100644 tests/full/netperf/netperf-shortsend.patch diff --git a/tests/full/netperf/netperf-shortsend.patch b/tests/full/netperf/netperf-shortsend.patch new file mode 100644 index 00000000..c9c7ab65 --- /dev/null +++ b/tests/full/netperf/netperf-shortsend.patch @@ -0,0 +1,70 @@ +Only in netperf-netperf-2.7.0: config.h +Only in netperf-netperf-2.7.0: config.log +Only in netperf-netperf-2.7.0: config.status +Only in netperf-netperf-2.7.0/doc/examples: Makefile +Only in netperf-netperf-2.7.0/doc: Makefile +Only in netperf-netperf-2.7.0: Makefile +Only in netperf-netperf-2.7.0: netperf.spec +Only in netperf-netperf-2.7.0/src: .deps +Only in netperf-netperf-2.7.0/src: dscp.o +Only in netperf-netperf-2.7.0/src: Makefile +Only in netperf-netperf-2.7.0/src/missing: .deps +Only in netperf-netperf-2.7.0/src/missing/m4: Makefile +Only in netperf-netperf-2.7.0/src/missing: Makefile +Only in netperf-netperf-2.7.0/src: netcpu_procstat.o +Only in netperf-netperf-2.7.0/src: netlib.o +Only in netperf-netperf-2.7.0/src: netperf +Only in netperf-netperf-2.7.0/src: netperf.o +Only in netperf-netperf-2.7.0/src: netperf_version.h +Only in netperf-netperf-2.7.0/src: netserver +Only in netperf-netperf-2.7.0/src: netserver.o +Only in netperf-netperf-2.7.0/src: netsh.o +Only in netperf-netperf-2.7.0/src: nettest_bsd.o +Only in netperf-netperf-2.7.0/src: nettest_dlpi.o +diff -ur netperf-netperf-2.7.0.orig/src/nettest_omni.c netperf-netperf-2.7.0/src/nettest_omni.c +--- netperf-netperf-2.7.0.orig/src/nettest_omni.c 2015-07-20 19:39:35.000000000 +0200 ++++ netperf-netperf-2.7.0/src/nettest_omni.c 2023-01-16 23:37:55.531646323 +0100 +@@ -2916,24 +2916,39 @@ + } + } + else { ++ int ret; ++ len = 0; ++ ++ while ((uint32_t) len != bytes_to_send) { + if (!use_write) { +- len = send(data_socket, ++ ret = send(data_socket, + send_ring->buffer_ptr, +- bytes_to_send, ++ bytes_to_send - len, + 0); + } + else { + #ifndef WIN32 +- len = write(data_socket, ++ ret = write(data_socket, + send_ring->buffer_ptr, +- bytes_to_send); ++ bytes_to_send - len); + #else + fprintf(where,"I'm sorry Dave I cannot write() under Windows\n"); + fflush(where); + return -3; + #endif + } ++ ++ if (ret <= 0) { ++ len = ret; ++ break; ++ } else if (SOCKET_EINTR(ret)) { ++ len = ret; ++ break; ++ } ++ len += ret; ++ } + } ++ + if(len != bytes_to_send) { + /* don't forget that some platforms may do a partial send upon + receipt of the interrupt and not return an EINTR... */ diff --git a/tests/full/netperf/rules.mk b/tests/full/netperf/rules.mk index b39d9e90..922a77ee 100644 --- a/tests/full/netperf/rules.mk +++ b/tests/full/netperf/rules.mk @@ -10,6 +10,7 @@ ft_netperf_tar := $(ft_netperf_parentdir)/netperf-$(ft_netperf_ver).tar.gz ft_netperf_build := $(ft_netperf_parentdir)/netperf-netperf-$(ft_netperf_ver) ft_netperf_server := $(ft_netperf_build)/src/netserver ft_netperf_client := $(ft_netperf_build)/src/netperf +ft_netperf_patch := $(d)/netperf-shortsend.patch # Download netperf tarball $(ft_netperf_tar): @@ -19,6 +20,7 @@ $(ft_netperf_tar): # Extract netperf tarball $(ft_netperf_build): $(ft_netperf_tar) tar xf $< -C $(ft_netperf_parentdir) + patch -d $(ft_netperf_build) -p1 <$(ft_netperf_patch) touch $(@) # Build netperf From a1fe0f61b23dea20fdda2beaafae074d86f1e6f8 Mon Sep 17 00:00:00 2001 From: Antoine Kaufmann Date: Mon, 16 Jan 2023 23:53:02 +0100 Subject: [PATCH 19/50] tests/full/netperf: proper command line parameters for test In particular, avoid deamonizing and fork, and use 5 seconds instead of 100. The client test still fails when closing connections. --- tests/full/netperf/rules.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/full/netperf/rules.mk b/tests/full/netperf/rules.mk index 922a77ee..09c58595 100644 --- a/tests/full/netperf/rules.mk +++ b/tests/full/netperf/rules.mk @@ -36,13 +36,13 @@ tests-full: tests-full-netperf run-tests-full-netperf-server: tests-full-netperf test-full-wrapdeps $(FTWRAP) -d 500 \ - -P '$(ft_netperf_server)' \ - -c '$(ft_netperf_client) -H $$TAS_IP -l 100 -t TCP_STREAM' + -P '$(ft_netperf_server) -D -f' \ + -c '$(ft_netperf_client) -H $$TAS_IP -l 5 -t TCP_STREAM' run-tests-full-netperf-client: tests-full-netperf test-full-wrapdeps $(FTWRAP) -d 500 \ - -C '$(ft_netperf_server)' \ - -p '$(ft_netperf_client) -H $$LINUX_IP -l 100 -t TCP_STREAM' + -C '$(ft_netperf_server) -D -f' \ + -p '$(ft_netperf_client) -H $$LINUX_IP -l 5 -t TCP_STREAM' run-tests-full-netperf: run-tests-full-netperf-server run-tests-full-netperf-client run-tests-full: run-tests-full-netperf From 4d0f1ff2fa9a6d2093956ec9ac948535ad31c190 Mon Sep 17 00:00:00 2001 From: stolet Date: Fri, 24 Mar 2023 15:03:01 +0100 Subject: [PATCH 20/50] fix error with implicit declaration of tas_qman_set --- Makefile | 2 +- tas/fast/internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bfb87c45..2e32e3c6 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CPPFLAGS += -Iinclude/ CPPFLAGS += $(EXTRA_CPPFLAGS) -CFLAGS += -std=gnu99 -O3 -g -Wall -march=native -fno-omit-frame-pointer +CFLAGS += -std=gnu99 -O3 -g -Wall -Werror -march=native CFLAGS += -Wno-address-of-packed-member CFLAGS += $(EXTRA_CFLAGS) CFLAGS_SHARED += $(CFLAGS) -fPIC diff --git a/tas/fast/internal.h b/tas/fast/internal.h index 7c6ea5b6..ba52aebb 100644 --- a/tas/fast/internal.h +++ b/tas/fast/internal.h @@ -69,7 +69,7 @@ extern volatile unsigned fp_scale_to; /** Qman functions */ int tas_qman_thread_init(struct dataplane_context *ctx); -int qman_poll(struct dataplane_context *ctx, unsigned num, unsigned *vm_id, +int tas_qman_poll(struct dataplane_context *ctx, unsigned num, unsigned *vm_id, unsigned *q_ids, uint16_t *q_bytes); int tas_qman_set(struct qman_thread *t, uint32_t vm_id, uint32_t flow_id, uint32_t rate, uint32_t avail, uint16_t max_chunk, uint8_t flags); From c27b192913edcd3181a74e6316749cf3705c5997 Mon Sep 17 00:00:00 2001 From: stolet Date: Sat, 25 Mar 2023 00:09:46 +0100 Subject: [PATCH 21/50] add configs for ovs tas experiment and fix dpdk version in dpdk-bind script --- Makefile | 2 +- experiments/configs/gen_config.py | 2 +- experiments/experiments.py | 6 + .../exps/perf_iso_tpconn/configs/ovs_tas.py | 116 ++++++++++++++++++ .../exps/perf_iso_tpconn/perf_iso_tpconn.py | 5 +- experiments/nodes/ovs_tas/ovslinux_client.py | 42 ------- experiments/nodes/ovs_tas/ovslinux_server.py | 36 ------ experiments/nodes/ovs_tas/ovstas_client.py | 6 +- experiments/nodes/ovs_tas/ovstas_server.py | 4 +- images/dpdk_bind.sh | 2 +- images/start-vm.sh | 16 +++ 11 files changed, 150 insertions(+), 87 deletions(-) create mode 100644 experiments/exps/perf_iso_tpconn/configs/ovs_tas.py delete mode 100644 experiments/nodes/ovs_tas/ovslinux_client.py delete mode 100644 experiments/nodes/ovs_tas/ovslinux_server.py diff --git a/Makefile b/Makefile index 2e32e3c6..204fc7db 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CPPFLAGS += -Iinclude/ CPPFLAGS += $(EXTRA_CPPFLAGS) -CFLAGS += -std=gnu99 -O3 -g -Wall -Werror -march=native +CFLAGS += -std=gnu99 -O3 -g -Wall -march=native CFLAGS += -Wno-address-of-packed-member CFLAGS += $(EXTRA_CFLAGS) CFLAGS_SHARED += $(CFLAGS) -fPIC diff --git a/experiments/configs/gen_config.py b/experiments/configs/gen_config.py index 94e6e291..a8160afa 100644 --- a/experiments/configs/gen_config.py +++ b/experiments/configs/gen_config.py @@ -88,7 +88,7 @@ def __init__(self, pane, machine_config, project_dir, ip, n_cores, self.args = '--ip-addr={}/24 --fp-cores-max={}'.format(ip, n_cores) + \ ' --cc=const-rate --cc-const-rate=0' + \ ' --fp-no-autoscale --fp-no-ints' + \ - ' --dpdk-extra="-w{}"'.format(dpdk_extra) + ' --dpdk-extra="-a{}"'.format(dpdk_extra) self.pane = pane self.ip = ip diff --git a/experiments/experiments.py b/experiments/experiments.py index 2c5dc1c8..2b54aa5c 100644 --- a/experiments/experiments.py +++ b/experiments/experiments.py @@ -15,6 +15,8 @@ from nodes.vtas_bare.vtasbare_client import VTasBareClient from nodes.ovs_linux.ovslinux_server import OvsLinuxServer from nodes.ovs_linux.ovslinux_client import OvsLinuxClient +from nodes.ovs_tas.ovstas_server import OvsTasServer +from nodes.ovs_tas.ovstas_client import OvsTasClient class Experiment: @@ -41,6 +43,8 @@ def init_server_node(self, stack): node = VTasBareServer(self.config, self.wmanager) elif stack == "ovs-linux": node = OvsLinuxServer(self.config, self.wmanager) + elif stack == "ovs-tas": + node = OvsTasServer(self.config, self.wmanager) return node @@ -59,6 +63,8 @@ def init_client_node(self, stack): node = VTasBareClient(self.config, self.wmanager) elif stack == "ovs-linux": node = OvsLinuxClient(self.config, self.wmanager) + elif stack == "ovs-tas": + node = OvsTasClient(self.config, self.wmanager) return node diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py new file mode 100644 index 00000000..998b9746 --- /dev/null +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py @@ -0,0 +1,116 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import HostProxyConfig +from configs.gen_config import GuestProxyConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, nconns): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=1024, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=1024, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-tas' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + tas0_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm0_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas_config.args = tas_config.args + ' --shm-len=4294967296' + + + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + tas1_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm1_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas_config.args = tas_config.args + ' --shm-len=4294967296' + + + self.c_tas_configs.append(tas0_config) + # self.c_tas_configs.append(tas1_config) + self.c_vm_configs.append(vm0_config) + # self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=64, mpending=64, nconns=nconns, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + + self.client_configs.append(client0_config) + # self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py index 2b140a6a..4ca33ce1 100644 --- a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py +++ b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py @@ -4,6 +4,7 @@ from exps.perf_iso_tpconn.configs.bare_vtas import Config as VTasBareConf from exps.perf_iso_tpconn.configs.virt_tas import Config as TasVirtConf from exps.perf_iso_tpconn.configs.ovs_linux import Config as OVSLinuxConf +from exps.perf_iso_tpconn.configs.ovs_tas import Config as OVSTasConf experiments = [] @@ -16,9 +17,11 @@ vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) # experiments.append(tas_bare_exp) # experiments.append(vtas_bare_exp) # experiments.append(tas_virt_exp) - experiments.append(ovs_linux_exp) + # experiments.append(ovs_linux_exp) + experiments.append(ovs_tas_exp) diff --git a/experiments/nodes/ovs_tas/ovslinux_client.py b/experiments/nodes/ovs_tas/ovslinux_client.py deleted file mode 100644 index 571bca63..00000000 --- a/experiments/nodes/ovs_tas/ovslinux_client.py +++ /dev/null @@ -1,42 +0,0 @@ -import time - -from nodes.ovs_linux.ovslinux import OvsLinux -from components.client import Client - -class OVSLinuxClient(OvsLinux): - - def __init__(self, config, wmanager): - - OvsLinux.__init__(self, config.defaults, config.c_machine_config, - config.c_vm_configs, wmanager, - config.defaults.c_setup_pane, - config.defaults.c_cleanup_pane) - - self.client_configs = config.client_configs - self.nodenum = config.cnodenum - self.cnum = config.cnum - self.clients = [] - - def start_clients(self): - for i in range(self.nodenum): - vm_config = self.vm_configs[i] - for j in range(self.cnum): - cidx = self.cnum * i + j - client_config = self.client_configs[cidx] - client = Client(self.defaults, - self.machine_config, - client_config, - vm_config, - self.wmanager) - self.clients.append(client) - client.run_virt(False, False) - time.sleep(3) - - def run(self): - self.setup() - self.start_vms() - self.start_clients() - - def save_logs(self, exp_path): - for client in self.clients: - client.save_log_virt(exp_path) diff --git a/experiments/nodes/ovs_tas/ovslinux_server.py b/experiments/nodes/ovs_tas/ovslinux_server.py deleted file mode 100644 index 2ce13fc7..00000000 --- a/experiments/nodes/ovs_tas/ovslinux_server.py +++ /dev/null @@ -1,36 +0,0 @@ -import time - -from nodes.ovs_linux.ovslinux import OvsLinux -from components.server import Server - -class OVSLinuxServer(OvsLinux): - - def __init__(self, config, wmanager): - - OvsLinux.__init__(self, config.defaults, config.s_machine_config, - config.s_vm_configs, wmanager, - config.defaults.s_setup_pane, - config.defaults.s_cleanup_pane) - - self.server_configs = config.server_configs - self.nodenum = config.snodenum - self.snum = config.snum - - def start_servers(self): - for i in range(self.nodenum): - vm_config = self.vm_configs[i] - for j in range(self.snum): - sidx = self.snum * i + j - server_config = self.server_configs[sidx] - server = Server(self.defaults, - self.machine_config, - server_config, - vm_config, - self.wmanager) - server.run_virt(False, False) - time.sleep(3) - - def run(self): - self.setup() - self.start_vms() - self.start_servers() diff --git a/experiments/nodes/ovs_tas/ovstas_client.py b/experiments/nodes/ovs_tas/ovstas_client.py index a8e2143f..7f6ea910 100644 --- a/experiments/nodes/ovs_tas/ovstas_client.py +++ b/experiments/nodes/ovs_tas/ovstas_client.py @@ -3,13 +3,13 @@ from nodes.ovs_tas.ovstas import OvsTas from components.client import Client -class OVSLinuxClient(OvsTas): +class OvsTasClient(OvsTas): def __init__(self, config, wmanager): OvsTas.__init__(self, config.defaults, config.c_machine_config, - config.c_vm_configs, wmanager, - config.defaults.c_setup_pane, + config.c_tas_configs, config.c_vm_configs, + wmanager, config.defaults.c_setup_pane, config.defaults.c_cleanup_pane) self.client_configs = config.client_configs diff --git a/experiments/nodes/ovs_tas/ovstas_server.py b/experiments/nodes/ovs_tas/ovstas_server.py index 8cbe1ac7..87a6cca3 100644 --- a/experiments/nodes/ovs_tas/ovstas_server.py +++ b/experiments/nodes/ovs_tas/ovstas_server.py @@ -8,8 +8,8 @@ class OvsTasServer(OvsTas): def __init__(self, config, wmanager): OvsTas.__init__(self, config.defaults, config.s_machine_config, - config.s_vm_configs, wmanager, - config.defaults.s_setup_pane, + config.s_tas_configs, config.s_vm_configs, + wmanager, config.defaults.s_setup_pane, config.defaults.s_cleanup_pane) self.server_configs = config.server_configs diff --git a/images/dpdk_bind.sh b/images/dpdk_bind.sh index 312c6352..9b112d7f 100644 --- a/images/dpdk_bind.sh +++ b/images/dpdk_bind.sh @@ -24,5 +24,5 @@ sudo ip link set $interface down # Bind vnic to dpdk sudo modprobe vfio-pci -cd /home/tas/programs/dpdk-stable-19.11.14/usertools +cd /home/tas/programs/dpdk-stable-22.11.3/usertools sudo python3 dpdk-devbind.py -b vfio-pci $pci_id diff --git a/images/start-vm.sh b/images/start-vm.sh index 3689a652..6f05763b 100755 --- a/images/start-vm.sh +++ b/images/start-vm.sh @@ -69,6 +69,22 @@ elif [[ "$stack" == 'ovs-linux' ]]; then -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ ; +elif [[ "$stack" == 'ovs-tas' ]]; then + sudo qemu-system-x86_64 \ + -nographic -monitor none -serial stdio \ + -machine accel=kvm,type=q35 \ + -cpu host \ + -smp 12 \ + -m 12G \ + -netdev user,id=net0 \ + -device virtio-net-pci,netdev=net0 \ + -netdev tap,ifname=$tap,script=no,downscript=no,vhost=on,id=net1 \ + -device virtio-net-pci,mac=$mac,netdev=net1 \ + -netdev tap,ifname=$ovstap,script=no,downscript=no,vhost=on,id=net2 \ + -device virtio-net-pci,mac=$alt_mac,vectors=18,mq=on,netdev=net2 \ + -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ + -drive if=virtio,format=raw,file="seed.img" \ + ; elif [[ "$stack" == 'tap-tas' ]]; then sudo qemu-system-x86_64 \ -nographic -monitor none -serial stdio \ From d3b355df4e313e139ef044a34ffa8f95a1a85f4e Mon Sep 17 00:00:00 2001 From: stolet Date: Sat, 25 Mar 2023 00:17:55 +0100 Subject: [PATCH 22/50] 21 instead of 22 in dpdk-bind script --- images/dpdk_bind.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/dpdk_bind.sh b/images/dpdk_bind.sh index 9b112d7f..2b23ae4d 100644 --- a/images/dpdk_bind.sh +++ b/images/dpdk_bind.sh @@ -24,5 +24,5 @@ sudo ip link set $interface down # Bind vnic to dpdk sudo modprobe vfio-pci -cd /home/tas/programs/dpdk-stable-22.11.3/usertools +cd /home/tas/programs/dpdk-stable-21.11.3/usertools sudo python3 dpdk-devbind.py -b vfio-pci $pci_id From 8e55eb1b322036b3e7ac264c791e1ceb20a034ff Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 27 Mar 2023 15:21:05 +0200 Subject: [PATCH 23/50] add config option to disable rss --- tas/config.c | 13 +++++++++++-- tas/fast/network.c | 6 ++++++ tas/include/config.h | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tas/config.c b/tas/config.c index 5c0a9497..ec72195a 100644 --- a/tas/config.c +++ b/tas/config.c @@ -74,6 +74,7 @@ enum cfg_params { CP_FP_NO_INTS, CP_FP_NO_XSUMOFFLOAD, CP_FP_NO_AUTOSCALE, + CP_FP_NO_RSS, CP_FP_NO_HUGEPAGES, CP_FP_VLAN_STRIP, CP_FP_POLL_INTERVAL_TAS, @@ -207,6 +208,9 @@ static struct option opts[] = { { .name = "fp-no-autoscale", .has_arg = no_argument, .val = CP_FP_NO_AUTOSCALE }, + { .name = "fp-no-rss", + .has_arg = no_argument, + .val = CP_FP_NO_RSS }, { .name = "fp-no-hugepages", .has_arg = no_argument, .val = CP_FP_NO_HUGEPAGES }, @@ -222,8 +226,7 @@ static struct option opts[] = { { .name = "bu-max-budget", .has_arg = required_argument, .val = CP_BU_MAX_BUDGET }, - { - .name = "bu-use-ratio", + { .name = "bu-use-ratio", .has_arg = required_argument, .val = CP_BU_USE_RATIO }, { .name = "bu-update-freq", @@ -513,6 +516,9 @@ int config_parse(struct configuration *c, int argc, char *argv[]) case CP_FP_NO_AUTOSCALE: c->fp_autoscale = 0; break; + case CP_FP_NO_RSS: + c->fp_rss = 0; + break; case CP_FP_NO_HUGEPAGES: c->fp_hugepages = 0; break; @@ -655,6 +661,7 @@ static int config_defaults(struct configuration *c, char *progname) c->fp_interrupts = 1; c->fp_xsumoffload = 1; c->fp_autoscale = 1; + c->fp_rss = 1; c->fp_hugepages = 1; c->fp_vlan_strip = 0; c->fp_poll_interval_tas = 10000; @@ -766,6 +773,8 @@ static void print_usage(struct configuration *c, char *progname) "[default: enabled]\n" " --fp-no-autoscale Disable autoscaling " "[default: enabled]\n" + " --fp-no-rss Disable rss " + "[default: enabled]\n" " --fp-no-hugepages Disable hugepages for SHM " "[default: enabled]\n" " --fp-poll-interval-tas TAS polling interval before blocking " diff --git a/tas/fast/network.c b/tas/fast/network.c index 25ac4310..c24dd903 100644 --- a/tas/fast/network.c +++ b/tas/fast/network.c @@ -134,6 +134,12 @@ int network_init(unsigned n_threads) goto error_exit; } + /* turn off rss */ + if (config.fp_rss == 0) + { + port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE; + } + /* mask unsupported RSS hash functions */ if ((port_conf.rx_adv_conf.rss_conf.rss_hf & eth_devinfo.flow_type_rss_offloads) != diff --git a/tas/include/config.h b/tas/include/config.h index 1cb924eb..7928bd1f 100644 --- a/tas/include/config.h +++ b/tas/include/config.h @@ -129,6 +129,8 @@ struct configuration { uint32_t fp_xsumoffload; /** FP: auto scaling enabled */ uint32_t fp_autoscale; + /** FP: rss enabled */ + uint32_t fp_rss; /** FP: use huge pages for internal and buffer memory */ uint32_t fp_hugepages; /** FP: enable vlan stripping */ From a9ca0d97b9f9253c8eb84b3e5906cee65c99765b Mon Sep 17 00:00:00 2001 From: stolet Date: Tue, 28 Mar 2023 11:28:15 +0200 Subject: [PATCH 24/50] use threading to start vms and add all baselines to perfiso_tp_conn experiment --- experiments/components/vm.py | 4 +- experiments/configs/gen_config.py | 2 +- .../perf_iso_tpconn/configs/bare_vtas_off.py | 90 ------------------- .../exps/perf_iso_tpconn/configs/ovs_tas.py | 12 ++- experiments/exps/perf_iso_tpconn/parse.py | 9 +- .../exps/perf_iso_tpconn/perf_iso_tpconn.py | 7 +- .../exps/perf_iso_tpconn/plot_script.plt | 2 + experiments/nodes/node.py | 5 +- experiments/nodes/ovs_linux/ovslinux.py | 18 +++- experiments/nodes/ovs_tas/ovstas.py | 31 +++++-- experiments/nodes/ovs_tas/ovstas_client.py | 2 +- experiments/nodes/tap_tas/ttas.py | 20 +++-- experiments/nodes/virt_linux/vlinux.py | 15 +++- experiments/nodes/virt_tas/vtas.py | 14 ++- images/ovstap-add.sh | 13 ++- images/start-vm.sh | 5 +- 16 files changed, 113 insertions(+), 136 deletions(-) delete mode 100644 experiments/exps/perf_iso_tpconn/configs/bare_vtas_off.py diff --git a/experiments/components/vm.py b/experiments/components/vm.py index 00409e73..1091c993 100644 --- a/experiments/components/vm.py +++ b/experiments/components/vm.py @@ -17,13 +17,13 @@ def start(self): self.pane.send_keys(start_vm_cmd) print("Started VM") - time.sleep(35) + time.sleep(25) self.login_vm() def enable_hugepages(self): cmd = "sudo mount -t hugetlbfs nodev /dev/hugepages" self.pane.send_keys(cmd) - cmd = "echo 1024 | sudo tee /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages" + cmd = "echo 8192 | sudo tee /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages" self.pane.send_keys(cmd) time.sleep(3) diff --git a/experiments/configs/gen_config.py b/experiments/configs/gen_config.py index a8160afa..2995a89e 100644 --- a/experiments/configs/gen_config.py +++ b/experiments/configs/gen_config.py @@ -87,7 +87,7 @@ def __init__(self, pane, machine_config, project_dir, ip, n_cores, self.exec_file = self.comp_dir + '/tas/tas' self.args = '--ip-addr={}/24 --fp-cores-max={}'.format(ip, n_cores) + \ ' --cc=const-rate --cc-const-rate=0' + \ - ' --fp-no-autoscale --fp-no-ints' + \ + ' --fp-no-autoscale --fp-no-ints --fp-no-xsumoffload --fp-no-rss' + \ ' --dpdk-extra="-a{}"'.format(dpdk_extra) self.pane = pane diff --git a/experiments/exps/perf_iso_tpconn/configs/bare_vtas_off.py b/experiments/exps/perf_iso_tpconn/configs/bare_vtas_off.py deleted file mode 100644 index 7a5618e4..00000000 --- a/experiments/exps/perf_iso_tpconn/configs/bare_vtas_off.py +++ /dev/null @@ -1,90 +0,0 @@ -from configs.gen_config import Defaults -from configs.gen_config import MachineConfig -from configs.gen_config import TasConfig -from configs.gen_config import ClientConfig -from configs.gen_config import ServerConfig - -class Config: - def __init__(self, exp_name, nconns): - self.exp_name = exp_name - self.defaults = Defaults() - - # Server Machine - self.sstack = 'bare-tas' - self.snum = 2 - self.snodenum = 1 - self.s_tas_configs = [] - self.s_vm_configs = [] - self.s_proxyg_configs = [] - self.server_configs = [] - - self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, - interface=self.defaults.server_interface, - stack=self.sstack, - is_remote=True, - is_server=True) - - tas_config = TasConfig(pane=self.defaults.s_tas_pane, - machine_config=self.s_machine_config, - project_dir=self.defaults.default_otas_dir_bare, - ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' - self.s_tas_configs.append(tas_config) - - server0_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=0, vmid=0, groupid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=1024, - bench_dir=self.defaults.default_obenchmark_dir_bare, - tas_dir=self.defaults.default_otas_dir_bare) - server1_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=1, vmid=0, groupid=1, - port=1235, ncores=8, max_flows=4096, max_bytes=1024, - bench_dir=self.defaults.default_obenchmark_dir_bare, - tas_dir=self.defaults.default_otas_dir_bare) - - self.server_configs.append(server0_config) - self.server_configs.append(server1_config) - - # Client Machine - self.cstack = 'bare-vtas' - self.cnum = 2 - self.cnodenum = 1 - self.c_tas_configs = [] - self.c_vm_configs = [] - self.c_proxyg_configs = [] - self.client_configs = [] - - self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, - interface=self.defaults.client_interface, - stack=self.cstack, - is_remote=False, - is_server=False) - - tas_config = TasConfig(pane=self.defaults.c_tas_pane, - machine_config=self.c_machine_config, - project_dir=self.defaults.default_vtas_dir_bare, - ip=self.c_machine_config.ip, - n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296 --bu-max-budget=2100000000 --bu-boost=2 --bu-update-freq=1000000' - self.c_tas_configs.append(tas_config) - - client0_config = ClientConfig(exp_name=exp_name, - pane=self.defaults.c_client_pane, - idx=0, vmid=0, groupid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1234, ncores=3, - msize=64, mpending=64, nconns=512, - open_delay=15, max_msgs_conn=0, max_pend_conns=1, - bench_dir=self.defaults.default_vbenchmark_dir_bare, - tas_dir=self.defaults.default_vtas_dir_bare) - client1_config = ClientConfig(exp_name=exp_name, - pane=self.defaults.c_client_pane, - idx=1, vmid=0, groupid=1, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=3, - msize=64, mpending=64, nconns=nconns, - open_delay=15, max_msgs_conn=0, max_pend_conns=1, - bench_dir=self.defaults.default_vbenchmark_dir_bare, - tas_dir=self.defaults.default_vtas_dir_bare) - - self.client_configs.append(client0_config) - self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py index 998b9746..aafb081d 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py @@ -2,8 +2,6 @@ from configs.gen_config import MachineConfig from configs.gen_config import TasConfig from configs.gen_config import VMConfig -from configs.gen_config import HostProxyConfig -from configs.gen_config import GuestProxyConfig from configs.gen_config import ClientConfig from configs.gen_config import ServerConfig @@ -74,7 +72,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, n_cores=1, dpdk_extra="00:04.0") - tas_config.args = tas_config.args + ' --shm-len=4294967296' + tas0_config.args = tas0_config.args + ' --shm-len=4294967296' vm1_config = VMConfig(pane=self.defaults.c_vm_pane, @@ -87,13 +85,13 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, n_cores=1, dpdk_extra="00:04.0") - tas_config.args = tas_config.args + ' --shm-len=4294967296' + tas1_config.args = tas1_config.args + ' --shm-len=4294967296' self.c_tas_configs.append(tas0_config) - # self.c_tas_configs.append(tas1_config) + self.c_tas_configs.append(tas1_config) self.c_vm_configs.append(vm0_config) - # self.c_vm_configs.append(vm1_config) + self.c_vm_configs.append(vm1_config) client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, @@ -113,4 +111,4 @@ def __init__(self, exp_name, nconns): tas_dir=self.defaults.default_otas_dir_virt) self.client_configs.append(client0_config) - # self.client_configs.append(client1_config) \ No newline at end of file + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpconn/parse.py b/experiments/exps/perf_iso_tpconn/parse.py index 1f8bde1d..8a1dbe15 100644 --- a/experiments/exps/perf_iso_tpconn/parse.py +++ b/experiments/exps/perf_iso_tpconn/parse.py @@ -80,7 +80,8 @@ def parse_data(parsed_md): for nconns in parsed_md: data_point = {"nconns": nconns} for stack in parsed_md[nconns]: - if stack == "virt-tas": + is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" + if is_virt: c0_fname = out_dir + parsed_md[nconns][stack]["0"]["0"] c1_fname = out_dir + parsed_md[nconns][stack]["1"]["0"] else: @@ -98,14 +99,16 @@ def parse_data(parsed_md): def save_dat_file(avg_tps, fname): f = open(fname, "w+") - header = "nconns bare-tas bare-vtas virt-tas\n" + header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" f.write(header) for tp in avg_tps: f.write("{} {} {} {}\n".format( tp["nconns"], tp["bare-tas"], tp["bare-vtas"], - tp["virt-tas"] + tp["virt-tas"], + tp["ovs-linux"], + tp["ovs-tas"] )) def main(): diff --git a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py index 4ca33ce1..e68f6e1e 100644 --- a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py +++ b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py @@ -8,8 +8,7 @@ experiments = [] -# n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] -n_conns = [128] +n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] for n in n_conns: exp_name = "perf-iso-tpconn_conns{}_".format(n) @@ -21,7 +20,7 @@ # experiments.append(tas_bare_exp) # experiments.append(vtas_bare_exp) - # experiments.append(tas_virt_exp) + experiments.append(tas_virt_exp) + # experiments.append(ovs_tas_exp) # experiments.append(ovs_linux_exp) - experiments.append(ovs_tas_exp) diff --git a/experiments/exps/perf_iso_tpconn/plot_script.plt b/experiments/exps/perf_iso_tpconn/plot_script.plt index 3b15fad2..eeebe830 100644 --- a/experiments/exps/perf_iso_tpconn/plot_script.plt +++ b/experiments/exps/perf_iso_tpconn/plot_script.plt @@ -15,3 +15,5 @@ set yrange [0:] plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ 'tp.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ + 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 4 w lp, \ + 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 4 w lp, \ diff --git a/experiments/nodes/node.py b/experiments/nodes/node.py index 57734c4d..275ce937 100644 --- a/experiments/nodes/node.py +++ b/experiments/nodes/node.py @@ -77,11 +77,12 @@ def ovsbr_del(self, br_name): self.cleanup_pane.send_keys(cmd) time.sleep(2) - def ovstap_add(self, br_name, tap_name, script_dir): + def ovstap_add(self, br_name, tap_name, multi_queue, script_dir): cmd = "cd {}".format(script_dir) self.setup_pane.send_keys(cmd) time.sleep(1) - cmd = "sudo bash ovstap-add.sh {} {}".format(br_name, tap_name) + cmd = "sudo bash ovstap-add.sh {} {} {}".format( + br_name, tap_name, multi_queue) self.setup_pane.send_keys(cmd) time.sleep(2) diff --git a/experiments/nodes/ovs_linux/ovslinux.py b/experiments/nodes/ovs_linux/ovslinux.py index 805675f6..86b28110 100644 --- a/experiments/nodes/ovs_linux/ovslinux.py +++ b/experiments/nodes/ovs_linux/ovslinux.py @@ -1,4 +1,6 @@ import time +import threading + from components.vm import VM from nodes.node import Node @@ -26,7 +28,8 @@ def setup(self): for vm_config in self.vm_configs: # Tap that allows us to ssh to VM self.ovstap_add("br0", - "tap{}".format(vm_config.id), + "tap{}".format(vm_config.id), + 0, vm_config.manager_dir) def cleanup(self): @@ -46,9 +49,18 @@ def cleanup(self): for vm_config in self.vm_configs: self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) + def start_vm(self, vm, vm_config): + vm.start() + vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) + def start_vms(self): + threads = [] for vm_config in self.vm_configs: vm = VM(self.defaults, self.machine_config, vm_config, self.wmanager) self.vms.append(vm) - vm.start() - vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) \ No newline at end of file + vm_thread = threading.Thread(target=self.start_vm, args=(vm, vm_config)) + threads.append(vm_thread) + vm_thread.start() + + for t in threads: + t.join() diff --git a/experiments/nodes/ovs_tas/ovstas.py b/experiments/nodes/ovs_tas/ovstas.py index 2d6cb4f3..bfd83f34 100644 --- a/experiments/nodes/ovs_tas/ovstas.py +++ b/experiments/nodes/ovs_tas/ovstas.py @@ -1,4 +1,5 @@ import time +import threading from components.tas import TAS from components.vm import VM @@ -30,11 +31,13 @@ def setup(self): for vm_config in self.vm_configs: # Tap that allows us to ssh to VM self.ovstap_add("br0", - "tap{}".format(vm_config.id), + "tap{}".format(vm_config.id), + 0, vm_config.manager_dir) # TAP used by OvS self.ovstap_add("br0", - "ovstap{}".format(vm_config.id), + "ovstap{}".format(vm_config.id), + 1, vm_config.manager_dir) def cleanup(self): @@ -69,14 +72,24 @@ def start_tas(self): tas.run_virt() time.sleep(3) + def start_vm(self, vm, vm_config): + vm.start() + vm.enable_hugepages() + vm.enable_noiommu("1af4 1110") + vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) + vm.init_interface(vm_config.tas_tap_ip, self.defaults.tas_interface) + vm.dpdk_bind(vm_config.tas_tap_ip, self.defaults.tas_interface, + self.defaults.pci_id) + def start_vms(self): + threads = [] for vm_config in self.vm_configs: vm = VM(self.defaults, self.machine_config, vm_config, self.wmanager) self.vms.append(vm) - vm.start() - vm.enable_hugepages() - vm.enable_noiommu("1af4 1110") - vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) - vm.init_interface(vm_config.tas_tap_ip, self.defaults.tas_interface) - vm.dpdk_bind(vm_config.tas_tap_ip, self.defaults.tas_interface, - self.defaults.pci_id) \ No newline at end of file + vm_thread = threading.Thread(target=self.start_vm, args=(vm, vm_config)) + threads.append(vm_thread) + vm_thread.start() + + for t in threads: + t.join() + \ No newline at end of file diff --git a/experiments/nodes/ovs_tas/ovstas_client.py b/experiments/nodes/ovs_tas/ovstas_client.py index 7f6ea910..b9bd0240 100644 --- a/experiments/nodes/ovs_tas/ovstas_client.py +++ b/experiments/nodes/ovs_tas/ovstas_client.py @@ -29,7 +29,7 @@ def start_clients(self): vm_config, self.wmanager) self.clients.append(client) - client.run_virt(False, True) + client.run_virt(True, True) time.sleep(3) def run(self): diff --git a/experiments/nodes/tap_tas/ttas.py b/experiments/nodes/tap_tas/ttas.py index 55717f82..6a3017a3 100644 --- a/experiments/nodes/tap_tas/ttas.py +++ b/experiments/nodes/tap_tas/ttas.py @@ -1,4 +1,5 @@ import time +import threading from components.tas import TAS from components.vm import VM @@ -52,14 +53,23 @@ def start_tas(self): tas.run_virt() time.sleep(3) - def start_vms(self): - for vm_config in self.vm_configs: - vm = VM(self.defaults, self.machine_config, vm_config, self.wmanager) - self.vms.append(vm) + def start_vm(self, vm, vm_config): vm.start() vm.enable_hugepages() vm.enable_noiommu("1af4 1110") vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) vm.init_interface(vm_config.tas_tap_ip, self.defaults.tas_interface) vm.dpdk_bind(vm_config.tas_tap_ip, self.defaults.tas_interface, - self.defaults.pci_id) \ No newline at end of file + self.defaults.pci_id) + + def start_vms(self): + threads = [] + for vm_config in self.vm_configs: + vm = VM(self.defaults, self.machine_config, vm_config, self.wmanager) + self.vms.append(vm) + vm_thread = threading.Thread(target=self.start_vm, args=(vm, vm_config)) + threads.append(vm_thread) + vm_thread.start() + + for t in threads: + t.join() \ No newline at end of file diff --git a/experiments/nodes/virt_linux/vlinux.py b/experiments/nodes/virt_linux/vlinux.py index ff0e86cd..90d36f7f 100644 --- a/experiments/nodes/virt_linux/vlinux.py +++ b/experiments/nodes/virt_linux/vlinux.py @@ -1,3 +1,5 @@ +import threading + from components.vm import VM from nodes.node import Node @@ -31,9 +33,18 @@ def cleanup(self): for vm_config in self.vm_configs: self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) + def start_vm(self, vm, vm_config): + vm.start() + vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) + def start_vms(self): + threads = [] for vm_config in self.vm_configs: vm = VM(self.defaults, self.machine_config, vm_config, self.wmanager) self.vms.append(vm) - vm.start() - vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) \ No newline at end of file + vm_thread = threading.Thread(target=self.start_vm, args=(vm, vm_config)) + threads.append(vm_thread) + vm_thread.start() + + for t in threads: + t.join() \ No newline at end of file diff --git a/experiments/nodes/virt_tas/vtas.py b/experiments/nodes/virt_tas/vtas.py index da99b830..ca3a509d 100644 --- a/experiments/nodes/virt_tas/vtas.py +++ b/experiments/nodes/virt_tas/vtas.py @@ -1,4 +1,5 @@ import time +import threading from components.vm import VM from components.proxy import ProxyGuest @@ -19,12 +20,21 @@ def __init__(self, defaults, machine_config, tas_config, self.proxyg_configs = proxyg_configs self.vms = [] + def start_vm(self, vm): + vm.start() + vm.enable_noiommu("1af4 1110") + def start_vms(self): + threads = [] for vm_config in self.vm_configs: vm = VM(self.defaults, self.machine_config, vm_config, self.wmanager) self.vms.append(vm) - vm.start() - vm.enable_noiommu("1af4 1110") + vm_thread = threading.Thread(target=self.start_vm, args=(vm,)) + threads.append(vm_thread) + vm_thread.start() + + for t in threads: + t.join() def start_guest_proxies(self): for i in range(len(self.vm_configs)): diff --git a/images/ovstap-add.sh b/images/ovstap-add.sh index 4212b36a..e8a62836 100644 --- a/images/ovstap-add.sh +++ b/images/ovstap-add.sh @@ -1,16 +1,23 @@ #!/usr/bin/env bash -if [ "$#" -ne 2 ]; then +if [ "$#" -ne 3 ]; then echo "Illegal number of parameters" echo "usage:" - echo "[br_name tap_name]" + echo "[br_name tap_name multi_queue]" exit fi br_name=$1 tap_name=$2 +multi_queue=$3 + +if [ $multi_queue -eq 1 ]; then + sudo ip tuntap add mode tap multi_queue name $tap_name + echo "Set ${tap_name} for multi queue" +else + ip tuntap add mode tap $tap_name +fi -ip tuntap add mode tap $tap_name ifconfig $tap_name up ovs-vsctl add-port $br_name $tap_name \ No newline at end of file diff --git a/images/start-vm.sh b/images/start-vm.sh index 6f05763b..3ef9fc72 100755 --- a/images/start-vm.sh +++ b/images/start-vm.sh @@ -76,12 +76,13 @@ elif [[ "$stack" == 'ovs-tas' ]]; then -cpu host \ -smp 12 \ -m 12G \ + -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ -netdev tap,ifname=$tap,script=no,downscript=no,vhost=on,id=net1 \ -device virtio-net-pci,mac=$mac,netdev=net1 \ - -netdev tap,ifname=$ovstap,script=no,downscript=no,vhost=on,id=net2 \ - -device virtio-net-pci,mac=$alt_mac,vectors=18,mq=on,netdev=net2 \ + -netdev tap,ifname=$ovstap,script=no,downscript=no,vhost=on,queues=10,id=net2 \ + -device virtio-net-pci,mac=$alt_mac,vectors=18,mq=on,rss=on,hash=off,netdev=net2 \ -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ ; From d623ac8743ad45a91cb0b134e61b5c68fb6c1e6e Mon Sep 17 00:00:00 2001 From: stolet Date: Tue, 28 Mar 2023 11:41:00 +0200 Subject: [PATCH 25/50] add msize per iso tp experiment --- .../exps/perf_iso_tpmsize/configs/bare_tas.py | 88 +++++++++++++ .../perf_iso_tpmsize/configs/bare_vtas.py | 90 +++++++++++++ .../perf_iso_tpmsize/configs/ovs_linux.py | 96 ++++++++++++++ .../exps/perf_iso_tpmsize/configs/ovs_tas.py | 114 +++++++++++++++++ .../exps/perf_iso_tpmsize/configs/virt_tas.py | 120 ++++++++++++++++++ experiments/exps/perf_iso_tpmsize/parse.py | 120 ++++++++++++++++++ .../exps/perf_iso_tpmsize/perf_iso_tpmsize.py | 26 ++++ .../exps/perf_iso_tpmsize/plot_script.plt | 19 +++ 8 files changed, 673 insertions(+) create mode 100644 experiments/exps/perf_iso_tpmsize/configs/bare_tas.py create mode 100644 experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py create mode 100644 experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py create mode 100644 experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py create mode 100644 experiments/exps/perf_iso_tpmsize/configs/virt_tas.py create mode 100644 experiments/exps/perf_iso_tpmsize/parse.py create mode 100644 experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py create mode 100644 experiments/exps/perf_iso_tpmsize/plot_script.plt diff --git a/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py b/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py new file mode 100644 index 00000000..3ec57379 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py @@ -0,0 +1,88 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'bare-tas' + self.cnum = 2 + self.cnodenum = 1 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + tas_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.c_machine_config.ip, + n_cores=1) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.c_tas_configs.append(tas_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=1, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py b/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py new file mode 100644 index 00000000..a9533f54 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py @@ -0,0 +1,90 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, groupid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, groupid=1, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'bare-vtas' + self.cnum = 2 + self.cnodenum = 1 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + tas_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_vtas_dir_bare, + ip=self.c_machine_config.ip, + n_cores=1) + tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + self.c_tas_configs.append(tas_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, groupid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_bare, + tas_dir=self.defaults.default_vtas_dir_bare) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=1, vmid=0, groupid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_bare, + tas_dir=self.defaults.default_vtas_dir_bare) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py b/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py new file mode 100644 index 00000000..eafeb4d1 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py @@ -0,0 +1,96 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-linux' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py b/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py new file mode 100644 index 00000000..b87e3c04 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py @@ -0,0 +1,114 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-tas' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + tas0_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm0_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + + + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + tas1_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm1_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + + + self.c_tas_configs.append(tas0_config) + self.c_tas_configs.append(tas1_config) + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py b/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py new file mode 100644 index 00000000..fb0a7924 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py @@ -0,0 +1,120 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import HostProxyConfig +from configs.gen_config import GuestProxyConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'virt-tas' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + tas_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_vtas_dir_bare, + ip=self.c_machine_config.ip, + n_cores=1) + tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + self.c_tas_configs.append(tas_config) + + self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, + machine_config=self.c_machine_config, + comp_dir=self.defaults.default_vtas_dir_bare) + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + proxyg0_config = GuestProxyConfig(pane=self.defaults.c_proxyg_pane, + machine_config=self.c_machine_config, + comp_dir=self.defaults.default_vtas_dir_virt) + proxyg1_config = GuestProxyConfig(pane=self.defaults.c_proxyg_pane, + machine_config=self.c_machine_config, + comp_dir=self.defaults.default_vtas_dir_virt) + + self.c_proxyg_configs.append(proxyg0_config) + self.c_proxyg_configs.append(proxyg1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/parse.py b/experiments/exps/perf_iso_tpmsize/parse.py new file mode 100644 index 00000000..0644f600 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/parse.py @@ -0,0 +1,120 @@ +import sys +sys.path.append("../../../") + +import os +import re +import experiments.plot_utils as putils + + +# For this experiment get the message size +# from the experiment name, since client 0 and client 1 +# have different message sizes +def get_msize(fname): + regex = "(?<=_msize)[0-9]*" + msize = re.search(regex, fname).group(0) + return msize + +def check_msize(data, msize): + if msize not in data: + data[msize] = {} + +def check_stack(data, msize, stack): + if stack not in data[msize]: + data[msize][stack] = {} + +def check_nid(data, msize, stack, nid): + if nid not in data[msize][stack]: + data[msize][stack][nid] = {} + +def check_cid(data, msize, stack, nid, cid): + if cid not in data[msize][stack][nid]: + data[msize][stack][nid][cid] = "" + +def get_avg_tp(fname_c0, fname_c1): + n_messages = 0 + n = 0 + + f = open(fname_c0) + lines = f.readlines() + + c1_first_ts = putils.get_first_ts(fname_c1) + idx, _ = putils.get_min_idx(fname_c0, c1_first_ts) + + first_line = lines[idx] + last_line = lines[len(lines) - 1] + + n_messages = int(putils.get_n_messages(last_line)) - \ + int(putils.get_n_messages(first_line)) + msize = int(putils.get_msize(fname_c0)) + n = len(lines) - idx + + return str((n_messages * msize * 8 / n) / 1000000) + +def parse_metadata(): + dir_path = "./out/" + data = {} + + for f in os.listdir(dir_path): + fname = os.fsdecode(f) + + if "tas_c" == fname: + continue + + msize = get_msize(fname) + cid = putils.get_client_id(fname) + nid = putils.get_node_id(fname) + stack = putils.get_stack(fname) + + check_msize(data, msize) + check_stack(data, msize, stack) + check_nid(data, msize, stack, nid) + check_cid(data, msize, stack, nid, cid) + + data[msize][stack][nid][cid] = fname + + return data + +def parse_data(parsed_md): + tp = [] + out_dir = "./out/" + for msize in parsed_md: + data_point = {"msize": msize} + for stack in parsed_md[msize]: + is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" + if is_virt: + c0_fname = out_dir + parsed_md[msize][stack]["0"]["0"] + c1_fname = out_dir + parsed_md[msize][stack]["1"]["0"] + else: + c0_fname = out_dir + parsed_md[msize][stack]["0"]["0"] + c1_fname = out_dir + parsed_md[msize][stack]["0"]["1"] + + avg_tp = get_avg_tp(c0_fname, c1_fname) + + data_point[stack] = avg_tp + + tp.append(data_point) + + tp = sorted(tp, key=lambda d: int(d['msize'])) + return tp + +def save_dat_file(avg_tps, fname): + f = open(fname, "w+") + header = "msize bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" + f.write(header) + for tp in avg_tps: + f.write("{} {} {} {}\n".format( + tp["msize"], + tp["bare-tas"], + tp["bare-vtas"], + tp["virt-tas"], + tp["ovs-linux"], + tp["ovs-tas"] + )) + +def main(): + parsed_md = parse_metadata() + avg_tps = parse_data(parsed_md) + save_dat_file(avg_tps, "./tp.dat") + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py new file mode 100644 index 00000000..76dce259 --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py @@ -0,0 +1,26 @@ +import experiments as exp + +from exps.perf_iso_tpconn.configs.bare_tas import Config as TasBareConf +from exps.perf_iso_tpconn.configs.bare_vtas import Config as VTasBareConf +from exps.perf_iso_tpconn.configs.virt_tas import Config as TasVirtConf +from exps.perf_iso_tpconn.configs.ovs_linux import Config as OVSLinuxConf +from exps.perf_iso_tpconn.configs.ovs_tas import Config as OVSTasConf + +experiments = [] + +msize = [64, 128, 256, 512, 1024, 2048] + +for n in msize: + exp_name = "perf-iso-tpconn_msize{}_".format(n) + tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) + vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) + tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) + + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) + diff --git a/experiments/exps/perf_iso_tpmsize/plot_script.plt b/experiments/exps/perf_iso_tpmsize/plot_script.plt new file mode 100644 index 00000000..3f0b151c --- /dev/null +++ b/experiments/exps/perf_iso_tpmsize/plot_script.plt @@ -0,0 +1,19 @@ +#!/usr/bin/gnuplot -persist +set terminal pdf +set output "plot.pdf" +set colorsequence podo +set key autotitle columnhead +set key left top +set logscale x 2 +set bmargin 4 + +set key left bottom +set label 1 "Aggressor Client Message Size" at screen 0.5, 0.03 center +set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 center + +set yrange [0:] +plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ + 'tp.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ + 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ + 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 4 w lp, \ + 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 4 w lp, \ From e214b8450445387e35aa7c70d0dc964e5b64a564 Mon Sep 17 00:00:00 2001 From: stolet Date: Wed, 29 Mar 2023 17:21:58 +0200 Subject: [PATCH 26/50] update experiment, parset and gnuplot script for latency experiment and msize experiment --- experiments/components/client.py | 12 +- experiments/components/tas.py | 4 +- experiments/components/vm.py | 3 +- .../exps/perf_iso_latconn/configs/bare_tas.py | 10 +- .../perf_iso_latconn/configs/bare_vtas.py | 27 +++-- .../perf_iso_latconn/configs/ovs_linux.py | 96 +++++++++++++++ .../exps/perf_iso_latconn/configs/ovs_tas.py | 114 ++++++++++++++++++ .../exps/perf_iso_latconn/configs/virt_tas.py | 57 +++------ experiments/exps/perf_iso_latconn/parse.py | 16 ++- .../exps/perf_iso_latconn/perf_iso_latconn.py | 14 ++- experiments/exps/perf_iso_latconn/plot.pdf | Bin 10896 -> 0 bytes experiments/exps/perf_iso_latconn/plot_script | 48 +++++--- .../perf_iso_latmsize/configs/bare_tas.py | 14 ++- .../perf_iso_latmsize/configs/bare_vtas.py | 31 ++--- .../perf_iso_latmsize/configs/ovs_linux.py | 96 +++++++++++++++ .../exps/perf_iso_latmsize/configs/ovs_tas.py | 114 ++++++++++++++++++ .../perf_iso_latmsize/configs/virt_tas.py | 61 +++------- experiments/exps/perf_iso_latmsize/parse.py | 10 +- .../perf_iso_latmsize/perf_iso_latmsize.py | 14 ++- .../exps/perf_iso_latmsize/plot_script | 24 ++-- .../exps/perf_iso_tpconn/configs/bare_vtas.py | 4 +- .../exps/perf_iso_tpconn/configs/ovs_linux.py | 4 +- .../exps/perf_iso_tpconn/configs/ovs_tas.py | 4 +- .../exps/perf_iso_tpconn/configs/virt_tas.py | 4 +- experiments/exps/perf_iso_tpconn/parse.py | 4 +- .../exps/perf_iso_tpconn/perf_iso_tpconn.py | 10 +- experiments/exps/perf_iso_tpconn/plot.pdf | Bin 10385 -> 10765 bytes .../exps/perf_iso_tpconn/plot_script.plt | 9 +- experiments/exps/perf_iso_tpmsize/parse.py | 4 +- .../exps/perf_iso_tpmsize/perf_iso_tpmsize.py | 23 ++-- .../exps/perf_iso_tpmsize/plot_script.plt | 9 +- images/start-vm.sh | 11 +- 32 files changed, 636 insertions(+), 215 deletions(-) create mode 100644 experiments/exps/perf_iso_latconn/configs/ovs_linux.py create mode 100644 experiments/exps/perf_iso_latconn/configs/ovs_tas.py delete mode 100644 experiments/exps/perf_iso_latconn/plot.pdf create mode 100644 experiments/exps/perf_iso_latmsize/configs/ovs_linux.py create mode 100644 experiments/exps/perf_iso_latmsize/configs/ovs_tas.py diff --git a/experiments/components/client.py b/experiments/components/client.py index 09cee174..d4cdbd78 100644 --- a/experiments/components/client.py +++ b/experiments/components/client.py @@ -24,6 +24,7 @@ def run_virt(self, w_sudo, ld_preload): self.pane.send_keys(ssh_com) time.sleep(3) self.pane.send_keys("tas") + time.sleep(3) self.run_benchmark_rpc(w_sudo, ld_preload) def run_benchmark_rpc(self, w_sudo, ld_preload): @@ -65,6 +66,14 @@ def save_log_virt(self, exp_path): self.save_logs_pane.send_keys(suppress_history=False, cmd='tas') time.sleep(1) + # Remove log from remote machine + ssh_com = utils.get_ssh_command(self.machine_config, self.vm_config) + ssh_com += " 'rm {}'".format(self.client_config.out) + self.save_logs_pane.send_keys(ssh_com) + time.sleep(3) + self.save_logs_pane.send_keys(suppress_history=False, cmd='tas') + time.sleep(1) + def save_log_bare(self, exp_path): # self.exp_path is set in the run.py file split_path = exp_path.split("/") @@ -75,4 +84,5 @@ def save_log_bare(self, exp_path): os.makedirs(out_dir) dest = out_dir + "/" + self.client_config.out_file - os.rename(self.client_config.out, dest) \ No newline at end of file + os.rename(self.client_config.out, dest) + os.remove(self.client_config.out) \ No newline at end of file diff --git a/experiments/components/tas.py b/experiments/components/tas.py index 8fe9bb33..834a8a1c 100644 --- a/experiments/components/tas.py +++ b/experiments/components/tas.py @@ -29,6 +29,7 @@ def run_virt(self): self.pane.send_keys(ssh_com) time.sleep(3) self.pane.send_keys("tas") + time.sleep(3) tas_args = self.tas_config.args utils.compile_and_run(pane=self.pane, @@ -48,4 +49,5 @@ def save_log_bare(self, exp_path): os.makedirs(out_dir) dest = out_dir + "/" + self.tas_config.out_file - os.rename(self.tas_config.out, dest) \ No newline at end of file + os.rename(self.tas_config.out, dest) + os.remove(self.client_config.out) \ No newline at end of file diff --git a/experiments/components/vm.py b/experiments/components/vm.py index 1091c993..791a9235 100644 --- a/experiments/components/vm.py +++ b/experiments/components/vm.py @@ -23,9 +23,10 @@ def start(self): def enable_hugepages(self): cmd = "sudo mount -t hugetlbfs nodev /dev/hugepages" self.pane.send_keys(cmd) + time.sleep(1) cmd = "echo 8192 | sudo tee /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages" self.pane.send_keys(cmd) - time.sleep(3) + time.sleep(5) def enable_noiommu(self, vendor_id): self.pane.send_keys("sudo su -") diff --git a/experiments/exps/perf_iso_latconn/configs/bare_tas.py b/experiments/exps/perf_iso_latconn/configs/bare_tas.py index cde50db2..d69c2dfa 100644 --- a/experiments/exps/perf_iso_latconn/configs/bare_tas.py +++ b/experiments/exps/perf_iso_latconn/configs/bare_tas.py @@ -28,17 +28,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=8) + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=4, max_flows=1024, max_bytes=1024, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=4, max_flows=1024, max_bytes=1024, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -64,6 +65,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, @@ -77,7 +79,7 @@ def __init__(self, exp_name, nconns): client1_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=1, vmid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=1, + ip=self.defaults.server_ip, port=1235, ncores=3, msize=64, mpending=64, nconns=nconns, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_obenchmark_dir_bare, diff --git a/experiments/exps/perf_iso_latconn/configs/bare_vtas.py b/experiments/exps/perf_iso_latconn/configs/bare_vtas.py index f848e124..da7570a4 100644 --- a/experiments/exps/perf_iso_latconn/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_latconn/configs/bare_vtas.py @@ -10,7 +10,7 @@ def __init__(self, exp_name, nconns): self.defaults = Defaults() # Server Machine - self.sstack = 'bare-vtas' + self.sstack = 'bare-tas' self.snum = 2 self.snodenum = 1 self.s_tas_configs = [] @@ -26,22 +26,22 @@ def __init__(self, exp_name, nconns): tas_config = TasConfig(pane=self.defaults.s_tas_pane, machine_config=self.s_machine_config, - project_dir=self.defaults.default_vtas_dir_bare, + project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=8) + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=0, vmid=0, groupid=0, - port=1234, ncores=4, max_flows=1024, max_bytes=1024, - bench_dir=self.defaults.default_vbenchmark_dir_bare, - tas_dir=self.defaults.default_vtas_dir_bare) + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=1, vmid=0, groupid=1, - port=1235, ncores=4, max_flows=1024, max_bytes=1024, - bench_dir=self.defaults.default_vbenchmark_dir_bare, - tas_dir=self.defaults.default_vtas_dir_bare) - + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) self.server_configs.append(server1_config) @@ -65,6 +65,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) + tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, @@ -78,7 +79,7 @@ def __init__(self, exp_name, nconns): client1_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=1, vmid=0, groupid=1, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=1, + ip=self.defaults.server_ip, port=1235, ncores=3, msize=64, mpending=64, nconns=nconns, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_bare, diff --git a/experiments/exps/perf_iso_latconn/configs/ovs_linux.py b/experiments/exps/perf_iso_latconn/configs/ovs_linux.py new file mode 100644 index 00000000..19545cd7 --- /dev/null +++ b/experiments/exps/perf_iso_latconn/configs/ovs_linux.py @@ -0,0 +1,96 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, nconns): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-linux' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=64, mpending=64, nconns=nconns, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_latconn/configs/ovs_tas.py b/experiments/exps/perf_iso_latconn/configs/ovs_tas.py new file mode 100644 index 00000000..fe194204 --- /dev/null +++ b/experiments/exps/perf_iso_latconn/configs/ovs_tas.py @@ -0,0 +1,114 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, nconns): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-tas' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + tas0_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm0_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + + + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + tas1_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm1_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + + + self.c_tas_configs.append(tas0_config) + self.c_tas_configs.append(tas1_config) + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=64, mpending=64, nconns=nconns, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_latconn/configs/virt_tas.py b/experiments/exps/perf_iso_latconn/configs/virt_tas.py index bc4e932a..0fcff46e 100644 --- a/experiments/exps/perf_iso_latconn/configs/virt_tas.py +++ b/experiments/exps/perf_iso_latconn/configs/virt_tas.py @@ -13,9 +13,9 @@ def __init__(self, exp_name, nconns): self.defaults = Defaults() # Server Machine - self.sstack = 'virt-tas' - self.snum = 1 - self.snodenum = 2 + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 self.s_tas_configs = [] self.s_vm_configs = [] self.s_proxyg_configs = [] @@ -29,50 +29,22 @@ def __init__(self, exp_name, nconns): tas_config = TasConfig(pane=self.defaults.s_tas_pane, machine_config=self.s_machine_config, - project_dir=self.defaults.default_vtas_dir_bare, + project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=8) + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.s_tas_configs.append(tas_config) - self.s_proxyh_config = HostProxyConfig(pane=self.defaults.s_proxyh_pane, - machine_config=self.s_machine_config, - comp_dir=self.defaults.default_vtas_dir_bare) - - vm0_config = VMConfig(pane=self.defaults.s_vm_pane, - machine_config=self.s_machine_config, - tas_dir=self.defaults.default_vtas_dir_bare, - tas_dir_virt=self.defaults.default_vtas_dir_virt, - idx=0) - vm1_config = VMConfig(pane=self.defaults.s_vm_pane, - machine_config=self.s_machine_config, - tas_dir=self.defaults.default_vtas_dir_bare, - tas_dir_virt=self.defaults.default_vtas_dir_virt, - idx=1) - - self.s_vm_configs.append(vm0_config) - self.s_vm_configs.append(vm1_config) - - proxyg0_config = GuestProxyConfig(pane=self.defaults.s_proxyg_pane, - machine_config=self.s_machine_config, - comp_dir=self.defaults.default_vtas_dir_virt) - proxyg1_config = GuestProxyConfig(pane=self.defaults.s_proxyg_pane, - machine_config=self.s_machine_config, - comp_dir=self.defaults.default_vtas_dir_virt) - - self.s_proxyg_configs.append(proxyg0_config) - self.s_proxyg_configs.append(proxyg1_config) - server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=4, max_flows=1024, max_bytes=1024, - bench_dir=self.defaults.default_vbenchmark_dir_virt, - tas_dir=self.defaults.default_vtas_dir_virt) + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=0, vmid=1, - port=1235, ncores=4, max_flows=1024, max_bytes=1024, - bench_dir=self.defaults.default_vbenchmark_dir_virt, - tas_dir=self.defaults.default_vtas_dir_virt) - + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) self.server_configs.append(server1_config) @@ -96,6 +68,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) + tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' self.c_tas_configs.append(tas_config) self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, @@ -137,7 +110,7 @@ def __init__(self, exp_name, nconns): client1_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=1, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=1, + ip=self.defaults.server_ip, port=1235, ncores=3, msize=64, mpending=64, nconns=nconns, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_virt, diff --git a/experiments/exps/perf_iso_latconn/parse.py b/experiments/exps/perf_iso_latconn/parse.py index e11d8eb3..66fd9e29 100644 --- a/experiments/exps/perf_iso_latconn/parse.py +++ b/experiments/exps/perf_iso_latconn/parse.py @@ -11,7 +11,7 @@ # from the experiment name, since client 0 and client 1 # have a different number of connections def get_conns(fname): - regex = "(?<=_conns)[0-9]*" + regex = "(?<=-conns)[0-9]*" nconns = re.search(regex, fname).group(0) return nconns @@ -53,6 +53,10 @@ def parse_metadata(): for f in os.listdir(dir_path): fname = os.fsdecode(f) + + if "tas_c" == fname: + continue + nconns = get_conns(fname) cid = putils.get_client_id(fname) nid = putils.get_node_id(fname) @@ -82,10 +86,10 @@ def parse_data(parsed_md): return lat_list def save_dat_file(exp_lats): - header = "nconns bare-tas bare-vtas virt-tas\n" + header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" nconns = list(exp_lats.keys()) - nconns = sorted(nconns) + nconns = list(map(str, sorted(map(int, nconns)))) stacks = list(exp_lats[nconns[0]].keys()) percentiles = list(exp_lats[nconns[0]][stacks[0]].keys()) @@ -95,11 +99,13 @@ def save_dat_file(exp_lats): f.write(header) for nconn in nconns: - f.write("{} {} {} {}\n".format( + f.write("{} {} {} {} {} {}\n".format( nconn, exp_lats[nconn]['bare-tas'][percentile], exp_lats[nconn]['bare-vtas'][percentile], - exp_lats[nconn]['virt-tas'][percentile]) + exp_lats[nconn]['virt-tas'][percentile], + exp_lats[nconn]['ovs-linux'][percentile], + exp_lats[nconn]['ovs-tas'][percentile]) ) def main(): diff --git a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py index fba71445..d1291b9c 100644 --- a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py +++ b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py @@ -3,18 +3,24 @@ from exps.perf_iso_latconn.configs.bare_tas import Config as TasBareConf from exps.perf_iso_latconn.configs.bare_vtas import Config as VTasBareConf from exps.perf_iso_latconn.configs.virt_tas import Config as TasVirtConf +from exps.perf_iso_latconn.configs.ovs_linux import Config as OVSLinuxConf +from exps.perf_iso_latconn.configs.ovs_tas import Config as OVSTasConf experiments = [] -n_conns = [64, 128, 256, 512, 1024, 2048, 4096] +n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] for n in n_conns: - exp_name = "perf-iso-latconn_conns{}_".format(n) + exp_name = "perf-iso-latconn-conns{}_".format(n) tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) + # experiments.append(vtas_bare_exp) + # experiments.append(tas_virt_exp) + # experiments.append(ovs_tas_exp) + # experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latconn/plot.pdf b/experiments/exps/perf_iso_latconn/plot.pdf deleted file mode 100644 index 178aa312f15286f41ce96a44ff9566947e59ea16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10896 zcmcJ#by$?m7x1qVQW6p(AuFA-ODrrYodVK`fD0_RbS&MCbT2DK7qsL%%w&s1%)36*-N^CYJ_R)M8&e8hw z`$3i7$lD~Tj-_xP0`ujAt%;4u*u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kY4J#qIFwE~5?Gh>o5;u7u+8>}j3Vowp2!Efuz2FY7$2FIif^1TS-TedW2T0=k?q z#gR`w77CTQ@Z#~JnO<-AHRjR`*5DT3XC6ANFPFbR(1~H|!yb%LNuSWmVEe`$ARFnc3AxDCSE?goYZ;(ba`%NuwnrlO>%%q9slgK9dcp`hAd<WSGK-Ecw(ikjVY=%#-+c@8da-d_Rd_k5~(3zmYM+m-}P@YvVUf7 zMu-A*FfPCi!}}-GyJ49B^~Ue!91Ib^_@z3E8s2#7msA{T5Bo(!|4*KQ+u0)|UPJBv zbbuoCk35L~Hv#>(y8*u@KLx)mYr%~XukBHolpAz2 z3Lt==`*->an?g|N6!rYRZy@S#EigA2@PB$x1ow~9KkNOSf+06=gMZ(=ynoyKcgcTq zU=SCobshjO&&}%t47wrHH#ZmG-)(@oxltvcUwS|Q59${$YJG4+ZU{0jcK_ZZ3UK3_*}55x>R&k9;f8(xgDIoj z^!EZ(v9mUIFhZRyWHy4r?W_TyCm`?>Ab|Nb0%2n>z=`7WD5aae=saAZ$Po6A;MqPosYy2>6rHOF&UO(AxCZ zLi;s@KM4KbT;JIaW`Y9*fOv3#e_a4DFE2MQzy$DHhT7i{6sW(s09Jp zflK_+9~p!Xgqnr_(c^{uM~@!@Mh)}ddi)T6)Q11J48p_ppSlnp zp8xG12*}O*zji@D9=?CHhp>a9-Z6H+&Wx(TU12xAx_Ni0T3e$g{r72to4lNr32JVC bt&86$0-$z?U)}`)dAT4s3=C4r(m4Mg#R*!y diff --git a/experiments/exps/perf_iso_latconn/plot_script b/experiments/exps/perf_iso_latconn/plot_script index aa050711..b93692b7 100644 --- a/experiments/exps/perf_iso_latconn/plot_script +++ b/experiments/exps/perf_iso_latconn/plot_script @@ -2,8 +2,12 @@ set terminal pdf set output "plot.pdf" set colorsequence podo +set logscale x 2 set key autotitle columnhead -set key left top + +set title font "Computer Modern Roman,6" +set key font "Computer Modern Roman,6" +set ytics font "Computer Modern Roman,6" # margins: left,right,bottom,top # spacing: xspacing,yspacing @@ -11,8 +15,8 @@ set multiplot layout 2,2 \ margins 0.1,0.95,0.15,0.90 \ spacing 0.1,0.07 -set label 1 "Aggresor Client # Connections" at screen 0.5, 0.03 center -set label 2 "Victim Client Latency (µs)" at screen 0.01, 0.5 rotate by 90 center +set label 1 "Aggresor Client # Connections" at screen 0.5, 0.03 center font "Computer Modern Roman,8" +set label 2 "Victim Client Latency (µs)" at screen 0.01, 0.5 rotate by 90 center font "Computer Modern Roman,8" set title offset 0,-0.6 @@ -20,30 +24,44 @@ set title offset 0,-0.6 unset xtics set yrange [0:] set title "50p Latency" -plot 'lat_50p.dat' using 1:2 title 'bare-tas' linetype 2 w lp, \ - 'lat_50p.dat' using 1:3 title 'bare-vtas' linetype 3 w lp, \ - 'lat_50p.dat' using 1:4 title 'virt-tas' linetype 4 w lp, \ +set key center right +plot 'lat_50p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ # Plot 90p latency unset xtics set yrange [0:] set title "90p Latency" -plot 'lat_90p.dat' using 1:2 title 'bare-tas' linetype 2 w lp, \ - 'lat_90p.dat' using 1:3 title 'bare-vtas' linetype 3 w lp, \ - 'lat_90p.dat' using 1:4 title 'virt-tas' linetype 4 w lp, \ +set key center right +plot 'lat_90p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ # Plot 99p latency set xtics +set xtics font "Computer Modern Roman,6" set yrange [0:] set title "99p Latency" -plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'lat_99p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ - 'lat_99p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ +set key center right +plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ # Plot 99.9p latency set xtics +set xtics font "Computer Modern Roman,6" set yrange [0:] set title "99.9p Latency" -plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ - 'lat_99.9p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ +set key left top +plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ diff --git a/experiments/exps/perf_iso_latmsize/configs/bare_tas.py b/experiments/exps/perf_iso_latmsize/configs/bare_tas.py index fe57edde..b40c9f2f 100644 --- a/experiments/exps/perf_iso_latmsize/configs/bare_tas.py +++ b/experiments/exps/perf_iso_latmsize/configs/bare_tas.py @@ -28,17 +28,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=8) + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=4, max_flows=1024, max_bytes=4096, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=4, max_flows=1024, max_bytes=4096, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -64,21 +65,22 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=0, stack=self.cstack, ip=self.defaults.server_ip, port=1234, ncores=1, - msize=msize, mpending=64, nconns=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) client1_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=1, vmid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=1, - msize=msize, mpending=64, nconns=1, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) diff --git a/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py b/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py index 1cf332d9..57754525 100644 --- a/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py @@ -10,7 +10,7 @@ def __init__(self, exp_name, msize): self.defaults = Defaults() # Server Machine - self.sstack = 'bare-vtas' + self.sstack = 'bare-tas' self.snum = 2 self.snodenum = 1 self.s_tas_configs = [] @@ -26,22 +26,22 @@ def __init__(self, exp_name, msize): tas_config = TasConfig(pane=self.defaults.s_tas_pane, machine_config=self.s_machine_config, - project_dir=self.defaults.default_vtas_dir_bare, + project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=8) + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=0, vmid=0, groupid=0, - port=1234, ncores=4, max_flows=1024, max_bytes=4096, - bench_dir=self.defaults.default_vbenchmark_dir_bare, - tas_dir=self.defaults.default_vtas_dir_bare) + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=1, vmid=0, groupid=1, - port=1235, ncores=4, max_flows=1024, max_bytes=4096, - bench_dir=self.defaults.default_vbenchmark_dir_bare, - tas_dir=self.defaults.default_vtas_dir_bare) - + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) self.server_configs.append(server1_config) @@ -65,21 +65,22 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) + tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=0, groupid=0, stack=self.cstack, ip=self.defaults.server_ip, port=1234, ncores=1, - msize=msize, mpending=64, nconns=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_bare, tas_dir=self.defaults.default_vtas_dir_bare) client1_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=1, vmid=0, groupid=1, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=1, - msize=msize, mpending=64, nconns=1, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_bare, tas_dir=self.defaults.default_vtas_dir_bare) diff --git a/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py b/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py new file mode 100644 index 00000000..eafeb4d1 --- /dev/null +++ b/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py @@ -0,0 +1,96 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-linux' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_vbenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_vtas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py b/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py new file mode 100644 index 00000000..b87e3c04 --- /dev/null +++ b/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py @@ -0,0 +1,114 @@ +from configs.gen_config import Defaults +from configs.gen_config import MachineConfig +from configs.gen_config import TasConfig +from configs.gen_config import VMConfig +from configs.gen_config import ClientConfig +from configs.gen_config import ServerConfig + +class Config: + def __init__(self, exp_name, msize): + self.exp_name = exp_name + self.defaults = Defaults() + + # Server Machine + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 + self.s_tas_configs = [] + self.s_vm_configs = [] + self.s_proxyg_configs = [] + self.server_configs = [] + + self.s_machine_config = MachineConfig(ip=self.defaults.server_ip, + interface=self.defaults.server_interface, + stack=self.sstack, + is_remote=True, + is_server=True) + + tas_config = TasConfig(pane=self.defaults.s_tas_pane, + machine_config=self.s_machine_config, + project_dir=self.defaults.default_otas_dir_bare, + ip=self.s_machine_config.ip, + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' + self.s_tas_configs.append(tas_config) + + server0_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=0, vmid=0, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + server1_config = ServerConfig(pane=self.defaults.s_server_pane, + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) + self.server_configs.append(server0_config) + self.server_configs.append(server1_config) + + # Client Machine + self.cstack = 'ovs-tas' + self.cnum = 1 + self.cnodenum = 2 + self.c_tas_configs = [] + self.c_vm_configs = [] + self.c_proxyg_configs = [] + self.client_configs = [] + + self.c_machine_config = MachineConfig(ip=self.defaults.client_ip, + interface=self.defaults.client_interface, + stack=self.cstack, + is_remote=False, + is_server=False) + + + vm0_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=0) + tas0_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm0_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + + + vm1_config = VMConfig(pane=self.defaults.c_vm_pane, + machine_config=self.c_machine_config, + tas_dir=self.defaults.default_vtas_dir_bare, + tas_dir_virt=self.defaults.default_vtas_dir_virt, + idx=1) + tas1_config = TasConfig(pane=self.defaults.c_tas_pane, + machine_config=self.c_machine_config, + project_dir=self.defaults.default_otas_dir_virt, + ip=vm1_config.tas_tap_ip, + n_cores=1, dpdk_extra="00:04.0") + tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + + + self.c_tas_configs.append(tas0_config) + self.c_tas_configs.append(tas1_config) + self.c_vm_configs.append(vm0_config) + self.c_vm_configs.append(vm1_config) + + client0_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=0, stack=self.cstack, + ip=self.defaults.server_ip, port=1234, ncores=3, + msize=64, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + client1_config = ClientConfig(exp_name=exp_name, + pane=self.defaults.c_client_pane, + idx=0, vmid=1, stack=self.cstack, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, + open_delay=15, max_msgs_conn=0, max_pend_conns=1, + bench_dir=self.defaults.default_obenchmark_dir_virt, + tas_dir=self.defaults.default_otas_dir_virt) + + self.client_configs.append(client0_config) + self.client_configs.append(client1_config) \ No newline at end of file diff --git a/experiments/exps/perf_iso_latmsize/configs/virt_tas.py b/experiments/exps/perf_iso_latmsize/configs/virt_tas.py index b6861fdd..65d653f8 100644 --- a/experiments/exps/perf_iso_latmsize/configs/virt_tas.py +++ b/experiments/exps/perf_iso_latmsize/configs/virt_tas.py @@ -13,9 +13,9 @@ def __init__(self, exp_name, msize): self.defaults = Defaults() # Server Machine - self.sstack = 'virt-tas' - self.snum = 1 - self.snodenum = 2 + self.sstack = 'bare-tas' + self.snum = 2 + self.snodenum = 1 self.s_tas_configs = [] self.s_vm_configs = [] self.s_proxyg_configs = [] @@ -29,50 +29,22 @@ def __init__(self, exp_name, msize): tas_config = TasConfig(pane=self.defaults.s_tas_pane, machine_config=self.s_machine_config, - project_dir=self.defaults.default_vtas_dir_bare, + project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=8) + n_cores=12) + tas_config.args = tas_config.args + ' --shm-len=4294967296' self.s_tas_configs.append(tas_config) - self.s_proxyh_config = HostProxyConfig(pane=self.defaults.s_proxyh_pane, - machine_config=self.s_machine_config, - comp_dir=self.defaults.default_vtas_dir_bare) - - vm0_config = VMConfig(pane=self.defaults.s_vm_pane, - machine_config=self.s_machine_config, - tas_dir=self.defaults.default_vtas_dir_bare, - tas_dir_virt=self.defaults.default_vtas_dir_virt, - idx=0) - vm1_config = VMConfig(pane=self.defaults.s_vm_pane, - machine_config=self.s_machine_config, - tas_dir=self.defaults.default_vtas_dir_bare, - tas_dir_virt=self.defaults.default_vtas_dir_virt, - idx=1) - - self.s_vm_configs.append(vm0_config) - self.s_vm_configs.append(vm1_config) - - proxyg0_config = GuestProxyConfig(pane=self.defaults.s_proxyg_pane, - machine_config=self.s_machine_config, - comp_dir=self.defaults.default_vtas_dir_virt) - proxyg1_config = GuestProxyConfig(pane=self.defaults.s_proxyg_pane, - machine_config=self.s_machine_config, - comp_dir=self.defaults.default_vtas_dir_virt) - - self.s_proxyg_configs.append(proxyg0_config) - self.s_proxyg_configs.append(proxyg1_config) - server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=4, max_flows=1024, max_bytes=4096, - bench_dir=self.defaults.default_vbenchmark_dir_virt, - tas_dir=self.defaults.default_vtas_dir_virt) + port=1234, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, - idx=0, vmid=1, - port=1235, ncores=4, max_flows=1024, max_bytes=4096, - bench_dir=self.defaults.default_vbenchmark_dir_virt, - tas_dir=self.defaults.default_vtas_dir_virt) - + idx=1, vmid=0, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, + bench_dir=self.defaults.default_obenchmark_dir_bare, + tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) self.server_configs.append(server1_config) @@ -96,6 +68,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) + tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' self.c_tas_configs.append(tas_config) self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, @@ -130,15 +103,15 @@ def __init__(self, exp_name, msize): pane=self.defaults.c_client_pane, idx=0, vmid=0, stack=self.cstack, ip=self.defaults.server_ip, port=1234, ncores=1, - msize=msize, mpending=64, nconns=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_virt, tas_dir=self.defaults.default_vtas_dir_virt) client1_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=1, stack=self.cstack, - ip=self.defaults.server_ip, port=1235, ncores=1, - msize=msize, mpending=64, nconns=1, + ip=self.defaults.server_ip, port=1235, ncores=3, + msize=msize, mpending=64, nconns=128, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_virt, tas_dir=self.defaults.default_vtas_dir_virt) diff --git a/experiments/exps/perf_iso_latmsize/parse.py b/experiments/exps/perf_iso_latmsize/parse.py index 58112f79..d2749f1e 100644 --- a/experiments/exps/perf_iso_latmsize/parse.py +++ b/experiments/exps/perf_iso_latmsize/parse.py @@ -11,7 +11,7 @@ # from the experiment name, since client 0 and client 1 # have a different message size def get_msize(fname): - regex = "(?<=_msize)[0-9]*" + regex = "(?<=-msize)[0-9]*" nconns = re.search(regex, fname).group(0) return nconns @@ -82,7 +82,7 @@ def parse_data(parsed_md): return lat_list def save_dat_file(exp_lats): - header = "nconns bare-tas bare-vtas virt-tas\n" + header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" msizes = list(exp_lats.keys()) msizes = sorted(msizes) @@ -95,11 +95,13 @@ def save_dat_file(exp_lats): f.write(header) for msize in msizes: - f.write("{} {} {} {}\n".format( + f.write("{} {} {} {} {} {}\n".format( msize, exp_lats[msize]['bare-tas'][percentile], exp_lats[msize]['bare-vtas'][percentile], - exp_lats[msize]['virt-tas'][percentile]) + exp_lats[msize]['virt-tas'][percentile], + exp_lats[msize]['ovs-linux'][percentile], + exp_lats[msize]['ovs-tas'][percentile],) ) def main(): diff --git a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py index d0913570..2c9e4871 100644 --- a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py +++ b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py @@ -3,18 +3,24 @@ from exps.perf_iso_latmsize.configs.bare_tas import Config as TasBareConf from exps.perf_iso_latmsize.configs.bare_vtas import Config as VTasBareConf from exps.perf_iso_latmsize.configs.virt_tas import Config as TasVirtConf +from exps.perf_iso_latmsize.configs.ovs_linux import Config as OVSLinuxConf +from exps.perf_iso_latmsize.configs.ovs_tas import Config as OVSTasConf experiments = [] -msize = [64, 128, 256, 512, 1024, 2048, 4096] +msize = [64, 128, 256, 512, 1024, 2048] for n in msize: - exp_name = "perf-iso-latmsize_msize{}_".format(n) + exp_name = "perf-iso-latmsize-msize{}_".format(n) tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) + # experiments.append(tas_bare_exp) + # experiments.append(vtas_bare_exp) experiments.append(tas_virt_exp) + # experiments.append(ovs_tas_exp) + # experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latmsize/plot_script b/experiments/exps/perf_iso_latmsize/plot_script index 11c86971..46bdcd95 100644 --- a/experiments/exps/perf_iso_latmsize/plot_script +++ b/experiments/exps/perf_iso_latmsize/plot_script @@ -20,30 +20,30 @@ set title offset 0,-0.6 unset xtics set yrange [0:] set title "50p Latency" -plot 'lat_50p.dat' using 1:2 title 'bare-tas' linetype 2 w lp, \ - 'lat_50p.dat' using 1:3 title 'bare-vtas' linetype 3 w lp, \ - 'lat_50p.dat' using 1:4 title 'virt-tas' linetype 4 w lp, \ +plot 'lat_50p.dat' using 1:2 title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:3 title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:4 title 'virt-tas' linetype 4 ps 0.3 w lp, \ # Plot 90p latency unset xtics set yrange [0:] set title "90p Latency" -plot 'lat_90p.dat' using 1:2 title 'bare-tas' linetype 2 w lp, \ - 'lat_90p.dat' using 1:3 title 'bare-vtas' linetype 3 w lp, \ - 'lat_90p.dat' using 1:4 title 'virt-tas' linetype 4 w lp, \ +plot 'lat_90p.dat' using 1:2 title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:3 title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:4 title 'virt-tas' linetype 4 ps 0.3 w lp, \ # Plot 99p latency set xtics set yrange [0:] set title "99p Latency" -plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'lat_99p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ - 'lat_99p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ +plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ # Plot 99.9p latency set xtics set yrange [0:] set title "99.9p Latency" -plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ - 'lat_99.9p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ +plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ diff --git a/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py b/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py index ce0da0e5..9d771734 100644 --- a/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py @@ -34,12 +34,12 @@ def __init__(self, exp_name, nconns): server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, groupid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=1024, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, groupid=1, - port=1235, ncores=8, max_flows=4096, max_bytes=1024, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py b/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py index d16a7c4b..19545cd7 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py @@ -35,12 +35,12 @@ def __init__(self, exp_name, nconns): server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=1024, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=1024, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py index aafb081d..fe194204 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py @@ -35,12 +35,12 @@ def __init__(self, exp_name, nconns): server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=1024, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=1024, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_tpconn/configs/virt_tas.py b/experiments/exps/perf_iso_tpconn/configs/virt_tas.py index 36b06472..53c0d125 100644 --- a/experiments/exps/perf_iso_tpconn/configs/virt_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/virt_tas.py @@ -37,12 +37,12 @@ def __init__(self, exp_name, nconns): server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=1024, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=1024, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_tpconn/parse.py b/experiments/exps/perf_iso_tpconn/parse.py index 8a1dbe15..703c9e5c 100644 --- a/experiments/exps/perf_iso_tpconn/parse.py +++ b/experiments/exps/perf_iso_tpconn/parse.py @@ -10,7 +10,7 @@ # from the experiment name, since client 0 and client 1 # have a different number of connections def get_conns(fname): - regex = "(?<=_conns)[0-9]*" + regex = "(?<=-conns)[0-9]*" nconns = re.search(regex, fname).group(0) return nconns @@ -102,7 +102,7 @@ def save_dat_file(avg_tps, fname): header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" f.write(header) for tp in avg_tps: - f.write("{} {} {} {}\n".format( + f.write("{} {} {} {} {} {}\n".format( tp["nconns"], tp["bare-tas"], tp["bare-vtas"], diff --git a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py index e68f6e1e..fac2cb1d 100644 --- a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py +++ b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py @@ -11,16 +11,16 @@ n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] for n in n_conns: - exp_name = "perf-iso-tpconn_conns{}_".format(n) + exp_name = "perf-iso-tpconn-conns{}_".format(n) tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) - # experiments.append(tas_bare_exp) - # experiments.append(vtas_bare_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) experiments.append(tas_virt_exp) - # experiments.append(ovs_tas_exp) - # experiments.append(ovs_linux_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpconn/plot.pdf b/experiments/exps/perf_iso_tpconn/plot.pdf index 9720ac740a29a77fec1fa61c5d42a6b7ec38d52e..964aa0c37914bc5e48cf09c79c9ae9b244b33933 100644 G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!$xE(|F) z79*Bn7AiZaa4pD5pzxH735TFnXLO5Uh@rX@Db!ecP_5k;+ z(1ZPcZTz0=C0>)WoDI-FiijNXF0OFM3>=#Bg|FTa?7UV)6_?NKftD$J#O-|M&m+qP z>gMkxpq`};cU^vhx-u?GbB)(SEYl{}M~2^n^x9`1aIZU+skC0U3aJG6v&xs$ZQmm# zbB|#4yf?*udVfB|Af&n5^sbZH4;T89;Hu&NqiFoXc!*)h;m}|m^i_o8vQOX;!I1s3 z|8#2w# zIg+QScwr=TR5c|Pn-Qt8ApbW`rlw*1!p_^QPQwqGoJ9K@ft`(yn~jZ!k&QiBpU#Gv zjqe*TCmGxS3^FG&g#QKD*m>B#{XZNRA8+yn9W}u9jr+fIe4HFS|IM-Ua{NC!UT!YF z|JLzxf8+RXj*pG=|HEdKXQO<)T>n|f|GRlUKAz-OdSwJQc3uQ(YAF?Ig#Q6l CXb5Bg diff --git a/experiments/exps/perf_iso_tpconn/plot_script.plt b/experiments/exps/perf_iso_tpconn/plot_script.plt index eeebe830..324cac1b 100644 --- a/experiments/exps/perf_iso_tpconn/plot_script.plt +++ b/experiments/exps/perf_iso_tpconn/plot_script.plt @@ -7,13 +7,12 @@ set key left top set logscale x 2 set bmargin 4 -set key left bottom +set key top right set label 1 "Aggressor Client # Connections" at screen 0.5, 0.03 center set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 center -set yrange [0:] +set yrange [0:2000] plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'tp.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ - 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 4 w lp, \ - 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 4 w lp, \ + 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 w lp, \ + 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 w lp, \ diff --git a/experiments/exps/perf_iso_tpmsize/parse.py b/experiments/exps/perf_iso_tpmsize/parse.py index 0644f600..6c3d482f 100644 --- a/experiments/exps/perf_iso_tpmsize/parse.py +++ b/experiments/exps/perf_iso_tpmsize/parse.py @@ -10,7 +10,7 @@ # from the experiment name, since client 0 and client 1 # have different message sizes def get_msize(fname): - regex = "(?<=_msize)[0-9]*" + regex = "(?<=-msize)[0-9]*" msize = re.search(regex, fname).group(0) return msize @@ -102,7 +102,7 @@ def save_dat_file(avg_tps, fname): header = "msize bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" f.write(header) for tp in avg_tps: - f.write("{} {} {} {}\n".format( + f.write("{} {} {} {} {} {}\n".format( tp["msize"], tp["bare-tas"], tp["bare-vtas"], diff --git a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py index 76dce259..3cc45107 100644 --- a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py +++ b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py @@ -1,17 +1,18 @@ import experiments as exp -from exps.perf_iso_tpconn.configs.bare_tas import Config as TasBareConf -from exps.perf_iso_tpconn.configs.bare_vtas import Config as VTasBareConf -from exps.perf_iso_tpconn.configs.virt_tas import Config as TasVirtConf -from exps.perf_iso_tpconn.configs.ovs_linux import Config as OVSLinuxConf -from exps.perf_iso_tpconn.configs.ovs_tas import Config as OVSTasConf +from exps.perf_iso_tpmsize.configs.bare_tas import Config as TasBareConf +from exps.perf_iso_tpmsize.configs.bare_vtas import Config as VTasBareConf +from exps.perf_iso_tpmsize.configs.virt_tas import Config as TasVirtConf +from exps.perf_iso_tpmsize.configs.ovs_linux import Config as OVSLinuxConf +from exps.perf_iso_tpmsize.configs.ovs_tas import Config as OVSTasConf experiments = [] -msize = [64, 128, 256, 512, 1024, 2048] +# msize = [64, 128, 256, 512, 1024, 2048] +msize = [2048] for n in msize: - exp_name = "perf-iso-tpconn_msize{}_".format(n) + exp_name = "perf-iso-tpconn-msize{}_".format(n) tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) @@ -19,8 +20,8 @@ ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) - experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + # experiments.append(vtas_bare_exp) + # experiments.append(tas_virt_exp) + # experiments.append(ovs_tas_exp) + # experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpmsize/plot_script.plt b/experiments/exps/perf_iso_tpmsize/plot_script.plt index 3f0b151c..7caa7cd8 100644 --- a/experiments/exps/perf_iso_tpmsize/plot_script.plt +++ b/experiments/exps/perf_iso_tpmsize/plot_script.plt @@ -7,13 +7,12 @@ set key left top set logscale x 2 set bmargin 4 -set key left bottom +set key top right set label 1 "Aggressor Client Message Size" at screen 0.5, 0.03 center set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 center -set yrange [0:] +set yrange [0:2000] plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'tp.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 w lp, \ 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ - 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 4 w lp, \ - 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 4 w lp, \ + 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 w lp, \ + 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 w lp, \ diff --git a/images/start-vm.sh b/images/start-vm.sh index 3ef9fc72..4ea361e4 100755 --- a/images/start-vm.sh +++ b/images/start-vm.sh @@ -30,8 +30,7 @@ if [[ "$stack" == 'virt-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 12G \ - -snapshot \ + -m 25G \ -device virtio-net-pci,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp::222${vm_id}-:22 \ -chardev socket,path="/run/tasproxy",id="tas" \ @@ -45,7 +44,7 @@ elif [[ "$stack" == 'virt-linux' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 12G \ + -m 25G \ -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ @@ -60,7 +59,7 @@ elif [[ "$stack" == 'ovs-linux' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 12G \ + -m 25G \ -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ @@ -75,7 +74,7 @@ elif [[ "$stack" == 'ovs-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 12G \ + -m 25G \ -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ @@ -92,7 +91,7 @@ elif [[ "$stack" == 'tap-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 12G \ + -m 25G \ -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ From 43515faa108aeb5f650a78ab2f2728176ded4f29 Mon Sep 17 00:00:00 2001 From: stolet Date: Fri, 31 Mar 2023 11:22:17 +0200 Subject: [PATCH 27/50] batch pokes --- proxy/guest/flextcp.c | 4 ++-- proxy/host/ivshmem.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/guest/flextcp.c b/proxy/guest/flextcp.c index 157ef943..8529f0bd 100644 --- a/proxy/guest/flextcp.c +++ b/proxy/guest/flextcp.c @@ -519,9 +519,9 @@ static int vflextcp_uxsocket_handle_msg(struct guest_proxy *pxy, static int vflextcp_tas_poke_poll(struct guest_proxy *pxy) { int n, i; struct poke_event *poke_ev; - struct epoll_event evs[32]; + struct epoll_event evs[2]; - n = epoll_wait(pxy->epfd, evs, 32, 0); + n = epoll_wait(pxy->epfd, evs, 2, 0); if (n < 0) { perror("vflextcp_tas_poke_poll: epoll_wait"); diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index db506c04..7945a99b 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -657,10 +657,10 @@ static int ctxs_poll() int i, n, ret; struct vmcontext_req *vctx; struct _msg; - struct epoll_event evs[32]; + struct epoll_event evs[2]; struct poke_app_ctx_msg msg; - n = epoll_wait(ctx_epfd, evs, 32, 0); + n = epoll_wait(ctx_epfd, evs, 2, 0); if (n < 0) { From fe07992c82e45aae7318f5a6a10281769d91f26c Mon Sep 17 00:00:00 2001 From: stolet Date: Fri, 31 Mar 2023 11:24:31 +0200 Subject: [PATCH 28/50] flush output to log at each print --- experiments/components/client.py | 19 ++++++--- experiments/components/tas.py | 6 ++- .../exps/perf_iso_latconn/perf_iso_latconn.py | 8 ++-- experiments/exps/perf_iso_latmsize/parse.py | 10 +++-- .../perf_iso_latmsize/perf_iso_latmsize.py | 8 ++-- experiments/exps/perf_iso_latmsize/plot.pdf | Bin 12420 -> 0 bytes .../exps/perf_iso_latmsize/plot_script | 37 +++++++++++++----- .../exps/perf_iso_tpmsize/perf_iso_tpmsize.py | 11 +++--- experiments/run.py | 2 +- experiments/run_perf_iso.sh | 1 + images/start-vm.sh | 1 + 11 files changed, 69 insertions(+), 34 deletions(-) delete mode 100644 experiments/exps/perf_iso_latmsize/plot.pdf diff --git a/experiments/components/client.py b/experiments/components/client.py index d4cdbd78..1848757e 100644 --- a/experiments/components/client.py +++ b/experiments/components/client.py @@ -33,11 +33,10 @@ def run_benchmark_rpc(self, w_sudo, ld_preload): self.pane.send_keys("cd " + self.client_config.tas_dir) time.sleep(3) - cmd = '' - stack = self.machine_config.stack + cmd = 'stdbuf -oL ' if w_sudo: - cmd = 'sudo ' + cmd += 'sudo ' if ld_preload: cmd += 'LD_PRELOAD=' + self.client_config.lib_so + ' ' @@ -51,6 +50,14 @@ def run_benchmark_rpc(self, w_sudo, ld_preload): self.pane.send_keys(cmd) def save_log_virt(self, exp_path): + # kill process to force flush to file + # ssh_com = utils.get_ssh_command(self.machine_config, self.vm_config) + # ssh_com += " 'sudo pkill testclient'" + # self.save_logs_pane.send_keys(ssh_com) + # time.sleep(3) + # self.save_logs_pane.send_keys(suppress_history=False, cmd='tas') + # time.sleep(1) + split_path = exp_path.split("/") n = len(split_path) @@ -75,6 +82,9 @@ def save_log_virt(self, exp_path): time.sleep(1) def save_log_bare(self, exp_path): + # kill process to force flush to file + # self.save_logs_pane.send_keys("sudo pkill testclient") + # self.exp_path is set in the run.py file split_path = exp_path.split("/") n = len(split_path) @@ -84,5 +94,4 @@ def save_log_bare(self, exp_path): os.makedirs(out_dir) dest = out_dir + "/" + self.client_config.out_file - os.rename(self.client_config.out, dest) - os.remove(self.client_config.out) \ No newline at end of file + os.rename(self.client_config.out, dest) \ No newline at end of file diff --git a/experiments/components/tas.py b/experiments/components/tas.py index 834a8a1c..00cc0ce7 100644 --- a/experiments/components/tas.py +++ b/experiments/components/tas.py @@ -41,6 +41,9 @@ def run_virt(self): save_log=True) def save_log_bare(self, exp_path): + # # kill process to force flush to file + # self.pane.send_keys("sudo pkill tas") + split_path = exp_path.split("/") n = len(split_path) @@ -49,5 +52,4 @@ def save_log_bare(self, exp_path): os.makedirs(out_dir) dest = out_dir + "/" + self.tas_config.out_file - os.rename(self.tas_config.out, dest) - os.remove(self.client_config.out) \ No newline at end of file + os.rename(self.tas_config.out, dest) \ No newline at end of file diff --git a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py index d1291b9c..cbfb6c7b 100644 --- a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py +++ b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py @@ -19,8 +19,8 @@ ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) experiments.append(tas_bare_exp) - # experiments.append(vtas_bare_exp) - # experiments.append(tas_virt_exp) - # experiments.append(ovs_tas_exp) - # experiments.append(ovs_linux_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latmsize/parse.py b/experiments/exps/perf_iso_latmsize/parse.py index d2749f1e..d73d36da 100644 --- a/experiments/exps/perf_iso_latmsize/parse.py +++ b/experiments/exps/perf_iso_latmsize/parse.py @@ -12,8 +12,8 @@ # have a different message size def get_msize(fname): regex = "(?<=-msize)[0-9]*" - nconns = re.search(regex, fname).group(0) - return nconns + msize = re.search(regex, fname).group(0) + return msize def check_msize(data, msize): if msize not in data: @@ -53,6 +53,10 @@ def parse_metadata(): for f in os.listdir(dir_path): fname = os.fsdecode(f) + + if "tas_c" == fname: + continue + msize = get_msize(fname) cid = putils.get_client_id(fname) nid = putils.get_node_id(fname) @@ -85,7 +89,7 @@ def save_dat_file(exp_lats): header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" msizes = list(exp_lats.keys()) - msizes = sorted(msizes) + msizes = list(map(str, sorted(map(int, msizes)))) stacks = list(exp_lats[msizes[0]].keys()) percentiles = list(exp_lats[msizes[0]][stacks[0]].keys()) diff --git a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py index 2c9e4871..12f95188 100644 --- a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py +++ b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py @@ -18,9 +18,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) - # experiments.append(tas_bare_exp) - # experiments.append(vtas_bare_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) experiments.append(tas_virt_exp) - # experiments.append(ovs_tas_exp) - # experiments.append(ovs_linux_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latmsize/plot.pdf b/experiments/exps/perf_iso_latmsize/plot.pdf deleted file mode 100644 index 8b27073f3f66aca9a950d6eebf661b6aace5ba6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12420 zcmcJWby!qg)aVrn0SPIQ9FUOip#&tQLAqgp0fvsD2c)}Gq&uZUx&@?^ZjcV?kme5h z=J$U0dG0^=9A?hhYp;FQ*=wzRo(1OzwW62=6B{!Z8gXf7%9$#OO%+&BUI z#|)P*NxKfNR^B6qBKfRF>4I3CFhjB*qb>iCz^UxLy##X?7xg7kgg&AZBn-gd9;~~9 zI7OEvQWuM_>vPlJWyb3Z!d_i_MrqFq-L}B&XcGfBeDSO=Y^-l+?rzr(_5#Jx>aU@! zl+24vtt{p{dba~^D-J(b{T$3MK55XYNW0wZ91X8sbq0$eQJ2UyN?!ncEL8osw?G%$ zXV~bDI@M3xQSet{vTWP^3le4{16e#(maVnfTGg=fbAe_EZTeGaZM9^f2?+mMnndcKutN!>QKrCG@{by zW=apC*@hX-I2E`g=Jq)spS6%dKAB`lA$<)G@vfCRAClbZiw3H_$8$FOOAHjAB0E`? zv|x(+nDPCCHx2%4ZhB-b{!G5_AeuKsWcf!LxsCzPLC4OX4dk!%h`y(e)2+r&K6Z5) zThR5mI5>cQJRQF|K5k7VAh`(SWOnX-S>2TcRHTV@^g5-5ZPM#g)Lso=BHgn|-~#cUK3dE#vOHqzfU6qBt{DTXJMN zPf<_4^xb7ZNpp!~6Q8oAYFk%Fxppws39a?qxTxzbt*`C5HtzF%pp=S-k#&-+eBK&+ zKATf_VK~9`^4-j}OKZTPTVJ>64Am*;CLN3sO`j}A{gV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ohYwi+}DMym0UY{`tM%BPhRhfE+-;|I6pkk-v{X9!>y|2R@Sb{t5E$or{Yb zzylB9-%=pQJ=+4OY2c&&mi~PPWMhZl11Ers^ZvmDWV>g4eve`2{ymTTBQH1HCI<(+ zpY4xcPWTxYJYP6?@2zq1-skP_BNzMsZs~8E|9{TzJ^2gkf#W$gs@9NuvKw$esedNa zf0x%iKJl=qY<1Ye`y4Q*xLZunAw2L ztbmthP^hf~9}Apxf=f;9LAGWPBL`+1dsDjKOHdTfnnNKr)?)XR)Jriwc2;%{_~PS+ zuO3!5P6k#sT2@xNe;WN8vHFvG5(UB6q>bsX)cZAsKbWV#Nhue5un8I~fQ=K4^{)*8 z1Mao|A>-tL2kqZ7R@VDu`L~RnlNFvc|B|t> zv9teIj~kw-|3ipyyIJUno>{d+7sy!p2bY7c@x zb?krrpMWyN4Sesb`^T%2jSW2Lzxk~Dwv@FAJhs2`;x}RivWNciE*m>57Y7 Date: Fri, 31 Mar 2023 17:11:01 +0200 Subject: [PATCH 29/50] Set mutex type to normal instead of default --- proxy/guest/flextcp.c | 3 +-- proxy/host/ivshmem.c | 7 +++---- proxy/shmring.c | 10 +++++++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/proxy/guest/flextcp.c b/proxy/guest/flextcp.c index 8529f0bd..975aa6e5 100644 --- a/proxy/guest/flextcp.c +++ b/proxy/guest/flextcp.c @@ -338,8 +338,7 @@ static int vflextcp_uxsocket_accept(struct guest_proxy *pxy) "failed to write req_msg to chan.\n"); return -1; } - /* Notify host and retrieve response from channel to continue - registration */ + /* Notify host */ ivshmem_notify_host(pxy); return 0; diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 7945a99b..68a503ae 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -42,7 +42,7 @@ static int uxsocket_handle_error(); static int uxsocket_send_int(int fd, int64_t i); static int uxsocket_sendfd(int uxfd, int fd, int64_t i); -static int ctxs_poll(); +static int app_ctxs_poll(); static int channel_poll(); static int channel_poll_vm(struct v_machine *vm); @@ -130,7 +130,7 @@ int ivshmem_poll() return -1; } - if (ctxs_poll() != 0) + if (app_ctxs_poll() != 0) { fprintf(stderr, "ivshmem_poll: failed to poll ctxs fds.\n"); return -1; @@ -629,7 +629,6 @@ static int channel_handle_newapp(struct v_machine *vm, notify_guest(vm->ifd); - return 0; } @@ -652,7 +651,7 @@ static void channel_handle_poke_tas_core(struct v_machine *vm, /*****************************************************************************/ /* App contexts */ -static int ctxs_poll() +static int app_ctxs_poll() { int i, n, ret; struct vmcontext_req *vctx; diff --git a/proxy/shmring.c b/proxy/shmring.c index c5167581..5543c8c1 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -358,7 +358,15 @@ pthread_mutexattr_t * init_mutex_attr() { fprintf(stderr, "init_mutex_attr: failed to set attr to shared.\n"); goto free_attr; - }; + } + + // Set mutex to normal type. Default type may have underfined behaviour + // when relocking + if (pthread_mutexattr_settype(attr, PTHREAD_MUTEX_NORMAL) < 0) + { + fprintf(stderr, "init_mutex_attr: failed to set mutex type to normal.\n"); + goto free_attr; + } // Subsequent attempts to lock will succeed if process dies with lock if (pthread_mutexattr_setrobust(attr, PTHREAD_MUTEX_ROBUST) < 0) From 5233bcc5315ea285b71f61df063eabf1f042b85e Mon Sep 17 00:00:00 2001 From: stolet Date: Fri, 31 Mar 2023 18:12:43 +0200 Subject: [PATCH 30/50] only initialize mutex on tx ring in each side --- proxy/channel.c | 2 -- proxy/shmring.c | 28 ++++++++++++---------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/proxy/channel.c b/proxy/channel.c index d78b400e..fb9022ea 100644 --- a/proxy/channel.c +++ b/proxy/channel.c @@ -18,8 +18,6 @@ struct channel * channel_init(void* tx_addr, void* rx_addr, uint64_t size) goto free_chan; } - /* Only init the tx channel, since the other side will - already have initialized the rx channel */ tx_buf = shmring_init(tx_addr, CHAN_SIZE); if (tx_buf == NULL) { diff --git a/proxy/shmring.c b/proxy/shmring.c index 5543c8c1..e5b851f1 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -16,8 +16,6 @@ pthread_mutexattr_t * init_mutex_attr(); struct ring_buffer* shmring_init(void *base_addr, size_t size) { struct ring_buffer *ring; - struct ring_header *hdr; - pthread_mutexattr_t *attr; ring = (struct ring_buffer *) malloc(sizeof(struct ring_buffer)); if (ring == NULL) @@ -30,31 +28,29 @@ struct ring_buffer* shmring_init(void *base_addr, size_t size) ring->buf_addr = base_addr + sizeof(struct ring_header); ring->size = size; + return ring; +} + +/* Resets read and write pos to zero and sets ring size to full */ +void shmring_reset(struct ring_buffer *ring, size_t size) +{ + pthread_mutexattr_t *attr; + struct ring_header *hdr = ring->hdr_addr; + if ((attr = init_mutex_attr()) == NULL) { fprintf(stderr, "shmring_init: failed to init mutex attr.\n"); - return NULL; + return; } hdr = ring->hdr_addr; if (pthread_mutex_init(&hdr->mux, attr) < 0) { fprintf(stderr, "shmring_init: failed to init mutex.\n"); - goto free_attr; + free(attr); + return; } - return ring; - -free_attr: - free(attr); - return NULL; -} - -/* Resets read and write pos to zero and sets ring size to full */ -void shmring_reset(struct ring_buffer *ring, size_t size) -{ - struct ring_header *hdr = ring->hdr_addr; - hdr->read_pos = 0; hdr->write_pos = 0; hdr->full = 0; From 158a1883b82ebdaa7633d498ba8ff9a81f4d1151 Mon Sep 17 00:00:00 2001 From: stolet Date: Sat, 1 Apr 2023 17:56:06 +0200 Subject: [PATCH 31/50] do all channel initialization that involves writing to shm in host proxy --- proxy/channel.c | 4 --- proxy/host/ivshmem.c | 7 +++++ proxy/shmring.c | 75 ++++++++++++++++++++++++-------------------- proxy/shmring.h | 1 + 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/proxy/channel.c b/proxy/channel.c index fb9022ea..e0f35789 100644 --- a/proxy/channel.c +++ b/proxy/channel.c @@ -32,10 +32,6 @@ struct channel * channel_init(void* tx_addr, void* rx_addr, uint64_t size) goto free_tx_buf; } - /* Only reset tx_ring since other side will have already - reset the rx_ring */ - shmring_reset(tx_buf, CHAN_SIZE); - chan->tx = tx_buf; chan->rx = rx_buf; return chan; diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 68a503ae..60b43917 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -370,6 +370,12 @@ static int uxsocket_accept() goto close_ifd; } + shmring_reset(chan->tx, CHAN_SIZE); + shmring_reset(chan->rx, CHAN_SIZE); + + shmring_init_mux(chan->tx); + shmring_init_mux(chan->rx); + /* Write number of cores to channel for guest proxy to receive */ h_msg.msg_type = MSG_TYPE_HELLO; h_msg.n_cores = flexnic_info_pxy->cores_num; @@ -629,6 +635,7 @@ static int channel_handle_newapp(struct v_machine *vm, notify_guest(vm->ifd); + printf("REGISTERED APP IN VM=%d\n", vm->id); return 0; } diff --git a/proxy/shmring.c b/proxy/shmring.c index e5b851f1..5f7c2484 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -15,46 +15,31 @@ pthread_mutexattr_t * init_mutex_attr(); struct ring_buffer* shmring_init(void *base_addr, size_t size) { - struct ring_buffer *ring; + struct ring_buffer *ring; - ring = (struct ring_buffer *) malloc(sizeof(struct ring_buffer)); - if (ring == NULL) - { - fprintf(stderr, "shmring_init: failed to allocate ring buffer.\n"); - return NULL; - } + ring = (struct ring_buffer *) malloc(sizeof(struct ring_buffer)); + if (ring == NULL) + { + fprintf(stderr, "shmring_init: failed to allocate ring buffer.\n"); + return NULL; + } - ring->hdr_addr = base_addr; - ring->buf_addr = base_addr + sizeof(struct ring_header); - ring->size = size; + ring->hdr_addr = base_addr; + ring->buf_addr = base_addr + sizeof(struct ring_header); + ring->size = size; - return ring; + return ring; } /* Resets read and write pos to zero and sets ring size to full */ void shmring_reset(struct ring_buffer *ring, size_t size) { - pthread_mutexattr_t *attr; - struct ring_header *hdr = ring->hdr_addr; - - if ((attr = init_mutex_attr()) == NULL) - { - fprintf(stderr, "shmring_init: failed to init mutex attr.\n"); - return; - } - - hdr = ring->hdr_addr; - if (pthread_mutex_init(&hdr->mux, attr) < 0) - { - fprintf(stderr, "shmring_init: failed to init mutex.\n"); - free(attr); - return; - } - - hdr->read_pos = 0; - hdr->write_pos = 0; - hdr->full = 0; - hdr->ring_size = size - sizeof(struct ring_header); + struct ring_header *hdr = ring->hdr_addr; + + hdr->read_pos = 0; + hdr->write_pos = 0; + hdr->full = 0; + hdr->ring_size = size - sizeof(struct ring_header); } int shmring_is_empty(struct ring_buffer *ring) @@ -69,6 +54,28 @@ int shmring_is_empty(struct ring_buffer *ring) return 0; } +int shmring_init_mux(struct ring_buffer *ring) +{ + struct ring_header *hdr = ring->hdr_addr; + pthread_mutexattr_t *attr; + + if ((attr = init_mutex_attr()) == NULL) + { + fprintf(stderr, "shmring_init: failed to init mutex attr.\n"); + return -1; + } + + hdr = ring->hdr_addr; + if (pthread_mutex_init(&hdr->mux, attr) < 0) + { + fprintf(stderr, "shmring_init: failed to init mutex.\n"); + free(attr); + return -1; + } + + return 0; +} + int shmring_lock(struct ring_buffer *ring) { struct ring_header *hdr = ring->hdr_addr; @@ -356,8 +363,8 @@ pthread_mutexattr_t * init_mutex_attr() goto free_attr; } - // Set mutex to normal type. Default type may have underfined behaviour - // when relocking + /* Set mutex to normal type. Default type may have + underfined behaviour when relocking */ if (pthread_mutexattr_settype(attr, PTHREAD_MUTEX_NORMAL) < 0) { fprintf(stderr, "init_mutex_attr: failed to set mutex type to normal.\n"); diff --git a/proxy/shmring.h b/proxy/shmring.h index 3be15033..0916c154 100644 --- a/proxy/shmring.h +++ b/proxy/shmring.h @@ -21,6 +21,7 @@ struct ring_buffer { struct ring_buffer* shmring_init(void *base_addr, size_t size); void shmring_reset(struct ring_buffer *ring, size_t size); int shmring_is_empty(struct ring_buffer *ring); +int shmring_init_mux(struct ring_buffer *ring); int shmring_lock(struct ring_buffer *ring); int shmring_unlock(struct ring_buffer *ring); size_t shmring_pop(struct ring_buffer *rx_ring, void *buf, size_t size); From acf718f51edfb6bbcaac37438009d5d01ac75b12 Mon Sep 17 00:00:00 2001 From: stolet Date: Sun, 2 Apr 2023 00:19:40 +0200 Subject: [PATCH 32/50] read more than one message --- proxy/channel.c | 15 +++------------ proxy/guest/flextcp.c | 4 ++-- proxy/guest/guest.c | 13 +++++++++++-- proxy/guest/ivshmem.c | 2 +- proxy/host/ivshmem.c | 15 ++++++++++----- proxy/proxy.h | 2 ++ 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/proxy/channel.c b/proxy/channel.c index e0f35789..fc56c135 100644 --- a/proxy/channel.c +++ b/proxy/channel.c @@ -47,20 +47,11 @@ struct channel * channel_init(void* tx_addr, void* rx_addr, uint64_t size) size_t channel_write(struct channel *chan, void *buf, size_t size) { - size_t free_sz; size_t ret; - /* If channel is full try again until - a read clears enough space */ - do { - shmring_lock(chan->tx); - free_sz = shmring_get_freesz(chan->tx); - - if (free_sz >= size) - ret = shmring_push(chan->tx, buf, size); - - shmring_unlock(chan->tx); - } while(free_sz < size); + shmring_lock(chan->tx); + ret = shmring_push(chan->tx, buf, size); + shmring_unlock(chan->tx); if (ret == 0) { diff --git a/proxy/guest/flextcp.c b/proxy/guest/flextcp.c index 975aa6e5..70851560 100644 --- a/proxy/guest/flextcp.c +++ b/proxy/guest/flextcp.c @@ -518,9 +518,9 @@ static int vflextcp_uxsocket_handle_msg(struct guest_proxy *pxy, static int vflextcp_tas_poke_poll(struct guest_proxy *pxy) { int n, i; struct poke_event *poke_ev; - struct epoll_event evs[2]; + struct epoll_event evs[1]; - n = epoll_wait(pxy->epfd, evs, 2, 0); + n = epoll_wait(pxy->epfd, evs, 1, 0); if (n < 0) { perror("vflextcp_tas_poke_poll: epoll_wait"); diff --git a/proxy/guest/guest.c b/proxy/guest/guest.c index bc80f042..7d9e1444 100644 --- a/proxy/guest/guest.c +++ b/proxy/guest/guest.c @@ -50,7 +50,8 @@ struct guest_proxy *guest_init_proxy() int main(int argc, char *argv[]) { - unsigned int n; + int ret; + unsigned int n, i; struct guest_proxy *pxy = guest_init_proxy(); if (ivshmem_init(pxy) < 0) @@ -69,7 +70,15 @@ int main(int argc, char *argv[]) while (exited == 0) { n = 0; - n += ivshmem_channel_poll(pxy); + + for (i = 0; i < CHANNEL_POLL_ROUNDS; i++) + { + ret = ivshmem_channel_poll(pxy); + n += ret; + if (ret == 0) + break; + } + n += vflextcp_poll(pxy); } diff --git a/proxy/guest/ivshmem.c b/proxy/guest/ivshmem.c index 6a8404c9..eaed6a23 100644 --- a/proxy/guest/ivshmem.c +++ b/proxy/guest/ivshmem.c @@ -125,7 +125,7 @@ int ivshmem_channel_poll(struct guest_proxy *pxy) fprintf(stderr, "ivshmem_channel_poll: unknown message.\n"); } - return 0; + return 1; } static int channel_handle_hello(struct guest_proxy *pxy) diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 60b43917..7576c532 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -426,7 +426,7 @@ static int uxsocket_handle_error() static int channel_poll() { - int i; + int i, j, ret; struct v_machine *vm; for(i = 0; i < next_vm_id; i++) @@ -434,7 +434,12 @@ static int channel_poll() vm = &vms[i]; if (vm != NULL) { - channel_poll_vm(vm); + for (j = 0; j < CHANNEL_POLL_ROUNDS; j++) + { + ret = channel_poll_vm(vm); + if (ret == 0) + break; + } } } @@ -489,7 +494,7 @@ static int channel_poll_vm(struct v_machine *vm) fprintf(stderr, "ivshmem_uxsocket_handle_msg: unknown message.\n"); } - return 0; + return 1; } /* Handles tasinfo request */ @@ -663,10 +668,10 @@ static int app_ctxs_poll() int i, n, ret; struct vmcontext_req *vctx; struct _msg; - struct epoll_event evs[2]; + struct epoll_event evs[1]; struct poke_app_ctx_msg msg; - n = epoll_wait(ctx_epfd, evs, 2, 0); + n = epoll_wait(ctx_epfd, evs, 1, 0); if (n < 0) { diff --git a/proxy/proxy.h b/proxy/proxy.h index be554a88..23bf486f 100644 --- a/proxy/proxy.h +++ b/proxy/proxy.h @@ -8,6 +8,8 @@ #define HOST_PEERID 255 +#define CHANNEL_POLL_ROUNDS 10 + struct proxy_context_req { int actx_evfd; int ctxreq_id; From 40a277380a9d6d429e051cf88978d6af2f924a20 Mon Sep 17 00:00:00 2001 From: stolet Date: Sun, 2 Apr 2023 12:23:48 +0200 Subject: [PATCH 33/50] mark values in ring as volatile --- proxy/shmring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/shmring.h b/proxy/shmring.h index 0916c154..b99c91b9 100644 --- a/proxy/shmring.h +++ b/proxy/shmring.h @@ -5,10 +5,10 @@ #include struct ring_header { - int write_pos; - int read_pos; - int full; - size_t ring_size; + volatile int write_pos; + volatile int read_pos; + volatile int full; + volatile size_t ring_size; pthread_mutex_t mux; } __attribute__((packed)); From 5c3fc38ee1b9d537170f550ff26ebb25ebbde1aa Mon Sep 17 00:00:00 2001 From: stolet Date: Sun, 2 Apr 2023 13:16:58 +0200 Subject: [PATCH 34/50] mark channel as not pull after every pop and go back to waiting to write until there is free space --- proxy/channel.c | 14 ++++++++++---- proxy/guest/flextcp.c | 4 ++-- proxy/guest/guest.c | 13 ++----------- proxy/host/ivshmem.c | 18 +++++++++--------- proxy/proxy.h | 2 -- proxy/shmring.c | 14 ++------------ proxy/shmring.h | 8 ++++---- 7 files changed, 29 insertions(+), 44 deletions(-) diff --git a/proxy/channel.c b/proxy/channel.c index fc56c135..072b5c90 100644 --- a/proxy/channel.c +++ b/proxy/channel.c @@ -47,11 +47,17 @@ struct channel * channel_init(void* tx_addr, void* rx_addr, uint64_t size) size_t channel_write(struct channel *chan, void *buf, size_t size) { - size_t ret; + size_t ret, free_sz; + + do { + shmring_lock(chan->tx); + free_sz = shmring_get_freesz(chan->tx); - shmring_lock(chan->tx); - ret = shmring_push(chan->tx, buf, size); - shmring_unlock(chan->tx); + if (free_sz >= size) + ret = shmring_push(chan->tx, buf, size); + + shmring_unlock(chan->tx); + } while(free_sz < size); if (ret == 0) { diff --git a/proxy/guest/flextcp.c b/proxy/guest/flextcp.c index 70851560..975aa6e5 100644 --- a/proxy/guest/flextcp.c +++ b/proxy/guest/flextcp.c @@ -518,9 +518,9 @@ static int vflextcp_uxsocket_handle_msg(struct guest_proxy *pxy, static int vflextcp_tas_poke_poll(struct guest_proxy *pxy) { int n, i; struct poke_event *poke_ev; - struct epoll_event evs[1]; + struct epoll_event evs[2]; - n = epoll_wait(pxy->epfd, evs, 1, 0); + n = epoll_wait(pxy->epfd, evs, 2, 0); if (n < 0) { perror("vflextcp_tas_poke_poll: epoll_wait"); diff --git a/proxy/guest/guest.c b/proxy/guest/guest.c index 7d9e1444..bc80f042 100644 --- a/proxy/guest/guest.c +++ b/proxy/guest/guest.c @@ -50,8 +50,7 @@ struct guest_proxy *guest_init_proxy() int main(int argc, char *argv[]) { - int ret; - unsigned int n, i; + unsigned int n; struct guest_proxy *pxy = guest_init_proxy(); if (ivshmem_init(pxy) < 0) @@ -70,15 +69,7 @@ int main(int argc, char *argv[]) while (exited == 0) { n = 0; - - for (i = 0; i < CHANNEL_POLL_ROUNDS; i++) - { - ret = ivshmem_channel_poll(pxy); - n += ret; - if (ret == 0) - break; - } - + n += ivshmem_channel_poll(pxy); n += vflextcp_poll(pxy); } diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 7576c532..fe63c623 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -426,7 +426,7 @@ static int uxsocket_handle_error() static int channel_poll() { - int i, j, ret; + int i; struct v_machine *vm; for(i = 0; i < next_vm_id; i++) @@ -434,12 +434,7 @@ static int channel_poll() vm = &vms[i]; if (vm != NULL) { - for (j = 0; j < CHANNEL_POLL_ROUNDS; j++) - { - ret = channel_poll_vm(vm); - if (ret == 0) - break; - } + channel_poll_vm(vm); } } @@ -476,18 +471,23 @@ static int channel_poll_vm(struct v_machine *vm) switch(msg_type) { case MSG_TYPE_TASINFO_REQ: + printf("MSG_TYPE_TASINFO_REQ\n"); channel_handle_tasinforeq_msg(vm); break; case MSG_TYPE_CONTEXT_REQ: + printf("MSG_TYPE_CONTEXT_REQ\n"); channel_handle_ctx_req(vm, msg); break; case MSG_TYPE_NEWAPP_REQ: + printf("MSG_TYPE_NEWAPP_REQ\n"); channel_handle_newapp(vm, msg); break; case MSG_TYPE_POKE_TAS_CORE: + printf("MSG_TYPE_POKE_TAS_CORE\n"); channel_handle_poke_tas_core(vm, msg); break; case MSG_TYPE_POKE_TAS_KERNEL: + printf("MSG_TYPE_POKE_TAS_KERNEL\n"); channel_handle_poke_tas_kernel(vm, msg); break; default: @@ -668,10 +668,10 @@ static int app_ctxs_poll() int i, n, ret; struct vmcontext_req *vctx; struct _msg; - struct epoll_event evs[1]; + struct epoll_event evs[2]; struct poke_app_ctx_msg msg; - n = epoll_wait(ctx_epfd, evs, 1, 0); + n = epoll_wait(ctx_epfd, evs, 2, 0); if (n < 0) { diff --git a/proxy/proxy.h b/proxy/proxy.h index 23bf486f..be554a88 100644 --- a/proxy/proxy.h +++ b/proxy/proxy.h @@ -8,8 +8,6 @@ #define HOST_PEERID 255 -#define CHANNEL_POLL_ROUNDS 10 - struct proxy_context_req { int actx_evfd; int ctxreq_id; diff --git a/proxy/shmring.c b/proxy/shmring.c index 5f7c2484..10c6960d 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -132,12 +132,7 @@ size_t shmring_pop(struct ring_buffer *rx_ring, void *dst, size_t size) hdr->read_pos += size; hdr->read_pos %= hdr->ring_size; - - /* Mark the ring as not full */ - if (hdr->write_pos != hdr->read_pos) - { - hdr->full = 0; - } + hdr->full = 0; return size; } @@ -171,12 +166,7 @@ size_t pop_fragmented(struct ring_buffer *rx_ring, hdr->read_pos += size; hdr->read_pos %= hdr->ring_size; - - /* Mark the ring as not full */ - if (hdr->write_pos != hdr->read_pos) - { - hdr->full = 0; - } + hdr->full = 0; return size; } diff --git a/proxy/shmring.h b/proxy/shmring.h index b99c91b9..0916c154 100644 --- a/proxy/shmring.h +++ b/proxy/shmring.h @@ -5,10 +5,10 @@ #include struct ring_header { - volatile int write_pos; - volatile int read_pos; - volatile int full; - volatile size_t ring_size; + int write_pos; + int read_pos; + int full; + size_t ring_size; pthread_mutex_t mux; } __attribute__((packed)); From 42d2995c5b74c88e5b3898529a7c59cc2a415b88 Mon Sep 17 00:00:00 2001 From: stolet Date: Sun, 2 Apr 2023 21:22:47 +0200 Subject: [PATCH 35/50] fix tests from compiling and add tests to proxy shmring --- tests/bench_ll_echo.c | 2 +- tests/libtas/tas_ll.c | 10 +- tests/lowlevel.c | 2 +- tests/lowlevel_echo.c | 4 +- tests/rules.mk | 9 + tests/tas_unit/activelist.c | 430 ++++++++++++++++++------------------ tests/tas_unit/fastpath.c | 5 +- tests/tas_unit/qman_rr.c | 332 ++++++++++++++-------------- tests/tas_unit/shmring.c | 387 ++++++++++++++++++++++++++++++++ 9 files changed, 789 insertions(+), 392 deletions(-) create mode 100644 tests/tas_unit/shmring.c diff --git a/tests/bench_ll_echo.c b/tests/bench_ll_echo.c index 3a166d09..e17982b6 100644 --- a/tests/bench_ll_echo.c +++ b/tests/bench_ll_echo.c @@ -304,7 +304,7 @@ int main(int argc, char *argv[]) for (i = 0; i < num_threads; i++) { cs->cn = i; - if (flextcp_context_create(&cs->context) != 0) { + if (flextcp_context_create(&cs->context, NULL, NULL) != 0) { fprintf(stderr, "flextcp_context_create failed %d\n", i); return EXIT_FAILURE; } diff --git a/tests/libtas/tas_ll.c b/tests/libtas/tas_ll.c index 6d90e97e..debc5fc6 100644 --- a/tests/libtas/tas_ll.c +++ b/tests/libtas/tas_ll.c @@ -23,7 +23,7 @@ static void test_poll_empty(void *p) test_error("flextcp_init failed"); test_randinit(&ctx, sizeof(ctx)); - if (flextcp_context_create(&ctx) != 0) + if (flextcp_context_create(&ctx, NULL, NULL) != 0) test_error("flextcp_context_create failed"); num = flextcp_context_poll(&ctx, 4, evs); @@ -47,7 +47,7 @@ static void test_connect_success(void *p) test_error("flextcp_init failed"); test_randinit(&ctx, sizeof(ctx)); - if (flextcp_context_create(&ctx) != 0) + if (flextcp_context_create(&ctx, NULL, NULL) != 0) test_error("flextcp_context_create failed"); /* initiate connect */ @@ -107,7 +107,7 @@ static void test_connect_fail(void *p) test_error("flextcp_init failed"); test_randinit(&ctx, sizeof(ctx)); - if (flextcp_context_create(&ctx) != 0) + if (flextcp_context_create(&ctx, NULL, NULL) != 0) test_error("flextcp_context_create failed"); /* initiate connect */ @@ -148,7 +148,7 @@ static void test_full_rxbuf(void *p) test_error("flextcp_init failed"); test_randinit(&ctx, sizeof(ctx)); - if (flextcp_context_create(&ctx) != 0) + if (flextcp_context_create(&ctx, NULL, NULL) != 0) test_error("flextcp_context_create failed"); /* initiate connect */ @@ -249,7 +249,7 @@ static void test_full_txbuf(void *p) test_error("flextcp_init failed"); test_randinit(&ctx, sizeof(ctx)); - if (flextcp_context_create(&ctx) != 0) + if (flextcp_context_create(&ctx, NULL, NULL) != 0) test_error("flextcp_context_create failed"); /* initiate connect */ diff --git a/tests/lowlevel.c b/tests/lowlevel.c index 25a229d7..ee7ed5a3 100644 --- a/tests/lowlevel.c +++ b/tests/lowlevel.c @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) return -1; } - if (flextcp_context_create(&ctx)) { + if (flextcp_context_create(&ctx, NULL, NULL)) { fprintf(stderr, "flextcp_context_create failed\n"); return -1; } diff --git a/tests/lowlevel_echo.c b/tests/lowlevel_echo.c index 229d4160..2aa5e60d 100644 --- a/tests/lowlevel_echo.c +++ b/tests/lowlevel_echo.c @@ -149,12 +149,12 @@ int main(int argc, char *argv[]) } port = atoi(argv[argc - 1]); - if (flextcp_init()) { + if (flextcp_init(0)) { fprintf(stderr, "flextcp_init failed\n"); return -1; } - if (flextcp_context_create(&ctx)) { + if (flextcp_context_create(&ctx, NULL, NULL)) { fprintf(stderr, "flextcp_context_create failed\n"); return -1; } diff --git a/tests/rules.mk b/tests/rules.mk index 84f8655c..a40a321b 100644 --- a/tests/rules.mk +++ b/tests/rules.mk @@ -25,6 +25,7 @@ TESTS_AUTO := \ tests/libtas/tas_ll \ tests/libtas/tas_sockets \ tests/tas_unit/fastpath \ + tests/tas_unit/shmring \ tests/tas_unit/qman_rr \ tests/tas_unit/activelist @@ -65,6 +66,13 @@ tests/tas_unit/fastpath: LDLIBS+= -lrte_eal tests/tas_unit/fastpath: tests/tas_unit/fastpath.o tests/testutils.o \ tas/fast/fast_flows.o +tests/tas_unit/shmring: CPPFLAGS+= -Itas/include $(DPDK_CPPFLAGS) +tests/tas_unit/shmring: CFLAGS+= $(DPDK_CFLAGS) +tests/tas_unit/shmring: LDFLAGS+= $(DPDK_LDFLAGS) +tests/tas_unit/shmring: LDLIBS+= -lrte_eal +tests/tas_unit/shmring: tests/tas_unit/shmring.o tests/testutils.o \ + proxy/shmring.o + tests/tas_unit/qman_rr: CPPFLAGS+= -Itas/include -Ilib/tas/include/ $(DPDK_CPPFLAGS) tests/tas_unit/qman_rr: CFLAGS+= $(DPDK_CFLAGS) tests/tas_unit/qman_rr: LDFLAGS+= $(DPDK_LDFLAGS) @@ -87,6 +95,7 @@ run-tests: $(TESTS_AUTO) tests/libtas/tas_ll tests/libtas/tas_sockets tests/tas_unit/fastpath + tests/tas_unit/shmring tests/tas_unit/qman_rr tests/tas_unit/activelist diff --git a/tests/tas_unit/activelist.c b/tests/tas_unit/activelist.c index e71022fa..6ed1c978 100644 --- a/tests/tas_unit/activelist.c +++ b/tests/tas_unit/activelist.c @@ -16,7 +16,7 @@ /* Redefined so tests compile properly */ /***************************************************************************/ -void *tas_shm = (void *) 0; +void **vm_shm = (void *) 0; struct flextcp_pl_mem state_base; struct flextcp_pl_mem *fp_state = &state_base; struct configuration config; @@ -28,21 +28,21 @@ int fast_flows_bump(struct dataplane_context *ctx, uint32_t flow_id, return 0; } -static void polled_app_init(struct polled_app *app, uint16_t id) +static void polled_vm_init(struct polled_vm *vm, uint16_t id) { - app->id = id; - app->next = IDXLIST_INVAL; - app->prev = IDXLIST_INVAL; - app->flags = 0; - app->poll_next_ctx = 0; - app->act_ctx_head = IDXLIST_INVAL; - app->act_ctx_tail = IDXLIST_INVAL; + vm->id = id; + vm->next = IDXLIST_INVAL; + vm->prev = IDXLIST_INVAL; + vm->flags = 0; + vm->poll_next_ctx = 0; + vm->act_ctx_head = IDXLIST_INVAL; + vm->act_ctx_tail = IDXLIST_INVAL; } -static void polled_ctx_init(struct polled_context *ctx, uint32_t id, uint32_t aid) +static void polled_ctx_init(struct polled_context *ctx, uint32_t id, uint32_t vmid) { ctx->id = id; - ctx->aid = aid; + ctx->vmid = vmid; ctx->next = IDXLIST_INVAL; ctx->prev = IDXLIST_INVAL; ctx->flags = 0; @@ -51,7 +51,7 @@ static void polled_ctx_init(struct polled_context *ctx, uint32_t id, uint32_t ai /***************************************************************************/ -void test_enqueue_app(void *arg) +void test_enqueue_vm(void *arg) { struct dataplane_context *ctx; @@ -60,40 +60,40 @@ void test_enqueue_app(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_app_to_active(ctx, 0); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 0 is tail", ctx->act_tail == 0); - test_assert("app 0 is active", - (ctx->polled_apps[0].flags & FLAG_ACTIVE) != 0); - enqueue_app_to_active(ctx, 1); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 1 is tail", ctx->act_tail == 1); - test_assert("app 1 is active", - (ctx->polled_apps[1].flags & FLAG_ACTIVE) != 0); - enqueue_app_to_active(ctx, 2); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 2 is tail", ctx->act_tail == 2); - test_assert("app 2 is active", - (ctx->polled_apps[2].flags & FLAG_ACTIVE) != 0); + enqueue_vm_to_active(ctx, 0); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 0 is tail", ctx->act_tail == 0); + test_assert("vm 0 is active", + (ctx->polled_vms[0].flags & FLAG_ACTIVE) != 0); + enqueue_vm_to_active(ctx, 1); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 1 is tail", ctx->act_tail == 1); + test_assert("vm 1 is active", + (ctx->polled_vms[1].flags & FLAG_ACTIVE) != 0); + enqueue_vm_to_active(ctx, 2); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 2 is tail", ctx->act_tail == 2); + test_assert("vm 2 is active", + (ctx->polled_vms[2].flags & FLAG_ACTIVE) != 0); } void test_enqueue_ctx(void *arg) { - struct polled_app *app0, *app1; + struct polled_vm *vm0, *vm1; struct dataplane_context *ctx; ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); - app0 = &ctx->polled_apps[0]; - app1 = &ctx->polled_apps[1]; + vm0 = &ctx->polled_vms[0]; + vm1 = &ctx->polled_vms[1]; - polled_app_init(app0, 0); - polled_ctx_init(&app0->ctxs[0], 0, 0); - polled_ctx_init(&app0->ctxs[1], 1, 0); + polled_vm_init(vm0, 0); + polled_ctx_init(&vm0->ctxs[0], 0, 0); + polled_ctx_init(&vm0->ctxs[1], 1, 0); - polled_app_init(app1, 1); - polled_ctx_init(&app0->ctxs[0], 0, 1); + polled_vm_init(vm1, 1); + polled_ctx_init(&vm0->ctxs[0], 0, 1); ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -101,24 +101,24 @@ void test_enqueue_ctx(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_ctx_to_active(app0, 0); - test_assert("app0: ctx 0 is head", app0->act_ctx_head == 0); - test_assert("app0: ctx 0 is tail", app0->act_ctx_tail == 0); - test_assert("app0: ctx 0 is active", - (app0->ctxs[0].flags & FLAG_ACTIVE) != 0); - enqueue_ctx_to_active(app0, 1); - test_assert("app0: ctx 0 is head", app0->act_ctx_head == 0); - test_assert("app0: ctx 1 is tail", app0->act_ctx_tail == 1); - test_assert("app0: ctx 1 is active", - (app0->ctxs[1].flags & FLAG_ACTIVE) != 0); - enqueue_ctx_to_active(app1, 0); - test_assert("app1: ctx 0 is head", app1->act_ctx_head == 0); - test_assert("app1: ctx 0 is tail", app1->act_ctx_tail == 0); - test_assert("app1: ctx 0 is active", - (app1->ctxs[0].flags & FLAG_ACTIVE) != 0); + enqueue_ctx_to_active(vm0, 0); + test_assert("vm0: ctx 0 is head", vm0->act_ctx_head == 0); + test_assert("vm0: ctx 0 is tail", vm0->act_ctx_tail == 0); + test_assert("vm0: ctx 0 is active", + (vm0->ctxs[0].flags & FLAG_ACTIVE) != 0); + enqueue_ctx_to_active(vm0, 1); + test_assert("vm0: ctx 0 is head", vm0->act_ctx_head == 0); + test_assert("vm0: ctx 1 is tail", vm0->act_ctx_tail == 1); + test_assert("vm0: ctx 1 is active", + (vm0->ctxs[1].flags & FLAG_ACTIVE) != 0); + enqueue_ctx_to_active(vm1, 0); + test_assert("vm1: ctx 0 is head", vm1->act_ctx_head == 0); + test_assert("vm1: ctx 0 is tail", vm1->act_ctx_tail == 0); + test_assert("vm1: ctx 0 is active", + (vm1->ctxs[0].flags & FLAG_ACTIVE) != 0); } -void test_remove_app(void *arg) +void test_remove_vm(void *arg) { struct dataplane_context *ctx; @@ -127,18 +127,18 @@ void test_remove_app(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_app_to_active(ctx, 0); - enqueue_app_to_active(ctx, 1); - enqueue_app_to_active(ctx, 2); - - remove_app_from_active(ctx, &ctx->polled_apps[1]); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 2 is tail", ctx->act_tail == 2); - test_assert("app 1 is not active", - (ctx->polled_apps[1].flags & FLAG_ACTIVE) == 0); + enqueue_vm_to_active(ctx, 0); + enqueue_vm_to_active(ctx, 1); + enqueue_vm_to_active(ctx, 2); + + remove_vm_from_active(ctx, &ctx->polled_vms[1]); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 2 is tail", ctx->act_tail == 2); + test_assert("vm 1 is not active", + (ctx->polled_vms[1].flags & FLAG_ACTIVE) == 0); } -void test_remove_app_head(void *arg) +void test_remove_vm_head(void *arg) { struct dataplane_context *ctx; @@ -147,18 +147,18 @@ void test_remove_app_head(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_app_to_active(ctx, 0); - enqueue_app_to_active(ctx, 1); - enqueue_app_to_active(ctx, 2); - - remove_app_from_active(ctx, &ctx->polled_apps[0]); - test_assert("app 1 is head", ctx->act_head == 1); - test_assert("app 2 is tail", ctx->act_tail == 2); - test_assert("app 0 is not active", - (ctx->polled_apps[0].flags & FLAG_ACTIVE) == 0); + enqueue_vm_to_active(ctx, 0); + enqueue_vm_to_active(ctx, 1); + enqueue_vm_to_active(ctx, 2); + + remove_vm_from_active(ctx, &ctx->polled_vms[0]); + test_assert("vm 1 is head", ctx->act_head == 1); + test_assert("vm 2 is tail", ctx->act_tail == 2); + test_assert("vm 0 is not active", + (ctx->polled_vms[0].flags & FLAG_ACTIVE) == 0); } -void test_remove_app_tail(void *arg) +void test_remove_vm_tail(void *arg) { struct dataplane_context *ctx; @@ -167,18 +167,18 @@ void test_remove_app_tail(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_app_to_active(ctx, 0); - enqueue_app_to_active(ctx, 1); - enqueue_app_to_active(ctx, 2); - - remove_app_from_active(ctx, &ctx->polled_apps[2]); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 1 is tail", ctx->act_tail == 1); - test_assert("app 2 is not active", - (ctx->polled_apps[2].flags & FLAG_ACTIVE) == 0); + enqueue_vm_to_active(ctx, 0); + enqueue_vm_to_active(ctx, 1); + enqueue_vm_to_active(ctx, 2); + + remove_vm_from_active(ctx, &ctx->polled_vms[2]); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 1 is tail", ctx->act_tail == 1); + test_assert("vm 2 is not active", + (ctx->polled_vms[2].flags & FLAG_ACTIVE) == 0); } -void test_remove_app_one_elt(void *arg) +void test_remove_vm_one_elt(void *arg) { struct dataplane_context *ctx; @@ -187,16 +187,16 @@ void test_remove_app_one_elt(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_app_to_active(ctx, 0); + enqueue_vm_to_active(ctx, 0); - remove_app_from_active(ctx, &ctx->polled_apps[0]); + remove_vm_from_active(ctx, &ctx->polled_vms[0]); test_assert("head is invalid", ctx->act_head == IDXLIST_INVAL); test_assert("tail is invalid", ctx->act_tail == IDXLIST_INVAL); - test_assert("app 0 is not active", - (ctx->polled_apps[0].flags & FLAG_ACTIVE) == 0); + test_assert("vm 0 is not active", + (ctx->polled_vms[0].flags & FLAG_ACTIVE) == 0); } -void test_remove_multiple_apps(void *arg) +void test_remove_multiple_vms(void *arg) { struct dataplane_context *ctx; @@ -205,43 +205,43 @@ void test_remove_multiple_apps(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_app_to_active(ctx, 0); - enqueue_app_to_active(ctx, 1); - enqueue_app_to_active(ctx, 2); - - remove_app_from_active(ctx, &ctx->polled_apps[1]); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 2 is tail", ctx->act_tail == 2); - test_assert("app 1 is not active", - (ctx->polled_apps[1].flags & FLAG_ACTIVE) == 0); - - remove_app_from_active(ctx, &ctx->polled_apps[2]); - test_assert("app 0 is head", ctx->act_head == 0); - test_assert("app 0 is tail", ctx->act_tail == 0); - test_assert("app 2 is not active", - (ctx->polled_apps[1].flags & FLAG_ACTIVE) == 0); - - remove_app_from_active(ctx, &ctx->polled_apps[0]); + enqueue_vm_to_active(ctx, 0); + enqueue_vm_to_active(ctx, 1); + enqueue_vm_to_active(ctx, 2); + + remove_vm_from_active(ctx, &ctx->polled_vms[1]); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 2 is tail", ctx->act_tail == 2); + test_assert("vm 1 is not active", + (ctx->polled_vms[1].flags & FLAG_ACTIVE) == 0); + + remove_vm_from_active(ctx, &ctx->polled_vms[2]); + test_assert("vm 0 is head", ctx->act_head == 0); + test_assert("vm 0 is tail", ctx->act_tail == 0); + test_assert("vm 2 is not active", + (ctx->polled_vms[1].flags & FLAG_ACTIVE) == 0); + + remove_vm_from_active(ctx, &ctx->polled_vms[0]); test_assert("head is invalid", ctx->act_head == IDXLIST_INVAL); test_assert("tail is invalid", ctx->act_tail == IDXLIST_INVAL); - test_assert("app 0 is not active", - (ctx->polled_apps[0].flags & FLAG_ACTIVE) == 0); + test_assert("vm 0 is not active", + (ctx->polled_vms[0].flags & FLAG_ACTIVE) == 0); } void test_remove_ctx(void *arg) { - struct polled_app *app0; + struct polled_vm *vm0; struct dataplane_context *ctx; ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); - app0 = &ctx->polled_apps[0]; + vm0 = &ctx->polled_vms[0]; - polled_app_init(app0, 0); - polled_ctx_init(&app0->ctxs[0], 0, 0); - polled_ctx_init(&app0->ctxs[1], 1, 0); - polled_ctx_init(&app0->ctxs[2], 2, 0); + polled_vm_init(vm0, 0); + polled_ctx_init(&vm0->ctxs[0], 0, 0); + polled_ctx_init(&vm0->ctxs[1], 1, 0); + polled_ctx_init(&vm0->ctxs[2], 2, 0); ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -249,31 +249,31 @@ void test_remove_ctx(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_ctx_to_active(app0, 0); - enqueue_ctx_to_active(app0, 1); - enqueue_ctx_to_active(app0, 2); + enqueue_ctx_to_active(vm0, 0); + enqueue_ctx_to_active(vm0, 1); + enqueue_ctx_to_active(vm0, 2); - remove_ctx_from_active(app0, &app0->ctxs[1]); - test_assert("ctx0 is head", app0->act_ctx_head == 0); - test_assert("ctx2 is tail", app0->act_ctx_tail == 2); + remove_ctx_from_active(vm0, &vm0->ctxs[1]); + test_assert("ctx0 is head", vm0->act_ctx_head == 0); + test_assert("ctx2 is tail", vm0->act_ctx_tail == 2); test_assert("ctx1 is not active", - (app0->ctxs[1].flags & FLAG_ACTIVE) == 0); + (vm0->ctxs[1].flags & FLAG_ACTIVE) == 0); } void test_remove_ctx_head(void *arg) { - struct polled_app *app0; + struct polled_vm *vm0; struct dataplane_context *ctx; ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); - app0 = &ctx->polled_apps[0]; + vm0 = &ctx->polled_vms[0]; - polled_app_init(app0, 0); - polled_ctx_init(&app0->ctxs[0], 0, 0); - polled_ctx_init(&app0->ctxs[1], 1, 0); - polled_ctx_init(&app0->ctxs[2], 2, 0); + polled_vm_init(vm0, 0); + polled_ctx_init(&vm0->ctxs[0], 0, 0); + polled_ctx_init(&vm0->ctxs[1], 1, 0); + polled_ctx_init(&vm0->ctxs[2], 2, 0); ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -281,31 +281,31 @@ void test_remove_ctx_head(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_ctx_to_active(app0, 0); - enqueue_ctx_to_active(app0, 1); - enqueue_ctx_to_active(app0, 2); + enqueue_ctx_to_active(vm0, 0); + enqueue_ctx_to_active(vm0, 1); + enqueue_ctx_to_active(vm0, 2); - remove_ctx_from_active(app0, &app0->ctxs[0]); - test_assert("ctx1 is head", app0->act_ctx_head == 1); - test_assert("ctx2 is tail", app0->act_ctx_tail == 2); + remove_ctx_from_active(vm0, &vm0->ctxs[0]); + test_assert("ctx1 is head", vm0->act_ctx_head == 1); + test_assert("ctx2 is tail", vm0->act_ctx_tail == 2); test_assert("ctx0 is not active", - (app0->ctxs[0].flags & FLAG_ACTIVE) == 0); + (vm0->ctxs[0].flags & FLAG_ACTIVE) == 0); } void test_remove_ctx_tail(void *arg) { - struct polled_app *app0; + struct polled_vm *vm0; struct dataplane_context *ctx; ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); - app0 = &ctx->polled_apps[0]; + vm0 = &ctx->polled_vms[0]; - polled_app_init(app0, 0); - polled_ctx_init(&app0->ctxs[0], 0, 0); - polled_ctx_init(&app0->ctxs[1], 1, 0); - polled_ctx_init(&app0->ctxs[2], 2, 0); + polled_vm_init(vm0, 0); + polled_ctx_init(&vm0->ctxs[0], 0, 0); + polled_ctx_init(&vm0->ctxs[1], 1, 0); + polled_ctx_init(&vm0->ctxs[2], 2, 0); ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -313,29 +313,29 @@ void test_remove_ctx_tail(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_ctx_to_active(app0, 0); - enqueue_ctx_to_active(app0, 1); - enqueue_ctx_to_active(app0, 2); + enqueue_ctx_to_active(vm0, 0); + enqueue_ctx_to_active(vm0, 1); + enqueue_ctx_to_active(vm0, 2); - remove_ctx_from_active(app0, &app0->ctxs[2]); - test_assert("ctx0 is head", app0->act_ctx_head == 0); - test_assert("ctx1 is tail", app0->act_ctx_tail == 1); + remove_ctx_from_active(vm0, &vm0->ctxs[2]); + test_assert("ctx0 is head", vm0->act_ctx_head == 0); + test_assert("ctx1 is tail", vm0->act_ctx_tail == 1); test_assert("ctx2 is not active", - (app0->ctxs[2].flags & FLAG_ACTIVE) == 0); + (vm0->ctxs[2].flags & FLAG_ACTIVE) == 0); } void test_remove_ctx_one_elt(void *arg) { - struct polled_app *app0; + struct polled_vm *vm0; struct dataplane_context *ctx; ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); - app0 = &ctx->polled_apps[0]; + vm0 = &ctx->polled_vms[0]; - polled_app_init(app0, 0); - polled_ctx_init(&app0->ctxs[0], 0, 0); + polled_vm_init(vm0, 0); + polled_ctx_init(&vm0->ctxs[0], 0, 0); ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -343,35 +343,35 @@ void test_remove_ctx_one_elt(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_ctx_to_active(app0, 0); + enqueue_ctx_to_active(vm0, 0); - remove_ctx_from_active(app0, &app0->ctxs[0]); - test_assert("head is invalid", app0->act_ctx_head == IDXLIST_INVAL); - test_assert("tail is invalid", app0->act_ctx_tail == IDXLIST_INVAL); + remove_ctx_from_active(vm0, &vm0->ctxs[0]); + test_assert("head is invalid", vm0->act_ctx_head == IDXLIST_INVAL); + test_assert("tail is invalid", vm0->act_ctx_tail == IDXLIST_INVAL); test_assert("ctx0 is not active", - (app0->ctxs[0].flags & FLAG_ACTIVE) == 0); + (vm0->ctxs[0].flags & FLAG_ACTIVE) == 0); } void test_remove_multiple_ctx(void *arg) { - struct polled_app *app0, *app1; + struct polled_vm *vm0, *vm1; struct dataplane_context *ctx; ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); - app0 = &ctx->polled_apps[0]; - app1 = &ctx->polled_apps[1]; + vm0 = &ctx->polled_vms[0]; + vm1 = &ctx->polled_vms[1]; - polled_app_init(app0, 0); - polled_ctx_init(&app0->ctxs[0], 0, 0); - polled_ctx_init(&app0->ctxs[1], 1, 0); - polled_ctx_init(&app0->ctxs[2], 2, 0); + polled_vm_init(vm0, 0); + polled_ctx_init(&vm0->ctxs[0], 0, 0); + polled_ctx_init(&vm0->ctxs[1], 1, 0); + polled_ctx_init(&vm0->ctxs[2], 2, 0); - polled_app_init(app1, 1); - polled_ctx_init(&app1->ctxs[0], 0, 1); - polled_ctx_init(&app1->ctxs[1], 1, 1); - polled_ctx_init(&app1->ctxs[2], 2, 1); + polled_vm_init(vm1, 1); + polled_ctx_init(&vm1->ctxs[0], 0, 1); + polled_ctx_init(&vm1->ctxs[1], 1, 1); + polled_ctx_init(&vm1->ctxs[2], 2, 1); ctx = malloc(sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -379,76 +379,76 @@ void test_remove_multiple_ctx(void *arg) ctx->act_head = IDXLIST_INVAL; ctx->act_tail = IDXLIST_INVAL; - enqueue_ctx_to_active(app0, 0); - enqueue_ctx_to_active(app0, 1); - enqueue_ctx_to_active(app0, 2); - - enqueue_ctx_to_active(app1, 0); - enqueue_ctx_to_active(app1, 1); - enqueue_ctx_to_active(app1, 2); - - /* Remove contexts from app 0 */ - remove_ctx_from_active(app0, &app0->ctxs[1]); - test_assert("app0: ctx0 is head", app0->act_ctx_head == 0); - test_assert("app0: ctx2 is tail", app0->act_ctx_tail == 2); - test_assert("app0: ctx1 is not active", - (app0->ctxs[1].flags & FLAG_ACTIVE) == 0); - - remove_ctx_from_active(app0, &app0->ctxs[2]); - test_assert("app0: ctx0 is head", app0->act_ctx_head == 0); - test_assert("app0: ctx0 is tail", app0->act_ctx_tail == 0); - test_assert("app0: ctx2 is not active", - (app0->ctxs[2].flags & FLAG_ACTIVE) == 0); - - remove_ctx_from_active(app0, &app0->ctxs[0]); - test_assert("app0: head is invalid", app0->act_ctx_head == IDXLIST_INVAL); - test_assert("app0: tail is invalid", app0->act_ctx_tail == IDXLIST_INVAL); - test_assert("app0: ctx0 is not active", - (app0->ctxs[0].flags & FLAG_ACTIVE) == 0); - - /* Remove contexts from app 1 */ - remove_ctx_from_active(app1, &app1->ctxs[1]); - test_assert("app1: ctx0 is head", app1->act_ctx_head == 0); - test_assert("app1: ctx2 is tail", app1->act_ctx_tail == 2); - test_assert("app1: ctx1 is not active", - (app1->ctxs[1].flags & FLAG_ACTIVE) == 0); - - remove_ctx_from_active(app1, &app1->ctxs[2]); - test_assert("app1: ctx0 is head", app1->act_ctx_head == 0); - test_assert("app1: ctx0 is tail", app1->act_ctx_tail == 0); - test_assert("app1: ctx2 is not active", - (app1->ctxs[2].flags & FLAG_ACTIVE) == 0); - - remove_ctx_from_active(app1, &app1->ctxs[0]); - test_assert("app1: head is invalid", app1->act_ctx_head == IDXLIST_INVAL); - test_assert("app1: tail is invalid", app1->act_ctx_tail == IDXLIST_INVAL); - test_assert("app1: ctx0 is not active", - (app1->ctxs[0].flags & FLAG_ACTIVE) == 0); + enqueue_ctx_to_active(vm0, 0); + enqueue_ctx_to_active(vm0, 1); + enqueue_ctx_to_active(vm0, 2); + + enqueue_ctx_to_active(vm1, 0); + enqueue_ctx_to_active(vm1, 1); + enqueue_ctx_to_active(vm1, 2); + + /* Remove contexts from vm 0 */ + remove_ctx_from_active(vm0, &vm0->ctxs[1]); + test_assert("vm0: ctx0 is head", vm0->act_ctx_head == 0); + test_assert("vm0: ctx2 is tail", vm0->act_ctx_tail == 2); + test_assert("vm0: ctx1 is not active", + (vm0->ctxs[1].flags & FLAG_ACTIVE) == 0); + + remove_ctx_from_active(vm0, &vm0->ctxs[2]); + test_assert("vm0: ctx0 is head", vm0->act_ctx_head == 0); + test_assert("vm0: ctx0 is tail", vm0->act_ctx_tail == 0); + test_assert("vm0: ctx2 is not active", + (vm0->ctxs[2].flags & FLAG_ACTIVE) == 0); + + remove_ctx_from_active(vm0, &vm0->ctxs[0]); + test_assert("vm0: head is invalid", vm0->act_ctx_head == IDXLIST_INVAL); + test_assert("vm0: tail is invalid", vm0->act_ctx_tail == IDXLIST_INVAL); + test_assert("vm0: ctx0 is not active", + (vm0->ctxs[0].flags & FLAG_ACTIVE) == 0); + + /* Remove contexts from vm 1 */ + remove_ctx_from_active(vm1, &vm1->ctxs[1]); + test_assert("vm1: ctx0 is head", vm1->act_ctx_head == 0); + test_assert("vm1: ctx2 is tail", vm1->act_ctx_tail == 2); + test_assert("vm1: ctx1 is not active", + (vm1->ctxs[1].flags & FLAG_ACTIVE) == 0); + + remove_ctx_from_active(vm1, &vm1->ctxs[2]); + test_assert("vm1: ctx0 is head", vm1->act_ctx_head == 0); + test_assert("vm1: ctx0 is tail", vm1->act_ctx_tail == 0); + test_assert("vm1: ctx2 is not active", + (vm1->ctxs[2].flags & FLAG_ACTIVE) == 0); + + remove_ctx_from_active(vm1, &vm1->ctxs[0]); + test_assert("vm1: head is invalid", vm1->act_ctx_head == IDXLIST_INVAL); + test_assert("vm1: tail is invalid", vm1->act_ctx_tail == IDXLIST_INVAL); + test_assert("vm1: ctx0 is not active", + (vm1->ctxs[0].flags & FLAG_ACTIVE) == 0); } int main(int argc, char *argv[]) { int ret = 0; - if (test_subcase("enqueue app", test_enqueue_app, NULL)) + if (test_subcase("enqueue vm", test_enqueue_vm, NULL)) ret = 1; if (test_subcase("enqueue ctx", test_enqueue_ctx, NULL)) ret = 1; - if (test_subcase("remove app", test_remove_app, NULL)) + if (test_subcase("remove vm", test_remove_vm, NULL)) ret = 1; - if (test_subcase("remove app head", test_remove_app_head, NULL)) + if (test_subcase("remove vm head", test_remove_vm_head, NULL)) ret = 1; - if (test_subcase("remove app tail", test_remove_app_tail, NULL)) + if (test_subcase("remove vm tail", test_remove_vm_tail, NULL)) ret = 1; - if (test_subcase("remove app one elt", test_remove_app_one_elt, NULL)) + if (test_subcase("remove vm one elt", test_remove_vm_one_elt, NULL)) ret = 1; - if (test_subcase("remove mult apps", test_remove_multiple_apps, NULL)) + if (test_subcase("remove mult vm", test_remove_multiple_vms, NULL)) ret = 1; if (test_subcase("remove ctx", test_remove_ctx, NULL)) diff --git a/tests/tas_unit/fastpath.c b/tests/tas_unit/fastpath.c index 15127ce9..a7f4387e 100644 --- a/tests/tas_unit/fastpath.c +++ b/tests/tas_unit/fastpath.c @@ -29,7 +29,7 @@ #endif macaddr_t eth_addr; -void *tas_shm = (void *) 0; +void **vm_shm = (void *) 0; struct flextcp_pl_mem state_base; struct flextcp_pl_mem *fp_state = &state_base; @@ -47,7 +47,8 @@ struct qman_set_op { uint8_t flags; } qm_set_op = { .got_op = 0 }; -int qman_set(struct qman_thread *t, uint32_t app_id, uint32_t flow_id, uint32_t rate, uint32_t avail, +int tas_qman_set(struct qman_thread *t, uint32_t app_id, uint32_t flow_id, + uint32_t rate, uint32_t avail, uint16_t max_chunk, uint8_t flags) { qm_set_op.got_op = 1; diff --git a/tests/tas_unit/qman_rr.c b/tests/tas_unit/qman_rr.c index 8ca62aae..ff76f227 100644 --- a/tests/tas_unit/qman_rr.c +++ b/tests/tas_unit/qman_rr.c @@ -21,10 +21,10 @@ void test_qman_rr_base(void *arg) unsigned num; struct qman_thread *t; uint32_t avail; - int all_app1, all_app2, ret; + int all_vm1, all_vm2, ret; struct dataplane_context *ctx; uint16_t q_bytes[TEST_BATCH_SIZE]; - unsigned app_ids[TEST_BATCH_SIZE], q_ids[TEST_BATCH_SIZE]; + unsigned vm_ids[TEST_BATCH_SIZE], q_ids[TEST_BATCH_SIZE]; ret = rte_eal_init(3, arg); test_assert("rte_eal_init", ret > -1); @@ -32,56 +32,56 @@ void test_qman_rr_base(void *arg) // Allocate memory for one context in 1 core ctx = rte_calloc("context", 1, sizeof(ctx), 0); - ret = qman_thread_init(ctx); + ret = tas_qman_thread_init(ctx); test_assert("init qman thread", ret > -1); t = &ctx->qman; - // Set 1 packet for 4 flows in app 1 - qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_set set app 1 check app 1", avail == 64 * 4); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_set set app 1 check app 2", avail == 0); - - // Set 1 packet for 4 flows in app 2 - qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_set set app 2 check app 1", avail == 64 * 4); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_set set app 2 check app 2", avail == 64 * 4); + // Set 1 packet for 4 flows in vm 1 + tas_qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_set set vm 1 check vm 1", avail == 64 * 4); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_set set vm 1 check vm 2", avail == 0); + + // Set 1 packet for 4 flows in vm 2 + tas_qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_set set vm 2 check vm 1", avail == 64 * 4); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_set set vm 2 check vm 2", avail == 64 * 4); num = TEST_BATCH_SIZE; - qman_poll(t, num, app_ids, q_ids, q_bytes); - all_app1 = (app_ids[0] == 1) && (app_ids[1] == 1) - && (app_ids[2] == 1) && (app_ids[3] == 1); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll poll app 1 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll poll app 1 check avail app 2", avail == 64 * 4); - test_assert("scheduled all packets from app 1", all_app1); - - memset(app_ids, 0, sizeof(*app_ids) * TEST_BATCH_SIZE); + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + all_vm1 = (vm_ids[0] == 1) && (vm_ids[1] == 1) + && (vm_ids[2] == 1) && (vm_ids[3] == 1); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll poll vm 1 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll poll vm 1 check avail vm 2", avail == 64 * 4); + test_assert("scheduled all packets from vm 1", all_vm1); + + memset(vm_ids, 0, sizeof(*vm_ids) * TEST_BATCH_SIZE); memset(q_ids, 0, sizeof(*q_ids) * TEST_BATCH_SIZE); memset(q_bytes, 0, sizeof(*q_bytes) * TEST_BATCH_SIZE); num = TEST_BATCH_SIZE; - qman_poll(t, num, app_ids, q_ids, q_bytes); - all_app2 = (app_ids[0] == 2) && (app_ids[1] == 2) - && (app_ids[2] == 2) && (app_ids[3] == 2); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll poll app 2 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll poll app 2 check avail app 2", avail == 0); - test_assert("scheduled all packets from app 2", all_app2); - - qman_free_app_cont(ctx); + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + all_vm2 = (vm_ids[0] == 2) && (vm_ids[1] == 2) + && (vm_ids[2] == 2) && (vm_ids[3] == 2); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll poll vm 2 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll poll vm 2 check avail vm 2", avail == 0); + test_assert("scheduled all packets from vm 2", all_vm2); + + qman_free_vm_cont(ctx); rte_free(ctx); } @@ -89,10 +89,10 @@ void test_qman_rr_full_loop(void *arg) { struct qman_thread *t; uint32_t avail; - int all_app1, all_app2, ret; + int all_vm1, all_vm2, ret; struct dataplane_context *ctx; uint16_t q_bytes[TEST_BATCH_SIZE]; - unsigned app_ids[TEST_BATCH_SIZE], q_ids[TEST_BATCH_SIZE]; + unsigned vm_ids[TEST_BATCH_SIZE], q_ids[TEST_BATCH_SIZE]; unsigned num = TEST_BATCH_SIZE; ret = rte_eal_init(3, arg); @@ -101,92 +101,92 @@ void test_qman_rr_full_loop(void *arg) // Allocate memory for one context in 1 core ctx = rte_calloc("context", 1, sizeof(ctx), 0); - ret = qman_thread_init(ctx); + ret = tas_qman_thread_init(ctx); test_assert("init qman thread", ret > -1); t = &ctx->qman; - // Set 8 packets in app 1 - qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_set set app 1 check app 1", avail == 64 * 8); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_set set app 1 check app 2", avail == 0); - - // Set 8 packets in app 2 - qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 5, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_set set app 2 check app 1", avail == 64 * 8); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_set set app 2 check app 2", avail == 64 * 8); + // Set 8 packets in vm 1 + tas_qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_set set vm 1 check vm 1", avail == 64 * 8); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_set set vm 1 check vm 2", avail == 0); + + // Set 8 packets in vm 2 + tas_qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 5, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_set set vm 2 check vm 1", avail == 64 * 8); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_set set vm 2 check vm 2", avail == 64 * 8); - // Poll and expect app 1 - qman_poll(t, num, app_ids, q_ids, q_bytes); - all_app1 = (app_ids[0] == 1) && (app_ids[1] == 1) - && (app_ids[2] == 1) && (app_ids[3] == 1); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (1) poll app 1 check avail app 1", avail == 64 * 4); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (1) poll app 1 check avail app 2", avail == 64 * 8); - test_assert("scheduled all packets from app 1", all_app1); - - memset(app_ids, 0, sizeof(*app_ids) * TEST_BATCH_SIZE); + // Poll and expect vm 1 + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + all_vm1 = (vm_ids[0] == 1) && (vm_ids[1] == 1) + && (vm_ids[2] == 1) && (vm_ids[3] == 1); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (1) poll vm 1 check avail vm 1", avail == 64 * 4); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (1) poll vm 1 check avail vm 2", avail == 64 * 8); + test_assert("scheduled all packets from vm 1", all_vm1); + + memset(vm_ids, 0, sizeof(*vm_ids) * TEST_BATCH_SIZE); memset(q_ids, 0, sizeof(*q_ids) * TEST_BATCH_SIZE); memset(q_bytes, 0, sizeof(*q_bytes) * TEST_BATCH_SIZE); - // Poll and expect app 2 - qman_poll(t, num, app_ids, q_ids, q_bytes); - all_app2 = (app_ids[0] == 2) && (app_ids[1] == 2) - && (app_ids[2] == 2) && (app_ids[3] == 2); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (2) poll app 2 check avail app 1", avail == 64 * 4); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (2) poll app 2 check avail app 2", avail == 64 * 4); - test_assert("scheduled all packets from app 2", all_app2); - - memset(app_ids, 0, sizeof(*app_ids) * TEST_BATCH_SIZE); + // Poll and expect vm 2 + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + all_vm2 = (vm_ids[0] == 2) && (vm_ids[1] == 2) + && (vm_ids[2] == 2) && (vm_ids[3] == 2); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (2) poll vm 2 check avail vm 1", avail == 64 * 4); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (2) poll vm 2 check avail vm 2", avail == 64 * 4); + test_assert("scheduled all packets from vm 2", all_vm2); + + memset(vm_ids, 0, sizeof(*vm_ids) * TEST_BATCH_SIZE); memset(q_ids, 0, sizeof(*q_ids) * TEST_BATCH_SIZE); memset(q_bytes, 0, sizeof(*q_bytes) * TEST_BATCH_SIZE); - // Poll and expect app 1 again - qman_poll(t, num, app_ids, q_ids, q_bytes); - all_app1 = (app_ids[0] == 1) && (app_ids[1] == 1) - && (app_ids[2] == 1) && (app_ids[3] == 1); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (3) poll app 1 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (3) poll app 1 check avail app 2", avail == 64 * 4); - test_assert("scheduled all packets from app 1", all_app1); - - memset(app_ids, 0, sizeof(*app_ids) * TEST_BATCH_SIZE); + // Poll and expect vm 1 again + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + all_vm1 = (vm_ids[0] == 1) && (vm_ids[1] == 1) + && (vm_ids[2] == 1) && (vm_ids[3] == 1); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (3) poll vm 1 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (3) poll vm 1 check avail vm 2", avail == 64 * 4); + test_assert("scheduled all packets from vm 1", all_vm1); + + memset(vm_ids, 0, sizeof(*vm_ids) * TEST_BATCH_SIZE); memset(q_ids, 0, sizeof(*q_ids) * TEST_BATCH_SIZE); memset(q_bytes, 0, sizeof(*q_bytes) * TEST_BATCH_SIZE); - // Poll and expect app 2 again - qman_poll(t, num, app_ids, q_ids, q_bytes); - all_app2 = (app_ids[0] == 2) && (app_ids[1] == 2) - && (app_ids[2] == 2) && (app_ids[3] == 2); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (4) poll app 2 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (4) poll app 2 check avail app 2", avail == 0); - test_assert("scheduled all packets from app 2", all_app2); - - qman_free_app_cont(ctx); + // Poll and expect vm 2 again + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + all_vm2 = (vm_ids[0] == 2) && (vm_ids[1] == 2) + && (vm_ids[2] == 2) && (vm_ids[3] == 2); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (4) poll vm 2 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (4) poll vm 2 check avail vm 2", avail == 0); + test_assert("scheduled all packets from vm 2", all_vm2); + + qman_free_vm_cont(ctx); rte_free(ctx); } @@ -196,7 +196,7 @@ void test_qman_rr_mix_round(void *arg) { int packs_exp, ret; struct dataplane_context *ctx; uint16_t q_bytes[TEST_BATCH_SIZE]; - unsigned app_ids[TEST_BATCH_SIZE], q_ids[TEST_BATCH_SIZE]; + unsigned vm_ids[TEST_BATCH_SIZE], q_ids[TEST_BATCH_SIZE]; unsigned num = TEST_BATCH_SIZE; ret = rte_eal_init(3, arg); @@ -205,72 +205,72 @@ void test_qman_rr_mix_round(void *arg) { // Allocate memory for one context in 1 core ctx = rte_calloc("context", 1, sizeof(ctx), 0); - ret = qman_thread_init(ctx); + ret = tas_qman_thread_init(ctx); test_assert("init qman thread", ret > -1); t = &ctx->qman; - // Set 8 packets in app 1 - qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_set set app 1 check app 1", avail == 64 * 3); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_set set app 1 check app 2", avail == 0); - - // Set 8 packets in app 2 - qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); - - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_set set app 2 check app 1", avail == 64 * 3); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_set set app 2 check app 2", avail == 64 * 6); + // Set 8 packets in vm 1 + tas_qman_set(t, 1, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 1, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_set set vm 1 check vm 1", avail == 64 * 3); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_set set vm 1 check vm 2", avail == 0); + + // Set 8 packets in vm 2 + tas_qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 1, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 2, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 3, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + tas_qman_set(t, 2, 0, 0, 64, TEST_TCP_MSS, QMAN_ADD_AVAIL | QMAN_SET_MAXCHUNK); + + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_set set vm 2 check vm 1", avail == 64 * 3); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_set set vm 2 check vm 2", avail == 64 * 6); - // Poll and expect app 1 and 2 - qman_poll(t, num, app_ids, q_ids, q_bytes); - packs_exp = (app_ids[0] == 1) && (app_ids[1] == 1) - && (app_ids[2] == 1) && (app_ids[3] == 2); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (1) poll app 1 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (1) poll app 1 check avail app 2", avail == 64 * 5); + // Poll and expect vm 1 and 2 + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + packs_exp = (vm_ids[0] == 1) && (vm_ids[1] == 1) + && (vm_ids[2] == 1) && (vm_ids[3] == 2); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (1) poll vm 1 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (1) poll vm 1 check avail vm 2", avail == 64 * 5); test_assert("qman poll (1) check correct packets scheduled", packs_exp); - memset(app_ids, 0, sizeof(*app_ids) * TEST_BATCH_SIZE); + memset(vm_ids, 0, sizeof(*vm_ids) * TEST_BATCH_SIZE); memset(q_ids, 0, sizeof(*q_ids) * TEST_BATCH_SIZE); memset(q_bytes, 0, sizeof(*q_bytes) * TEST_BATCH_SIZE); - // Poll and expect app 2 - qman_poll(t, num, app_ids, q_ids, q_bytes); - packs_exp = (app_ids[0] == 2) && (app_ids[1] == 2) - && (app_ids[2] == 2) && (app_ids[3] == 2); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (2) poll app 2 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (2) poll app 2 check avail app 2", avail == 64); + // Poll and expect vm 2 + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + packs_exp = (vm_ids[0] == 2) && (vm_ids[1] == 2) + && (vm_ids[2] == 2) && (vm_ids[3] == 2); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (2) poll vm 2 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (2) poll vm 2 check avail vm 2", avail == 64); test_assert("qman poll (2) check correct packets scheduled", packs_exp); - memset(app_ids, 0, sizeof(*app_ids) * TEST_BATCH_SIZE); + memset(vm_ids, 0, sizeof(*vm_ids) * TEST_BATCH_SIZE); memset(q_ids, 0, sizeof(*q_ids) * TEST_BATCH_SIZE); memset(q_bytes, 0, sizeof(*q_bytes) * TEST_BATCH_SIZE); - // Poll and expect app 2 again - qman_poll(t, num, app_ids, q_ids, q_bytes); - packs_exp = (app_ids[0] == 2); - avail = qman_app_get_avail(ctx, 1); - test_assert("qman_poll (3) poll app 1 check avail app 1", avail == 0); - avail = qman_app_get_avail(ctx, 2); - test_assert("qman_poll (3) poll app 1 check avail app 2", avail == 0); + // Poll and expect vm 2 again + tas_qman_poll(ctx, num, vm_ids, q_ids, q_bytes); + packs_exp = (vm_ids[0] == 2); + avail = qman_vm_get_avail(ctx, 1); + test_assert("qman_poll (3) poll vm 1 check avail vm 1", avail == 0); + avail = qman_vm_get_avail(ctx, 2); + test_assert("qman_poll (3) poll vm 1 check avail vm 2", avail == 0); test_assert("qman poll (3) check correct packets scheduled", packs_exp); - qman_free_app_cont(ctx); + qman_free_vm_cont(ctx); rte_free(ctx); } diff --git a/tests/tas_unit/shmring.c b/tests/tas_unit/shmring.c new file mode 100644 index 00000000..a51bc396 --- /dev/null +++ b/tests/tas_unit/shmring.c @@ -0,0 +1,387 @@ +#include +#include +#include +#include + +#include "../testutils.h" +#include "../../proxy/shmring.h" + + +void test_reset_ring() +{ + void *base_addr; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + test_assert("read_pos reset", hdr->read_pos == 0); + test_assert("write_pos reset", hdr->write_pos == 0); + test_assert("full set to not full", hdr->full == 0); + test_assert("ring size set", hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); +} + +void test_push_ring() +{ + int ret; + void *base_addr, *msg; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = 10; + msg = malloc(write_sz); + + ret = shmring_push(ring, msg, write_sz); + test_assert("returned correct number of bytes written", + ret == write_sz); + test_assert("write_pos updated", hdr->write_pos == write_sz); + test_assert("read not updated", hdr->read_pos == 0); + test_assert("ring is not full", hdr->full == 0); + test_assert("hdr_size stayed the same", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); + free(msg); +} + +void test_push_full_ring() +{ + int ret; + void *base_addr, *msg; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = RING_SIZE - hdr_size; + msg = malloc(write_sz); + + ret = shmring_push(ring, msg, write_sz); + test_assert("returned correct number of bytes written", + ret == write_sz); + test_assert("write_pos updated", hdr->write_pos == 0); + test_assert("read not updated", hdr->read_pos == 0); + test_assert("ring is full", hdr->full == 1); + test_assert("hdr_size stayed the same", + hdr->ring_size == (RING_SIZE - hdr_size)); + + ret = shmring_push(ring, msg, 1); + test_assert("write to full ring failed", ret == 0); + test_assert("write_pos not updated", hdr->write_pos == 0); + test_assert("read not updated", hdr->read_pos == 0); + test_assert("ring is still full", hdr->full == 1); + test_assert("hdr_size still stayed the same", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); + free(msg); +} + +void test_fragmented_push() +{ + int ret; + void *base_addr, *msg, *dst; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = RING_SIZE - hdr_size - 5; + msg = malloc(write_sz); + ret = shmring_push(ring, msg, write_sz); + + test_assert("returned correct number of bytes written", + ret == write_sz); + test_assert("write_pos updated", hdr->write_pos == write_sz); + test_assert("read not updated", hdr->read_pos == 0); + test_assert("ring is full", hdr->full == 0); + test_assert("hdr_size stayed the same", + hdr->ring_size == (RING_SIZE - hdr_size)); + + size_t read_sz = 10; + dst = malloc(read_sz); + shmring_pop(ring, dst, read_sz); + + size_t fwrite_sz = 8; + assert(fwrite_sz < write_sz); + ret = shmring_push(ring, msg, fwrite_sz); + + test_assert("returned correct number of bytes written for frag write", + ret == fwrite_sz); + test_assert("write_pos updated for frag write", + hdr->write_pos == 3); + test_assert("read not updated for frag write", hdr->read_pos == read_sz); + test_assert("ring is not full", hdr->full == 0); + test_assert("hdr_size stayed the same for frag write", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(msg); + free(dst); +} + + +void test_pop_ring() +{ + int ret; + void *base_addr; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + uint8_t write_msg[3] = {0, 1, 2}; + uint8_t *dst; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = 3; + shmring_push(ring, write_msg, write_sz); + + dst = malloc(write_sz); + ret = shmring_pop(ring, dst, write_sz); + + test_assert("returned correct number of bytes read", ret == write_sz); + test_assert("read did not update write pos", hdr->write_pos == write_sz); + test_assert("read pos updated", hdr->read_pos == write_sz); + test_assert("ring is not full", hdr->full == 0); + test_assert("values are correct", + dst[0] == 0 && dst[1] == 1 && dst[2] == 2); + test_assert("ring size stayed the same after read", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); + free(dst); +} + +void test_pop_too_large() +{ + int ret; + void *base_addr, *write_msg; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + uint8_t *dst; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = 3; + write_msg = malloc(write_sz); + shmring_push(ring, write_msg, write_sz); + + size_t read_sz = 4; + dst = malloc(read_sz); + ret = shmring_pop(ring, dst, read_sz); + + test_assert("returned no bytes read", ret == 0); + test_assert("read did not update write pos", hdr->write_pos == write_sz); + test_assert("read pos was not updated", hdr->read_pos == 0); + test_assert("ring is not full", hdr->full == 0); + test_assert("ring size stayed the same after read", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); + free(write_msg); + free(dst); +} + +void test_pop_empty_ring() +{ + int ret; + void *base_addr, *write_msg; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + size_t msg_sz = 4; + uint8_t *dst; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + dst = malloc(msg_sz); + ret = shmring_pop(ring, dst, msg_sz); + + test_assert("returned no bytes read", ret == 0); + test_assert("read did not update write pos", hdr->write_pos == 0); + test_assert("read pos was not updated", hdr->read_pos == 0); + test_assert("ring is not full", hdr->full == 0); + test_assert("ring size stayed the same after read", + hdr->ring_size == (RING_SIZE - hdr_size)); + + write_msg = malloc(msg_sz); + shmring_push(ring, write_msg, msg_sz); + shmring_pop(ring, dst, msg_sz); + + ret = shmring_pop(ring, dst, msg_sz); + + test_assert("second empty read returned no bytes", ret == 0); + test_assert("second empty read did not update write pos", + hdr->write_pos == msg_sz); + test_assert("second empty read pos was not updated", + hdr->read_pos == msg_sz); + test_assert("ring is not full after second empty read", + hdr->full == 0); + test_assert("ring size stayed the same after second empty read", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); + free(write_msg); + free(dst); +} + +void test_pop_ring_till_empty() +{ + int ret; + void *base_addr, *msg, *dst; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = RING_SIZE - hdr_size; + msg = malloc(write_sz); + shmring_push(ring, msg, write_sz); + + dst = malloc(write_sz); + ret = shmring_pop(ring, dst, write_sz); + test_assert("returned correct number of bytes read", ret == write_sz); + test_assert("read did not update write pos", hdr->write_pos == 0); + test_assert("read pos updated", hdr->read_pos == 0); + test_assert("ring is not full", hdr->full == 0); + test_assert("ring size stayed the same after read", + hdr->ring_size == (RING_SIZE - hdr_size)); + + ret = shmring_pop(ring, dst, 1); + test_assert("returned no read bytes", ret == 0); + test_assert("second read did not update write pos", + hdr->write_pos == 0); + test_assert("read pos not updated", hdr->read_pos == 0); + test_assert("ring is still not full", hdr->full == 0); + test_assert("ring size stayed the same after second read", + hdr->ring_size == (RING_SIZE - hdr_size)); + +} + +void test_fragmented_pop() +{ + int ret; + void *base_addr, *jumbled_msg; + struct ring_buffer *ring; + struct ring_header *hdr; + size_t RING_SIZE = 100; + uint8_t write_msg[3] = {0, 1, 2}; + uint8_t *read_msg; + uint8_t *dst; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + hdr = ring->hdr_addr; + + size_t write_sz = RING_SIZE - hdr_size - 1; + jumbled_msg = malloc(write_sz); + shmring_push(ring, write_msg, write_sz); + dst = malloc(write_sz); + shmring_pop(ring, dst, write_sz); + shmring_push(ring, write_msg, 3); + + read_msg = malloc(3); + ret = shmring_pop(ring, read_msg, 3); + + test_assert("returned correct number of bytes read", ret = 3); + test_assert("read did not update write pos", hdr->write_pos == 2); + test_assert("read pos got updated", hdr->read_pos == 2); + test_assert("ring is not full", hdr->full == 0); + test_assert("values are correct", + read_msg[0] == 0 && read_msg[1] == 1 && read_msg[2] == 2); + test_assert("ring size statyed the same after read", + hdr->ring_size == (RING_SIZE - hdr_size)); + + free(base_addr); + free(dst); + free(read_msg); + free(jumbled_msg); +} + +void test_ring_is_empty() +{ + +} + +void test_ring_get_freesz() +{ + +} + +int main(int argc, char *argv[]) +{ + int ret = 0; + + if (test_subcase("reset ring", test_reset_ring, NULL)) + ret = 1; + + if (test_subcase("push ring", test_push_ring, NULL)) + ret = 1; + + if (test_subcase("push full ring", test_push_full_ring, NULL)) + ret = 1; + + if (test_subcase("push frag write to ring", test_fragmented_push, NULL)) + ret = 1; + + if (test_subcase("pop ring", test_pop_ring, NULL)) + ret = 1; + + if (test_subcase("pop too large", test_pop_too_large, NULL)) + ret = 1; + + if (test_subcase("pop empty ring", test_pop_empty_ring, NULL)) + ret = 1; + + if (test_subcase("pop ring until empty", test_pop_ring_till_empty, NULL)) + ret = 1; + + if (test_subcase("pop frag write to ring", test_fragmented_pop, NULL)) + ret = 1; + + + return ret; +} \ No newline at end of file From 6bc4358e1a19340c13912e84e0077b846e6f310b Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 11:08:46 +0200 Subject: [PATCH 36/50] add tests for get free sz of ring and check if it's empty --- tests/tas_unit/shmring.c | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/tests/tas_unit/shmring.c b/tests/tas_unit/shmring.c index a51bc396..84f93ea2 100644 --- a/tests/tas_unit/shmring.c +++ b/tests/tas_unit/shmring.c @@ -343,12 +343,88 @@ void test_fragmented_pop() void test_ring_is_empty() { + int ret; + void *base_addr, *msg, *dst; + struct ring_buffer *ring; + size_t RING_SIZE = 100; + + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + + ret = shmring_is_empty(ring); + test_assert("ring is empty after initialization", ret); + size_t hdr_size = sizeof(struct ring_header); + msg = malloc(RING_SIZE - hdr_size); + dst = malloc(RING_SIZE - hdr_size); + + shmring_push(ring, msg, 10); + ret = shmring_is_empty(ring); + test_assert("ring is not empty after pushing one message", ret == 0); + + shmring_pop(ring, dst, 10); + ret = shmring_is_empty(ring); + test_assert("ring is empty after pushing and popping message", ret); + + shmring_push(ring, msg, RING_SIZE - hdr_size); + ret = shmring_is_empty(ring); + test_assert("ring is not empty when full", ret == 0); + + shmring_pop(ring, dst, RING_SIZE - hdr_size); + ret = shmring_is_empty(ring); + test_assert("ring is empty after being full and popped completely", ret); + + shmring_push(ring, msg, RING_SIZE - hdr_size); + shmring_pop(ring, dst, 10); + shmring_push(ring, msg, 5); + ret = shmring_is_empty(ring); + test_assert("ring is not empty when write_pos < read_pos", ret == 0); } void test_ring_get_freesz() { + int ret; + void *base_addr, *msg, *dst; + struct ring_buffer *ring; + size_t RING_SIZE = 100; + base_addr = malloc(RING_SIZE); + ring = shmring_init(base_addr, RING_SIZE); + shmring_reset(ring, RING_SIZE); + size_t hdr_size = sizeof(struct ring_header); + + ret = shmring_get_freesz(ring); + test_assert("get free size after initialization", + ret == RING_SIZE - hdr_size); + + msg = malloc(RING_SIZE - hdr_size); + dst = malloc(RING_SIZE - hdr_size); + + shmring_push(ring, msg, 10); + ret = shmring_get_freesz(ring); + test_assert("get free size after pushing one message", + ret == RING_SIZE - hdr_size - 10); + + shmring_pop(ring, dst, 10); + ret = shmring_get_freesz(ring); + test_assert("get free size after pushing and popping message", + ret == RING_SIZE - hdr_size); + + shmring_push(ring, msg, RING_SIZE - hdr_size); + ret = shmring_get_freesz(ring); + test_assert("get free size when full", ret == 0); + + shmring_pop(ring, dst, RING_SIZE - hdr_size); + ret = shmring_get_freesz(ring); + test_assert("get free size after being full and popped completely", + ret == RING_SIZE - hdr_size); + + shmring_push(ring, msg, RING_SIZE - hdr_size); + shmring_pop(ring, dst, 10); + shmring_push(ring, msg, 5); + ret = shmring_get_freesz(ring); + test_assert("get free size when write_pos < read_pos", ret == 5); } int main(int argc, char *argv[]) @@ -382,6 +458,12 @@ int main(int argc, char *argv[]) if (test_subcase("pop frag write to ring", test_fragmented_pop, NULL)) ret = 1; + if (test_subcase("ring is empty check", test_ring_is_empty, NULL)) + ret = 1; + + if (test_subcase("get free size", test_ring_get_freesz, NULL)) + ret = 1; + return ret; } \ No newline at end of file From 89fa5dfdc1cdd5a53c717d04f900494db8e8ac5b Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 11:17:54 +0200 Subject: [PATCH 37/50] add memory barrier after reading is empty --- proxy/guest/ivshmem.c | 2 ++ proxy/host/ivshmem.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/guest/ivshmem.c b/proxy/guest/ivshmem.c index eaed6a23..e3bcc4f2 100644 --- a/proxy/guest/ivshmem.c +++ b/proxy/guest/ivshmem.c @@ -88,6 +88,8 @@ int ivshmem_channel_poll(struct guest_proxy *pxy) shmring_lock(pxy->chan->rx); is_empty = shmring_is_empty(pxy->chan->rx); shmring_unlock(pxy->chan->rx); + + MEM_BARRIER(); if (is_empty) { return 0; diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index fe63c623..836ad2c8 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -451,7 +451,9 @@ static int channel_poll_vm(struct v_machine *vm) /* Move on if rx channel for this vm is empty */ shmring_lock(vm->chan->rx); is_empty = shmring_is_empty(vm->chan->rx); - shmring_unlock(vm->chan->rx); + shmring_unlock(vm->chan->rx); + + MEM_BARRIER(); if (is_empty) { return 0; From d48908739a9becca66e1d781e6a08f8949553ddb Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 13:07:21 +0200 Subject: [PATCH 38/50] add logs to channel to trace messages sent back and forth --- proxy/guest/flextcp.c | 4 ++++ proxy/guest/ivshmem.c | 6 ++++++ proxy/host/ivshmem.c | 6 +++++- proxy/shmring.c | 15 +++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/proxy/guest/flextcp.c b/proxy/guest/flextcp.c index 975aa6e5..c2648eef 100644 --- a/proxy/guest/flextcp.c +++ b/proxy/guest/flextcp.c @@ -331,6 +331,7 @@ static int vflextcp_uxsocket_accept(struct guest_proxy *pxy) /* Register app with host */ req_msg.msg_type = MSG_TYPE_NEWAPP_REQ; req_msg.cfd = cfd; + printf("MSG_TYPE_NEWAPP_REQ\n"); ret = channel_write(pxy->chan, &req_msg, sizeof(req_msg)); if (ret != sizeof(req_msg)) { @@ -498,6 +499,7 @@ static int vflextcp_uxsocket_handle_msg(struct guest_proxy *pxy, msg.ctxreq_id = ctx_req->ctxreq_id; msg.actx_evfd = ctx_req->actx_evfd; + printf("MSG_TYPE_CONTEXT_REQ\n"); ret = channel_write(pxy->chan, &msg, sizeof(struct context_req_msg)); if (ret < sizeof(struct context_req_msg)) { @@ -551,6 +553,7 @@ static int vflextcp_handle_tas_kernel_poke(struct guest_proxy *pxy, int ret; ivshmem_drain_evfd(pxy->kernel_notifyfd); + printf("MSG_TYPE_POKE_TAS_KERNEL\n"); ret = channel_write(pxy->chan, msg, sizeof(struct poke_tas_kernel_msg)); if (ret != sizeof(struct poke_tas_kernel_msg)) @@ -570,6 +573,7 @@ static int vflextcp_handle_tas_core_poke(struct guest_proxy *pxy, int ret; ivshmem_drain_evfd(pxy->core_evfds[msg->core_id]); + printf("MSG_TYPE_POKE_TAS_CORE\n"); ret = channel_write(pxy->chan, msg, sizeof(struct poke_tas_core_msg)); if (ret != sizeof(struct poke_tas_core_msg)) diff --git a/proxy/guest/ivshmem.c b/proxy/guest/ivshmem.c index e3bcc4f2..6785907a 100644 --- a/proxy/guest/ivshmem.c +++ b/proxy/guest/ivshmem.c @@ -109,18 +109,23 @@ int ivshmem_channel_poll(struct guest_proxy *pxy) switch(msg_type) { case MSG_TYPE_HELLO: + printf("MSG_TYPE_HELLO\n"); channel_handle_hello(pxy); break; case MSG_TYPE_TASINFO_RES: + printf("MSG_TYPE_TASINFO_RES\n"); channel_handle_tasinfo_res(pxy, (struct tasinfo_res_msg *) msg); break; case MSG_TYPE_NEWAPP_RES: + printf("MSG_TYPE_NEWAPP_RES\n"); channel_handle_newapp_res(pxy, (struct newapp_res_msg *) msg); break; case MSG_TYPE_CONTEXT_RES: + printf("MSG_TYPE_CONTEXT_RES\n"); channel_handle_ctx_res(pxy, (struct context_res_msg *) msg); break; case MSG_TYPE_POKE_APP_CTX: + printf("MSG_TYPE_POKE_APP_CTX\n"); channel_handle_vpoke(pxy, (struct poke_app_ctx_msg *) msg); break; default: @@ -137,6 +142,7 @@ static int channel_handle_hello(struct guest_proxy *pxy) /* Send tasinfo request and wait for the response in the channel poll */ treq_msg.msg_type = MSG_TYPE_TASINFO_REQ; + printf("MSG_TYPE_TASINFO_REQ\n"); ret = channel_write(pxy->chan, &treq_msg, sizeof(struct tasinfo_req_msg)); if (ret != sizeof(struct tasinfo_req_msg)) { diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 836ad2c8..6b81fef9 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -380,6 +380,7 @@ static int uxsocket_accept() h_msg.msg_type = MSG_TYPE_HELLO; h_msg.n_cores = flexnic_info_pxy->cores_num; + printf("MSG_TYPE_HELLO\n"); ret = channel_write(chan, &h_msg, sizeof(struct hello_msg)); if (ret < 0) { @@ -522,6 +523,7 @@ static int channel_handle_tasinforeq_msg(struct v_machine *vm) goto free_msg; } + printf("MSG_TYPE_TASINFO_RES\n"); ret = channel_write(vm->chan, msg, sizeof(struct tasinfo_res_msg)); if (ret < sizeof(struct tasinfo_res_msg)) { @@ -592,6 +594,7 @@ static int channel_handle_ctx_req(struct v_machine *vm, res_msg.ctxreq_id = msg->ctxreq_id; res_msg.app_id = msg->app_id; + printf("MSG_TYPE_CONTEXT_RES\n"); ret = channel_write(vm->chan, &res_msg, sizeof(struct context_res_msg)); if (ret < sizeof(struct context_res_msg)) { @@ -631,6 +634,7 @@ static int channel_handle_newapp(struct v_machine *vm, msg_res.msg_type = MSG_TYPE_NEWAPP_RES; msg_res.cfd = msg_req->cfd; + printf("MSG_TYPE_NEWAPP_RES\n"); ret = channel_write(vm->chan, &msg_res, sizeof(msg_res)); if (ret != sizeof(msg_res)) @@ -642,7 +646,6 @@ static int channel_handle_newapp(struct v_machine *vm, notify_guest(vm->ifd); - printf("REGISTERED APP IN VM=%d\n", vm->id); return 0; } @@ -690,6 +693,7 @@ static int app_ctxs_poll() msg.msg_type = MSG_TYPE_POKE_APP_CTX; msg.ctxreq_id = vctx->ctxreq_id; + printf("MSG_TYPE_POKE_APP_CTX\n"); ret = channel_write(vctx->vm->chan, &msg, sizeof(struct poke_app_ctx_msg)); diff --git a/proxy/shmring.c b/proxy/shmring.c index 10c6960d..f90a2dcd 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -134,6 +134,10 @@ size_t shmring_pop(struct ring_buffer *rx_ring, void *dst, size_t size) hdr->read_pos %= hdr->ring_size; hdr->full = 0; + int is_empty = shmring_is_empty(rx_ring); + printf("shmring_pop: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + return size; } @@ -168,6 +172,10 @@ size_t pop_fragmented(struct ring_buffer *rx_ring, hdr->read_pos %= hdr->ring_size; hdr->full = 0; + int is_empty = shmring_is_empty(rx_ring); + printf("pop_fragmented: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + return size; } @@ -275,6 +283,9 @@ size_t shmring_push(struct ring_buffer *tx_ring, void *src, size_t size) hdr->full = 1; } + int is_empty = shmring_is_empty(tx_ring); + printf("shmring_push: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); return size; } @@ -311,6 +322,10 @@ size_t push_fragmented(struct ring_buffer *tx_ring, hdr->full = 1; } + int is_empty = shmring_is_empty(tx_ring); + printf("push_fragmented: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + return size; } From 51b23bf0480b0b52713993e52e3561a2a5af053a Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 13:12:51 +0200 Subject: [PATCH 39/50] position msg type log after write --- proxy/guest/flextcp.c | 8 ++++---- proxy/guest/ivshmem.c | 2 +- proxy/host/ivshmem.c | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/proxy/guest/flextcp.c b/proxy/guest/flextcp.c index c2648eef..8918ca58 100644 --- a/proxy/guest/flextcp.c +++ b/proxy/guest/flextcp.c @@ -331,8 +331,8 @@ static int vflextcp_uxsocket_accept(struct guest_proxy *pxy) /* Register app with host */ req_msg.msg_type = MSG_TYPE_NEWAPP_REQ; req_msg.cfd = cfd; - printf("MSG_TYPE_NEWAPP_REQ\n"); ret = channel_write(pxy->chan, &req_msg, sizeof(req_msg)); + printf("MSG_TYPE_NEWAPP_REQ\n"); if (ret != sizeof(req_msg)) { fprintf(stderr, "vflextcp_uxsocket_accept: " @@ -499,8 +499,8 @@ static int vflextcp_uxsocket_handle_msg(struct guest_proxy *pxy, msg.ctxreq_id = ctx_req->ctxreq_id; msg.actx_evfd = ctx_req->actx_evfd; - printf("MSG_TYPE_CONTEXT_REQ\n"); ret = channel_write(pxy->chan, &msg, sizeof(struct context_req_msg)); + printf("MSG_TYPE_CONTEXT_REQ\n"); if (ret < sizeof(struct context_req_msg)) { fprintf(stderr, "vflextcp_uxsocket_handle_msg: " @@ -553,8 +553,8 @@ static int vflextcp_handle_tas_kernel_poke(struct guest_proxy *pxy, int ret; ivshmem_drain_evfd(pxy->kernel_notifyfd); - printf("MSG_TYPE_POKE_TAS_KERNEL\n"); ret = channel_write(pxy->chan, msg, sizeof(struct poke_tas_kernel_msg)); + printf("MSG_TYPE_POKE_TAS_KERNEL\n"); if (ret != sizeof(struct poke_tas_kernel_msg)) { @@ -573,8 +573,8 @@ static int vflextcp_handle_tas_core_poke(struct guest_proxy *pxy, int ret; ivshmem_drain_evfd(pxy->core_evfds[msg->core_id]); - printf("MSG_TYPE_POKE_TAS_CORE\n"); ret = channel_write(pxy->chan, msg, sizeof(struct poke_tas_core_msg)); + printf("MSG_TYPE_POKE_TAS_CORE\n"); if (ret != sizeof(struct poke_tas_core_msg)) { diff --git a/proxy/guest/ivshmem.c b/proxy/guest/ivshmem.c index 6785907a..ee54adfe 100644 --- a/proxy/guest/ivshmem.c +++ b/proxy/guest/ivshmem.c @@ -142,8 +142,8 @@ static int channel_handle_hello(struct guest_proxy *pxy) /* Send tasinfo request and wait for the response in the channel poll */ treq_msg.msg_type = MSG_TYPE_TASINFO_REQ; - printf("MSG_TYPE_TASINFO_REQ\n"); ret = channel_write(pxy->chan, &treq_msg, sizeof(struct tasinfo_req_msg)); + printf("MSG_TYPE_TASINFO_REQ\n"); if (ret != sizeof(struct tasinfo_req_msg)) { fprintf(stderr, "channel_handle_hello: failed to write tasinfo req msg.\n"); diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 6b81fef9..352a352d 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -380,8 +380,8 @@ static int uxsocket_accept() h_msg.msg_type = MSG_TYPE_HELLO; h_msg.n_cores = flexnic_info_pxy->cores_num; - printf("MSG_TYPE_HELLO\n"); ret = channel_write(chan, &h_msg, sizeof(struct hello_msg)); + printf("MSG_TYPE_HELLO\n"); if (ret < 0) { fprintf(stderr, "ivshmem_uxsocket_accept: failed to send number " @@ -523,8 +523,8 @@ static int channel_handle_tasinforeq_msg(struct v_machine *vm) goto free_msg; } - printf("MSG_TYPE_TASINFO_RES\n"); ret = channel_write(vm->chan, msg, sizeof(struct tasinfo_res_msg)); + printf("MSG_TYPE_TASINFO_RES\n"); if (ret < sizeof(struct tasinfo_res_msg)) { fprintf(stderr, "ivshmem_handle_tasinforeq_msg: " @@ -594,8 +594,8 @@ static int channel_handle_ctx_req(struct v_machine *vm, res_msg.ctxreq_id = msg->ctxreq_id; res_msg.app_id = msg->app_id; - printf("MSG_TYPE_CONTEXT_RES\n"); ret = channel_write(vm->chan, &res_msg, sizeof(struct context_res_msg)); + printf("MSG_TYPE_CONTEXT_RES\n"); if (ret < sizeof(struct context_res_msg)) { fprintf(stderr, "ivshmem_handle_ctxreq: failed to send ctx res.\n"); @@ -634,8 +634,8 @@ static int channel_handle_newapp(struct v_machine *vm, msg_res.msg_type = MSG_TYPE_NEWAPP_RES; msg_res.cfd = msg_req->cfd; - printf("MSG_TYPE_NEWAPP_RES\n"); ret = channel_write(vm->chan, &msg_res, sizeof(msg_res)); + printf("MSG_TYPE_NEWAPP_RES\n"); if (ret != sizeof(msg_res)) { @@ -693,8 +693,8 @@ static int app_ctxs_poll() msg.msg_type = MSG_TYPE_POKE_APP_CTX; msg.ctxreq_id = vctx->ctxreq_id; - printf("MSG_TYPE_POKE_APP_CTX\n"); ret = channel_write(vctx->vm->chan, &msg, sizeof(struct poke_app_ctx_msg)); + printf("MSG_TYPE_POKE_APP_CTX\n"); if (ret != sizeof(struct poke_app_ctx_msg)) From d2aa04918bea4211784f7ca3e30c8dfd2818b9b3 Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 13:46:18 +0200 Subject: [PATCH 40/50] add msg size to log --- proxy/shmring.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/proxy/shmring.c b/proxy/shmring.c index f90a2dcd..cf9394b6 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -135,8 +135,8 @@ size_t shmring_pop(struct ring_buffer *rx_ring, void *dst, size_t size) hdr->full = 0; int is_empty = shmring_is_empty(rx_ring); - printf("shmring_pop: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", - hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + printf("shmring_pop: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d size=%ld\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty, size); return size; } @@ -173,8 +173,8 @@ size_t pop_fragmented(struct ring_buffer *rx_ring, hdr->full = 0; int is_empty = shmring_is_empty(rx_ring); - printf("pop_fragmented: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", - hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + printf("pop_fragmented: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d size=%ld\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty, size); return size; } @@ -284,8 +284,8 @@ size_t shmring_push(struct ring_buffer *tx_ring, void *src, size_t size) } int is_empty = shmring_is_empty(tx_ring); - printf("shmring_push: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", - hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + printf("shmring_push: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d size=%ld\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty, size); return size; } @@ -323,8 +323,8 @@ size_t push_fragmented(struct ring_buffer *tx_ring, } int is_empty = shmring_is_empty(tx_ring); - printf("push_fragmented: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d\n", - hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty); + printf("push_fragmented: write_pos=%d read_pos=%d ring_size=%ld full=%d is_empty=%d size=%ld\n", + hdr->write_pos, hdr->read_pos, hdr->ring_size, hdr->full, is_empty, size); return size; } From 13cb770741a02e0c88499fe7210d529891e006a2 Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 17:14:12 +0200 Subject: [PATCH 41/50] add break condition after ring write is successful --- proxy/channel.c | 8 +++++--- proxy/guest/ivshmem.c | 1 - proxy/host/ivshmem.c | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/channel.c b/proxy/channel.c index 072b5c90..d0772163 100644 --- a/proxy/channel.c +++ b/proxy/channel.c @@ -52,10 +52,12 @@ size_t channel_write(struct channel *chan, void *buf, size_t size) do { shmring_lock(chan->tx); free_sz = shmring_get_freesz(chan->tx); - - if (free_sz >= size) + if (free_sz >= size) + { ret = shmring_push(chan->tx, buf, size); - + shmring_unlock(chan->tx); + break; + } shmring_unlock(chan->tx); } while(free_sz < size); diff --git a/proxy/guest/ivshmem.c b/proxy/guest/ivshmem.c index ee54adfe..890be1c7 100644 --- a/proxy/guest/ivshmem.c +++ b/proxy/guest/ivshmem.c @@ -89,7 +89,6 @@ int ivshmem_channel_poll(struct guest_proxy *pxy) is_empty = shmring_is_empty(pxy->chan->rx); shmring_unlock(pxy->chan->rx); - MEM_BARRIER(); if (is_empty) { return 0; diff --git a/proxy/host/ivshmem.c b/proxy/host/ivshmem.c index 352a352d..2806f0de 100644 --- a/proxy/host/ivshmem.c +++ b/proxy/host/ivshmem.c @@ -454,7 +454,6 @@ static int channel_poll_vm(struct v_machine *vm) is_empty = shmring_is_empty(vm->chan->rx); shmring_unlock(vm->chan->rx); - MEM_BARRIER(); if (is_empty) { return 0; From 7bcd932957593f73d6428b4aba970ae0525a3d7d Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 18:22:13 +0200 Subject: [PATCH 42/50] add assert to channel write --- proxy/channel.c | 2 ++ proxy/guest/ivshmem.c | 2 ++ proxy/shmring.c | 1 + 3 files changed, 5 insertions(+) diff --git a/proxy/channel.c b/proxy/channel.c index d0772163..34da6166 100644 --- a/proxy/channel.c +++ b/proxy/channel.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "channel.h" #include "shmring.h" @@ -55,6 +56,7 @@ size_t channel_write(struct channel *chan, void *buf, size_t size) if (free_sz >= size) { ret = shmring_push(chan->tx, buf, size); + assert(ret == size || ret == 0); shmring_unlock(chan->tx); break; } diff --git a/proxy/guest/ivshmem.c b/proxy/guest/ivshmem.c index 890be1c7..ed57765b 100644 --- a/proxy/guest/ivshmem.c +++ b/proxy/guest/ivshmem.c @@ -85,10 +85,12 @@ int ivshmem_channel_poll(struct guest_proxy *pxy) size_t msg_size; /* Return if there are no messages in channel */ + MEM_BARRIER(); shmring_lock(pxy->chan->rx); is_empty = shmring_is_empty(pxy->chan->rx); shmring_unlock(pxy->chan->rx); + MEM_BARRIER(); if (is_empty) { return 0; diff --git a/proxy/shmring.c b/proxy/shmring.c index cf9394b6..243749f8 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -28,6 +28,7 @@ struct ring_buffer* shmring_init(void *base_addr, size_t size) ring->buf_addr = base_addr + sizeof(struct ring_header); ring->size = size; + memset(base_addr, 0, size); return ring; } From 392cf337812a61cbfdadef39284cf77dba57f3c4 Mon Sep 17 00:00:00 2001 From: stolet Date: Mon, 3 Apr 2023 18:30:21 +0200 Subject: [PATCH 43/50] actually add memset to 0 in shmring reset instead of init --- proxy/shmring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/shmring.c b/proxy/shmring.c index 243749f8..0de1ac09 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -28,7 +28,6 @@ struct ring_buffer* shmring_init(void *base_addr, size_t size) ring->buf_addr = base_addr + sizeof(struct ring_header); ring->size = size; - memset(base_addr, 0, size); return ring; } @@ -37,6 +36,7 @@ void shmring_reset(struct ring_buffer *ring, size_t size) { struct ring_header *hdr = ring->hdr_addr; + memset(ring->hdr_addr, 0, size); hdr->read_pos = 0; hdr->write_pos = 0; hdr->full = 0; From 68f99823c3b3ca66785095521ba8fdcd98be13e5 Mon Sep 17 00:00:00 2001 From: stolet Date: Tue, 4 Apr 2023 16:06:15 +0200 Subject: [PATCH 44/50] change ovstas to use vhost instead of tap --- experiments/components/client.py | 23 ++++++------ experiments/components/proxy.py | 8 +++-- experiments/components/server.py | 15 +++++--- experiments/components/tas.py | 8 +++-- experiments/components/vm.py | 21 ++++++++--- experiments/nodes/node.py | 30 +++++++++++----- experiments/nodes/ovs_linux/ovslinux.py | 7 ++-- .../nodes/ovs_linux/ovslinux_client.py | 3 ++ experiments/nodes/ovs_tas/ovstas.py | 35 +++++++++---------- experiments/nodes/tap_tas/ttas.py | 3 ++ experiments/nodes/virt_linux/vlinux.py | 3 ++ experiments/nodes/virt_tas/vtas.py | 5 +++ images/{br_down.sh => br-down.sh} | 0 images/{br_up.sh => br-up.sh} | 0 images/{dpdk_bind.sh => dpdk-bind.sh} | 0 images/dpdk-ovsbr-add.sh | 32 +++++++++++++++++ images/ovs-start.sh | 17 +++++++++ images/ovs-stop.sh | 5 +++ images/start-vm.sh | 12 ++++--- images/{tap_down.sh => tap-down.sh} | 0 images/{tap_up.sh => tap-up.sh} | 0 21 files changed, 167 insertions(+), 60 deletions(-) rename images/{br_down.sh => br-down.sh} (100%) rename images/{br_up.sh => br-up.sh} (100%) rename images/{dpdk_bind.sh => dpdk-bind.sh} (100%) create mode 100644 images/dpdk-ovsbr-add.sh create mode 100644 images/ovs-start.sh create mode 100644 images/ovs-stop.sh rename images/{tap_down.sh => tap-down.sh} (100%) rename images/{tap_up.sh => tap-up.sh} (100%) diff --git a/experiments/components/client.py b/experiments/components/client.py index 1848757e..9c0f8c11 100644 --- a/experiments/components/client.py +++ b/experiments/components/client.py @@ -17,7 +17,7 @@ def __init__(self, defaults, machine_config, client_config, vm_config, wmanager) machine_config.is_remote) def run_bare(self, w_sudo, ld_preload): - self.run_benchmark_rpc(w_sudo, ld_preload) + self.run_benchmark_rpc(w_sudo, ld_preload, clean=False) def run_virt(self, w_sudo, ld_preload): ssh_com = utils.get_ssh_command(self.machine_config, self.vm_config) @@ -25,18 +25,24 @@ def run_virt(self, w_sudo, ld_preload): time.sleep(3) self.pane.send_keys("tas") time.sleep(3) - self.run_benchmark_rpc(w_sudo, ld_preload) + self.run_benchmark_rpc(w_sudo, ld_preload, clean=False) - def run_benchmark_rpc(self, w_sudo, ld_preload): + def run_benchmark_rpc(self, w_sudo, ld_preload, clean): self.pane.send_keys('cd ' + self.client_config.comp_dir) + + if clean: + self.pane.send_keys(self.client_config.clean_cmd) + time.sleep(1) + self.pane.send_keys(self.client_config.comp_cmd) + time.sleep(1) self.pane.send_keys("cd " + self.client_config.tas_dir) time.sleep(3) cmd = 'stdbuf -oL ' if w_sudo: - cmd += 'sudo ' + cmd += 'sudo -E ' if ld_preload: cmd += 'LD_PRELOAD=' + self.client_config.lib_so + ' ' @@ -46,18 +52,9 @@ def run_benchmark_rpc(self, w_sudo, ld_preload): ' | tee ' + \ self.client_config.out - print(cmd) self.pane.send_keys(cmd) def save_log_virt(self, exp_path): - # kill process to force flush to file - # ssh_com = utils.get_ssh_command(self.machine_config, self.vm_config) - # ssh_com += " 'sudo pkill testclient'" - # self.save_logs_pane.send_keys(ssh_com) - # time.sleep(3) - # self.save_logs_pane.send_keys(suppress_history=False, cmd='tas') - # time.sleep(1) - split_path = exp_path.split("/") n = len(split_path) diff --git a/experiments/components/proxy.py b/experiments/components/proxy.py index f0ea467d..543f969b 100644 --- a/experiments/components/proxy.py +++ b/experiments/components/proxy.py @@ -22,9 +22,11 @@ def run(self): pane=self.pane, comp_dir=self.proxy_config.comp_dir, comp_cmd=self.proxy_config.comp_cmd, + clean_cmd=self.proxy_config.clean_cmd, exec_file=self.proxy_config.exec_file, out=self.proxy_config.out, - args='') + args='', + clean=False) class ProxyGuest(Proxy): @@ -44,7 +46,9 @@ def run(self): pane=self.pane, comp_dir=self.proxy_config.comp_dir, comp_cmd=self.proxy_config.comp_cmd, + clean_cmd=self.proxy_config.clean_cmd, exec_file=self.proxy_config.exec_file, out=self.proxy_config.out, args='', - bg=False) \ No newline at end of file + bg=False, + clean=False) \ No newline at end of file diff --git a/experiments/components/server.py b/experiments/components/server.py index ea714326..e41feef1 100644 --- a/experiments/components/server.py +++ b/experiments/components/server.py @@ -15,18 +15,24 @@ def __init__(self, defaults, machine_config, machine_config.is_remote) def run_bare(self, w_sudo, ld_preload): - self.run_benchmark_rpc(w_sudo, ld_preload) + self.run_benchmark_rpc(w_sudo, ld_preload, clean=False) def run_virt(self, w_sudo, ld_preload): ssh_com = utils.get_ssh_command(self.machine_config, self.vm_config) self.pane.send_keys(ssh_com) time.sleep(3) self.pane.send_keys("tas") - self.run_benchmark_rpc(w_sudo, ld_preload) + self.run_benchmark_rpc(w_sudo, ld_preload, clean=False) - def run_benchmark_rpc(self, w_sudo, ld_preload): + def run_benchmark_rpc(self, w_sudo, ld_preload, clean): self.pane.send_keys('cd ' + self.server_config.comp_dir) + + if clean: + self.pane.send_keys(self.server_config.clean_cmd) + time.sleep(1) + self.pane.send_keys(self.server_config.comp_cmd) + time.sleep(1) self.pane.send_keys("cd " + self.server_config.tas_dir) time.sleep(3) @@ -34,7 +40,7 @@ def run_benchmark_rpc(self, w_sudo, ld_preload): stack = self.machine_config.stack if w_sudo: - cmd = 'sudo ' + cmd = 'sudo -E ' if ld_preload: cmd += 'LD_PRELOAD=' + self.server_config.lib_so + ' ' @@ -45,5 +51,4 @@ def run_benchmark_rpc(self, w_sudo, ld_preload): # ' | tee ' + \ # self.server_config.out - print(cmd) self.pane.send_keys(cmd) \ No newline at end of file diff --git a/experiments/components/tas.py b/experiments/components/tas.py index 00cc0ce7..cdf4093d 100644 --- a/experiments/components/tas.py +++ b/experiments/components/tas.py @@ -19,10 +19,12 @@ def run_bare(self): utils.compile_and_run(pane=self.pane, comp_dir=self.tas_config.comp_dir, comp_cmd=self.tas_config.comp_cmd, + clean_cmd=self.tas_config.clean_cmd, exec_file=self.tas_config.exec_file, out=self.tas_config.out, args=tas_args, - save_log=True) + save_log=True, + clean=False) def run_virt(self): ssh_com = utils.get_ssh_command(self.machine_config, self.vm_config) @@ -35,10 +37,12 @@ def run_virt(self): utils.compile_and_run(pane=self.pane, comp_dir=self.tas_config.comp_dir, comp_cmd=self.tas_config.comp_cmd, + clean_cmd=self.tas_config.clean_cmd, exec_file=self.tas_config.exec_file, out=self.tas_config.out, args=tas_args, - save_log=True) + save_log=True, + clean=False) def save_log_bare(self, exp_path): # # kill process to force flush to file diff --git a/experiments/components/vm.py b/experiments/components/vm.py index 791a9235..687d72d3 100644 --- a/experiments/components/vm.py +++ b/experiments/components/vm.py @@ -12,8 +12,9 @@ def __init__(self, defaults, machine_config, vm_config, wmanager): def start(self): self.pane.send_keys('cd ' + self.vm_config.manager_dir) - start_vm_cmd = "sudo bash start-vm.sh {} {}".format( - self.machine_config.stack, self.vm_config.id) + start_vm_cmd = "sudo bash start-vm.sh {} {} {}".format( + self.machine_config.stack, self.vm_config.id, + self.machine_config.interface) self.pane.send_keys(start_vm_cmd) print("Started VM") @@ -46,7 +47,7 @@ def init_interface(self, ip, interface): def dpdk_bind(self, ip, interface, pci_id): cmd = 'cd ' + self.vm_config.manager_dir_virt self.pane.send_keys(cmd) - cmd = 'bash dpdk_bind.sh {} {} {}'.format(ip, interface, pci_id) + cmd = 'bash dpdk-bind.sh {} {} {}'.format(ip, interface, pci_id) self.pane.send_keys(cmd) time.sleep(3) @@ -55,4 +56,16 @@ def login_vm(self): time.sleep(3) self.pane.send_keys(suppress_history=False, cmd='tas') self.pane.enter() - time.sleep(5) \ No newline at end of file + time.sleep(5) + + def shutdown(self): + self.pane.send_keys(suppress_history=False, cmd='whoami') + + captured_pane = self.pane.capture_pane() + user = captured_pane[len(captured_pane) - 2] + + # This means we are in the vm, so we don't + # accidentally shutdown machine + if user == 'tas': + self.pane.send_keys(suppress_history=False, cmd='sudo shutdown -h now') + time.sleep(2) \ No newline at end of file diff --git a/experiments/nodes/node.py b/experiments/nodes/node.py index 275ce937..ce7c792f 100644 --- a/experiments/nodes/node.py +++ b/experiments/nodes/node.py @@ -22,7 +22,7 @@ def tap_up(self, interface, script_dir, multi_queue): cmd = "cd {}".format(script_dir) self.setup_pane.send_keys(cmd) time.sleep(1) - cmd = "sudo bash tap_up.sh {} {}".format(interface, multi_queue) + cmd = "sudo bash tap-up.sh {} {}".format(interface, multi_queue) self.setup_pane.send_keys(cmd) time.sleep(2) @@ -30,7 +30,7 @@ def tap_down(self, interface, script_dir): cmd = "cd {}".format(script_dir) self.cleanup_pane.send_keys(cmd) time.sleep(1) - cmd = "sudo bash tap_down.sh {}".format(interface) + cmd = "sudo bash tap-down.sh {}".format(interface) self.cleanup_pane.send_keys(cmd) time.sleep(2) @@ -40,7 +40,7 @@ def bridge_up(self, ip, interface, script_dir): cmd = "cd {}".format(script_dir) self.setup_pane.send_keys(cmd) time.sleep(1) - cmd = "sudo bash br_up.sh {} {}/24".format(interface, ip) + cmd = "sudo bash br-up.sh {} {}/24".format(interface, ip) self.setup_pane.send_keys(cmd) time.sleep(2) @@ -50,17 +50,23 @@ def bridge_down(self, ip, interface, script_dir): cmd = "cd {}".format(script_dir) self.cleanup_pane.send_keys(cmd) time.sleep(1) - cmd = "sudo bash br_down.sh {} {}/24".format(interface, ip) + cmd = "sudo bash br-down.sh {} {}/24".format(interface, ip) self.cleanup_pane.send_keys(cmd) time.sleep(2) - def start_ovs(self, ovsctl_path): - cmd = "sudo {} start".format(ovsctl_path) + def start_ovs(self, script_dir): + cmd = "cd {}".format(script_dir) + self.setup_pane.send_keys(cmd) + time.sleep(1) + cmd = "sudo bash ovs-start.sh" self.setup_pane.send_keys(cmd) time.sleep(2) - def stop_ovs(self, ovsctl_path): - cmd = "sudo {} stop".format(ovsctl_path) + def stop_ovs(self, script_dir): + cmd = "cd {}".format(script_dir) + self.cleanup_pane.send_keys(cmd) + time.sleep(1) + cmd = "sudo bash ovs-stop.sh" self.cleanup_pane.send_keys(cmd) time.sleep(2) @@ -72,6 +78,14 @@ def ovsbr_add(self, br_name, ip, interface, script_dir): self.setup_pane.send_keys(cmd) time.sleep(2) + def dpdk_ovsbr_add(self, br_name, ip, interface, script_dir): + cmd = "cd {}".format(script_dir) + self.setup_pane.send_keys(cmd) + time.sleep(1) + cmd = "sudo bash dpdk-ovsbr-add.sh {} {} {}".format(br_name, ip, interface) + self.setup_pane.send_keys(cmd) + time.sleep(2) + def ovsbr_del(self, br_name): cmd = "sudo ovs-vsctl del-br {}".format(br_name) self.cleanup_pane.send_keys(cmd) diff --git a/experiments/nodes/ovs_linux/ovslinux.py b/experiments/nodes/ovs_linux/ovslinux.py index 86b28110..dbf8aa4f 100644 --- a/experiments/nodes/ovs_linux/ovslinux.py +++ b/experiments/nodes/ovs_linux/ovslinux.py @@ -19,7 +19,7 @@ def __init__(self, defaults, machine_config, def setup(self): super().setup() - self.start_ovs(self.defaults.ovs_ctl_path) + self.start_ovs(self.vm_configs[0].manager_dir) self.ovsbr_add("br0", self.machine_config.ip + "/24", self.machine_config.interface, @@ -35,7 +35,7 @@ def setup(self): def cleanup(self): super().cleanup() self.ovsbr_del("br0") - self.stop_ovs(self.defaults.ovs_ctl_path) + self.stop_ovs(self.vm_configs[0].manager_dir) cmd = "sudo ip addr add {} dev {}".format(self.machine_config.ip + "/24", self.machine_config.interface) @@ -48,6 +48,9 @@ def cleanup(self): for vm_config in self.vm_configs: self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) + + for vm in self.vms: + vm.shutdown() def start_vm(self, vm, vm_config): vm.start() diff --git a/experiments/nodes/ovs_linux/ovslinux_client.py b/experiments/nodes/ovs_linux/ovslinux_client.py index e25bef41..755afdd2 100644 --- a/experiments/nodes/ovs_linux/ovslinux_client.py +++ b/experiments/nodes/ovs_linux/ovslinux_client.py @@ -17,6 +17,9 @@ def __init__(self, config, wmanager): self.cnum = config.cnum self.clients = [] + def cleanup(self): + super().cleanup() + def start_clients(self): for i in range(self.nodenum): vm_config = self.vm_configs[i] diff --git a/experiments/nodes/ovs_tas/ovstas.py b/experiments/nodes/ovs_tas/ovstas.py index bfd83f34..5aa7cb6b 100644 --- a/experiments/nodes/ovs_tas/ovstas.py +++ b/experiments/nodes/ovs_tas/ovstas.py @@ -22,28 +22,23 @@ def __init__(self, defaults, machine_config, tas_configs, def setup(self): super().setup() - self.start_ovs(self.defaults.ovs_ctl_path) - self.ovsbr_add("br0", + self.start_ovs(self.vm_configs[0].manager_dir) + self.dpdk_ovsbr_add("br0", self.machine_config.ip + "/24", self.machine_config.interface, self.vm_configs[0].manager_dir) - for vm_config in self.vm_configs: - # Tap that allows us to ssh to VM - self.ovstap_add("br0", - "tap{}".format(vm_config.id), - 0, - vm_config.manager_dir) - # TAP used by OvS - self.ovstap_add("br0", - "ovstap{}".format(vm_config.id), - 1, - vm_config.manager_dir) + # for vm_config in self.vm_configs: + # # Tap that allows us to ssh to VM + # self.ovstap_add("br0", + # "tap{}".format(vm_config.id), + # 0, + # vm_config.manager_dir) def cleanup(self): super().cleanup() self.ovsbr_del("br0") - self.stop_ovs(self.defaults.ovs_ctl_path) + self.stop_ovs(self.vm_configs[0].manager_dir) cmd = "sudo ip addr add {} dev {}".format(self.machine_config.ip + "/24", self.machine_config.interface) @@ -54,9 +49,12 @@ def cleanup(self): self.cleanup_pane.send_keys(cmd) time.sleep(1) - for vm_config in self.vm_configs: - self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) - self.tap_down("ovstap{}".format(vm_config.id), vm_config.manager_dir) + # for vm_config in self.vm_configs: + # self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) + # self.tap_down("ovstap{}".format(vm_config.id), vm_config.manager_dir) + + for vm in self.vms: + vm.shutdown() def start_tas(self): for i in range(self.nodenum): @@ -77,8 +75,7 @@ def start_vm(self, vm, vm_config): vm.enable_hugepages() vm.enable_noiommu("1af4 1110") vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) - vm.init_interface(vm_config.tas_tap_ip, self.defaults.tas_interface) - vm.dpdk_bind(vm_config.tas_tap_ip, self.defaults.tas_interface, + vm.dpdk_bind(vm_config.vm_ip, self.defaults.vm_interface, self.defaults.pci_id) def start_vms(self): diff --git a/experiments/nodes/tap_tas/ttas.py b/experiments/nodes/tap_tas/ttas.py index 6a3017a3..880af0b7 100644 --- a/experiments/nodes/tap_tas/ttas.py +++ b/experiments/nodes/tap_tas/ttas.py @@ -39,6 +39,9 @@ def cleanup(self): self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) self.tap_down("tastap{}".format(vm_config.id), vm_config.manager_dir) + for vm in self.vms: + vm.shutdown() + def start_tas(self): for i in range(self.nodenum): tas_config = self.tas_configs[i] diff --git a/experiments/nodes/virt_linux/vlinux.py b/experiments/nodes/virt_linux/vlinux.py index 90d36f7f..0b78471f 100644 --- a/experiments/nodes/virt_linux/vlinux.py +++ b/experiments/nodes/virt_linux/vlinux.py @@ -33,6 +33,9 @@ def cleanup(self): for vm_config in self.vm_configs: self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) + for vm in self.vms: + vm.shutdown() + def start_vm(self, vm, vm_config): vm.start() vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) diff --git a/experiments/nodes/virt_tas/vtas.py b/experiments/nodes/virt_tas/vtas.py index ca3a509d..59b09b9a 100644 --- a/experiments/nodes/virt_tas/vtas.py +++ b/experiments/nodes/virt_tas/vtas.py @@ -24,6 +24,11 @@ def start_vm(self, vm): vm.start() vm.enable_noiommu("1af4 1110") + def cleanup(self): + super().cleanup() + for vm in self.vms: + vm.shutdown() + def start_vms(self): threads = [] for vm_config in self.vm_configs: diff --git a/images/br_down.sh b/images/br-down.sh similarity index 100% rename from images/br_down.sh rename to images/br-down.sh diff --git a/images/br_up.sh b/images/br-up.sh similarity index 100% rename from images/br_up.sh rename to images/br-up.sh diff --git a/images/dpdk_bind.sh b/images/dpdk-bind.sh similarity index 100% rename from images/dpdk_bind.sh rename to images/dpdk-bind.sh diff --git a/images/dpdk-ovsbr-add.sh b/images/dpdk-ovsbr-add.sh new file mode 100644 index 00000000..0e47355c --- /dev/null +++ b/images/dpdk-ovsbr-add.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 3 ]; then + echo "Illegal number of parameters" + echo "usage:" + echo "[br_name ip interface]" + exit +fi + +br_name=$1 +ip=$2 +interface=$3 + + +# Create bridge using OvS +echo "Creating bridge ${br_name} using OvS" +ovs-vsctl add-br $br_name +echo "Set bridge ${br_name} datapath type to netdev" +ovs-vsctl set bridge $br_name datapath_type=netdev +echo "Adding interface ${interface} to port" +ovs-vsctl add-port $br_name $interface +echo "Set dpdkvhost interface ${interface}" +ovs-vsctl set Interface $interface type=dpdkvhostuser options:n_rxq=12 + +# Delete ip config from interface so that it can be added to bridge +echo "Delete ip config from interface ${interface}" +sudo ip addr del $ip dev $interface + +# Add ip address to bridge +echo "Add ip ${ip} to bridge ${br_name}" +sudo ip addr add $ip dev $br_name +ifconfig $br_name up \ No newline at end of file diff --git a/images/ovs-start.sh b/images/ovs-start.sh new file mode 100644 index 00000000..1a33e90b --- /dev/null +++ b/images/ovs-start.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Start database server +export DB_SOCK=/usr/local/var/run/openvswitch/db.sock +echo "Creating conf.db and ovsschema" +ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/local/share/openvswitch/vswitch.ovsschema +echo "Starting serverver at ${DB_SOCK}" +ovsdb-server --remote=punix:${DB_SOCK} --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach + +# Start OVS +echo "Starting OVS" +ovs-vsctl --no-wait init +ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0xf +ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=1024 +ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true + +ovs-vswitchd unix:${DB_SOCK} --pidfile --detach --log-file=/usr/local/var/log/openvswitch/ovs-vswitchd.log \ No newline at end of file diff --git a/images/ovs-stop.sh b/images/ovs-stop.sh new file mode 100644 index 00000000..cc057d37 --- /dev/null +++ b/images/ovs-stop.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +killall ovsdb-server ovs-vswitchd +rm -f /var/run/openvswitch/vhost-user* +rm -f /usr/local/etc/openvswitch/conf.db \ No newline at end of file diff --git a/images/start-vm.sh b/images/start-vm.sh index 9b1cc42b..767bfe6d 100755 --- a/images/start-vm.sh +++ b/images/start-vm.sh @@ -4,6 +4,7 @@ set -ex stack=$1 vm_id=$2 +interface=$3 stty intr ^] stty susp ^] @@ -24,6 +25,8 @@ printf -v alt_mac '02:00:00:%02X:%02X:%02X' $((RANDOM%256)) $((RANDOM%256)) $((R echo $mac echo $alt_mac +# Note: vectors=<2 + 2 * queues_nr> + if [[ "$stack" == 'virt-tas' ]]; then sudo qemu-system-x86_64 \ -nographic -monitor none -serial stdio \ @@ -77,12 +80,11 @@ elif [[ "$stack" == 'ovs-tas' ]]; then -smp 12 \ -m 25G \ -snapshot \ - -netdev user,id=net0 \ + -netdev user,id=net0,hostfwd=tcp::222${vm_id}-:22 \ -device virtio-net-pci,netdev=net0 \ - -netdev tap,ifname=$tap,script=no,downscript=no,vhost=on,id=net1 \ - -device virtio-net-pci,mac=$mac,netdev=net1 \ - -netdev tap,ifname=$ovstap,script=no,downscript=no,vhost=on,queues=10,id=net2 \ - -device virtio-net-pci,mac=$alt_mac,vectors=18,mq=on,rss=on,hash=off,netdev=net2 \ + -chardev socket,id=char0,path=/usr/local/var/run/openvswitch/$interface \ + -netdev type=vhost-user,chardev=char0,vhostforce=on,queues=12,id=net1 \ + -device virtio-net-pci,netdev=net1,mac=$alt_mac,mq=on,vectors=26 \ -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ ; diff --git a/images/tap_down.sh b/images/tap-down.sh similarity index 100% rename from images/tap_down.sh rename to images/tap-down.sh diff --git a/images/tap_up.sh b/images/tap-up.sh similarity index 100% rename from images/tap_up.sh rename to images/tap-up.sh From 59c7d2b0d01b5dd98bea562543d71189d8b3a21d Mon Sep 17 00:00:00 2001 From: stolet Date: Tue, 4 Apr 2023 16:06:51 +0200 Subject: [PATCH 45/50] turn off shmring lock for now --- proxy/shmring.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/proxy/shmring.c b/proxy/shmring.c index 0de1ac09..638e9f03 100644 --- a/proxy/shmring.c +++ b/proxy/shmring.c @@ -79,24 +79,24 @@ int shmring_init_mux(struct ring_buffer *ring) int shmring_lock(struct ring_buffer *ring) { - struct ring_header *hdr = ring->hdr_addr; - if (pthread_mutex_lock(&hdr->mux) < 0) - { - fprintf(stderr, "shmring_lock: failed to acquire lock.\n"); - return -1; - } + // struct ring_header *hdr = ring->hdr_addr; + // if (pthread_mutex_lock(&hdr->mux) < 0) + // { + // fprintf(stderr, "shmring_lock: failed to acquire lock.\n"); + // return -1; + // } return 0; } int shmring_unlock(struct ring_buffer *ring) { - struct ring_header *hdr = ring->hdr_addr; - if (pthread_mutex_unlock(&hdr->mux) < 0) - { - fprintf(stderr, "shmring_lock: failed to release lock.\n"); - return -1; - } + // struct ring_header *hdr = ring->hdr_addr; + // if (pthread_mutex_unlock(&hdr->mux) < 0) + // { + // fprintf(stderr, "shmring_lock: failed to release lock.\n"); + // return -1; + // } return 0; } From a733d0e32bff633ce409620bf72683d91c76cf82 Mon Sep 17 00:00:00 2001 From: stolet Date: Tue, 4 Apr 2023 16:09:30 +0200 Subject: [PATCH 46/50] add param to do multiple runs of an experiment --- experiments/configs/gen_config.py | 16 +++-- .../perf_iso_latconn/configs/ovs_linux.py | 4 +- .../exps/perf_iso_latconn/configs/ovs_tas.py | 8 +-- experiments/exps/perf_iso_latconn/parse.py | 57 ++++++---------- .../exps/perf_iso_latconn/perf_iso_latconn.py | 26 ++++---- .../perf_iso_latmsize/configs/ovs_linux.py | 4 +- .../exps/perf_iso_latmsize/configs/ovs_tas.py | 8 +-- experiments/exps/perf_iso_latmsize/parse.py | 62 +++++++----------- .../perf_iso_latmsize/perf_iso_latmsize.py | 26 ++++---- .../exps/perf_iso_tpconn/configs/bare_tas.py | 4 +- .../exps/perf_iso_tpconn/configs/ovs_tas.py | 4 +- experiments/exps/perf_iso_tpconn/parse.py | 61 +++++++++-------- .../exps/perf_iso_tpconn/perf_iso_tpconn.py | 26 ++++---- experiments/exps/perf_iso_tpconn/plot.pdf | Bin 10765 -> 0 bytes .../exps/perf_iso_tpmsize/configs/ovs_tas.py | 4 +- experiments/exps/perf_iso_tpmsize/parse.py | 61 +++++++++-------- .../exps/perf_iso_tpmsize/perf_iso_tpmsize.py | 26 ++++---- .../exps/scalability/configs/tap_tas.py | 4 +- experiments/plot_utils.py | 49 ++++++++++++++ experiments/run.py | 2 - experiments/utils.py | 15 ++++- 21 files changed, 251 insertions(+), 216 deletions(-) delete mode 100644 experiments/exps/perf_iso_tpconn/plot.pdf diff --git a/experiments/configs/gen_config.py b/experiments/configs/gen_config.py index 2995a89e..c5a93897 100644 --- a/experiments/configs/gen_config.py +++ b/experiments/configs/gen_config.py @@ -37,9 +37,9 @@ def __init__(self): # Network interface used to set ip for a VM self.vm_interface = "enp0s3" # Network interface used to bind TAS in tap VM - self.tas_interface = "enp0s4" + self.tas_interface = "enp0s3" # PCI Id of tas interface - self.pci_id = "0000:00:04.0" + self.pci_id = "0000:00:03.0" self.remote_connect_cmd = 'ssh swsnetlab04' @@ -82,7 +82,8 @@ def __init__(self, pane, machine_config, project_dir, ip, n_cores, self.out = self.out_dir + '/' + self.out_file self.comp_dir = self.project_dir - self.comp_cmd = 'make' + self.comp_cmd = 'make -j6' + self.clean_cmd = 'make clean' self.lib_so = self.comp_dir + 'lib/libtas_interpose.so' self.exec_file = self.comp_dir + '/tas/tas' self.args = '--ip-addr={}/24 --fp-cores-max={}'.format(ip, n_cores) + \ @@ -119,7 +120,8 @@ def __init__(self, machine_config, comp_dir): self.ivshm_socket_path = '/run/tasproxy' self.comp_dir = comp_dir - self.comp_cmd = 'make' + self.comp_cmd = 'make -j6' + self.clean_cmd = 'make clean' class HostProxyConfig(ProxyConfig): def __init__(self, pane, machine_config, comp_dir): @@ -152,7 +154,8 @@ def __init__(self, pane, idx, vmid, self.tas_dir = tas_dir self.comp_dir = bench_dir + "/micro_rpc" - self.comp_cmd = 'make' + self.comp_cmd = 'make -j6' + self.clean_cmd = 'make clean' self.bench_dir = bench_dir self.lib_so = tas_dir + '/lib/libtas_interpose.so' @@ -180,7 +183,8 @@ def __init__(self, pane, idx, vmid, self.bench_dir = bench_dir self.comp_dir = bench_dir + "/micro_rpc" - self.comp_cmd = 'make' + self.comp_cmd = 'make -j6' + self.clean_cmd = 'make clean' self.lib_so = tas_dir + '/lib/libtas_interpose.so' self.exec_file = self.comp_dir + '/echoserver_linux' self.args = '{} {} foo {} {}'.format(port, ncores, \ diff --git a/experiments/exps/perf_iso_latconn/configs/ovs_linux.py b/experiments/exps/perf_iso_latconn/configs/ovs_linux.py index 19545cd7..320c27c9 100644 --- a/experiments/exps/perf_iso_latconn/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_latconn/configs/ovs_linux.py @@ -78,8 +78,8 @@ def __init__(self, exp_name, nconns): client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1234, ncores=3, - msize=64, mpending=64, nconns=128, + ip=self.defaults.server_ip, port=1234, ncores=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_virt, tas_dir=self.defaults.default_vtas_dir_virt) diff --git a/experiments/exps/perf_iso_latconn/configs/ovs_tas.py b/experiments/exps/perf_iso_latconn/configs/ovs_tas.py index fe194204..283e5243 100644 --- a/experiments/exps/perf_iso_latconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_latconn/configs/ovs_tas.py @@ -71,7 +71,7 @@ def __init__(self, exp_name, nconns): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas0_config.args = tas0_config.args + ' --shm-len=4294967296' @@ -84,7 +84,7 @@ def __init__(self, exp_name, nconns): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas1_config.args = tas1_config.args + ' --shm-len=4294967296' @@ -96,8 +96,8 @@ def __init__(self, exp_name, nconns): client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1234, ncores=3, - msize=64, mpending=64, nconns=128, + ip=self.defaults.server_ip, port=1234, ncores=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_obenchmark_dir_virt, tas_dir=self.defaults.default_otas_dir_virt) diff --git a/experiments/exps/perf_iso_latconn/parse.py b/experiments/exps/perf_iso_latconn/parse.py index 66fd9e29..963ee77d 100644 --- a/experiments/exps/perf_iso_latconn/parse.py +++ b/experiments/exps/perf_iso_latconn/parse.py @@ -2,19 +2,9 @@ sys.path.append("../../../") import os -import re -import functools import experiments.plot_utils as putils -# For this experiment get the number of connections -# from the experiment name, since client 0 and client 1 -# have a different number of connections -def get_conns(fname): - regex = "(?<=-conns)[0-9]*" - nconns = re.search(regex, fname).group(0) - return nconns - def check_nconns(data, nconns): if nconns not in data: data[nconns] = {} @@ -23,29 +13,18 @@ def check_stack(data, nconns, stack): if stack not in data[nconns]: data[nconns][stack] = {} -def check_nid(data, nconns, stack, nid): - if nid not in data[nconns][stack]: - data[nconns][stack][nid] = {} - -def check_cid(data, nconns, stack, nid, cid): - if cid not in data[nconns][stack][nid]: - data[nconns][stack][nid][cid] = "" +def check_run(data, nconns, stack, run): + if run not in data[nconns][stack]: + data[nconns][stack][run] = {} -def get_latencies(fname_c0): - f = open(fname_c0) - lines = f.readlines() +def check_nid(data, nconns, stack, run, nid): + if nid not in data[nconns][stack][run]: + data[nconns][stack][run][nid] = {} - # Latencies are already accumulated over all time - # period in the logs - line = lines[len(lines) - 1] - latencies = {} - latencies["50p"] = putils.get_50p_lat(line) - latencies["90p"] = putils.get_90p_lat(line) - latencies["99p"] = putils.get_99p_lat(line) - latencies["99.9p"] = putils.get_99_9p_lat(line) - latencies["99.99p"] = putils.get_99_99p_lat(line) +def check_cid(data, nconns, stack, run, nid, cid): + if cid not in data[nconns][stack][run][nid]: + data[nconns][stack][run][nid][cid] = "" - return latencies def parse_metadata(): dir_path = "./out/" @@ -57,17 +36,19 @@ def parse_metadata(): if "tas_c" == fname: continue - nconns = get_conns(fname) + run = putils.get_expname_run(fname) + nconns = putils.get_expname_conns(fname) cid = putils.get_client_id(fname) nid = putils.get_node_id(fname) stack = putils.get_stack(fname) check_nconns(data, nconns) check_stack(data, nconns, stack) - check_nid(data, nconns, stack, nid) - check_cid(data, nconns, stack, nid, cid) + check_run(data, nconns, stack, run) + check_nid(data, nconns, stack, run, nid) + check_cid(data, nconns, stack, run, nid, cid) - data[nconns][stack][nid][cid] = fname + data[nconns][stack][run][nid][cid] = fname return data @@ -77,8 +58,12 @@ def parse_data(parsed_md): for nconns in parsed_md: data_point = {} for stack in parsed_md[nconns]: - fname_c0 = out_dir + parsed_md[nconns][stack]['0']['0'] - latencies = get_latencies(fname_c0) + latencies = putils.init_latencies() + for run in parsed_md[nconns][stack]: + fname_c0 = out_dir + parsed_md[nconns][stack][run]['0']['0'] + putils.add_latencies(latencies, fname_c0) + + putils.divide_latencies(latencies, len(parsed_md[nconns][stack])) data_point[stack] = latencies lat_list[nconns] = data_point diff --git a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py index cbfb6c7b..54998a2e 100644 --- a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py +++ b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py @@ -9,18 +9,20 @@ experiments = [] n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] +n_runs = 3 -for n in n_conns: - exp_name = "perf-iso-latconn-conns{}_".format(n) - tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) - vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) - tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) - ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) - ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) +for n_r in range(n_runs): + for n_c in n_conns: + exp_name = "perf-iso-latconn-run{}-conns{}_".format(n_r, n_c) + tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n_c), name=exp_name) + vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n_c), name=exp_name) + tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n_c), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_c), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_c), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) - experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py b/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py index eafeb4d1..fbf948b3 100644 --- a/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py @@ -78,8 +78,8 @@ def __init__(self, exp_name, msize): client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1234, ncores=3, - msize=64, mpending=64, nconns=128, + ip=self.defaults.server_ip, port=1234, ncores=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_vbenchmark_dir_virt, tas_dir=self.defaults.default_vtas_dir_virt) diff --git a/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py b/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py index b87e3c04..cd985cd3 100644 --- a/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py @@ -71,7 +71,7 @@ def __init__(self, exp_name, msize): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas0_config.args = tas0_config.args + ' --shm-len=4294967296' @@ -84,7 +84,7 @@ def __init__(self, exp_name, msize): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas1_config.args = tas1_config.args + ' --shm-len=4294967296' @@ -96,8 +96,8 @@ def __init__(self, exp_name, msize): client0_config = ClientConfig(exp_name=exp_name, pane=self.defaults.c_client_pane, idx=0, vmid=0, stack=self.cstack, - ip=self.defaults.server_ip, port=1234, ncores=3, - msize=64, mpending=64, nconns=128, + ip=self.defaults.server_ip, port=1234, ncores=1, + msize=64, mpending=64, nconns=1, open_delay=15, max_msgs_conn=0, max_pend_conns=1, bench_dir=self.defaults.default_obenchmark_dir_virt, tas_dir=self.defaults.default_otas_dir_virt) diff --git a/experiments/exps/perf_iso_latmsize/parse.py b/experiments/exps/perf_iso_latmsize/parse.py index d73d36da..1251fdf0 100644 --- a/experiments/exps/perf_iso_latmsize/parse.py +++ b/experiments/exps/perf_iso_latmsize/parse.py @@ -2,19 +2,9 @@ sys.path.append("../../../") import os -import re -import functools import experiments.plot_utils as putils -# For this experiment get the message size -# from the experiment name, since client 0 and client 1 -# have a different message size -def get_msize(fname): - regex = "(?<=-msize)[0-9]*" - msize = re.search(regex, fname).group(0) - return msize - def check_msize(data, msize): if msize not in data: data[msize] = {} @@ -23,29 +13,17 @@ def check_stack(data, nconns, stack): if stack not in data[nconns]: data[nconns][stack] = {} -def check_nid(data, nconns, stack, nid): - if nid not in data[nconns][stack]: - data[nconns][stack][nid] = {} - -def check_cid(data, nconns, stack, nid, cid): - if cid not in data[nconns][stack][nid]: - data[nconns][stack][nid][cid] = "" +def check_run(data, msize, stack, run): + if run not in data[msize][stack]: + data[msize][stack][run] = {} -def get_latencies(fname_c0): - f = open(fname_c0) - lines = f.readlines() +def check_nid(data, msize, stack, run, nid): + if nid not in data[msize][stack][run]: + data[msize][stack][run][nid] = {} - # Latencies are already accumulated over all time - # period in the logs - line = lines[len(lines) - 1] - latencies = {} - latencies["50p"] = putils.get_50p_lat(line) - latencies["90p"] = putils.get_90p_lat(line) - latencies["99p"] = putils.get_99p_lat(line) - latencies["99.9p"] = putils.get_99_9p_lat(line) - latencies["99.99p"] = putils.get_99_99p_lat(line) - - return latencies +def check_cid(data, msize, stack, run, nid, cid): + if cid not in data[msize][stack][run][nid]: + data[msize][stack][run][nid][cid] = "" def parse_metadata(): dir_path = "./out/" @@ -56,18 +34,20 @@ def parse_metadata(): if "tas_c" == fname: continue - - msize = get_msize(fname) - cid = putils.get_client_id(fname) + + run = putils.get_expname_runs(fname) + msize = putils.get_expname_msize(fname) nid = putils.get_node_id(fname) + cid = putils.get_client_id(fname) stack = putils.get_stack(fname) check_msize(data, msize) check_stack(data, msize, stack) - check_nid(data, msize, stack, nid) - check_cid(data, msize, stack, nid, cid) + check_run(data, msize, stack, run) + check_nid(data, msize, stack, run, nid) + check_cid(data, msize, stack, run, nid, cid) - data[msize][stack][nid][cid] = fname + data[msize][stack][run][nid][cid] = fname return data @@ -77,8 +57,12 @@ def parse_data(parsed_md): for msize in parsed_md: data_point = {} for stack in parsed_md[msize]: - fname_c0 = out_dir + parsed_md[msize][stack]['0']['0'] - latencies = get_latencies(fname_c0) + latencies = putils.init_latencies() + for run in parsed_md[msize][stack]: + fname_c0 = out_dir + parsed_md[msize][stack][run]['0']['0'] + putils.add_latencies(latencies, fname_c0) + + putils.divide_latencies(latencies, len(parsed_md[msize][stack])) data_point[stack] = latencies lat_list[msize] = data_point diff --git a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py index 12f95188..78bae988 100644 --- a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py +++ b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py @@ -9,18 +9,20 @@ experiments = [] msize = [64, 128, 256, 512, 1024, 2048] +n_runs = 3 -for n in msize: - exp_name = "perf-iso-latmsize-msize{}_".format(n) - tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) - vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) - tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) - ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) - ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) +for n_r in range(n_runs): + for n_m in msize: + exp_name = "perf-iso-latmsize-run{}-msize{}_".format(n_r, n_m) + tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n_m), name=exp_name) + vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n_m), name=exp_name) + tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n_m), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_m), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_m), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) - experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpconn/configs/bare_tas.py b/experiments/exps/perf_iso_tpconn/configs/bare_tas.py index 5b482190..74a375f8 100644 --- a/experiments/exps/perf_iso_tpconn/configs/bare_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/bare_tas.py @@ -34,12 +34,12 @@ def __init__(self, exp_name, nconns): server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=1024, + port=1234, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=1024, + port=1235, ncores=8, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py index fe194204..cda97e28 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py @@ -71,7 +71,7 @@ def __init__(self, exp_name, nconns): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas0_config.args = tas0_config.args + ' --shm-len=4294967296' @@ -84,7 +84,7 @@ def __init__(self, exp_name, nconns): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas1_config.args = tas1_config.args + ' --shm-len=4294967296' diff --git a/experiments/exps/perf_iso_tpconn/parse.py b/experiments/exps/perf_iso_tpconn/parse.py index 703c9e5c..c0b58d50 100644 --- a/experiments/exps/perf_iso_tpconn/parse.py +++ b/experiments/exps/perf_iso_tpconn/parse.py @@ -5,15 +5,6 @@ import re import experiments.plot_utils as putils - -# For this experiment get the number of connections -# from the experiment name, since client 0 and client 1 -# have a different number of connections -def get_conns(fname): - regex = "(?<=-conns)[0-9]*" - nconns = re.search(regex, fname).group(0) - return nconns - def check_nconns(data, nconns): if nconns not in data: data[nconns] = {} @@ -22,13 +13,17 @@ def check_stack(data, nconns, stack): if stack not in data[nconns]: data[nconns][stack] = {} -def check_nid(data, nconns, stack, nid): - if nid not in data[nconns][stack]: - data[nconns][stack][nid] = {} +def check_run(data, nconns, stack, run): + if run not in data[nconns][stack]: + data[nconns][stack][run] = {} + +def check_nid(data, nconns, stack, run, nid): + if nid not in data[nconns][stack][run]: + data[nconns][stack][run][nid] = {} -def check_cid(data, nconns, stack, nid, cid): - if cid not in data[nconns][stack][nid]: - data[nconns][stack][nid][cid] = "" +def check_cid(data, nconns, stack, run, nid, cid): + if cid not in data[nconns][stack][run][nid]: + data[nconns][stack][run][nid][cid] = "" def get_avg_tp(fname_c0, fname_c1): n_messages = 0 @@ -48,7 +43,7 @@ def get_avg_tp(fname_c0, fname_c1): msize = int(putils.get_msize(fname_c0)) n = len(lines) - idx - return str((n_messages * msize * 8 / n) / 1000000) + return (n_messages * msize * 8 / n) / 1000000 def parse_metadata(): dir_path = "./out/" @@ -60,17 +55,19 @@ def parse_metadata(): if "tas_c" == fname: continue - nconns = get_conns(fname) + run = putils.get_expname_run(fname) + nconns = putils.get_expname_conns(fname) cid = putils.get_client_id(fname) nid = putils.get_node_id(fname) stack = putils.get_stack(fname) check_nconns(data, nconns) check_stack(data, nconns, stack) - check_nid(data, nconns, stack, nid) - check_cid(data, nconns, stack, nid, cid) + check_run(data, nconns, stack, run) + check_nid(data, nconns, stack, run, nid) + check_cid(data, nconns, stack, run, nid, cid) - data[nconns][stack][nid][cid] = fname + data[nconns][stack][run][nid][cid] = fname return data @@ -80,17 +77,19 @@ def parse_data(parsed_md): for nconns in parsed_md: data_point = {"nconns": nconns} for stack in parsed_md[nconns]: - is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" - if is_virt: - c0_fname = out_dir + parsed_md[nconns][stack]["0"]["0"] - c1_fname = out_dir + parsed_md[nconns][stack]["1"]["0"] - else: - c0_fname = out_dir + parsed_md[nconns][stack]["0"]["0"] - c1_fname = out_dir + parsed_md[nconns][stack]["0"]["1"] - - avg_tp = get_avg_tp(c0_fname, c1_fname) - - data_point[stack] = avg_tp + avg_tp = 0 + for run in parsed_md[nconns][stack]: + is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" + if is_virt: + c0_fname = out_dir + parsed_md[nconns][stack][run]["0"]["0"] + c1_fname = out_dir + parsed_md[nconns][stack][run]["1"]["0"] + else: + c0_fname = out_dir + parsed_md[nconns][stack][run]["0"]["0"] + c1_fname = out_dir + parsed_md[nconns][stack][run]["0"]["1"] + + avg_tp += get_avg_tp(c0_fname, c1_fname) + + data_point[stack] = avg_tp / len(parsed_md[nconns][stack]) tp.append(data_point) diff --git a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py index fac2cb1d..017a3143 100644 --- a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py +++ b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py @@ -9,18 +9,20 @@ experiments = [] n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] +n_runs = 3 -for n in n_conns: - exp_name = "perf-iso-tpconn-conns{}_".format(n) - tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) - vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) - tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) - ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) - ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) +for n_r in range(n_runs): + for n_c in n_conns: + exp_name = "perf-iso-tpconn-run{}-conns{}_".format(n_r, n_c) + tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n_c), name=exp_name) + vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n_c), name=exp_name) + tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n_c), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_c), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_c), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) - experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpconn/plot.pdf b/experiments/exps/perf_iso_tpconn/plot.pdf deleted file mode 100644 index 964aa0c37914bc5e48cf09c79c9ae9b244b33933..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10765 zcma)i1z1#D)V4Gt9R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{lDJ$-JQLj-7i>O2?l0AcWebxBiXGsg>%WKdzl-~U6Y+b^N|_iuc<*5j3V*R4 z>>nr+f1@722K~PaLf*#Gz+N9l>toQ@HL)R zP4sQqENzS!e{TR080pW>#L`0af%?H9%FhAh-~@7V@PW92oLs!jKn{8!kn!(E|CcxN zCzV4)7q%lTjeZ6G*A)IBa{Mp-!^s9>hz5kwPtbsWT>vmQHzzm15b#?E0)oJ>t{*Od z#UDDDiVqfwf9be+VH@F}Iw0^NWdGEGxc}Q99}leef7jy!{l_jZAB=4BuX?{{WmiCj|fi diff --git a/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py b/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py index b87e3c04..3c5942ec 100644 --- a/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py @@ -71,7 +71,7 @@ def __init__(self, exp_name, msize): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas0_config.args = tas0_config.args + ' --shm-len=4294967296' @@ -84,7 +84,7 @@ def __init__(self, exp_name, msize): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, - n_cores=1, dpdk_extra="00:04.0") + n_cores=1, dpdk_extra="00:03.0") tas1_config.args = tas1_config.args + ' --shm-len=4294967296' diff --git a/experiments/exps/perf_iso_tpmsize/parse.py b/experiments/exps/perf_iso_tpmsize/parse.py index 6c3d482f..fba9b93b 100644 --- a/experiments/exps/perf_iso_tpmsize/parse.py +++ b/experiments/exps/perf_iso_tpmsize/parse.py @@ -2,18 +2,9 @@ sys.path.append("../../../") import os -import re import experiments.plot_utils as putils -# For this experiment get the message size -# from the experiment name, since client 0 and client 1 -# have different message sizes -def get_msize(fname): - regex = "(?<=-msize)[0-9]*" - msize = re.search(regex, fname).group(0) - return msize - def check_msize(data, msize): if msize not in data: data[msize] = {} @@ -22,13 +13,17 @@ def check_stack(data, msize, stack): if stack not in data[msize]: data[msize][stack] = {} -def check_nid(data, msize, stack, nid): - if nid not in data[msize][stack]: - data[msize][stack][nid] = {} +def check_run(data, msize, stack, run): + if run not in data[msize][stack]: + data[msize][stack][run] = {} + +def check_nid(data, msize, stack, run, nid): + if nid not in data[msize][stack][run]: + data[msize][stack][run][nid] = {} -def check_cid(data, msize, stack, nid, cid): - if cid not in data[msize][stack][nid]: - data[msize][stack][nid][cid] = "" +def check_cid(data, msize, stack, run, nid, cid): + if cid not in data[msize][stack][run][nid]: + data[msize][stack][run][nid][cid] = "" def get_avg_tp(fname_c0, fname_c1): n_messages = 0 @@ -48,7 +43,7 @@ def get_avg_tp(fname_c0, fname_c1): msize = int(putils.get_msize(fname_c0)) n = len(lines) - idx - return str((n_messages * msize * 8 / n) / 1000000) + return (n_messages * msize * 8 / n) / 1000000 def parse_metadata(): dir_path = "./out/" @@ -60,17 +55,19 @@ def parse_metadata(): if "tas_c" == fname: continue - msize = get_msize(fname) + run = putils.get_expname_run(fname) + msize = putils.get_expname_msize(fname) cid = putils.get_client_id(fname) nid = putils.get_node_id(fname) stack = putils.get_stack(fname) check_msize(data, msize) check_stack(data, msize, stack) - check_nid(data, msize, stack, nid) - check_cid(data, msize, stack, nid, cid) + check_run(data, msize, stack, run) + check_nid(data, msize, stack, run, nid) + check_cid(data, msize, stack, run, nid, cid) - data[msize][stack][nid][cid] = fname + data[msize][stack][run][nid][cid] = fname return data @@ -80,17 +77,19 @@ def parse_data(parsed_md): for msize in parsed_md: data_point = {"msize": msize} for stack in parsed_md[msize]: - is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" - if is_virt: - c0_fname = out_dir + parsed_md[msize][stack]["0"]["0"] - c1_fname = out_dir + parsed_md[msize][stack]["1"]["0"] - else: - c0_fname = out_dir + parsed_md[msize][stack]["0"]["0"] - c1_fname = out_dir + parsed_md[msize][stack]["0"]["1"] - - avg_tp = get_avg_tp(c0_fname, c1_fname) - - data_point[stack] = avg_tp + avg_tp = 0 + for run in parsed_md[msize][stack]: + is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" + if is_virt: + c0_fname = out_dir + parsed_md[msize][stack][run]["0"]["0"] + c1_fname = out_dir + parsed_md[msize][stack][run]["1"]["0"] + else: + c0_fname = out_dir + parsed_md[msize][stack][run]["0"]["0"] + c1_fname = out_dir + parsed_md[msize][stack][run]["0"]["1"] + + avg_tp += get_avg_tp(c0_fname, c1_fname) + + data_point[stack] = avg_tp / len(parsed_md[msize][stack]) tp.append(data_point) diff --git a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py index 92958476..e209c033 100644 --- a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py +++ b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py @@ -9,18 +9,20 @@ experiments = [] msize = [64, 128, 256, 512, 1024, 2048] +n_runs = 3 -for n in msize: - exp_name = "perf-iso-tpconn-msize{}_".format(n) - tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n), name=exp_name) - vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n), name=exp_name) - tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n), name=exp_name) - ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n), name=exp_name) - ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n), name=exp_name) +for n_r in range(n_runs): + for n_m in msize: + exp_name = "perf-iso-tpconn-run{}-msize{}_".format(n_r, n_m) + tas_bare_exp = exp.Experiment(TasBareConf(exp_name + "bare-tas", n_m), name=exp_name) + vtas_bare_exp = exp.Experiment(VTasBareConf(exp_name + "bare-vtas", n_m), name=exp_name) + tas_virt_exp = exp.Experiment(TasVirtConf(exp_name + "virt-tas", n_m), name=exp_name) + ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_m), name=exp_name) + ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_m), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) - experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) + experiments.append(ovs_tas_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/scalability/configs/tap_tas.py b/experiments/exps/scalability/configs/tap_tas.py index 5a247c5d..b4529c79 100644 --- a/experiments/exps/scalability/configs/tap_tas.py +++ b/experiments/exps/scalability/configs/tap_tas.py @@ -37,7 +37,7 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm_config.tas_tap_ip, - n_cores=10, dpdk_extra="00:04.0") + n_cores=10, dpdk_extra="00:03.0") self.s_tas_configs.append(tas_config) for j in range(self.snum): @@ -75,7 +75,7 @@ def __init__(self, exp_name, nconns): machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, ip=vm_config.tas_tap_ip, - n_cores=10, dpdk_extra="00:04.0") + n_cores=10, dpdk_extra="00:03.0") self.c_tas_configs.append(tas_config) for j in range(self.cnum): diff --git a/experiments/plot_utils.py b/experiments/plot_utils.py index d72fdc08..2d36b0e4 100644 --- a/experiments/plot_utils.py +++ b/experiments/plot_utils.py @@ -1,5 +1,54 @@ + import re +def init_latencies(): + latencies = { + "50p": 0, + "90p": 0, + "99p": 0, + "99.9p": 0, + "99.99p": 0 + } + + return latencies + +def divide_latencies(latencies, den): + latencies["50p"] /= den + latencies["90p"] /= den + latencies["99p"] /= den + latencies["99.9p"] /= den + latencies["99.99p"] /= den + +def add_latencies(latencies, fname_c0): + f = open(fname_c0) + lines = f.readlines() + + # Latencies are already accumulated over all time + # period in the logs + line = lines[len(lines) - 1] + latencies["50p"] += int(get_50p_lat(line)) + latencies["90p"] += int(get_90p_lat(line)) + latencies["99p"] += int(get_99p_lat(line)) + latencies["99.9p"] += int(get_99_9p_lat(line)) + latencies["99.99p"] += int(get_99_99p_lat(line)) + + return latencies + +def get_expname_msize(fname): + regex = "(?<=-msize)[0-9]*" + msize = re.search(regex, fname).group(0) + return msize + +def get_expname_run(fname): + run_id_regex = "(?<=-run)[0-9]*" + run_id = re.search(run_id_regex, fname).group(0) + return run_id + +def get_expname_conns(fname): + regex = "(?<=-conns)[0-9]*" + nconns = re.search(regex, fname).group(0) + return nconns + def get_stack(line): stack_regex = "(?<=_)([a-z]+-[a-z]+)(?=_)" stack = re.search(stack_regex, line).group(0) diff --git a/experiments/run.py b/experiments/run.py index de21a74b..bb749cb7 100644 --- a/experiments/run.py +++ b/experiments/run.py @@ -29,7 +29,6 @@ for path in args.experiments: modname, _ = os.path.splitext(os.path.basename(path)) - print(modname) spec = importlib.util.spec_from_file_location(modname, path) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) @@ -53,7 +52,6 @@ continue print('******' + e.get_name() + '********') e.run() - print(e.get_name()) time.sleep(80) e.save_logs() time.sleep(15) diff --git a/experiments/utils.py b/experiments/utils.py index 7c9a035a..b7ec6adb 100644 --- a/experiments/utils.py +++ b/experiments/utils.py @@ -2,7 +2,7 @@ def get_ssh_command(machine_config, vm_config): stack = machine_config.stack - if stack == "virt-tas": + if stack == "virt-tas" or stack == "ovs-tas": ssh_com = "ssh -p 222{} tas@localhost".format(vm_config.id) else: ssh_com = "ssh tas@{}".format(vm_config.vm_ip) @@ -19,18 +19,27 @@ def get_scp_command(machine_config, vm_config, src_path, save_path): return ssh_com -def compile_and_run(pane, comp_dir, comp_cmd, +def compile_and_run(pane, comp_dir, comp_cmd, clean_cmd, exec_file, args, out, - bg=False, gdb=False, + bg=False, gdb=False, + valgrind=False, clean=False, break_file=None, line_break=None, save_log=False): pane.send_keys('cd ' + comp_dir) pane.send_keys('git pull') time.sleep(1) + + if clean: + pane.send_keys(clean_cmd) + time.sleep(1) + pane.send_keys(comp_cmd) + time.sleep(3) if gdb: cmd = 'sudo gdb --args ' + exec_file + ' ' + args + elif valgrind: + cmd = 'sudo valgrind --leak-check=yes ' + exec_file + ' ' + args else: cmd = 'sudo ' + exec_file + ' ' + args From 9b6199829f7c50f19fb96a2afe6896d6ec4df0e9 Mon Sep 17 00:00:00 2001 From: stolet Date: Wed, 5 Apr 2023 00:40:36 +0200 Subject: [PATCH 47/50] get ovs-linux to work with vhost --- experiments/exps/perf_iso_latconn/parse.py | 9 ++---- .../{plot_script => plot_script.plt} | 16 +++++----- experiments/exps/perf_iso_latmsize/parse.py | 4 +-- .../{plot_script => plot_script.plt} | 16 +++++----- .../exps/perf_iso_tpconn/configs/ovs_tas.py | 5 ++- .../exps/perf_iso_tpconn/plot_script.plt | 5 +-- .../exps/perf_iso_tpmsize/plot_script.plt | 1 + experiments/nodes/node.py | 15 +++++---- experiments/nodes/ovs_linux/ovslinux.py | 10 ++---- experiments/nodes/ovs_tas/ovstas.py | 22 +++++-------- experiments/nodes/tap_tas/ttas.py | 2 +- experiments/utils.py | 5 +-- images/dpdk-ovsbr-add.sh | 32 ------------------- images/ovsbr-add.sh | 1 + images/ovsvhost-add.sh | 18 +++++++++++ images/start-vm.sh | 20 ++++++++---- 16 files changed, 82 insertions(+), 99 deletions(-) rename experiments/exps/perf_iso_latconn/{plot_script => plot_script.plt} (78%) rename experiments/exps/perf_iso_latmsize/{plot_script => plot_script.plt} (78%) delete mode 100644 images/dpdk-ovsbr-add.sh create mode 100644 images/ovsvhost-add.sh diff --git a/experiments/exps/perf_iso_latconn/parse.py b/experiments/exps/perf_iso_latconn/parse.py index 963ee77d..5d0e0b9d 100644 --- a/experiments/exps/perf_iso_latconn/parse.py +++ b/experiments/exps/perf_iso_latconn/parse.py @@ -71,7 +71,7 @@ def parse_data(parsed_md): return lat_list def save_dat_file(exp_lats): - header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" + header = "nconns bare-tas bare-vtas\n" nconns = list(exp_lats.keys()) nconns = list(map(str, sorted(map(int, nconns)))) @@ -84,13 +84,10 @@ def save_dat_file(exp_lats): f.write(header) for nconn in nconns: - f.write("{} {} {} {} {} {}\n".format( + f.write("{} {} {}\n".format( nconn, exp_lats[nconn]['bare-tas'][percentile], - exp_lats[nconn]['bare-vtas'][percentile], - exp_lats[nconn]['virt-tas'][percentile], - exp_lats[nconn]['ovs-linux'][percentile], - exp_lats[nconn]['ovs-tas'][percentile]) + exp_lats[nconn]['bare-vtas'][percentile]) ) def main(): diff --git a/experiments/exps/perf_iso_latconn/plot_script b/experiments/exps/perf_iso_latconn/plot_script.plt similarity index 78% rename from experiments/exps/perf_iso_latconn/plot_script rename to experiments/exps/perf_iso_latconn/plot_script.plt index b93692b7..40ecd88d 100644 --- a/experiments/exps/perf_iso_latconn/plot_script +++ b/experiments/exps/perf_iso_latconn/plot_script.plt @@ -26,8 +26,8 @@ set yrange [0:] set title "50p Latency" set key center right plot 'lat_50p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_50p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_50p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ @@ -37,8 +37,8 @@ set yrange [0:] set title "90p Latency" set key center right plot 'lat_90p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_90p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_90p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ @@ -49,8 +49,8 @@ set yrange [0:] set title "99p Latency" set key center right plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_99p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_99p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ @@ -61,7 +61,7 @@ set yrange [0:] set title "99.9p Latency" set key left top plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_99.9p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_99.9p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ diff --git a/experiments/exps/perf_iso_latmsize/parse.py b/experiments/exps/perf_iso_latmsize/parse.py index 1251fdf0..edc29989 100644 --- a/experiments/exps/perf_iso_latmsize/parse.py +++ b/experiments/exps/perf_iso_latmsize/parse.py @@ -35,7 +35,7 @@ def parse_metadata(): if "tas_c" == fname: continue - run = putils.get_expname_runs(fname) + run = putils.get_expname_run(fname) msize = putils.get_expname_msize(fname) nid = putils.get_node_id(fname) cid = putils.get_client_id(fname) @@ -89,7 +89,7 @@ def save_dat_file(exp_lats): exp_lats[msize]['bare-vtas'][percentile], exp_lats[msize]['virt-tas'][percentile], exp_lats[msize]['ovs-linux'][percentile], - exp_lats[msize]['ovs-tas'][percentile],) + exp_lats[msize]['ovs-tas'][percentile]) ) def main(): diff --git a/experiments/exps/perf_iso_latmsize/plot_script b/experiments/exps/perf_iso_latmsize/plot_script.plt similarity index 78% rename from experiments/exps/perf_iso_latmsize/plot_script rename to experiments/exps/perf_iso_latmsize/plot_script.plt index 707e2650..e7d6de98 100644 --- a/experiments/exps/perf_iso_latmsize/plot_script +++ b/experiments/exps/perf_iso_latmsize/plot_script.plt @@ -26,8 +26,8 @@ set key center left set yrange [0:] set title "50p Latency" plot 'lat_50p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_50p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_50p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_50p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ @@ -37,8 +37,8 @@ set key top right set yrange [0:] set title "90p Latency" plot 'lat_90p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_90p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_90p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_90p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ @@ -50,8 +50,8 @@ set key center left set yrange [0:] set title "99p Latency" plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_99p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_99p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_99p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ @@ -62,7 +62,7 @@ set key center right set yrange [0:] set title "99.9p Latency" plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-vtas' linetype 3 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ + 'lat_99.9p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ 'lat_99.9p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ 'lat_99.9p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py index cda97e28..d7c95f24 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py @@ -60,7 +60,6 @@ def __init__(self, exp_name, nconns): stack=self.cstack, is_remote=False, is_server=False) - vm0_config = VMConfig(pane=self.defaults.c_vm_pane, machine_config=self.c_machine_config, @@ -70,7 +69,7 @@ def __init__(self, exp_name, nconns): tas0_config = TasConfig(pane=self.defaults.c_tas_pane, machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, - ip=vm0_config.tas_tap_ip, + ip=vm0_config.vm_ip, n_cores=1, dpdk_extra="00:03.0") tas0_config.args = tas0_config.args + ' --shm-len=4294967296' @@ -83,7 +82,7 @@ def __init__(self, exp_name, nconns): tas1_config = TasConfig(pane=self.defaults.c_tas_pane, machine_config=self.c_machine_config, project_dir=self.defaults.default_otas_dir_virt, - ip=vm1_config.tas_tap_ip, + ip=vm1_config.vm_ip, n_cores=1, dpdk_extra="00:03.0") tas1_config.args = tas1_config.args + ' --shm-len=4294967296' diff --git a/experiments/exps/perf_iso_tpconn/plot_script.plt b/experiments/exps/perf_iso_tpconn/plot_script.plt index 324cac1b..0f2321a6 100644 --- a/experiments/exps/perf_iso_tpconn/plot_script.plt +++ b/experiments/exps/perf_iso_tpconn/plot_script.plt @@ -12,7 +12,8 @@ set label 1 "Aggressor Client # Connections" at screen 0.5, 0.03 center set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 center set yrange [0:2000] -plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ +plot 'tp.dat' using 1:2:xtic(1) title 'tas' linetype 2 w lp, \ + 'tp.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 w lp, \ + 'tp.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 w lp, \ 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 w lp, \ 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 w lp, \ diff --git a/experiments/exps/perf_iso_tpmsize/plot_script.plt b/experiments/exps/perf_iso_tpmsize/plot_script.plt index 7caa7cd8..7d3d7445 100644 --- a/experiments/exps/perf_iso_tpmsize/plot_script.plt +++ b/experiments/exps/perf_iso_tpmsize/plot_script.plt @@ -13,6 +13,7 @@ set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 c set yrange [0:2000] plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ + 'tp.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 w lp, \ 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 w lp, \ 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 w lp, \ diff --git a/experiments/nodes/node.py b/experiments/nodes/node.py index ce7c792f..c70f84bd 100644 --- a/experiments/nodes/node.py +++ b/experiments/nodes/node.py @@ -78,19 +78,20 @@ def ovsbr_add(self, br_name, ip, interface, script_dir): self.setup_pane.send_keys(cmd) time.sleep(2) - def dpdk_ovsbr_add(self, br_name, ip, interface, script_dir): + def ovsbr_del(self, br_name): + cmd = "sudo ovs-vsctl del-br {}".format(br_name) + self.cleanup_pane.send_keys(cmd) + time.sleep(2) + + def ovsvhost_add(self, br_name, vhost_name, script_dir): cmd = "cd {}".format(script_dir) self.setup_pane.send_keys(cmd) time.sleep(1) - cmd = "sudo bash dpdk-ovsbr-add.sh {} {} {}".format(br_name, ip, interface) + cmd = "sudo bash ovsvhost-add.sh {} {}".format( + br_name, vhost_name) self.setup_pane.send_keys(cmd) time.sleep(2) - def ovsbr_del(self, br_name): - cmd = "sudo ovs-vsctl del-br {}".format(br_name) - self.cleanup_pane.send_keys(cmd) - time.sleep(2) - def ovstap_add(self, br_name, tap_name, multi_queue, script_dir): cmd = "cd {}".format(script_dir) self.setup_pane.send_keys(cmd) diff --git a/experiments/nodes/ovs_linux/ovslinux.py b/experiments/nodes/ovs_linux/ovslinux.py index dbf8aa4f..afac2d21 100644 --- a/experiments/nodes/ovs_linux/ovslinux.py +++ b/experiments/nodes/ovs_linux/ovslinux.py @@ -27,10 +27,9 @@ def setup(self): for vm_config in self.vm_configs: # Tap that allows us to ssh to VM - self.ovstap_add("br0", - "tap{}".format(vm_config.id), - 0, - vm_config.manager_dir) + self.ovsvhost_add("br0", + "vhost{}".format(vm_config.id), + vm_config.manager_dir) def cleanup(self): super().cleanup() @@ -46,9 +45,6 @@ def cleanup(self): self.cleanup_pane.send_keys(cmd) time.sleep(1) - for vm_config in self.vm_configs: - self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) - for vm in self.vms: vm.shutdown() diff --git a/experiments/nodes/ovs_tas/ovstas.py b/experiments/nodes/ovs_tas/ovstas.py index 5aa7cb6b..b7f8d85d 100644 --- a/experiments/nodes/ovs_tas/ovstas.py +++ b/experiments/nodes/ovs_tas/ovstas.py @@ -23,17 +23,15 @@ def setup(self): super().setup() self.start_ovs(self.vm_configs[0].manager_dir) - self.dpdk_ovsbr_add("br0", - self.machine_config.ip + "/24", + self.ovsbr_add("br0", + self.machine_config.ip + "/24", self.machine_config.interface, self.vm_configs[0].manager_dir) - # for vm_config in self.vm_configs: - # # Tap that allows us to ssh to VM - # self.ovstap_add("br0", - # "tap{}".format(vm_config.id), - # 0, - # vm_config.manager_dir) + for vm_config in self.vm_configs: + self.ovsvhost_add("br0", + "vhost{}".format(vm_config.id), + vm_config.manager_dir) def cleanup(self): super().cleanup() @@ -49,10 +47,6 @@ def cleanup(self): self.cleanup_pane.send_keys(cmd) time.sleep(1) - # for vm_config in self.vm_configs: - # self.tap_down("tap{}".format(vm_config.id), vm_config.manager_dir) - # self.tap_down("ovstap{}".format(vm_config.id), vm_config.manager_dir) - for vm in self.vms: vm.shutdown() @@ -74,8 +68,8 @@ def start_vm(self, vm, vm_config): vm.start() vm.enable_hugepages() vm.enable_noiommu("1af4 1110") - vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) - vm.dpdk_bind(vm_config.vm_ip, self.defaults.vm_interface, + vm.init_interface(vm_config.vm_ip, self.defaults.tas_interface) + vm.dpdk_bind(vm_config.vm_ip, self.defaults.tas_interface, self.defaults.pci_id) def start_vms(self): diff --git a/experiments/nodes/tap_tas/ttas.py b/experiments/nodes/tap_tas/ttas.py index 880af0b7..a5a325bb 100644 --- a/experiments/nodes/tap_tas/ttas.py +++ b/experiments/nodes/tap_tas/ttas.py @@ -60,7 +60,7 @@ def start_vm(self, vm, vm_config): vm.start() vm.enable_hugepages() vm.enable_noiommu("1af4 1110") - vm.init_interface(vm_config.vm_ip, self.defaults.vm_interface) + vm.init_interface(vm_config.vm_ip, self.defaults.tas_interface) vm.init_interface(vm_config.tas_tap_ip, self.defaults.tas_interface) vm.dpdk_bind(vm_config.tas_tap_ip, self.defaults.tas_interface, self.defaults.pci_id) diff --git a/experiments/utils.py b/experiments/utils.py index b7ec6adb..58a95669 100644 --- a/experiments/utils.py +++ b/experiments/utils.py @@ -2,7 +2,7 @@ def get_ssh_command(machine_config, vm_config): stack = machine_config.stack - if stack == "virt-tas" or stack == "ovs-tas": + if stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux": ssh_com = "ssh -p 222{} tas@localhost".format(vm_config.id) else: ssh_com = "ssh tas@{}".format(vm_config.vm_ip) @@ -12,7 +12,8 @@ def get_ssh_command(machine_config, vm_config): def get_scp_command(machine_config, vm_config, src_path, save_path): ip = vm_config.vm_ip idx = vm_config.id - if machine_config.stack == "virt-tas": + stack = machine_config.stack + if stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux": ssh_com = "scp -P 222{} tas@localhost:{} {}".format(idx, src_path, save_path) else: ssh_com = "scp tas@{}:{} {}".format(ip, src_path, save_path) diff --git a/images/dpdk-ovsbr-add.sh b/images/dpdk-ovsbr-add.sh deleted file mode 100644 index 0e47355c..00000000 --- a/images/dpdk-ovsbr-add.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -if [ "$#" -ne 3 ]; then - echo "Illegal number of parameters" - echo "usage:" - echo "[br_name ip interface]" - exit -fi - -br_name=$1 -ip=$2 -interface=$3 - - -# Create bridge using OvS -echo "Creating bridge ${br_name} using OvS" -ovs-vsctl add-br $br_name -echo "Set bridge ${br_name} datapath type to netdev" -ovs-vsctl set bridge $br_name datapath_type=netdev -echo "Adding interface ${interface} to port" -ovs-vsctl add-port $br_name $interface -echo "Set dpdkvhost interface ${interface}" -ovs-vsctl set Interface $interface type=dpdkvhostuser options:n_rxq=12 - -# Delete ip config from interface so that it can be added to bridge -echo "Delete ip config from interface ${interface}" -sudo ip addr del $ip dev $interface - -# Add ip address to bridge -echo "Add ip ${ip} to bridge ${br_name}" -sudo ip addr add $ip dev $br_name -ifconfig $br_name up \ No newline at end of file diff --git a/images/ovsbr-add.sh b/images/ovsbr-add.sh index d3d92248..9fae4fb5 100644 --- a/images/ovsbr-add.sh +++ b/images/ovsbr-add.sh @@ -13,6 +13,7 @@ interface=$3 # Create bridge using OvS ovs-vsctl add-br $br_name + ovs-vsctl add-port $br_name $interface # Delete ip config from interface so that it can be added to bridge diff --git a/images/ovsvhost-add.sh b/images/ovsvhost-add.sh new file mode 100644 index 00000000..518997b7 --- /dev/null +++ b/images/ovsvhost-add.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 2 ]; then + echo "Illegal number of parameters" + echo "usage:" + echo "[br_name vhost_name]" + exit +fi + +br_name=$1 +vhost_name=$2 + +echo "Set bridge datapath type to netdev" +ovs-vsctl set bridge ${br_name} datapath_type=netdev + +echo "Adding interface ${vhost_name} to port" +ovs-vsctl add-port ${br_name} ${vhost_name} -- set Interface ${vhost_name} type=dpdkvhostuser + diff --git a/images/start-vm.sh b/images/start-vm.sh index 767bfe6d..61aa80b8 100755 --- a/images/start-vm.sh +++ b/images/start-vm.sh @@ -18,6 +18,7 @@ disk_img_snapshot="base.snapshot.qcow2" tap=tap$vm_id tastap=tastap$vm_id ovstap=ovstap$vm_id +vhost=vhost$vm_id printf -v mac '02:00:00:%02X:%02X:%02X' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) printf -v alt_mac '02:00:00:%02X:%02X:%02X' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) @@ -63,12 +64,15 @@ elif [[ "$stack" == 'ovs-linux' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 25G \ + -m 10G \ -snapshot \ - -netdev user,id=net0 \ + -netdev user,id=net0,hostfwd=tcp::222${vm_id}-:22 \ -device virtio-net-pci,netdev=net0 \ - -netdev tap,ifname=$tap,script=no,downscript=no,vhost=on,id=net1 \ - -device virtio-net-pci,mac=$mac,netdev=net1 \ + -chardev socket,id=char0,path=/usr/local/var/run/openvswitch/$vhost \ + -netdev type=vhost-user,chardev=char0,vhostforce=on,queues=12,id=net1 \ + -device virtio-net-pci,netdev=net1,mac=$alt_mac,mq=on,vectors=26 \ + -object memory-backend-file,id=mem,size=10G,mem-path=/dev/hugepages,share=on \ + -numa node,memdev=mem -mem-prealloc \ -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ ; @@ -78,13 +82,15 @@ elif [[ "$stack" == 'ovs-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 25G \ + -m 10G \ -snapshot \ -netdev user,id=net0,hostfwd=tcp::222${vm_id}-:22 \ -device virtio-net-pci,netdev=net0 \ - -chardev socket,id=char0,path=/usr/local/var/run/openvswitch/$interface \ + -chardev socket,id=char0,path=/usr/local/var/run/openvswitch/$vhost \ -netdev type=vhost-user,chardev=char0,vhostforce=on,queues=12,id=net1 \ -device virtio-net-pci,netdev=net1,mac=$alt_mac,mq=on,vectors=26 \ + -object memory-backend-file,id=mem,size=10G,mem-path=/dev/hugepages,share=on \ + -numa node,memdev=mem -mem-prealloc \ -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ ; @@ -94,7 +100,7 @@ elif [[ "$stack" == 'tap-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 25G \ + -m 6G \ -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ From 13d6d2a8172bd1394a9d7fdaa6298229d637be5d Mon Sep 17 00:00:00 2001 From: stolet Date: Thu, 6 Apr 2023 15:57:23 +0200 Subject: [PATCH 48/50] add error bars --- .../exps/perf_iso_latconn/perf_iso_latconn.py | 8 ++-- .../perf_iso_latmsize/perf_iso_latmsize.py | 8 ++-- experiments/exps/perf_iso_tpconn/parse.py | 47 +++++++++++-------- .../exps/perf_iso_tpconn/perf_iso_tpconn.py | 8 ++-- .../exps/perf_iso_tpconn/plot_script.plt | 10 ++-- .../exps/perf_iso_tpmsize/perf_iso_tpmsize.py | 8 ++-- 6 files changed, 48 insertions(+), 41 deletions(-) diff --git a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py index 54998a2e..f41e3679 100644 --- a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py +++ b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py @@ -20,9 +20,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_c), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_c), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) + # experiments.append(tas_bare_exp) + # experiments.append(vtas_bare_exp) + # experiments.append(tas_virt_exp) experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + # experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py index 78bae988..434b4b25 100644 --- a/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py +++ b/experiments/exps/perf_iso_latmsize/perf_iso_latmsize.py @@ -20,9 +20,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_m), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_m), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) + # experiments.append(tas_bare_exp) + # experiments.append(vtas_bare_exp) + # experiments.append(tas_virt_exp) experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + # experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpconn/parse.py b/experiments/exps/perf_iso_tpconn/parse.py index c0b58d50..60cc62f6 100644 --- a/experiments/exps/perf_iso_tpconn/parse.py +++ b/experiments/exps/perf_iso_tpconn/parse.py @@ -3,6 +3,7 @@ import os import re +import numpy as np import experiments.plot_utils as putils def check_nconns(data, nconns): @@ -72,12 +73,12 @@ def parse_metadata(): return data def parse_data(parsed_md): - tp = [] + data = [] out_dir = "./out/" for nconns in parsed_md: data_point = {"nconns": nconns} for stack in parsed_md[nconns]: - avg_tp = 0 + tp_x = np.array([]) for run in parsed_md[nconns][stack]: is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" if is_virt: @@ -87,33 +88,39 @@ def parse_data(parsed_md): c0_fname = out_dir + parsed_md[nconns][stack][run]["0"]["0"] c1_fname = out_dir + parsed_md[nconns][stack][run]["0"]["1"] - avg_tp += get_avg_tp(c0_fname, c1_fname) + tp = get_avg_tp(c0_fname, c1_fname) + if tp > 0: + tp_x = np.append(tp_x, tp) - data_point[stack] = avg_tp / len(parsed_md[nconns][stack]) + data_point[stack] = { + "tp": tp_x.mean(), + "std": tp_x.std(), + } - tp.append(data_point) + data.append(data_point) - tp = sorted(tp, key=lambda d: int(d['nconns'])) - return tp + data = sorted(data, key=lambda d: int(d['nconns'])) + return data -def save_dat_file(avg_tps, fname): +def save_dat_file(data, fname): f = open(fname, "w+") - header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" + header = "nconns bare-tas-avg bare-vtas-avg " + \ + "virt-tas-avg ovs-linux-avg ovs-tas-avg " + \ + "bare-tas-std " + \ + "virt-tas-std ovs-linux-std\n" f.write(header) - for tp in avg_tps: - f.write("{} {} {} {} {} {}\n".format( - tp["nconns"], - tp["bare-tas"], - tp["bare-vtas"], - tp["virt-tas"], - tp["ovs-linux"], - tp["ovs-tas"] - )) + for dp in data: + f.write("{} {} {} {} {} {} {} {} {}\n".format( + dp["nconns"], + dp["bare-tas"]["tp"], dp["bare-vtas"]["tp"], dp["virt-tas"]["tp"], + dp["ovs-linux"]["tp"], + dp["bare-tas"]["std"], dp["bare-vtas"]["std"], dp["virt-tas"]["std"], + dp["ovs-linux"]["std"])) def main(): parsed_md = parse_metadata() - avg_tps = parse_data(parsed_md) - save_dat_file(avg_tps, "./tp.dat") + data = parse_data(parsed_md) + save_dat_file(data, "./tp.dat") if __name__ == '__main__': main() \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py index 017a3143..1c262dac 100644 --- a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py +++ b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py @@ -20,9 +20,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_c), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_c), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) + # experiments.append(tas_bare_exp) + # experiments.append(vtas_bare_exp) + # experiments.append(tas_virt_exp) experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + # experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpconn/plot_script.plt b/experiments/exps/perf_iso_tpconn/plot_script.plt index 0f2321a6..19e6486f 100644 --- a/experiments/exps/perf_iso_tpconn/plot_script.plt +++ b/experiments/exps/perf_iso_tpconn/plot_script.plt @@ -12,8 +12,8 @@ set label 1 "Aggressor Client # Connections" at screen 0.5, 0.03 center set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 center set yrange [0:2000] -plot 'tp.dat' using 1:2:xtic(1) title 'tas' linetype 2 w lp, \ - 'tp.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 w lp, \ - 'tp.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 w lp, \ - 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 w lp, \ - 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 w lp, \ +plot 'tp.dat' using 1:2:6 with yerrorlines title 'tas' linetype 2 ps 0.7, \ + 'tp.dat' using 1:3:7 with yerrorlines title 'bare-virtuoso' linetype 3 ps 0.7, \ + 'tp.dat' using 1:4:8 with yerrorlines title 'virtuoso' linetype 4 ps 0.7, \ + 'tp.dat' using 1:5:9 with yerrorlines title 'ovs-linux' linetype 5 ps 0.7, \ + # 'tp.dat' using 1:6:11 with yerrorlines title 'ovs-tas' linetype 6 ps 0.7, \ diff --git a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py index e209c033..bf391ba9 100644 --- a/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py +++ b/experiments/exps/perf_iso_tpmsize/perf_iso_tpmsize.py @@ -20,9 +20,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_m), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_m), name=exp_name) - experiments.append(tas_bare_exp) - experiments.append(vtas_bare_exp) - experiments.append(tas_virt_exp) + # experiments.append(tas_bare_exp) + # experiments.append(vtas_bare_exp) + # experiments.append(tas_virt_exp) experiments.append(ovs_tas_exp) - experiments.append(ovs_linux_exp) + # experiments.append(ovs_linux_exp) From c82866262a56045405220c799b3d590b1604ff41 Mon Sep 17 00:00:00 2001 From: stolet Date: Tue, 18 Apr 2023 17:17:59 +0200 Subject: [PATCH 49/50] do a per VM round robin in congestion control to precent tail latency from going up --- tas/fast/fast_flows.c | 2 +- tas/slow/cc.c | 98 ++++++++++++++++++++++++++++++------------- 2 files changed, 69 insertions(+), 31 deletions(-) diff --git a/tas/fast/fast_flows.c b/tas/fast/fast_flows.c index 1bf4dea2..fc924d37 100644 --- a/tas/fast/fast_flows.c +++ b/tas/fast/fast_flows.c @@ -419,7 +419,7 @@ int fast_flows_packet(struct dataplane_context *ctx, } } -#ifdef FLEXNIC_PL_OOO_RECV +#ifdef FLEXNIC_PL_OOO_RECV /* check if we should drop this segment */ if (UNLIKELY(tcp_trim_rxbuf(fs, seq, payload_bytes, &trim_start, &trim_end) != 0)) { /* packet is completely outside of unused receive buffer */ diff --git a/tas/slow/cc.c b/tas/slow/cc.c index 9c84b198..de37f918 100644 --- a/tas/slow/cc.c +++ b/tas/slow/cc.c @@ -29,13 +29,12 @@ #include #include "internal.h" +#include "appif.h" #define CONF_MSS 1400 -int cc_init(void) -{ - return 0; -} +static void cc_next_ts_vm(uint32_t cur_ts, int vmid, uint32_t *ts); +static unsigned cc_poll_vm(int vmid, unsigned n, uint32_t diff_ts); static inline void issue_retransmits(struct connection *c, struct nicif_connection_stats *stats, uint32_t cur_ts); @@ -59,50 +58,89 @@ static inline void const_rate_update(struct connection *c, static inline uint32_t window_to_rate(uint32_t window, uint32_t rtt); static uint32_t last_ts = 0; -static struct connection *cc_conns = NULL; -static struct connection *next_conn = NULL; +int next_vm = 0; +static struct connection *cc_conns[FLEXNIC_PL_VMST_NUM]; +static struct connection *next_conn[FLEXNIC_PL_VMST_NUM]; + +int cc_init(void) +{ + int i; + + for (i = 0; i < FLEXNIC_PL_VMST_NUM; i++) + { + cc_conns[i] = NULL; + next_conn[i] = NULL; + } + + return 0; +} uint32_t cc_next_ts(uint32_t cur_ts) { - struct connection *c; + int i; assert(cur_ts >= last_ts); uint32_t ts = -1U; - for (c = cc_conns; c != NULL; c = c->cc_next) { + for (i = 0; i < FLEXNIC_PL_VMST_NUM; i++) + { + cc_next_ts_vm(cur_ts, i, &ts); + } + + return (ts == -1U ? -1U : MAX(ts, config.cc_control_granularity - (cur_ts - last_ts))); +} + +static void cc_next_ts_vm(uint32_t cur_ts, int vmid, uint32_t *ts) +{ + struct connection *c; + + for (c = cc_conns[vmid]; c != NULL; c = c->cc_next) { if (c->status != CONN_OPEN) continue; int32_t next_ts = (c->cc_rtt * config.cc_control_interval) - (cur_ts - c->cc_last_ts); if(next_ts >= 0) { - ts = MIN(ts, next_ts); + *ts = MIN(*ts, next_ts); } else { - ts = 0; + *ts = 0; } } - - return (ts == -1U ? -1U : MAX(ts, config.cc_control_granularity - (cur_ts - last_ts))); } unsigned cc_poll(uint32_t cur_ts) { - struct connection *c, *c_first; - struct nicif_connection_stats stats; - uint32_t diff_ts; - uint32_t last; + int i, vmid; unsigned n = 0; + uint32_t diff_ts; diff_ts = cur_ts - last_ts; if (0 && diff_ts < config.cc_control_granularity) return 0; - c = c_first = (next_conn != NULL ? next_conn : cc_conns); + + for(i = 0; i < FLEXNIC_PL_VMST_NUM && n < 128; i++) + { + vmid = (next_vm + i) % FLEXNIC_PL_VMST_NUM; + n = cc_poll_vm(vmid, n, diff_ts); + } + + last_ts = cur_ts; + next_vm = (vmid + 1) % FLEXNIC_PL_VMST_NUM; + return n; +} + +static unsigned cc_poll_vm(int vmid, unsigned n, uint32_t diff_ts) +{ + struct connection *c, *c_first; + struct nicif_connection_stats stats; + uint32_t last; + + c = c_first = (next_conn[vmid] != NULL ? next_conn[vmid] : cc_conns[vmid]); if (c == NULL) { - last_ts = cur_ts; - return 0; + return n; } for (; n < 128 && (n == 0 || c != c_first); - c = (c->cc_next != NULL ? c->cc_next : cc_conns), n++) + c = (c->cc_next != NULL ? c->cc_next : cc_conns[vmid]), n++) { if (c->status != CONN_OPEN) continue; @@ -164,18 +202,17 @@ unsigned cc_poll(uint32_t cur_ts) nicif_connection_setrate(c->flow_id, c->cc_rate); c->cc_last_ts = cur_ts; - } - next_conn = c; - last_ts = cur_ts; + next_conn[vmid] = c; return n; } void cc_conn_init(struct connection *conn) { - conn->cc_next = cc_conns; - cc_conns = conn; + int vmid = conn->ctx->app->vm_id; + conn->cc_next = cc_conns[vmid]; + cc_conns[vmid] = conn; conn->cc_last_ts = cur_ts; conn->cc_rtt = config.tcp_rtt_init; @@ -209,15 +246,16 @@ void cc_conn_init(struct connection *conn) void cc_conn_remove(struct connection *conn) { struct connection *cp = NULL; + int vmid = conn->ctx->app->vm_id; - if (next_conn == conn) { - next_conn = conn->cc_next; + if (next_conn[vmid] == conn) { + next_conn[vmid] = conn->cc_next; } - if (cc_conns == conn) { - cc_conns = conn->cc_next; + if (cc_conns[vmid] == conn) { + cc_conns[vmid] = conn->cc_next; } else { - for (cp = cc_conns; cp != NULL && cp->cc_next != conn; + for (cp = cc_conns[vmid]; cp != NULL && cp->cc_next != conn; cp = cp->cc_next); if (cp == NULL) { fprintf(stderr, "conn_unregister: connection not found\n"); From 16eb31236cdee6621b14de9d68844433aef21811 Mon Sep 17 00:00:00 2001 From: stolet Date: Wed, 19 Apr 2023 14:29:33 +0200 Subject: [PATCH 50/50] Make perf iso exps the same --- experiments/components/vm.py | 3 + .../exps/perf_iso_latconn/configs/bare_tas.py | 10 +-- .../perf_iso_latconn/configs/bare_vtas.py | 10 +-- .../perf_iso_latconn/configs/ovs_linux.py | 8 +-- .../exps/perf_iso_latconn/configs/ovs_tas.py | 12 ++-- .../exps/perf_iso_latconn/configs/virt_tas.py | 10 +-- .../exps/perf_iso_latconn/perf_iso_latconn.py | 10 +-- .../perf_iso_latmsize/configs/bare_tas.py | 10 +-- .../perf_iso_latmsize/configs/bare_vtas.py | 10 +-- .../perf_iso_latmsize/configs/ovs_linux.py | 8 +-- .../exps/perf_iso_latmsize/configs/ovs_tas.py | 12 ++-- .../perf_iso_latmsize/configs/virt_tas.py | 10 +-- experiments/exps/perf_iso_latmsize/parse.py | 49 ++++++++------ .../exps/perf_iso_latmsize/plot_script.plt | 40 +++++------ .../exps/perf_iso_tpconn/configs/bare_tas.py | 10 +-- .../exps/perf_iso_tpconn/configs/bare_vtas.py | 10 +-- .../exps/perf_iso_tpconn/configs/ovs_linux.py | 8 +-- .../exps/perf_iso_tpconn/configs/ovs_tas.py | 12 ++-- .../exps/perf_iso_tpconn/configs/virt_tas.py | 10 +-- experiments/exps/perf_iso_tpconn/parse.py | 9 +-- .../exps/perf_iso_tpconn/perf_iso_tpconn.py | 10 +-- .../exps/perf_iso_tpmsize/configs/bare_tas.py | 10 +-- .../perf_iso_tpmsize/configs/bare_vtas.py | 10 +-- .../perf_iso_tpmsize/configs/ovs_linux.py | 8 +-- .../exps/perf_iso_tpmsize/configs/ovs_tas.py | 12 ++-- .../exps/perf_iso_tpmsize/configs/virt_tas.py | 10 +-- experiments/exps/perf_iso_tpmsize/parse.py | 48 ++++++++------ .../exps/perf_iso_tpmsize/plot_script.plt | 10 +-- experiments/nodes/node.py | 6 +- experiments/plot_utils.py | 66 +++++++++++++------ experiments/run.py | 3 +- images/start-vm.sh | 10 +-- 32 files changed, 255 insertions(+), 209 deletions(-) diff --git a/experiments/components/vm.py b/experiments/components/vm.py index 687d72d3..1005d4e3 100644 --- a/experiments/components/vm.py +++ b/experiments/components/vm.py @@ -31,8 +31,11 @@ def enable_hugepages(self): def enable_noiommu(self, vendor_id): self.pane.send_keys("sudo su -") + time.sleep(1) self.pane.send_keys("sudo echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode") + time.sleep(1) self.pane.send_keys("sudo echo {} > /sys/bus/pci/drivers/vfio-pci/new_id".format(vendor_id)) + time.sleep(1) self.pane.send_keys("exit") time.sleep(1) diff --git a/experiments/exps/perf_iso_latconn/configs/bare_tas.py b/experiments/exps/perf_iso_latconn/configs/bare_tas.py index d69c2dfa..87142d0e 100644 --- a/experiments/exps/perf_iso_latconn/configs/bare_tas.py +++ b/experiments/exps/perf_iso_latconn/configs/bare_tas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -65,7 +65,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_latconn/configs/bare_vtas.py b/experiments/exps/perf_iso_latconn/configs/bare_vtas.py index da7570a4..084c9d98 100644 --- a/experiments/exps/perf_iso_latconn/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_latconn/configs/bare_vtas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -65,7 +65,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_latconn/configs/ovs_linux.py b/experiments/exps/perf_iso_latconn/configs/ovs_linux.py index 320c27c9..5ee30ea6 100644 --- a/experiments/exps/perf_iso_latconn/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_latconn/configs/ovs_linux.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_latconn/configs/ovs_tas.py b/experiments/exps/perf_iso_latconn/configs/ovs_tas.py index 283e5243..3a79deab 100644 --- a/experiments/exps/perf_iso_latconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_latconn/configs/ovs_tas.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -72,7 +72,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, n_cores=1, dpdk_extra="00:03.0") - tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + tas0_config.args = tas0_config.args + ' --shm-len=8589934592' vm1_config = VMConfig(pane=self.defaults.c_vm_pane, @@ -85,7 +85,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, n_cores=1, dpdk_extra="00:03.0") - tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + tas1_config.args = tas1_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas0_config) diff --git a/experiments/exps/perf_iso_latconn/configs/virt_tas.py b/experiments/exps/perf_iso_latconn/configs/virt_tas.py index 0fcff46e..b09bf4dd 100644 --- a/experiments/exps/perf_iso_latconn/configs/virt_tas.py +++ b/experiments/exps/perf_iso_latconn/configs/virt_tas.py @@ -31,18 +31,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -68,7 +68,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, diff --git a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py index f41e3679..ee153ada 100644 --- a/experiments/exps/perf_iso_latconn/perf_iso_latconn.py +++ b/experiments/exps/perf_iso_latconn/perf_iso_latconn.py @@ -8,7 +8,7 @@ experiments = [] -n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] +n_conns = [128, 256, 512, 1024, 2048, 4096, 8192, 16384] n_runs = 3 for n_r in range(n_runs): @@ -20,9 +20,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_c), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_c), name=exp_name) - # experiments.append(tas_bare_exp) - # experiments.append(vtas_bare_exp) - # experiments.append(tas_virt_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) experiments.append(ovs_tas_exp) - # experiments.append(ovs_linux_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_latmsize/configs/bare_tas.py b/experiments/exps/perf_iso_latmsize/configs/bare_tas.py index b40c9f2f..c60422d4 100644 --- a/experiments/exps/perf_iso_latmsize/configs/bare_tas.py +++ b/experiments/exps/perf_iso_latmsize/configs/bare_tas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -65,7 +65,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py b/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py index 57754525..f346fb50 100644 --- a/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_latmsize/configs/bare_vtas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -65,7 +65,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py b/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py index fbf948b3..fd0a8663 100644 --- a/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_latmsize/configs/ovs_linux.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py b/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py index cd985cd3..131c4221 100644 --- a/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_latmsize/configs/ovs_tas.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -72,7 +72,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, n_cores=1, dpdk_extra="00:03.0") - tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + tas0_config.args = tas0_config.args + ' --shm-len=8589934592' vm1_config = VMConfig(pane=self.defaults.c_vm_pane, @@ -85,7 +85,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, n_cores=1, dpdk_extra="00:03.0") - tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + tas1_config.args = tas1_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas0_config) diff --git a/experiments/exps/perf_iso_latmsize/configs/virt_tas.py b/experiments/exps/perf_iso_latmsize/configs/virt_tas.py index 65d653f8..38ca219d 100644 --- a/experiments/exps/perf_iso_latmsize/configs/virt_tas.py +++ b/experiments/exps/perf_iso_latmsize/configs/virt_tas.py @@ -31,18 +31,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -68,7 +68,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, diff --git a/experiments/exps/perf_iso_latmsize/parse.py b/experiments/exps/perf_iso_latmsize/parse.py index edc29989..6370e2a1 100644 --- a/experiments/exps/perf_iso_latmsize/parse.py +++ b/experiments/exps/perf_iso_latmsize/parse.py @@ -2,6 +2,7 @@ sys.path.append("../../../") import os +import numpy as np import experiments.plot_utils as putils @@ -52,7 +53,7 @@ def parse_metadata(): return data def parse_data(parsed_md): - lat_list = {} + data = {} out_dir = "./out/" for msize in parsed_md: data_point = {} @@ -60,22 +61,27 @@ def parse_data(parsed_md): latencies = putils.init_latencies() for run in parsed_md[msize][stack]: fname_c0 = out_dir + parsed_md[msize][stack][run]['0']['0'] - putils.add_latencies(latencies, fname_c0) - - putils.divide_latencies(latencies, len(parsed_md[msize][stack])) - data_point[stack] = latencies - - lat_list[msize] = data_point + putils.append_latencies(latencies, fname_c0) + + data_point[stack] = { + "lat": putils.get_latency_avg(latencies), + "std": putils.get_latency_std(latencies) + } + data[msize] = data_point - return lat_list + return data -def save_dat_file(exp_lats): - header = "nconns bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" +def save_dat_file(data): + header = "msize " + \ + "bare-tas-avg bare-vtas-avg virt-tas-avg " + \ + "ovs-linux-avg " + \ + "bare-tas-std bare-vtas-std virt-tas-std " + \ + "ovs-linux-std\n" - msizes = list(exp_lats.keys()) + msizes = list(data.keys()) msizes = list(map(str, sorted(map(int, msizes)))) - stacks = list(exp_lats[msizes[0]].keys()) - percentiles = list(exp_lats[msizes[0]][stacks[0]].keys()) + stacks = list(data[msizes[0]].keys()) + percentiles = list(data[msizes[0]][stacks[0]]['lat'].keys()) for percentile in percentiles: fname = "./lat_{}.dat".format(percentile) @@ -83,14 +89,17 @@ def save_dat_file(exp_lats): f.write(header) for msize in msizes: - f.write("{} {} {} {} {} {}\n".format( + f.write("{} {} {} {} {} {} {} {} {}\n".format( msize, - exp_lats[msize]['bare-tas'][percentile], - exp_lats[msize]['bare-vtas'][percentile], - exp_lats[msize]['virt-tas'][percentile], - exp_lats[msize]['ovs-linux'][percentile], - exp_lats[msize]['ovs-tas'][percentile]) - ) + data[msize]['bare-tas']['lat'][percentile], + data[msize]['bare-vtas']["lat"][percentile], + data[msize]['virt-tas']["lat"][percentile], + data[msize]['ovs-linux']["lat"][percentile], + data[msize]['bare-tas']["std"][percentile], + data[msize]['bare-vtas']["std"][percentile], + data[msize]['virt-tas']["std"][percentile], + data[msize]['ovs-linux']["std"][percentile])) + def main(): parsed_md = parse_metadata() diff --git a/experiments/exps/perf_iso_latmsize/plot_script.plt b/experiments/exps/perf_iso_latmsize/plot_script.plt index e7d6de98..cfa26593 100644 --- a/experiments/exps/perf_iso_latmsize/plot_script.plt +++ b/experiments/exps/perf_iso_latmsize/plot_script.plt @@ -25,22 +25,22 @@ unset xtics set key center left set yrange [0:] set title "50p Latency" -plot 'lat_50p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ - 'lat_50p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ +plot 'lat_50p.dat' using 1:2:6 with yerrorlines title 'bare-tas' linetype 2 ps 0.3, \ + 'lat_50p.dat' using 1:3:7 with yerrorlines title 'bare-virtuoso' linetype 3 ps 0.3, \ + 'lat_50p.dat' using 1:4:8 with yerrorlines title 'virtuoso' linetype 4 ps 0.3, \ + 'lat_50p.dat' using 1:5:9 with yerrorlines title 'ovs-linux' linetype 5 ps 0.3, \ + # 'lat_50p.dat' using 1:6: with yerrorlines title 'ovs-tas' linetype 6 ps 0.3, \ # Plot 90p latency unset xtics set key top right set yrange [0:] set title "90p Latency" -plot 'lat_90p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ - 'lat_90p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ +plot 'lat_90p.dat' using 1:2:6 with yerrorlines title 'bare-tas' linetype 2 ps 0.3, \ + 'lat_90p.dat' using 1:3:7 with yerrorlines title 'bare-virtuoso' linetype 3 ps 0.3, \ + 'lat_90p.dat' using 1:4:8 with yerrorlines title 'virtuoso' linetype 4 ps 0.3, \ + 'lat_90p.dat' using 1:5:9 with yerrorlines title 'ovs-linux' linetype 5 ps 0.3, \ + # 'lat_90p.dat' using 1:6: with yerrorlines title 'ovs-tas' linetype 6 ps 0.3, \ # Plot 99p latency @@ -49,11 +49,11 @@ set xtics font "Computer Modern Roman,6" set key center left set yrange [0:] set title "99p Latency" -plot 'lat_99p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ - 'lat_99p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ +plot 'lat_99p.dat' using 1:2:6 with yerrorlines title 'bare-tas' linetype 2 ps 0.3, \ + 'lat_99p.dat' using 1:3:7 with yerrorlines title 'bare-virtuoso' linetype 3 ps 0.3, \ + 'lat_99p.dat' using 1:4:8 with yerrorlines title 'virtuoso' linetype 4 ps 0.3, \ + 'lat_99p.dat' using 1:5:9 with yerrorlines title 'ovs-linux' linetype 5 ps 0.3, \ + # 'lat_99p.dat' using 1:6: with yerrorlines title 'ovs-tas' linetype 6 ps 0.3, \ # Plot 99.9p latency set xtics @@ -61,8 +61,8 @@ set xtics font "Computer Modern Roman,6" set key center right set yrange [0:] set title "99.9p Latency" -plot 'lat_99.9p.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:4:xtic(1) title 'virtuoso' linetype 4 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 ps 0.3 w lp, \ - 'lat_99.9p.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 ps 0.3 w lp, \ +plot 'lat_99.9p.dat' using 1:2:6 with yerrorlines title 'bare-tas' linetype 2 ps 0.3, \ + 'lat_99.9p.dat' using 1:3:7 with yerrorlines title 'bare-virtuoso' linetype 3 ps 0.3, \ + 'lat_99.9p.dat' using 1:4:8 with yerrorlines title 'virtuoso' linetype 4 ps 0.3, \ + 'lat_99.9p.dat' using 1:5:9 with yerrorlines title 'ovs-linux' linetype 5 ps 0.3, \ + # 'lat_99.9p.dat' using 1:6: with yerrorlines title 'ovs-tas' linetype 6 ps 0.3, \ diff --git a/experiments/exps/perf_iso_tpconn/configs/bare_tas.py b/experiments/exps/perf_iso_tpconn/configs/bare_tas.py index 74a375f8..c5c95fc5 100644 --- a/experiments/exps/perf_iso_tpconn/configs/bare_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/bare_tas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -65,7 +65,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py b/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py index 9d771734..9b9e5541 100644 --- a/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_tpconn/configs/bare_vtas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, groupid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, groupid=1, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) @@ -66,7 +66,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py b/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py index 19545cd7..838e5983 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_linux.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py index d7c95f24..4ada0270 100644 --- a/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/ovs_tas.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -71,7 +71,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.vm_ip, n_cores=1, dpdk_extra="00:03.0") - tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + tas0_config.args = tas0_config.args + ' --shm-len=8589934592' vm1_config = VMConfig(pane=self.defaults.c_vm_pane, @@ -84,7 +84,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.vm_ip, n_cores=1, dpdk_extra="00:03.0") - tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + tas1_config.args = tas1_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas0_config) diff --git a/experiments/exps/perf_iso_tpconn/configs/virt_tas.py b/experiments/exps/perf_iso_tpconn/configs/virt_tas.py index 53c0d125..f7cd6534 100644 --- a/experiments/exps/perf_iso_tpconn/configs/virt_tas.py +++ b/experiments/exps/perf_iso_tpconn/configs/virt_tas.py @@ -31,18 +31,18 @@ def __init__(self, exp_name, nconns): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -68,7 +68,7 @@ def __init__(self, exp_name, nconns): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, diff --git a/experiments/exps/perf_iso_tpconn/parse.py b/experiments/exps/perf_iso_tpconn/parse.py index 60cc62f6..e139dba5 100644 --- a/experiments/exps/perf_iso_tpconn/parse.py +++ b/experiments/exps/perf_iso_tpconn/parse.py @@ -104,10 +104,11 @@ def parse_data(parsed_md): def save_dat_file(data, fname): f = open(fname, "w+") - header = "nconns bare-tas-avg bare-vtas-avg " + \ - "virt-tas-avg ovs-linux-avg ovs-tas-avg " + \ - "bare-tas-std " + \ - "virt-tas-std ovs-linux-std\n" + header = "nconns " + \ + "bare-tas-avg bare-vtas-avg virt-tas-avg " + \ + "ovs-linux-avg " + \ + "bare-tas-std bare-vtas-std virt-tas-std " + \ + "ovs-linux-std\n" f.write(header) for dp in data: f.write("{} {} {} {} {} {} {} {} {}\n".format( diff --git a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py index 1c262dac..319040af 100644 --- a/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py +++ b/experiments/exps/perf_iso_tpconn/perf_iso_tpconn.py @@ -8,7 +8,7 @@ experiments = [] -n_conns = [128, 256, 512, 1024, 2048, 4096, 8192] +n_conns = [128, 256, 512, 1024, 2048, 4096, 8192, 16384] n_runs = 3 for n_r in range(n_runs): @@ -20,9 +20,9 @@ ovs_linux_exp = exp.Experiment(OVSLinuxConf(exp_name + "ovs-linux", n_c), name=exp_name) ovs_tas_exp = exp.Experiment(OVSTasConf(exp_name + "ovs-tas", n_c), name=exp_name) - # experiments.append(tas_bare_exp) - # experiments.append(vtas_bare_exp) - # experiments.append(tas_virt_exp) + experiments.append(tas_bare_exp) + experiments.append(vtas_bare_exp) + experiments.append(tas_virt_exp) experiments.append(ovs_tas_exp) - # experiments.append(ovs_linux_exp) + experiments.append(ovs_linux_exp) diff --git a/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py b/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py index 3ec57379..33275fbc 100644 --- a/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py +++ b/experiments/exps/perf_iso_tpmsize/configs/bare_tas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -65,7 +65,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py b/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py index a9533f54..eeb52beb 100644 --- a/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py +++ b/experiments/exps/perf_iso_tpmsize/configs/bare_vtas.py @@ -28,18 +28,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, groupid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, groupid=1, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) @@ -66,7 +66,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) client0_config = ClientConfig(exp_name=exp_name, diff --git a/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py b/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py index eafeb4d1..92b0897a 100644 --- a/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py +++ b/experiments/exps/perf_iso_tpmsize/configs/ovs_linux.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) diff --git a/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py b/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py index 3c5942ec..9a94a730 100644 --- a/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py +++ b/experiments/exps/perf_iso_tpmsize/configs/ovs_tas.py @@ -29,18 +29,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -72,7 +72,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_virt, ip=vm0_config.tas_tap_ip, n_cores=1, dpdk_extra="00:03.0") - tas0_config.args = tas0_config.args + ' --shm-len=4294967296' + tas0_config.args = tas0_config.args + ' --shm-len=8589934592' vm1_config = VMConfig(pane=self.defaults.c_vm_pane, @@ -85,7 +85,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_otas_dir_virt, ip=vm1_config.tas_tap_ip, n_cores=1, dpdk_extra="00:03.0") - tas1_config.args = tas1_config.args + ' --shm-len=4294967296' + tas1_config.args = tas1_config.args + ' --shm-len=8589934592' self.c_tas_configs.append(tas0_config) diff --git a/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py b/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py index fb0a7924..1f6e939c 100644 --- a/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py +++ b/experiments/exps/perf_iso_tpmsize/configs/virt_tas.py @@ -31,18 +31,18 @@ def __init__(self, exp_name, msize): machine_config=self.s_machine_config, project_dir=self.defaults.default_otas_dir_bare, ip=self.s_machine_config.ip, - n_cores=12) - tas_config.args = tas_config.args + ' --shm-len=4294967296' + n_cores=14) + tas_config.args = tas_config.args + ' --shm-len=8589934592' self.s_tas_configs.append(tas_config) server0_config = ServerConfig(pane=self.defaults.s_server_pane, idx=0, vmid=0, - port=1234, ncores=8, max_flows=4096, max_bytes=4096, + port=1234, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) server1_config = ServerConfig(pane=self.defaults.s_server_pane, idx=1, vmid=0, - port=1235, ncores=8, max_flows=4096, max_bytes=4096, + port=1235, ncores=12, max_flows=4096, max_bytes=4096, bench_dir=self.defaults.default_obenchmark_dir_bare, tas_dir=self.defaults.default_otas_dir_bare) self.server_configs.append(server0_config) @@ -68,7 +68,7 @@ def __init__(self, exp_name, msize): project_dir=self.defaults.default_vtas_dir_bare, ip=self.c_machine_config.ip, n_cores=1) - tas_config.args = tas_config.args + ' --vm-shm-len=4294967296' + tas_config.args = tas_config.args + ' --vm-shm-len=8589934592' self.c_tas_configs.append(tas_config) self.c_proxyh_config = HostProxyConfig(pane=self.defaults.c_proxyh_pane, diff --git a/experiments/exps/perf_iso_tpmsize/parse.py b/experiments/exps/perf_iso_tpmsize/parse.py index fba9b93b..5214b94d 100644 --- a/experiments/exps/perf_iso_tpmsize/parse.py +++ b/experiments/exps/perf_iso_tpmsize/parse.py @@ -2,6 +2,7 @@ sys.path.append("../../../") import os +import numpy as np import experiments.plot_utils as putils @@ -72,12 +73,12 @@ def parse_metadata(): return data def parse_data(parsed_md): - tp = [] + data = [] out_dir = "./out/" for msize in parsed_md: data_point = {"msize": msize} for stack in parsed_md[msize]: - avg_tp = 0 + tp_x = np.array([]) for run in parsed_md[msize][stack]: is_virt = stack == "virt-tas" or stack == "ovs-tas" or stack == "ovs-linux" if is_virt: @@ -87,33 +88,40 @@ def parse_data(parsed_md): c0_fname = out_dir + parsed_md[msize][stack][run]["0"]["0"] c1_fname = out_dir + parsed_md[msize][stack][run]["0"]["1"] - avg_tp += get_avg_tp(c0_fname, c1_fname) + tp = get_avg_tp(c0_fname, c1_fname) + if tp > 0: + tp_x = np.append(tp_x, tp) - data_point[stack] = avg_tp / len(parsed_md[msize][stack]) + data_point[stack] = { + "tp": tp_x.mean(), + "std": tp_x.std(), + } - tp.append(data_point) + data.append(data_point) - tp = sorted(tp, key=lambda d: int(d['msize'])) - return tp + data = sorted(data, key=lambda d: int(d['msize'])) + return data -def save_dat_file(avg_tps, fname): +def save_dat_file(data, fname): f = open(fname, "w+") - header = "msize bare-tas bare-vtas virt-tas ovs-linux ovs-tas\n" + header = "msize " + \ + "bare-tas-avg bare-vtas-avg virt-tas-avg " + \ + "ovs-linux-avg " + \ + "bare-tas-std bare-vtas-std virt-tas-std " + \ + "ovs-linux-std\n" f.write(header) - for tp in avg_tps: - f.write("{} {} {} {} {} {}\n".format( - tp["msize"], - tp["bare-tas"], - tp["bare-vtas"], - tp["virt-tas"], - tp["ovs-linux"], - tp["ovs-tas"] - )) + for dp in data: + f.write("{} {} {} {} {} {} {} {} {}\n".format( + dp["msize"], + dp["bare-tas"]["tp"], dp["bare-vtas"]["tp"], dp["virt-tas"]["tp"], + dp["ovs-linux"]["tp"], + dp["bare-tas"]["std"], dp["bare-vtas"]["std"], dp["virt-tas"]["std"], + dp["ovs-linux"]["std"])) def main(): parsed_md = parse_metadata() - avg_tps = parse_data(parsed_md) - save_dat_file(avg_tps, "./tp.dat") + data = parse_data(parsed_md) + save_dat_file(data, "./tp.dat") if __name__ == '__main__': main() \ No newline at end of file diff --git a/experiments/exps/perf_iso_tpmsize/plot_script.plt b/experiments/exps/perf_iso_tpmsize/plot_script.plt index 7d3d7445..584b0580 100644 --- a/experiments/exps/perf_iso_tpmsize/plot_script.plt +++ b/experiments/exps/perf_iso_tpmsize/plot_script.plt @@ -12,8 +12,8 @@ set label 1 "Aggressor Client Message Size" at screen 0.5, 0.03 center set label 2 "Victim Client Throughput (Mbps)" at screen 0.01, 0.5 rotate by 90 center set yrange [0:2000] -plot 'tp.dat' using 1:2:xtic(1) title 'bare-tas' linetype 2 w lp, \ - 'tp.dat' using 1:3:xtic(1) title 'bare-virtuoso' linetype 3 w lp, \ - 'tp.dat' using 1:4:xtic(1) title 'virt-tas' linetype 4 w lp, \ - 'tp.dat' using 1:5:xtic(1) title 'ovs-linux' linetype 5 w lp, \ - 'tp.dat' using 1:6:xtic(1) title 'ovs-tas' linetype 6 w lp, \ +plot 'tp.dat' using 1:2:6 with yerrorlines title 'tas' linetype 2 ps 0.7, \ + 'tp.dat' using 1:3:7 with yerrorlines title 'bare-virtuoso' linetype 3 ps 0.7, \ + 'tp.dat' using 1:4:8 with yerrorlines title 'virtuoso' linetype 4 ps 0.7, \ + 'tp.dat' using 1:5:9 with yerrorlines title 'ovs-linux' linetype 5 ps 0.7, \ + # 'tp.dat' using 1:6:11 with yerrorlines title 'ovs-tas' linetype 6 ps 0.7, \ diff --git a/experiments/nodes/node.py b/experiments/nodes/node.py index c70f84bd..72fb704c 100644 --- a/experiments/nodes/node.py +++ b/experiments/nodes/node.py @@ -60,7 +60,7 @@ def start_ovs(self, script_dir): time.sleep(1) cmd = "sudo bash ovs-start.sh" self.setup_pane.send_keys(cmd) - time.sleep(2) + time.sleep(4) def stop_ovs(self, script_dir): cmd = "cd {}".format(script_dir) @@ -76,7 +76,7 @@ def ovsbr_add(self, br_name, ip, interface, script_dir): time.sleep(1) cmd = "sudo bash ovsbr-add.sh {} {} {}".format(br_name, ip, interface) self.setup_pane.send_keys(cmd) - time.sleep(2) + time.sleep(4) def ovsbr_del(self, br_name): cmd = "sudo ovs-vsctl del-br {}".format(br_name) @@ -90,7 +90,7 @@ def ovsvhost_add(self, br_name, vhost_name, script_dir): cmd = "sudo bash ovsvhost-add.sh {} {}".format( br_name, vhost_name) self.setup_pane.send_keys(cmd) - time.sleep(2) + time.sleep(4) def ovstap_add(self, br_name, tap_name, multi_queue, script_dir): cmd = "cd {}".format(script_dir) diff --git a/experiments/plot_utils.py b/experiments/plot_utils.py index 2d36b0e4..7e875644 100644 --- a/experiments/plot_utils.py +++ b/experiments/plot_utils.py @@ -1,38 +1,64 @@ - +import numpy as np import re def init_latencies(): latencies = { - "50p": 0, - "90p": 0, - "99p": 0, - "99.9p": 0, - "99.99p": 0 + "50p": np.array([]), + "90p": np.array([]), + "99p": np.array([]), + "99.9p": np.array([]), + "99.99p": np.array([]) } return latencies -def divide_latencies(latencies, den): - latencies["50p"] /= den - latencies["90p"] /= den - latencies["99p"] /= den - latencies["99.9p"] /= den - latencies["99.99p"] /= den - -def add_latencies(latencies, fname_c0): +def append_latencies(latencies, fname_c0): f = open(fname_c0) lines = f.readlines() # Latencies are already accumulated over all time # period in the logs line = lines[len(lines) - 1] - latencies["50p"] += int(get_50p_lat(line)) - latencies["90p"] += int(get_90p_lat(line)) - latencies["99p"] += int(get_99p_lat(line)) - latencies["99.9p"] += int(get_99_9p_lat(line)) - latencies["99.99p"] += int(get_99_99p_lat(line)) - return latencies + lat = int(get_50p_lat(line)) + if lat > 0: + latencies["50p"] = np.append(latencies["50p"], lat) + + lat = int(get_90p_lat(line)) + if lat > 0: + latencies["90p"] = np.append(latencies["90p"], lat) + + lat = int(get_99p_lat(line)) + if lat > 0: + latencies["99p"] = np.append(latencies["99p"], lat) + + lat = int(get_99_9p_lat(line)) + if lat > 0: + latencies["99.9p"] = np.append(latencies["99.9p"], lat) + + lat = int(get_99_99p_lat(line)) + if lat > 0: + latencies["99.99p"] = np.append(latencies["99.99p"], lat) + +def get_latency_avg(latencies): + avg_lats = { + "50p": latencies["50p"].mean(), + "90p": latencies["90p"].mean(), + "99p": latencies["99p"].mean(), + "99.9p": latencies["99.9p"].mean(), + "99.99p": latencies["99.99p"].mean() + } + + return avg_lats + +def get_latency_std(latencies): + return { + "50p": latencies["50p"].std(), + "90p": latencies["90p"].std(), + "99p": latencies["99p"].std(), + "99.9p": latencies["99.9p"].std(), + "99.99p": latencies["99.99p"].std() + } def get_expname_msize(fname): regex = "(?<=-msize)[0-9]*" diff --git a/experiments/run.py b/experiments/run.py index bb749cb7..8cc8e279 100644 --- a/experiments/run.py +++ b/experiments/run.py @@ -52,7 +52,6 @@ continue print('******' + e.get_name() + '********') e.run() - time.sleep(80) + time.sleep(120) e.save_logs() - time.sleep(15) e.reset() \ No newline at end of file diff --git a/images/start-vm.sh b/images/start-vm.sh index 61aa80b8..583742ff 100755 --- a/images/start-vm.sh +++ b/images/start-vm.sh @@ -64,14 +64,14 @@ elif [[ "$stack" == 'ovs-linux' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 10G \ + -m 25G \ -snapshot \ -netdev user,id=net0,hostfwd=tcp::222${vm_id}-:22 \ -device virtio-net-pci,netdev=net0 \ -chardev socket,id=char0,path=/usr/local/var/run/openvswitch/$vhost \ -netdev type=vhost-user,chardev=char0,vhostforce=on,queues=12,id=net1 \ -device virtio-net-pci,netdev=net1,mac=$alt_mac,mq=on,vectors=26 \ - -object memory-backend-file,id=mem,size=10G,mem-path=/dev/hugepages,share=on \ + -object memory-backend-file,id=mem,size=25G,mem-path=/dev/hugepages,share=on \ -numa node,memdev=mem -mem-prealloc \ -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ @@ -82,14 +82,14 @@ elif [[ "$stack" == 'ovs-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 10G \ + -m 25G \ -snapshot \ -netdev user,id=net0,hostfwd=tcp::222${vm_id}-:22 \ -device virtio-net-pci,netdev=net0 \ -chardev socket,id=char0,path=/usr/local/var/run/openvswitch/$vhost \ -netdev type=vhost-user,chardev=char0,vhostforce=on,queues=12,id=net1 \ -device virtio-net-pci,netdev=net1,mac=$alt_mac,mq=on,vectors=26 \ - -object memory-backend-file,id=mem,size=10G,mem-path=/dev/hugepages,share=on \ + -object memory-backend-file,id=mem,size=25G,mem-path=/dev/hugepages,share=on \ -numa node,memdev=mem -mem-prealloc \ -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \ -drive if=virtio,format=raw,file="seed.img" \ @@ -100,7 +100,7 @@ elif [[ "$stack" == 'tap-tas' ]]; then -machine accel=kvm,type=q35 \ -cpu host \ -smp 12 \ - -m 6G \ + -m 25G \ -snapshot \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \