l2: allocate l2fib only when needed 23/28823/3
authorDamjan Marion <damarion@cisco.com>
Mon, 14 Sep 2020 10:18:44 +0000 (12:18 +0200)
committerDamjan Marion <damarion@cisco.com>
Mon, 14 Sep 2020 20:15:49 +0000 (22:15 +0200)
commit9514781064ef80e0bf46b0a2df7a7088034033d9
treee5a07471730ccc54285015094593481a7d2e4284
parentf99a7d64476fc25636a1df200b256df445d9e446
l2: allocate l2fib only when needed

Currently l2 fib allocates 512MB hash table unconditionally on startup.
This patch postpones table creation up to the point where first
interface is put into l2 mode or mac entry is added.

In addition it reduces default table size to 128MB and increases number
of buckets 4 times. This default setting should be enough to keep 1M mac
entries.

Also, new startup.conf section is added which allows user to change memory
and bucket size. .i.e:

l2fib {
  table-size 512M
  num-buckets 524288
}

Type: improvement
Change-Id: I2a29209aa3545181f0087544c97a54d8157b6ec5
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vnet/l2/l2_bd.c
src/vnet/l2/l2_fib.c
src/vnet/l2/l2_fib.h
src/vnet/l2/l2_input.c
src/vpp/conf/startup.conf