FD.io VPP  v18.11-rc0-18-g2a3fb1a
Vector Packet Processing
ip_source_and_port_range_check.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  source_range_check_main_t
 
struct  ip_source_and_port_range_check_config_t
 
struct  u16x8vec_t
 
struct  protocol_port_range_t
 
struct  protocol_port_range_dpo_t_
 The object that is in the data-path to perform the check. More...
 

Macros

#define IP_SOURCE_AND_PORT_RANGE_CHECK_RANGE_LIMIT   VLIB_BUFFER_PRE_DATA_SIZE/(2*sizeof(u16x8));
 
#define N_PORT_RANGES_PER_DPO   64
 The number of supported ranges per-data path object. More...
 
#define N_RANGES_PER_BLOCK   (sizeof(u16x8vec_t)/2)
 
#define N_BLOCKS_PER_DPO   (N_PORT_RANGES_PER_DPO/N_RANGES_PER_BLOCK)
 

Typedefs

typedef struct protocol_port_range_dpo_t_ protocol_port_range_dpo_t
 The object that is in the data-path to perform the check. More...
 

Enumerations

enum  ip_source_and_port_range_check_protocol_t {
  IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_OUT, IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_OUT, IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_IN, IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_IN,
  IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS
}
 

Functions

int ip4_source_and_port_range_check_add_del (ip4_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *hi_ports, int is_add)
 
int ip6_source_and_port_range_check_add_del (ip6_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *hi_ports, int is_add)
 
int set_ip_source_and_port_range_check (vlib_main_t *vm, u32 *fib_index, u32 sw_if_index, u32 is_add)
 

Variables

source_range_check_main_t source_range_check_main
 

Macro Definition Documentation

#define IP_SOURCE_AND_PORT_RANGE_CHECK_RANGE_LIMIT   VLIB_BUFFER_PRE_DATA_SIZE/(2*sizeof(u16x8));

Definition at line 43 of file ip_source_and_port_range_check.h.

#define N_BLOCKS_PER_DPO   (N_PORT_RANGES_PER_DPO/N_RANGES_PER_BLOCK)

Definition at line 66 of file ip_source_and_port_range_check.h.

#define N_PORT_RANGES_PER_DPO   64

The number of supported ranges per-data path object.

If more ranges are required, bump this number.

Definition at line 64 of file ip_source_and_port_range_check.h.

#define N_RANGES_PER_BLOCK   (sizeof(u16x8vec_t)/2)

Definition at line 65 of file ip_source_and_port_range_check.h.

Typedef Documentation

The object that is in the data-path to perform the check.

Some trade-offs here; memory vs performance.

performance: the principle factor is d-cache line misses/hits. so we want the data layout to minimise the d-cache misses. This means not following dependent reads. i.e. not doing

struct B { u16 n_ranges; range_t *ragnes; // vector of ranges. }

so to read ranges[0] we would first d-cache miss on the address of the object of type B, for which we would need to wait before we can get the address of B->ranges. So this layout is better:

struct B { u16 n_ranges; range_t ragnes[N]; }

memory: the latter layout above is more memory hungry. And N needs to be: 1 - sized for the maximum required 2 - fixed, so that objects of type B can be pool allocated and so 'get'-able using an index. An option over fixed might be to allocate contiguous chunk from the pool (like we used to do for multi-path adjs).

Enumeration Type Documentation

Enumerator
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_OUT 
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_OUT 
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_IN 
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_IN 
IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS 

Definition at line 29 of file ip_source_and_port_range_check.h.

Function Documentation

int ip4_source_and_port_range_check_add_del ( ip4_address_t address,
u32  length,
u32  vrf_id,
u16 low_ports,
u16 hi_ports,
int  is_add 
)

Definition at line 1142 of file ip4_source_and_port_range_check.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ip6_source_and_port_range_check_add_del ( ip6_address_t address,
u32  length,
u32  vrf_id,
u16 low_ports,
u16 hi_ports,
int  is_add 
)

Definition at line 1124 of file ip4_source_and_port_range_check.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int set_ip_source_and_port_range_check ( vlib_main_t vm,
u32 fib_index,
u32  sw_if_index,
u32  is_add 
)

Definition at line 623 of file ip4_source_and_port_range_check.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

source_range_check_main_t source_range_check_main

Definition at line 21 of file ip4_source_and_port_range_check.c.