nat: use correct data types for memory sizes
Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Id2d181385f109163d4c806eecda166c2087c4b92
This commit is contained in:
Klement Sekera
committed by
Neale Ranns
parent
7d69718543
commit
61717cc38f
@ -110,14 +110,14 @@ define nat_show_config_reply
|
||||
u32 translation_buckets;
|
||||
u32 translation_memory_size;
|
||||
u32 user_buckets;
|
||||
u32 user_memory_size;
|
||||
u64 user_memory_size;
|
||||
u32 max_translations_per_user;
|
||||
u32 outside_vrf_id;
|
||||
u32 inside_vrf_id;
|
||||
u32 nat64_bib_buckets;
|
||||
u32 nat64_bib_memory_size;
|
||||
u64 nat64_bib_memory_size;
|
||||
u32 nat64_st_buckets;
|
||||
u32 nat64_st_memory_size;
|
||||
u64 nat64_st_memory_size;
|
||||
};
|
||||
|
||||
enum nat_log_level : u8
|
||||
|
@ -3917,18 +3917,18 @@ snat_config (vlib_main_t * vm, unformat_input_t * input)
|
||||
snat_main_per_thread_data_t *tsm;
|
||||
|
||||
u32 static_mapping_buckets = 1024;
|
||||
u32 static_mapping_memory_size = 64 << 20;
|
||||
uword static_mapping_memory_size = 64 << 20;
|
||||
|
||||
u32 nat64_bib_buckets = 1024;
|
||||
u32 nat64_bib_memory_size = 128 << 20;
|
||||
|
||||
u32 nat64_st_buckets = 2048;
|
||||
u32 nat64_st_memory_size = 256 << 20;
|
||||
uword nat64_st_memory_size = 256 << 20;
|
||||
|
||||
u32 user_buckets = 128;
|
||||
u32 user_memory_size = 64 << 20;
|
||||
uword user_memory_size = 64 << 20;
|
||||
u32 translation_buckets = 1024;
|
||||
u32 translation_memory_size = 128 << 20;
|
||||
uword translation_memory_size = 128 << 20;
|
||||
|
||||
u32 max_translations_per_user = ~0;
|
||||
|
||||
|
@ -711,10 +711,10 @@ typedef struct snat_main_s
|
||||
u8 out2in_dpo;
|
||||
u8 endpoint_dependent;
|
||||
u32 translation_buckets;
|
||||
u32 translation_memory_size;
|
||||
uword translation_memory_size;
|
||||
u32 max_translations;
|
||||
u32 user_buckets;
|
||||
u32 user_memory_size;
|
||||
uword user_memory_size;
|
||||
u32 max_translations_per_user;
|
||||
u32 outside_vrf_id;
|
||||
u32 outside_fib_index;
|
||||
|
@ -256,8 +256,8 @@ static void nat64_free_out_addr_and_port (struct nat64_db_s *db,
|
||||
u8 protocol);
|
||||
|
||||
void
|
||||
nat64_set_hash (u32 bib_buckets, u32 bib_memory_size, u32 st_buckets,
|
||||
u32 st_memory_size)
|
||||
nat64_set_hash (u32 bib_buckets, uword bib_memory_size, u32 st_buckets,
|
||||
uword st_memory_size)
|
||||
{
|
||||
nat64_main_t *nm = &nat64_main;
|
||||
nat64_db_t *db;
|
||||
|
@ -91,9 +91,9 @@ typedef struct
|
||||
|
||||
/** config parameters */
|
||||
u32 bib_buckets;
|
||||
u32 bib_memory_size;
|
||||
uword bib_memory_size;
|
||||
u32 st_buckets;
|
||||
u32 st_memory_size;
|
||||
uword st_memory_size;
|
||||
|
||||
/** values of various timeouts */
|
||||
u32 udp_timeout;
|
||||
@ -359,8 +359,8 @@ void nat64_extract_ip4 (ip6_address_t * ip6, ip4_address_t * ip4,
|
||||
* @param st_buckets Number of session table hash buckets.
|
||||
* @param st_memory_size Memory size of session table hash.
|
||||
*/
|
||||
void nat64_set_hash (u32 bib_buckets, u32 bib_memory_size, u32 st_buckets,
|
||||
u32 st_memory_size);
|
||||
void nat64_set_hash (u32 bib_buckets, uword bib_memory_size, u32 st_buckets,
|
||||
uword st_memory_size);
|
||||
|
||||
/**
|
||||
* @brief Get worker thread index for NAT64 in2out.
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include <vnet/fib/fib_table.h>
|
||||
|
||||
int
|
||||
nat64_db_init (nat64_db_t * db, u32 bib_buckets, u32 bib_memory_size,
|
||||
u32 st_buckets, u32 st_memory_size,
|
||||
nat64_db_init (nat64_db_t * db, u32 bib_buckets, uword bib_memory_size,
|
||||
u32 st_buckets, uword st_memory_size,
|
||||
nat64_db_free_addr_port_function_t free_addr_port_cb)
|
||||
{
|
||||
clib_bihash_init_24_8 (&db->bib.in2out, "bib-in2out", bib_buckets,
|
||||
|
@ -153,8 +153,8 @@ typedef struct nat64_db_s
|
||||
*
|
||||
* @returns 0 on success, non-zero value otherwise.
|
||||
*/
|
||||
int nat64_db_init (nat64_db_t * db, u32 bib_buckets, u32 bib_memory_size,
|
||||
u32 st_buckets, u32 st_memory_size,
|
||||
int nat64_db_init (nat64_db_t * db, u32 bib_buckets, uword bib_memory_size,
|
||||
u32 st_buckets, uword st_memory_size,
|
||||
nat64_db_free_addr_port_function_t free_addr_port_cb);
|
||||
|
||||
/**
|
||||
|
@ -104,9 +104,9 @@ vl_api_nat_show_config_t_handler (vl_api_nat_show_config_t * mp)
|
||||
REPLY_MACRO2 (VL_API_NAT_SHOW_CONFIG_REPLY,
|
||||
({
|
||||
rmp->translation_buckets = htonl (sm->translation_buckets);
|
||||
rmp->translation_memory_size = htonl (sm->translation_memory_size);
|
||||
rmp->translation_memory_size = clib_host_to_net_u64 (sm->translation_memory_size);
|
||||
rmp->user_buckets = htonl (sm->user_buckets);
|
||||
rmp->user_memory_size = htonl (sm->user_memory_size);
|
||||
rmp->user_memory_size = clib_host_to_net_u64 (sm->user_memory_size);
|
||||
rmp->max_translations_per_user = htonl (sm->max_translations_per_user);
|
||||
rmp->outside_vrf_id = htonl (sm->outside_vrf_id);
|
||||
rmp->inside_vrf_id = htonl (sm->inside_vrf_id);
|
||||
@ -117,10 +117,10 @@ vl_api_nat_show_config_t_handler (vl_api_nat_show_config_t * mp)
|
||||
rmp->endpoint_dependent = sm->endpoint_dependent;
|
||||
rmp->out2in_dpo = sm->out2in_dpo;
|
||||
//rmp->dslite_ce = dm->is_ce;
|
||||
rmp->nat64_bib_buckets = n64m->bib_buckets;
|
||||
rmp->nat64_bib_memory_size = n64m->bib_memory_size;
|
||||
rmp->nat64_st_buckets = n64m->st_buckets;
|
||||
rmp->nat64_st_memory_size = n64m->st_memory_size;
|
||||
rmp->nat64_bib_buckets = clib_net_to_host_u32(n64m->bib_buckets);
|
||||
rmp->nat64_bib_memory_size = clib_net_to_host_u64(n64m->bib_memory_size);
|
||||
rmp->nat64_st_buckets = clib_net_to_host_u32(n64m->st_buckets);
|
||||
rmp->nat64_st_memory_size = clib_net_to_host_u64(n64m->st_memory_size);
|
||||
}));
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
Reference in New Issue
Block a user