aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-12-23 15:15:48 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-23 21:52:47 +0000
commit0f3b680f406fddd1b5ef6776aeb0c6fb363b1702 (patch)
tree07374d6ddc3a1a4610449f506aff16ce0d6262b6 /vnet
parent3eec9b458338e923dfd8826fa3a1f686bf7c9be0 (diff)
Make test support for the ipfix flow-per-pkt plugin
Change-Id: I7a0d37fc2bc21dbbff1cea1b92dc24d43f971eec Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/flow/flow_report.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/vnet/vnet/flow/flow_report.c b/vnet/vnet/flow/flow_report.c
index 46333288436..c78a78a9680 100644
--- a/vnet/vnet/flow/flow_report.c
+++ b/vnet/vnet/flow/flow_report.c
@@ -189,7 +189,9 @@ flow_report_process (vlib_main_t * vm,
while (1)
{
- vlib_process_suspend (vm, 5.0);
+ vlib_process_wait_for_event_or_clock (vm, 5.0);
+ event_type = vlib_process_get_events (vm, &event_data);
+ vec_reset_length (event_data);
vec_foreach (fr, frm->reports)
{
@@ -465,6 +467,24 @@ VLIB_CLI_COMMAND (set_ipfix_exporter_command, static) = {
.function = set_ipfix_exporter_command_fn,
};
+
+static clib_error_t *
+ipfix_flush_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ /* poke the flow reporting process */
+ vlib_process_signal_event (vm, flow_report_process_node.index,
+ 1, 0);
+ return 0;
+}
+
+VLIB_CLI_COMMAND (ipfix_flush_command, static) = {
+ .path = "ipfix flush",
+ .short_help = "flush the current ipfix data [for make test]",
+ .function = ipfix_flush_command_fn,
+};
+
static clib_error_t *
flow_report_init (vlib_main_t *vm)
{