aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nsim/nsim.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-04-03 11:20:06 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-04-11 01:19:56 +0000
commit7c91007e1e13b56a29236bd076891709eaa21754 (patch)
treee6d78635a3b53f6db4b0bfa563d98254c464da6f /src/plugins/nsim/nsim.h
parent10dc2eabd6e8a266405aef270a819794a3ddd333 (diff)
Make the loss / delay sim available as an output feature
Add binary api and debug cli support. Rewrite for speed: enqueue vlib_buffer_t's to the wheel, instead of memcpy'ing data. Quad-loop the output feature / x-connect (interior) node. Prefetch wheel entries in the input node. Save packet-generator-based unit-test setup in extras/nsim. Simple config example: set nsim delay 20 ms bandwidth 1 gbit packet-size 1024 nsim output-feature enable-disable GigabitEthernet3/0/0 Change-Id: I852a32d4eb596e7e2aa1d9b30bf3b53525e39fd1 Signed-off-by: Dave Barach <dave@barachs.net>c
Diffstat (limited to 'src/plugins/nsim/nsim.h')
-rw-r--r--src/plugins/nsim/nsim.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/nsim/nsim.h b/src/plugins/nsim/nsim.h
index c5264ecb244..6afe32dc7f7 100644
--- a/src/plugins/nsim/nsim.h
+++ b/src/plugins/nsim/nsim.h
@@ -25,15 +25,14 @@
#include <vppinfra/hash.h>
#include <vppinfra/error.h>
-#define WHEEL_ENTRY_DATA_SIZE 1536 /* an even multiple of 64, pls */
-
typedef struct
{
f64 tx_time;
+ u32 rx_sw_if_index;
u32 tx_sw_if_index;
- u32 current_length;
- CLIB_CACHE_LINE_ALIGN_MARK (pad);
- u8 data[WHEEL_ENTRY_DATA_SIZE];
+ u32 output_next_index;
+ u32 buffer_index;
+ u32 pad; /* pad to 32-bytes */
} nsim_wheel_entry_t;
typedef struct
@@ -54,12 +53,15 @@ typedef struct
/* Two interfaces, cross-connected with delay */
u32 sw_if_index0, sw_if_index1;
u32 output_next_index0, output_next_index1;
+
+ /* N interfaces, using the output feature */
+ u32 *output_next_index_by_sw_if_index;
+
/* Random seed for loss-rate simulation */
u32 seed;
- /* Per-thread buffer / scheduler wheels */
+ /* Per-thread scheduler wheels */
nsim_wheel_t **wheel_by_thread;
- u32 **buffer_indices_by_thread;
/* Config parameters */
f64 delay;