summaryrefslogtreecommitdiffstats
path: root/src/vlib/node.c
diff options
context:
space:
mode:
authorDave Barach <dbarach@cisco.com>2019-03-10 09:44:51 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-03-10 23:16:43 +0000
commit593eedf2561f639703d366cd21ab0c3ae03bdb0c (patch)
tree75c7ed53b941d46127d1c6b88a16f5936570d2ce /src/vlib/node.c
parentc7886c5d50782b9653ab41772fb93cff0c0ad9da (diff)
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 <dbarach@cisco.com>
Diffstat (limited to 'src/vlib/node.c')
-rw-r--r--src/vlib/node.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vlib/node.c b/src/vlib/node.c
index 69f505143b2..af323c4d63c 100644
--- a/src/vlib/node.c
+++ b/src/vlib/node.c
@@ -635,7 +635,10 @@ vlib_node_main_init (vlib_main_t * vm)
vlib_node_t *n;
uword ni;
+ nm->frame_sizes = vec_new (vlib_frame_size_t, 1);
+#ifdef VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES
nm->frame_size_hash = hash_create (0, sizeof (uword));
+#endif
nm->flags |= VLIB_NODE_MAIN_RUNTIME_STARTED;
/* Generate sibling relationships */