summaryrefslogtreecommitdiffstats
path: root/src/plugins/nsim/nsim.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-07-28 19:20:40 -0700
committerDave Barach <openvpp@barachs.net>2020-07-31 19:34:20 +0000
commite6c3e8f0ee47799c76bdca362c4d75af62aacac3 (patch)
tree4a5bbbbb17f3aae3fe7be1a92c0ad147115ee8ff /src/plugins/nsim/nsim.h
parentb2f44bd8e7d226d851d4d05981914e642a4da571 (diff)
nsim: basic reorder support
Reorder delayed packets, i.e., flush instead of delay, with a configured rate. Type: feature Change-Id: Ib1294f5f1c9b6e98a12b1bb0be655e54facfed3a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/plugins/nsim/nsim.h')
-rw-r--r--src/plugins/nsim/nsim.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/nsim/nsim.h b/src/plugins/nsim/nsim.h
index 0ed9b251fbc..7222a96dcb4 100644
--- a/src/plugins/nsim/nsim.h
+++ b/src/plugins/nsim/nsim.h
@@ -45,11 +45,44 @@ typedef struct
CLIB_CACHE_LINE_ALIGN_MARK (pad);
} nsim_wheel_t;
+typedef struct nsim_node_ctx
+{
+ vnet_feature_config_main_t *fcm;
+ f64 expires;
+ u32 *drop;
+ u32 *reord;
+ u16 *reord_nexts;
+ u8 *action;
+ u64 n_buffered;
+ u64 n_loss;
+} nsim_node_ctx_t;
+
+#define foreach_nsm_action \
+ _(DROP, "Packet loss") \
+ _(REORDER, "Packet reorder")
+
+enum nsm_action_bit
+{
+#define _(sym, str) NSIM_ACTION_##sym##_BIT,
+ foreach_nsm_action
+#undef _
+};
+
+typedef enum nsm_action
+{
+#define _(sym, str) NSIM_ACTION_##sym = 1 << NSIM_ACTION_##sym##_BIT,
+ foreach_nsm_action
+#undef _
+} nsm_action_e;
+
typedef struct
{
/* API message ID base */
u16 msg_id_base;
+ /* output feature arc index */
+ u16 arc_index;
+
/* Two interfaces, cross-connected with delay */
u32 sw_if_index0, sw_if_index1;
u32 output_next_index0, output_next_index1;
@@ -68,6 +101,7 @@ typedef struct
f64 bandwidth;
f64 packet_size;
f64 drop_fraction;
+ f64 reorder_fraction;
u32 poll_main_thread;
u64 mmap_size;