From 87d7bac5cf2ebdc7820e1edaadc2cc3b6d111cf2 Mon Sep 17 00:00:00 2001 From: "Christian E. Hopps" Date: Fri, 27 Sep 2019 12:59:30 -0400 Subject: misc: add "maxframe" and "rate" to packet-generator cli. Allow for setting the maximum number of generated packets to be included in the frame passed to next nodes. This is very important for testing code which may be susceptible to multi-frame vs single-frame bugs (e.g., code that is doing re-ordering where packets may be buffered between frames). Update: - remove redundant packet "rate" option. - reduce n_max_frame to u32 as that's what pulled from the CLI. Type: feature Signed-off-by: Christian E. Hopps Change-Id: Ie362bbb110b2cf01d9f65c559bbe9101e17b7fdc Signed-off-by: Christian Hopps --- src/vnet/pg/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vnet/pg/input.c') diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c index 39aea7c3c5a..c47dfe270e7 100644 --- a/src/vnet/pg/input.c +++ b/src/vnet/pg/input.c @@ -1762,8 +1762,8 @@ pg_input_stream (vlib_node_runtime_t * node, pg_main_t * pg, pg_stream_t * s) n_packets = s->n_packets_limit - s->n_packets_generated; /* Generate up to one frame's worth of packets. */ - if (n_packets > VLIB_FRAME_SIZE) - n_packets = VLIB_FRAME_SIZE; + if (n_packets > s->n_max_frame) + n_packets = s->n_max_frame; if (n_packets > 0) n_packets = pg_generate_packets (node, pg, s, n_packets); -- cgit 1.2.3-korg