FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
cnat_bulk_port.c File Reference
+ Include dependency graph for cnat_bulk_port.c:

Go to the source code of this file.

Macros

#define PORT_TO_CACHE(y, z)   ((y)/(z))
 
#define CACHE_TO_PORT(x, z)   (((x)& 0x7FFF) * (z))
 
#define IS_CACHE_ENTRY_FULL(x)   ((x) & 0x8000)
 
#define MARK_CACHE_ENTRY_AS_FULL(x)   ((x) = ((x) | 0x8000))
 
#define UNMARK_CACHE_ENTRY_AS_FULL(x)   ((x) = ((x) & 0x7FFF))
 
#define CACHE_ENTRY_WITHOUT_FULL_STAT(x)   ((x) & 0x7FFF)
 
#define NUM_BULK_CHECK
 
#define HAVE_BULK_PORT_STATS   1
 

Functions

void show_bulk_port_allocation (u16 in_vrfid, u32 inside_ip)
 
void show_bulk_port_stats ()
 
void clear_bulk_port_stats ()
 
void cnat_update_bulk_range_cache (cnat_user_db_entry_t *udb, u16 o_port, bulk_alloc_size_t bulk_size)
 
void cnat_port_free_v2_bulk (cnat_portmap_v2_t *pm, int index, port_pair_t ptype, u16 base_port, cnat_user_db_entry_t *udb, u16 static_port_range, bulk_alloc_size_t bulk_size, int *nfv9_log_req)
 
static i16 get_suiting_port_pos_from_range (cnat_portmap_v2_t *my_pm, u16 bulk_start, i16 bulk_size, port_pair_t pair_type)
 
static cnat_errno_t try_bulk_port_from_non_cache (cnat_user_db_entry_t *udb, cnat_portmap_v2_t *my_pm, port_pair_t pair_type, bulk_alloc_size_t bulk_size, u16 *port_available, u16 static_port_range)
 
cnat_errno_t cnat_dynamic_port_alloc_v2_bulk (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1, u32 *rseed_ip)
 
cnat_errno_t cnat_static_port_alloc_v2_bulk (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 i_ipv4_address, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1)
 
cnat_errno_t cnat_mapped_static_port_alloc_v2_bulk (cnat_portmap_v2_t *pm, port_alloc_t atype, u32 *index, u32 ipv4_address, u16 port, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1)
 
cnat_errno_t cnat_dynamic_port_alloc_rtsp_bulk (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u32 *rseed_ip)
 

Variables

static uword bulk_cache_hit_count
 
static uword bulk_port_use_count
 
static uword bulk_port_alloc_count
 
static uword mapped_port_alloc_count
 
static u32 bulk_port_rand_across
 

Macro Definition Documentation

#define CACHE_ENTRY_WITHOUT_FULL_STAT (   x)    ((x) & 0x7FFF)

Definition at line 48 of file cnat_bulk_port.c.

#define CACHE_TO_PORT (   x,
 
)    (((x)& 0x7FFF) * (z))

Definition at line 44 of file cnat_bulk_port.c.

#define HAVE_BULK_PORT_STATS   1

Definition at line 57 of file cnat_bulk_port.c.

#define IS_CACHE_ENTRY_FULL (   x)    ((x) & 0x8000)

Definition at line 45 of file cnat_bulk_port.c.

#define MARK_CACHE_ENTRY_AS_FULL (   x)    ((x) = ((x) | 0x8000))

Definition at line 46 of file cnat_bulk_port.c.

#define NUM_BULK_CHECK
Value:
128 /* max number of previous chache to check.
* somewhat orbirtrary.. assume 64 as bulk size.. can handle up
* to 128*64 ports allocated by a single subscriber */

Definition at line 51 of file cnat_bulk_port.c.

#define PORT_TO_CACHE (   y,
 
)    ((y)/(z))

Definition at line 42 of file cnat_bulk_port.c.

#define UNMARK_CACHE_ENTRY_AS_FULL (   x)    ((x) = ((x) & 0x7FFF))

Definition at line 47 of file cnat_bulk_port.c.

Function Documentation

void clear_bulk_port_stats ( )

Definition at line 191 of file cnat_bulk_port.c.

+ Here is the caller graph for this function:

cnat_errno_t cnat_dynamic_port_alloc_rtsp_bulk ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u16  i_port,
u32 index,
u32 o_ipv4_address,
u16 o_port,
u16  static_port_range,
cnat_user_db_entry_t udb,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u32 rseed_ip 
)

Definition at line 775 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_errno_t cnat_dynamic_port_alloc_v2_bulk ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u32 index,
u32 o_ipv4_address,
u16 o_port,
u16  static_port_range,
cnat_user_db_entry_t udb,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u16  ip_n_to_1,
u32 rseed_ip 
)

Definition at line 477 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_errno_t cnat_mapped_static_port_alloc_v2_bulk ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
u32 index,
u32  ipv4_address,
u16  port,
cnat_user_db_entry_t udb,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u16  ip_n_to_1 
)

Definition at line 729 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cnat_port_free_v2_bulk ( cnat_portmap_v2_t pm,
int  index,
port_pair_t  ptype,
u16  base_port,
cnat_user_db_entry_t udb,
u16  static_port_range,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req 
)

Definition at line 248 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_errno_t cnat_static_port_alloc_v2_bulk ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u32  i_ipv4_address,
u16  i_port,
u32 index,
u32 o_ipv4_address,
u16 o_port,
u16  static_port_range,
cnat_user_db_entry_t udb,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u16  ip_n_to_1 
)

Definition at line 598 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cnat_update_bulk_range_cache ( cnat_user_db_entry_t udb,
u16  o_port,
bulk_alloc_size_t  bulk_size 
)

Definition at line 202 of file cnat_bulk_port.c.

+ Here is the caller graph for this function:

static i16 get_suiting_port_pos_from_range ( cnat_portmap_v2_t my_pm,
u16  bulk_start,
i16  bulk_size,
port_pair_t  pair_type 
)
static

Definition at line 315 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void show_bulk_port_allocation ( u16  in_vrfid,
u32  inside_ip 
)

Definition at line 68 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

void show_bulk_port_stats ( )

Definition at line 164 of file cnat_bulk_port.c.

+ Here is the caller graph for this function:

static cnat_errno_t try_bulk_port_from_non_cache ( cnat_user_db_entry_t udb,
cnat_portmap_v2_t my_pm,
port_pair_t  pair_type,
bulk_alloc_size_t  bulk_size,
u16 port_available,
u16  static_port_range 
)
static

Definition at line 376 of file cnat_bulk_port.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uword bulk_cache_hit_count
static

Definition at line 60 of file cnat_bulk_port.c.

uword bulk_port_alloc_count
static

Definition at line 62 of file cnat_bulk_port.c.

u32 bulk_port_rand_across
static

Definition at line 66 of file cnat_bulk_port.c.

uword bulk_port_use_count
static

Definition at line 61 of file cnat_bulk_port.c.

uword mapped_port_alloc_count
static

Definition at line 63 of file cnat_bulk_port.c.