31 #define MSEC_PER_SEC 1000 32 #define IP4_REASS_TIMEOUT_DEFAULT_MS 100 33 #define IP4_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS 10000 // 10 seconds default 34 #define IP4_REASS_MAX_REASSEMBLIES_DEFAULT 1024 35 #define IP4_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT 3 36 #define IP4_REASS_HT_LOAD_FACTOR (0.75) 38 #define IP4_REASS_DEBUG_BUFFERS 0 39 #if IP4_REASS_DEBUG_BUFFERS 40 #define IP4_REASS_DEBUG_BUFFER(bi, what) \ 44 printf (#what "buffer %u", _bi); \ 45 vlib_buffer_t *_b = vlib_get_buffer (vm, _bi); \ 46 while (_b->flags & VLIB_BUFFER_NEXT_PRESENT) \ 48 _bi = _b->next_buffer; \ 49 printf ("[%u]", _bi); \ 50 _b = vlib_get_buffer (vm, _bi); \ 57 #define IP4_REASS_DEBUG_BUFFER(...) 110 return vnb->
ip.reass.range_first - vnb->
ip.reass.fragment_first;
117 return clib_min (vnb->
ip.reass.range_last, vnb->
ip.reass.fragment_last) -
118 (vnb->
ip.reass.fragment_first +
194 #ifndef CLIB_MARCH_VARIANT 292 "first bi: %u, data len: %u, ip/fragment[%u, %u]",
331 ip4_full_reass_trace_operation_e
action,
332 u32 size_diff,
u32 thread_id_to)
336 bool is_after_handoff =
false;
339 is_after_handoff =
true;
373 printf (
"%.*s\n",
vec_len (s), s);
395 clib_bihash_add_del_16_8 (&rm->
hash, &kv, 0);
407 while (~0 != range_bi)
416 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
419 b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
426 range_bi = range_vnb->
ip.reass.next_range_bi;
431 u32 n_left_to_next, *to_next, next_index;
440 while (
vec_len (to_free) > 0 && n_left_to_next > 0)
483 if (!clib_bihash_search_16_8 (&rm->
hash, &kv->
kv, &kv->
kv))
531 int rv = clib_bihash_add_del_16_8 (&rm->
hash, &kv->
kv, 2);
549 u32 * next0,
u32 * error0,
bool is_custom_app)
554 u32 total_length = 0;
558 u32 tmp_bi = sub_chain_bi;
562 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
563 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
598 u32 to_be_freed_bi = tmp_bi;
600 if (!(tmp->
flags & VLIB_BUFFER_NEXT_PRESENT))
604 tmp->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
621 last_b->
flags |= VLIB_BUFFER_NEXT_PRESENT;
625 if (keep_data <= tmp->current_length)
633 if (!(tmp->
flags & VLIB_BUFFER_NEXT_PRESENT))
639 if (tmp->
flags & VLIB_BUFFER_NEXT_PRESENT)
651 u32 to_be_freed_bi = tmp_bi;
656 if (tmp->
flags & VLIB_BUFFER_NEXT_PRESENT)
658 tmp->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
676 while (~0 != sub_chain_bi);
682 last_b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
684 if (total_length < first_b->current_length)
689 first_b->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
700 first_b->
flags &= ~VLIB_BUFFER_EXT_HDR_VALID;
716 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
725 printf (
"%.*s\n",
vec_len (s), s);
742 *error0 = IP4_ERROR_NONE;
753 u32 prev_range_bi,
u32 new_next_bi)
757 if (~0 != prev_range_bi)
761 new_next_vnb->
ip.reass.next_range_bi = prev_vnb->
ip.reass.next_range_bi;
762 prev_vnb->
ip.reass.next_range_bi = new_next_bi;
768 new_next_vnb->
ip.reass.next_range_bi = reass->
first_bi;
773 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
774 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
787 u32 prev_range_bi,
u32 discard_bi)
791 if (~0 != prev_range_bi)
795 if (!(prev_vnb->
ip.reass.next_range_bi == discard_bi))
799 prev_vnb->
ip.reass.next_range_bi = discard_vnb->
ip.reass.next_range_bi;
803 reass->
first_bi = discard_vnb->
ip.reass.next_range_bi;
806 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
807 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
814 u32 to_be_freed_bi = discard_bi;
820 if (discard_b->
flags & VLIB_BUFFER_NEXT_PRESENT)
822 discard_b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
843 u32 * error0,
bool is_custom_app,
844 u32 * handoff_thread_idx)
858 const u32 fragment_length =
860 const u32 fragment_last = fragment_first + fragment_length - 1;
861 fvnb->
ip.reass.fragment_first = fragment_first;
862 fvnb->
ip.reass.fragment_last = fragment_last;
865 u32 prev_range_bi = ~0;
866 fvnb->
ip.reass.range_first = fragment_first;
867 fvnb->
ip.reass.range_last = fragment_last;
868 fvnb->
ip.reass.next_range_bi = ~0;
878 prev_range_bi, *bi0);
895 fvnb->
ip.reass.estimated_mtu);
896 while (~0 != candidate_range_bi)
900 if (fragment_first > candidate_vnb->
ip.reass.range_last)
903 prev_range_bi = candidate_range_bi;
904 candidate_range_bi = candidate_vnb->
ip.reass.next_range_bi;
905 if (candidate_vnb->
ip.reass.range_last < fragment_last &&
906 ~0 == candidate_range_bi)
911 prev_range_bi, *bi0);
921 if (fragment_last < candidate_vnb->
ip.reass.range_first)
926 prev_range_bi, *bi0);
935 if (fragment_first >= candidate_vnb->
ip.reass.range_first &&
936 fragment_last <= candidate_vnb->
ip.reass.range_last)
946 int discard_candidate = 0;
947 if (fragment_first < candidate_vnb->
ip.reass.range_first)
950 fragment_last - candidate_vnb->
ip.reass.range_first + 1;
953 candidate_vnb->
ip.reass.range_first += overlap;
977 discard_candidate = 1;
980 else if (fragment_last > candidate_vnb->
ip.reass.range_last)
983 candidate_vnb->
ip.reass.range_last - fragment_first + 1;
986 fvnb->
ip.reass.range_first += overlap;
987 if (~0 != candidate_vnb->
ip.reass.next_range_bi)
989 prev_range_bi = candidate_range_bi;
991 candidate_vnb->
ip.reass.next_range_bi;
1011 discard_candidate = 1;
1016 discard_candidate = 1;
1018 if (discard_candidate)
1020 u32 next_range_bi = candidate_vnb->
ip.reass.next_range_bi;
1025 candidate_range_bi);
1030 if (~0 != next_range_bi)
1032 candidate_range_bi = next_range_bi;
1088 *error0 = IP4_ERROR_REASS_DUPLICATE_FRAGMENT;
1100 u32 n_left_from, n_left_to_next, *to_next, next_index;
1107 while (n_left_from > 0)
1111 while (n_left_from > 0 && n_left_to_next > 0)
1116 u32 error0 = IP4_ERROR_NONE;
1133 goto packet_enqueue;
1136 const u32 fragment_length =
1138 const u32 fragment_last = fragment_first + fragment_length - 1;
1139 if (fragment_first > fragment_last || fragment_first + fragment_length > UINT16_MAX - 20 || (fragment_length < 8 &&
ip4_get_fragment_more (ip0)))
1142 error0 = IP4_ERROR_REASS_MALFORMED_PACKET;
1143 goto packet_enqueue;
1163 if (0 == fragment_first)
1177 u32 handoff_thread_idx;
1179 (vm, node, rm, rt, reass, &bi0, &next0,
1180 &error0, is_custom_app, &handoff_thread_idx))
1193 IP4_ERROR_REASS_FRAGMENT_CHAIN_TOO_LONG,
1201 IP4_ERROR_REASS_NO_BUF, 1);
1209 IP4_ERROR_REASS_INTERNAL_ERROR,
1220 error0 = IP4_ERROR_REASS_LIMIT_REACHED;
1230 n_left_to_next -= 1;
1234 if (IP4_ERROR_NONE != error0)
1246 reass.owner_thread_index);
1249 else if (is_feature && IP4_ERROR_NONE == error0)
1254 to_next, n_left_to_next,
1272 #define _(sym, string) string, 1287 .name =
"ip4-full-reassembly",
1288 .vector_size =
sizeof (
u32),
1290 .n_errors =
ARRAY_LEN (ip4_full_reass_error_strings),
1313 .name =
"ip4-full-reassembly-feature",
1314 .vector_size =
sizeof (
u32),
1316 .n_errors =
ARRAY_LEN (ip4_full_reass_error_strings),
1330 .arc_name =
"ip4-unicast",
1331 .node_name =
"ip4-full-reassembly-feature",
1333 "ipsec4-input-feature"),
1338 #ifndef CLIB_MARCH_VARIANT 1348 for (i = 0; i < 31; i++)
1349 if ((1 << i) >= nbuckets)
1368 #ifndef CLIB_MARCH_VARIANT 1373 if (clib_bihash_add_del_16_8 (ctx->
new_hash, kv, 1))
1377 return (BIHASH_WALK_CONTINUE);
1382 u32 max_reassembly_length,
1383 u32 expire_walk_interval_ms)
1387 ip4_full_reass_main.
max_reass_n = max_reassemblies;
1394 u32 max_reassembly_length,
u32 expire_walk_interval_ms)
1398 max_reassembly_length, expire_walk_interval_ms);
1403 if (ip4_full_reass_main.
max_reass_n > 0 && new_nbuckets > old_nbuckets)
1405 clib_bihash_16_8_t new_hash;
1410 clib_bihash_init_16_8 (&new_hash,
"ip4-dr", new_nbuckets,
1411 new_nbuckets * 1024);
1412 clib_bihash_foreach_key_value_pair_16_8 (&ip4_full_reass_main.
hash,
1416 clib_bihash_free_16_8 (&new_hash);
1421 clib_bihash_free_16_8 (&ip4_full_reass_main.
hash);
1423 sizeof (ip4_full_reass_main.
hash));
1432 u32 * max_reassembly_length,
1433 u32 * expire_walk_interval_ms)
1435 *timeout_ms = ip4_full_reass_main.
timeout_ms;
1436 *max_reassemblies = ip4_full_reass_main.
max_reass_n;
1470 clib_bihash_init_16_8 (&rm->
hash,
"ip4-dr", nbuckets, nbuckets * 1024);
1492 uword event_type, *event_data = 0;
1516 int *pool_indexes_to_free = NULL;
1518 uword thread_index = 0;
1521 for (thread_index = 0; thread_index < nthreads; ++thread_index)
1530 reass = pool_elt_at_index (rt->pool, index);
1531 if (now > reass->last_heard + rm->timeout)
1533 vec_add1 (pool_indexes_to_free, index);
1553 _vec_len (event_data) = 0;
1564 .name =
"ip4-full-reassembly-expire-walk",
1578 "xx_id: %u, src: %U, dst: %U, frag_id: %u, proto: %u",
1590 s =
format (s,
"ID: %lu, key: %U\n first_bi: %u, data_len: %u, " 1591 "last_packet_octet: %u, trace_op_counter: %u\n",
1604 " #%03u: range: [%u, %u], bi: %u, off: %d, len: %u, " 1605 "fragment[%u, %u]\n", counter, vnb->
ip.reass.range_first,
1606 vnb->
ip.reass.range_last, bi,
1609 vnb->
ip.reass.fragment_first, vnb->
ip.reass.fragment_last);
1610 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
1632 bool details =
false;
1638 u32 sum_reass_n = 0;
1642 for (thread_index = 0; thread_index < nthreads; ++thread_index)
1650 vlib_cli_output (vm,
"%U", format_ip4_reass, vm, reass);
1659 (
long unsigned) sum_reass_n);
1661 "Maximum configured concurrent full IP4 reassemblies per worker-thread: %lu\n",
1664 "Maximum configured full IP4 reassembly timeout: %lums\n",
1667 "Maximum configured full IP4 reassembly expire walk interval: %lums\n",
1674 .path =
"show ip4-full-reassembly",
1675 .short_help =
"show ip4-full-reassembly [details]",
1680 #ifndef CLIB_MARCH_VARIANT 1685 "ip4-full-reassembly-feature",
1686 sw_if_index, enable_disable, 0, 0);
1691 #define foreach_ip4_full_reass_handoff_error \ 1692 _(CONGESTION_DROP, "congestion drop") 1697 #define _(sym,str) IP4_FULL_REASS_HANDOFF_ERROR_##sym, 1704 #define _(sym,string) string, 1723 format (s,
"ip4-full-reassembly-handoff: next-worker %d",
1737 u32 n_enq, n_left_from, *from;
1746 ti = thread_indices;
1750 while (n_left_from > 0)
1752 ti[0] =
vnet_buffer (b[0])->ip.reass.owner_thread_index;
1756 && (b[0]->
flags & VLIB_BUFFER_IS_TRACED)))
1771 if (n_enq < frame->n_vectors)
1773 IP4_FULL_REASS_HANDOFF_ERROR_CONGESTION_DROP,
1789 .name =
"ip4-full-reassembly-handoff",
1790 .vector_size =
sizeof (
u32),
1791 .n_errors =
ARRAY_LEN(ip4_full_reass_handoff_error_strings),
1818 .name =
"ip4-full-reass-feature-hoff",
1819 .vector_size =
sizeof (
u32),
1820 .n_errors =
ARRAY_LEN(ip4_full_reass_handoff_error_strings),
1832 #ifndef CLIB_MARCH_VARIANT 1844 "ip4-full-reassembly-feature",
1845 sw_if_index, 1, 0, 0);
1854 "ip4-full-reassembly-feature",
1855 sw_if_index, 0, 0, 0);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
static u16 ip4_full_reass_buffer_get_data_len(vlib_buffer_t *b)
u32 expire_walk_interval_ms
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
vnet_api_error_t ip4_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
ip4_full_reass_trace_operation_e
#define pool_alloc(P, N)
Allocate N more free elements to pool (unspecified alignment).
static void ip4_full_reass_set_params(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
#define clib_memcpy_fast(a, b, c)
static char * ip4_full_reass_error_strings[]
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
ip4_full_reass_handoff_error_t
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
static u8 * format_ip4_full_reass_key(u8 *s, va_list *args)
u16 current_length
Nbytes between current data and the end of this buffer.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static clib_error_t * show_ip4_reass(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
u32 * feature_use_refcount_per_intf
static void ip4_full_reass_init(ip4_full_reass_t *reass)
static ip4_full_reass_rc_t ip4_full_reass_update(vlib_main_t *vm, vlib_node_runtime_t *node, ip4_full_reass_main_t *rm, ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass, u32 *bi0, u32 *next0, u32 *error0, bool is_custom_app, u32 *handoff_thread_idx)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
#define VLIB_NODE_FN(node)
#define IP4_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT
vlib_error_t * errors
Vector of errors for this 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 vec_pop(V)
Returns last element of a vector and decrements its length.
static int ip4_get_fragment_offset_bytes(const ip4_header_t *i)
vlib_node_registration_t ip4_full_reass_handoff_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_handoff_node)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define clib_memcpy(d, s, n)
#define IP4_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS
u32 ip4_full_reass_expire_node_idx
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
static u16 ip4_get_fragment_more(const ip4_header_t *i)
#define foreach_ip4_full_reass_handoff_error
static ip4_full_reass_rc_t ip4_full_reass_insert_range_in_chain(vlib_main_t *vm, ip4_full_reass_main_t *rm, ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass, u32 prev_range_bi, u32 new_next_bi)
static uword ip4_full_reass_walk_expired(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
clib_bihash_16_8_t * new_hash
static void ip4_full_reass_free(ip4_full_reass_main_t *rm, ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass)
vlib_node_registration_t ip4_full_reass_node_feature
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_node_feature)
static uword ip4_full_reass_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature, bool is_custom_app)
static void clib_spinlock_init(clib_spinlock_t *p)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vlib_node_registration_t ip4_full_reass_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_node)
static u32 vlib_buffer_chain_linearize(vlib_main_t *vm, vlib_buffer_t *b)
u32 fq_index
Worker handoff.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static u32 ip4_full_reass_get_nbuckets()
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
static void ip4_full_reass_free_ctx(ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass)
u32 memory_owner_thread_index
ip4_full_reass_per_thread_t * per_thread_data
static void ip4_full_reass_add_trace(vlib_main_t *vm, vlib_node_runtime_t *node, ip4_full_reass_main_t *rm, ip4_full_reass_t *reass, u32 bi, ip4_full_reass_trace_operation_e action, u32 size_diff, u32 thread_id_to)
u32 node_index
Node index.
u32 memory_owner_thread_index
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
ip4_full_reass_main_t ip4_full_reass_main
static ip4_full_reass_t * ip4_full_reass_find_or_create(vlib_main_t *vm, vlib_node_runtime_t *node, ip4_full_reass_main_t *rm, ip4_full_reass_per_thread_t *rt, ip4_full_reass_kv_t *kv, u8 *do_handoff)
#define foreach_ip4_error
static int ip4_rehash_cb(clib_bihash_kv_16_8_t *kv, void *_ctx)
#define VLIB_REGISTER_NODE(x,...)
static u8 * format_ip4_reass(u8 *s, va_list *args)
sll srl srl sll sra u16x4 i
static u16 ip4_get_fragment_offset(const ip4_header_t *i)
#define vec_free(V)
Free vector's memory (no header).
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
#define clib_warning(format, args...)
vnet_api_error_t ip4_full_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip4 reassembly configuration
vlib_node_registration_t ip4_full_reass_expire_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_expire_node)
static u32 vlib_buffer_get_trace_thread(vlib_buffer_t *b)
Extract the thread id from a trace handle.
static u8 * format_ip4_full_reass_trace(u8 *s, va_list *args)
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 void ip4_full_reass_drop_all(vlib_main_t *vm, vlib_node_runtime_t *node, ip4_full_reass_main_t *rm, ip4_full_reass_t *reass)
static vlib_cli_command_t show_ip4_full_reass_cmd
(constructor) VLIB_CLI_COMMAND (show_ip4_full_reass_cmd)
vlib_main_t vlib_node_runtime_t * node
static ip4_full_reass_rc_t ip4_full_reass_remove_range_from_chain(vlib_main_t *vm, vlib_node_runtime_t *node, ip4_full_reass_main_t *rm, ip4_full_reass_t *reass, u32 prev_range_bi, u32 discard_bi)
#define VLIB_CLI_COMMAND(x,...)
static ip4_full_reass_rc_t ip4_full_reass_finalize(vlib_main_t *vm, vlib_node_runtime_t *node, ip4_full_reass_main_t *rm, ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass, u32 *bi0, u32 *next0, u32 *error0, bool is_custom_app)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static char * ip4_full_reass_handoff_error_strings[]
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vnet_api_error_t ip4_full_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip4 reassembly configuration
static uword ip4_full_reass_handoff_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
VNET_FEATURE_INIT(ip4_full_reass_feature, static)
ip4_full_reass_trace_operation_e action
#define VNET_FEATURES(...)
struct vnet_buffer_opaque_t::@150::@152 ip
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vec_elt(v, i)
Get vector value at index i.
void clib_bihash_copied(void *dst, void *src)
struct _vlib_node_registration vlib_node_registration_t
static void ip4_full_reass_trace_details(vlib_main_t *vm, u32 bi, ip4_full_reass_range_trace_t *trace)
static u8 * format_ip4_full_reass_range_trace(u8 *s, va_list *args)
vl_api_mac_event_action_t action
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 next_buffer
Next buffer for this linked-list of buffers.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
ip4_full_reass_range_trace_t trace_range
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)
int ip4_full_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable)
static u32 ip4_full_reass_buffer_get_data_offset(vlib_buffer_t *b)
ip4_main_t ip4_main
Global ip4 main structure.
static u32 vlib_num_workers()
static u8 * format_ip4_full_reass_handoff_trace(u8 *s, va_list *args)
static clib_error_t * ip4_full_reass_init_function(vlib_main_t *vm)
#define vec_foreach(var, vec)
Vector iterator.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u16 flags
Copy of main node flags.
#define IP4_REASS_MAX_REASSEMBLIES_DEFAULT
static void vlib_buffer_free_one(vlib_main_t *vm, u32 buffer_index)
Free one buffer Shorthand to free a single buffer chain.
static int ip4_header_bytes(const ip4_header_t *i)
#define pool_foreach_index(i, v, body)
Iterate pool by index.
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 total_length_not_including_first_buffer
Only valid for first buffer in chain.
#define IP4_REASS_HT_LOAD_FACTOR
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u16 ip4_header_checksum(ip4_header_t *i)
vlib_node_registration_t ip4_full_reass_feature_handoff_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_feature_handoff_node)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
#define IP4_REASS_TIMEOUT_DEFAULT_MS
#define IP4_REASS_DEBUG_BUFFER(...)