aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/init.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-01-05 16:51:41 -0500
committerDamjan Marion <dmarion@me.com>2019-01-06 13:03:55 +0000
commit3c8e14684d32c19529c471a747bc9693a2801335 (patch)
tree697ece0e1fb22e8bdfec762b6bb7af841b300657 /src/vnet/pg/init.c
parent30e79c2e388a98160a3660f4f03103890c9b1b7c (diff)
pktgen: support mixed multi/single chunk pcap replay
Change-Id: I3d387b5e2b17f89ed688ea6cfee3fb6d782fe326 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/pg/init.c')
-rw-r--r--src/vnet/pg/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/pg/init.c b/src/vnet/pg/init.c
index 631be25ea3c..5db9c00ffc4 100644
--- a/src/vnet/pg/init.c
+++ b/src/vnet/pg/init.c
@@ -48,6 +48,8 @@ pg_init (vlib_main_t * vm)
{
clib_error_t *error;
pg_main_t *pg = &pg_main;
+ vlib_thread_main_t *vtm = vlib_get_thread_main ();
+ u32 num_threads = 1 /* main thread */ + vtm->n_threads;
pg->if_index_by_if_id = hash_create (0, sizeof (uword));
@@ -57,6 +59,8 @@ pg_init (vlib_main_t * vm)
if ((error = vlib_call_init_function (vm, pg_cli_init)))
goto done;
+ vec_validate (pg->replay_buffers_by_thread, num_threads);
+
done:
return error;
}