|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
29 #ifndef CLIB_MARCH_VARIANT
39 s =
format (s,
"CT6_IN2OUT: sw_if_index %d, next index %d session %d\n",
48 #define foreach_ct6_in2out_error \
49 _(PROCESSED, "ct6 packets processed") \
50 _(CREATED, "ct6 sessions created") \
51 _(RECYCLED, "ct6 sessions recycled")
55 #define _(sym,str) CT6_IN2OUT_ERROR_##sym,
61 #ifndef CLIB_MARCH_VARIANT
63 #define _(sym,string) string,
75 #ifndef CLIB_MARCH_VARIANT
79 u32 my_thread_index,
u32 * recyclep,
112 s0 - cmp->
sessions[my_thread_index]);
126 memset (s0, 0,
sizeof (*s0));
131 clib_bihash_add_del_48_8 (&cmp->
session_hash, kvpp, 1 );
182 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
185 t->next_index =
next[0];
188 if (
b[1]->
flags & VLIB_BUFFER_IS_TRACED)
191 t->next_index =
next[1];
194 if (
b[2]->
flags & VLIB_BUFFER_IS_TRACED)
197 t->next_index =
next[2];
200 if (
b[3]->
flags & VLIB_BUFFER_IS_TRACED)
203 t->next_index =
next[3];
217 ct6_session_key_t *key0;
219 u32 session_index0 = ~0;
244 delta0 =
sizeof (*e0);
245 delta0 += (e0->
type == clib_net_to_host_u16 (ETHERNET_TYPE_VLAN))
247 delta0 += (e0->
type == clib_net_to_host_u16 (ETHERNET_TYPE_DOT1AD))
252 if (e0->
type != clib_host_to_net_u16 (ETHERNET_TYPE_IP6))
258 if (*tagged_etype_ptr != clib_host_to_net_u16 (ETHERNET_TYPE_IP6))
282 key0 = (ct6_session_key_t *) & kvp0;
284 sizeof (ip6_address_t));
286 sizeof (ip6_address_t));
294 if (clib_bihash_search_48_8 (&cmp->
session_hash, &kvp0, &kvp0) < 0)
298 &recycled, &created);
299 session_index0 = kvp0.
value;
304 session_index0 = kvp0.
value;
311 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
329 CT6_IN2OUT_ERROR_PROCESSED,
frame->n_vectors);
331 CT6_IN2OUT_ERROR_CREATED, created);
333 CT6_IN2OUT_ERROR_RECYCLED, recycled);
335 return frame->n_vectors;
348 #ifndef CLIB_MARCH_VARIANT
351 .name =
"ct6-in2out",
352 .vector_size =
sizeof (
u32),
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static uword ip6_address_is_global_unicast(const ip6_address_t *a)
vlib_node_registration_t ct6_in2out_node
(constructor) VLIB_REGISTER_NODE (ct6_in2out_node)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
static void ct6_update_session_hit(ct6_main_t *cmp, ct6_session_t *s0, f64 now)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static void * ip6_next_header(ip6_header_t *i)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
clib_bihash_48_8_t session_hash
#define CLIB_PREFETCH(addr, size, type)
#define VLIB_NODE_FN(node)
ct6_session_t ** sessions
static void ct6_lru_add(ct6_main_t *cmp, ct6_session_t *s0, f64 now)
#define VLIB_NODE_FLAG_TRACE
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static void ct6_lru_remove(ct6_main_t *cmp, ct6_session_t *s0)
static u8 * format_ct6_in2out_trace(u8 *s, va_list *args)
static uword ct6_in2out_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_trace)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
ct6_session_t * ct6_create_or_recycle_session(ct6_main_t *cmp, clib_bihash_kv_48_8_t *kvpp, f64 now, u32 my_thread_index, u32 *recyclep, u32 *createp)
uword unformat_ethernet_header(unformat_input_t *input, va_list *args)
description fragment has unexpected format
#define foreach_ct6_in2out_error
static uword pool_elts(void *v)
Number of active elements in a pool.
static char * ct6_in2out_error_strings[]
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
u32 max_sessions_per_worker
#define clib_warning(format, args...)
u16 nexts[VLIB_FRAME_SIZE]
f64 session_timeout_interval
static f64 vlib_time_now(vlib_main_t *vm)
vl_api_fib_path_type_t type
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags