|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
29 "sw-if-index %u next-index %u\n"
30 "%Uinstance %u qpair %u desc-index %u slot %u\n"
31 "%Udesc: buffer-pool %u offset %u len %u address-space-id %u\n",
40 #define foreach_snort_enq_error \
41 _ (SOCKET_ERROR, "write socket error") \
42 _ (NO_INSTANCE, "no snort instance") \
43 _ (NO_ENQ_SLOTS, "no enqueue slots (packet dropped)")
47 #define _(sym, str) SNORT_ENQ_ERROR_##sym,
54 #define _(sym, string) string,
69 u32 total_enq = 0, n_processed = 0;
86 if (
si->drop_on_disconnect)
105 if (with_trace &&
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
124 SNORT_ENQ_ERROR_NO_INSTANCE, n_processed);
131 u32 head, freelist_len, n_pending, n_enq,
mask;
143 if (freelist_len < n_pending)
145 n_enq = freelist_len;
149 SNORT_ENQ_ERROR_NO_ENQ_SLOTS,
161 for (
u32 i = 0;
i < n_enq;
i++)
172 if (with_trace && n_trace)
175 if (tb->
flags & VLIB_BUFFER_IS_TRACED)
192 __atomic_store_n (qp->
enq_head, head, __ATOMIC_RELEASE);
193 _vec_len (qp->
freelist) = freelist_len;
194 if (sm->
input_mode == VLIB_NODE_STATE_INTERRUPT)
196 if (write (qp->
enq_fd, &ctr, sizeof (ctr)) < 0)
198 SNORT_ENQ_ERROR_SOCKET_ERROR, 1);
216 .vector_size =
sizeof (
u32),
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
u8 buffer_pool_index
index of buffer pool this buffer belongs.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
daq_vpp_desc_t * descriptors
nat44_ei_hairpin_src_next_t next_index
static u8 * format_snort_enq_trace(u8 *s, va_list *args)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static uword pow2_mask(uword x)
vlib_node_registration_t snort_enq_node
(constructor) VLIB_REGISTER_NODE (snort_enq_node)
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static_always_inline void * vnet_feature_next_with_data(u32 *next0, vlib_buffer_t *b0, u32 n_data_bytes)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 pending_buffers[VLIB_FRAME_SIZE]
#define VLIB_NODE_FN(node)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static_always_inline uword snort_enq_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int with_trace)
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
snort_instance_t * instances
#define static_always_inline
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define SNORT_ENQ_NEXT_NODES
static u32 vlib_buffer_chain_linearize(vlib_main_t *vm, vlib_buffer_t *b)
struct _vlib_node_registration vlib_node_registration_t
vlib_main_t vlib_node_runtime_t * node
u16 current_length
Nbytes between current data and the end of this buffer.
#define foreach_snort_enq_error
daq_vpp_desc_t pending_descs[VLIB_FRAME_SIZE]
description fragment has unexpected format
u16 pending_nexts[VLIB_FRAME_SIZE]
#define vec_foreach(var, vec)
Vector iterator.
uint16_t address_space_id
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u16 nexts[VLIB_FRAME_SIZE]
static char * snort_enq_error_strings[]
u8 ** buffer_pool_base_addrs
vl_api_fib_path_type_t type
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags