hash: add local variable 01/37501/2
authorGabriel Oginski <gabrielx.oginski@intel.com>
Fri, 21 Oct 2022 07:05:56 +0000 (07:05 +0000)
committerFan Zhang <royzhang1980@hotmail.com>
Tue, 25 Oct 2022 08:30:02 +0000 (08:30 +0000)
commit813c1bd257ddcc573422083bd66cc8b8ed79d5b2
tree9fe49f620cb410b8a9d293bbee8fe28d940a35a2
parentc9d916c7cc312d2396985f5cb83bcfdb98c98a1f
hash: add local variable

The current implmentation of the hash table is not thread-safe.
This design leads to a segfault when VPP handling a lot of tunnels for
Wireguard, where one thread modify the hash table and other threads
starting to lookup at the same time.

The fix add a local variable to store how many bits are used by a user
object.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Iecf6b3ef9f308b61015c66277cc459a6d019c9c1
src/vppinfra/hash.h