summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-09-03 13:06:11 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-29 13:08:00 +0000
commitbc5f2bcc2c186983aabc020d0cb1158dee36a549 (patch)
treed79be5de9d7a51ec59e65a1d0f717b4f5ca84b5f
parentd89329a90f1db45846369ba554fbc1f86e55d09f (diff)
session: avoid bihash list for session tables
Type: fix Change-Id: I1dbc822061f43fcc25dfa5d1728f5c7575139f45 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 27eeb87f43d9d9dfab3d807f33fc5a4a68cb55d9)
-rw-r--r--src/vnet/session/session_table.c50
1 files changed, 38 insertions, 12 deletions
diff --git a/src/vnet/session/session_table.c b/src/vnet/session/session_table.c
index 3722e0f63be..1f586f8cba2 100644
--- a/src/vnet/session/session_table.c
+++ b/src/vnet/session/session_table.c
@@ -86,21 +86,47 @@ session_table_init (session_table_t * slt, u8 fib_proto)
if (fib_proto == FIB_PROTOCOL_IP4 || all)
{
- clib_bihash_init_16_8 (&slt->v4_session_hash, "v4 session table",
- configured_v4_session_table_buckets,
- configured_v4_session_table_memory);
- clib_bihash_init_16_8 (&slt->v4_half_open_hash, "v4 half-open table",
- configured_v4_halfopen_table_buckets,
- configured_v4_halfopen_table_memory);
+ clib_bihash_init2_args_16_8_t _a, *a = &_a;
+
+ memset (a, 0, sizeof (*a));
+ a->h = &slt->v4_session_hash;
+ a->name = "v4 session table";
+ a->nbuckets = configured_v4_session_table_buckets;
+ a->memory_size = configured_v4_session_table_memory;
+ a->dont_add_to_all_bihash_list = 1;
+ a->instantiate_immediately = 1;
+ clib_bihash_init2_16_8 (a);
+
+ memset (a, 0, sizeof (*a));
+ a->h = &slt->v4_half_open_hash;
+ a->name = "v4 half-open table";
+ a->nbuckets = configured_v4_halfopen_table_buckets;
+ a->memory_size = configured_v4_halfopen_table_memory;
+ a->dont_add_to_all_bihash_list = 1;
+ a->instantiate_immediately = 1;
+ clib_bihash_init2_16_8 (a);
}
if (fib_proto == FIB_PROTOCOL_IP6 || all)
{
- clib_bihash_init_48_8 (&slt->v6_session_hash, "v6 session table",
- configured_v6_session_table_buckets,
- configured_v6_session_table_memory);
- clib_bihash_init_48_8 (&slt->v6_half_open_hash, "v6 half-open table",
- configured_v6_halfopen_table_buckets,
- configured_v6_halfopen_table_memory);
+ clib_bihash_init2_args_48_8_t _a, *a = &_a;
+
+ memset (a, 0, sizeof (*a));
+ a->h = &slt->v6_session_hash;
+ a->name = "v6 session table";
+ a->nbuckets = configured_v6_session_table_buckets;
+ a->memory_size = configured_v6_session_table_memory;
+ a->dont_add_to_all_bihash_list = 1;
+ a->instantiate_immediately = 1;
+ clib_bihash_init2_48_8 (a);
+
+ memset (a, 0, sizeof (*a));
+ a->h = &slt->v6_half_open_hash;
+ a->name = "v6 half-open table";
+ a->nbuckets = configured_v6_halfopen_table_buckets;
+ a->memory_size = configured_v6_halfopen_table_memory;
+ a->dont_add_to_all_bihash_list = 1;
+ a->instantiate_immediately = 1;
+ clib_bihash_init2_48_8 (a);
}
for (i = 0; i < TRANSPORT_N_PROTO; i++)