pktgen: support mixed multi/single chunk pcap replay
Change-Id: I3d387b5e2b17f89ed688ea6cfee3fb6d782fe326
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/src/vnet/pg/init.c b/src/vnet/pg/init.c
index 631be25..5db9c00 100644
--- a/src/vnet/pg/init.c
+++ b/src/vnet/pg/init.c
@@ -48,6 +48,8 @@
{
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 @@
if ((error = vlib_call_init_function (vm, pg_cli_init)))
goto done;
+ vec_validate (pg->replay_buffers_by_thread, num_threads);
+
done:
return error;
}