From 32dcd3b2f227dec638c39ade0c58d6741d83ec30 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 8 Jul 2019 12:25:38 -0400 Subject: vppinfra: allocate bihash virtual space on demand Reduces the vpp image virtual size by multiple gigabytes Add a "show bihash" command which displays configured and current virtual space in use by bihash tables. Modify the .py test framework to call "show bihash" on test tear-down Type: refactor Change-Id: Ifc1b7e2c43d29bbef645f6802fa29ff8ef09940c Signed-off-by: Dave Barach --- src/vnet/l2/l2_fib.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vnet/l2/l2_fib.c') diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c index fc518fe9dbf..b7646cac4cd 100644 --- a/src/vnet/l2/l2_fib.c +++ b/src/vnet/l2/l2_fib.c @@ -1000,6 +1000,10 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only) vl_api_l2_macs_event_t *mp = 0; vl_api_registration_t *reg = 0; + /* Don't scan the l2 fib if it hasn't been instantiated yet */ + if (alloc_arena (h) == 0) + return 0.0; + if (client) { mp = allocate_mac_evt_buf (client, cl_idx); -- cgit 1.2.3-korg