FD.io VPP
v18.04-17-g3a0d853
Vector Packet Processing
|
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... | |
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 |
#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 struct protocol_port_range_dpo_t_ protocol_port_range_dpo_t |
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).
Definition at line 29 of file ip_source_and_port_range_check.h.
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 1143 of file ip4_source_and_port_range_check.c.
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 1125 of file ip4_source_and_port_range_check.c.
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 624 of file ip4_source_and_port_range_check.c.
source_range_check_main_t source_range_check_main |
Definition at line 21 of file ip4_source_and_port_range_check.c.