always_inline void
make_v4_ss_kv_from_tc (session_kv4_t * kv, transport_connection_t * t)
{
- return make_v4_ss_kv (kv, &t->lcl_ip.ip4, &t->rmt_ip.ip4, t->lcl_port,
- t->rmt_port, t->transport_proto);
+ make_v4_ss_kv (kv, &t->lcl_ip.ip4, &t->rmt_ip.ip4, t->lcl_port, t->rmt_port,
+ session_type_from_proto_and_ip (t->transport_proto, 1));
}
always_inline void
always_inline void
make_v6_ss_kv_from_tc (session_kv6_t * kv, transport_connection_t * t)
{
- make_v6_ss_kv (kv, &t->lcl_ip.ip6, &t->rmt_ip.ip6, t->lcl_port,
- t->rmt_port, t->transport_proto);
+ make_v6_ss_kv (kv, &t->lcl_ip.ip6, &t->rmt_ip.ip6, t->lcl_port, t->rmt_port,
+ session_type_from_proto_and_ip (t->transport_proto, 0));
}
/*
return 0;
}
+#define foreach_hash_table_parameter \
+ _(v4,session,buckets,20000) \
+ _(v4,session,memory,(64<<20)) \
+ _(v6,session,buckets,20000) \
+ _(v6,session,memory,(64<<20)) \
+ _(v4,halfopen,buckets,20000) \
+ _(v4,halfopen,memory,(64<<20)) \
+ _(v6,halfopen,buckets,20000) \
+ _(v6,halfopen,memory,(64<<20))
+
void
session_lookup_init (void)
{
session_lookup_t *sl = &session_lookup;
+
+#define _(af,table,parm,value) \
+ u32 configured_##af##_##table##_table_##parm = value;
+ foreach_hash_table_parameter;
+#undef _
+
+#define _(af,table,parm,value) \
+ if (session_manager_main.configured_##af##_##table##_table_##parm) \
+ configured_##af##_##table##_table_##parm = \
+ session_manager_main.configured_##af##_##table##_table_##parm;
+ foreach_hash_table_parameter;
+#undef _
+
clib_bihash_init_16_8 (&sl->v4_session_hash, "v4 session table",
- 200000 /* $$$$ config parameter nbuckets */ ,
- (64 << 20) /*$$$ config parameter table size */ );
+ configured_v4_session_table_buckets,
+ configured_v4_session_table_memory);
clib_bihash_init_48_8 (&sl->v6_session_hash, "v6 session table",
- 200000 /* $$$$ config parameter nbuckets */ ,
- (64 << 20) /*$$$ config parameter table size */ );
-
+ configured_v6_session_table_buckets,
+ configured_v6_session_table_memory);
clib_bihash_init_16_8 (&sl->v4_half_open_hash, "v4 half-open table",
- 200000 /* $$$$ config parameter nbuckets */ ,
- (64 << 20) /*$$$ config parameter table size */ );
+ configured_v4_halfopen_table_buckets,
+ configured_v4_halfopen_table_memory);
clib_bihash_init_48_8 (&sl->v6_half_open_hash, "v6 half-open table",
- 200000 /* $$$$ config parameter nbuckets */ ,
- (64 << 20) /*$$$ config parameter table size */ );
+ configured_v6_halfopen_table_buckets,
+ configured_v6_halfopen_table_memory);
}
/*