20 #ifndef CLIB_MARCH_VARIANT 35 pool_get(interface_rx_dpo_pool, ido);
51 return (ido - interface_rx_dpo_pool);
75 pool_put(interface_rx_dpo_pool, ido);
154 #ifndef CLIB_MARCH_VARIANT 163 return (
format(s,
"%U-rx-dpo: %U",
196 "interface-rx-dpo-ip4",
201 "interface-rx-dpo-ip6",
206 "interface-rx-dpo-l2",
222 &interface_rx_dpo_vft,
247 u32 n_left_from, next_index, * from, * to_next;
257 while (n_left_from > 0)
263 while (n_left_from >= 4 && n_left_to_next > 2)
266 u32 bi0, idoi0, bi1, idoi1;
324 while (n_left_from > 0 && n_left_to_next > 0)
378 s =
format (s,
"%U sw_if_index:%d",
406 .name =
"interface-rx-dpo-ip4",
407 .vector_size =
sizeof (
u32),
419 .name =
"interface-rx-dpo-ip6",
420 .vector_size =
sizeof (
u32),
432 .name =
"interface-rx-dpo-l2",
433 .vector_size =
sizeof (
u32),
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
dpo_lock_fn_t dv_lock
A reference counting lock function.
static void interface_rx_dpo_mem_show(void)
A virtual function table regisitered for a DPO type.
Interface DPO trace data.
vl_api_wireguard_peer_flags_t flags
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
static interface_rx_dpo_t * interface_rx_dpo_get(index_t index)
static clib_error_t * interface_rx_dpo_interface_state_change(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(interface_rx_dpo_interface_state_change)
#define VLIB_NODE_FN(node)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define pool_len(p)
Number of elements in pool vector.
static void interface_rx_dpo_unlock(dpo_id_t *dpo)
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
vlib_node_registration_t interface_rx_dpo_ip4_node
(constructor) VLIB_REGISTER_NODE (interface_rx_dpo_ip4_node)
static u8 * format_interface_rx_dpo(u8 *s, va_list *ap)
vlib_combined_counter_main_t * combined_sw_if_counters
static index_t interface_rx_dpo_get_index(interface_rx_dpo_t *ido)
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(interface_rx_dpo_interface_delete)
void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
Show the memory usage for a type.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
struct interface_rx_dpo_trace_t_ interface_rx_dpo_trace_t
Interface DPO trace data.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
format_function_t format_vnet_sw_interface_name
static clib_error_t * interface_rx_dpo_hw_interface_state_change(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Registered callback for HW interface state changes.
u32 ido_sw_if_index
The Software interface index that the packets will be given as the ingress/rx interface.
void interface_rx_dpo_module_init(void)
interface_rx_dpo_t * interface_rx_dpo_pool
pool of all interface DPOs
dpo_type_t dpoi_type
the type
#define pool_put(P, E)
Free an object E in pool P.
static const char *const interface_rx_dpo_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
static uword interface_rx_dpo_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_l2)
vlib_node_registration_t interface_rx_dpo_ip6_node
(constructor) VLIB_REGISTER_NODE (interface_rx_dpo_ip6_node)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
The data-path object representing a change of receive interface.
static const char *const *const interface_rx_dpo_nodes[DPO_PROTO_NUM]
#define VLIB_REGISTER_NODE(x,...)
static void interface_rx_dpo_lock(dpo_id_t *dpo)
void interface_rx_dpo_add_or_lock(dpo_proto_t proto, u32 sw_if_index, dpo_id_t *dpo)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
static interface_rx_dpo_t * interface_rx_dpo_alloc(void)
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
static u8 * format_interface_rx_dpo_trace(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t * node
vlib_node_registration_t interface_rx_dpo_l2_node
(constructor) VLIB_REGISTER_NODE (interface_rx_dpo_l2_node)
u16 ido_locks
number of locks.
static interface_rx_dpo_t * interface_rx_dpo_get_from_dpo(const dpo_id_t *dpo)
index_t dpoi_index
the index of objects of that type
static const char *const interface_rx_dpo_ip6_nodes[]
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
dpo_proto_t ido_proto
DPO protocol that the packets will have as they 'ingress' on this interface.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
enum interface_rx_dpo_next_t_ interface_rx_dpo_next_t
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
static index_t * interface_rx_dpo_db[DPO_PROTO_NUM]
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(interface_rx_dpo_hw_interface_state_change)
static const char *const interface_rx_dpo_l2_nodes[]
vl_api_interface_index_t sw_if_index
static clib_error_t * interface_rx_dpo_interface_delete(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
static uword pool_elts(void *v)
Number of active elements in a pool.