From 593eedf2561f639703d366cd21ab0c3ae03bdb0c Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Sun, 10 Mar 2019 09:44:51 -0400 Subject: Perf tune get_frame_size_info It turns out that for scalar sizes 0..24, frames are always the same size. That range includes all current use-cases - and then some - so get rid of the hash table. Old code preserved under #ifdef VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES. Change-Id: Ic005c7143c9639f77d1a0fadd2fc0e90dccb68c1 Signed-off-by: Dave Barach --- src/vlib/threads.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vlib/threads.c') diff --git a/src/vlib/threads.c b/src/vlib/threads.c index e2f7d2634b9..7d17c7b37cc 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -866,9 +866,11 @@ start_workers (vlib_main_t * vm) nm_clone->processes = vec_dup_aligned (nm->processes, CLIB_CACHE_LINE_BYTES); - /* zap the (per worker) frame freelists, etc */ - nm_clone->frame_sizes = 0; + /* Create per-thread frame freelist */ + nm_clone->frame_sizes = vec_new (vlib_frame_size_t, 1); +#ifdef VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES nm_clone->frame_size_hash = hash_create (0, sizeof (uword)); +#endif /* Packet trace buffers are guaranteed to be empty, nothing to do here */ -- cgit 1.2.3-korg