33 #define foreach_nat44_handoff_error \ 34 _(CONGESTION_DROP, "congestion drop") \ 35 _(SAME_WORKER, "same worker") \ 36 _(DO_HANDOFF, "do handoff") 40 #define _(sym,str) NAT44_HANDOFF_ERROR_##sym, 47 #define _(sym,string) string, 65 tag = t->
in2out ?
"IN2OUT" :
"OUT2IN";
67 format (s,
"NAT44_%s_WORKER_HANDOFF: next-worker %d", tag,
80 u32 n_enq, n_left_from, *from;
85 u32 do_handoff = 0, same_worker = 0;
110 while (n_left_from > 0)
119 ti[0] = get_worker (ip0, rx_fib_index0);
121 if (ti[0] != thread_index)
127 && (b[0]->
flags & VLIB_BUFFER_IS_TRACED)))
144 if (n_enq < frame->n_vectors)
146 NAT44_HANDOFF_ERROR_CONGESTION_DROP,
149 NAT44_HANDOFF_ERROR_SAME_WORKER, same_worker);
151 NAT44_HANDOFF_ERROR_DO_HANDOFF, do_handoff);
166 .name =
"nat44-in2out-worker-handoff",
167 .vector_size =
sizeof (
u32),
193 .name =
"nat44-in2out-output-worker-handoff",
194 .vector_size =
sizeof (
u32),
220 .name =
"nat44-out2in-worker-handoff",
221 .vector_size =
sizeof (
u32),
static char * nat44_handoff_error_strings[]
#define foreach_nat44_handoff_error
static uword snat_in2out_worker_handoff_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 fq_in2out_output_index
vlib_node_registration_t snat_in2out_worker_handoff_node
(constructor) VLIB_REGISTER_NODE (snat_in2out_worker_handoff_node)
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
VLIB_NODE_FUNCTION_MULTIARCH(snat_in2out_worker_handoff_node, snat_in2out_worker_handoff_fn)
u32() snat_get_worker_function_t(ip4_header_t *ip, u32 rx_fib_index)
u32 node_index
Node index.
static uword snat_in2out_output_worker_handoff_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
snat_get_worker_function_t * worker_in2out_cb
snat_get_worker_function_t * worker_out2in_cb
static uword nat44_worker_handoff_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_output, u8 is_in2out)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword snat_out2in_worker_handoff_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t snat_out2in_worker_handoff_node
(constructor) VLIB_REGISTER_NODE (snat_out2in_worker_handoff_node)
static_always_inline u32 vlib_buffer_enqueue_to_thread(vlib_main_t *vm, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
vlib_node_registration_t snat_in2out_output_worker_handoff_node
(constructor) VLIB_REGISTER_NODE (snat_in2out_output_worker_handoff_node)
u16 flags
Copy of main node flags.
static u8 * format_nat44_handoff_trace(u8 *s, va_list *args)
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.