29 #define MSEC_PER_SEC 1000 30 #define IP6_FULL_REASS_TIMEOUT_DEFAULT_MS 100 31 #define IP6_FULL_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS 10000 // 10 seconds default 32 #define IP6_FULL_REASS_MAX_REASSEMBLIES_DEFAULT 1024 33 #define IP6_FULL_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT 3 34 #define IP6_FULL_REASS_HT_LOAD_FACTOR (0.75) 87 return vnb->
ip.reass.range_first - vnb->
ip.reass.fragment_first;
94 return clib_min (vnb->
ip.reass.range_last, vnb->
ip.reass.fragment_last) -
95 (vnb->
ip.reass.fragment_first +
171 #ifndef CLIB_MARCH_VARIANT 254 s =
format (s,
"first bi: %u, data len: %u, ip/fragment[%u, %u]",
269 s =
format (s,
"\n%Uicmp-error - frag_len > 65535 %U",
274 s =
format (s,
"\n%Uicmp-error - frag_len mod 8 != 0 %U",
279 s =
format (s,
"\n%Uicmp-error - reassembly time exceeded",
298 ip6_full_reass_trace_operation_e action,
325 printf (
"%.*s\n",
vec_len (s), s);
351 clib_bihash_add_del_48_8 (&rm->
hash, &kv, 0);
363 while (~0 != range_bi)
372 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
375 b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
382 range_bi = range_vnb->
ip.reass.next_range_bi;
387 u32 n_left_to_next, *to_next, next_index;
396 while (
vec_len (to_free) > 0 && n_left_to_next > 0)
438 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
441 b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
449 ICMP6_time_exceeded_fragment_reassembly_time_exceeded,
471 if (!clib_bihash_search_48_8
474 if (vm->
thread_index != kv->v.memory_owner_thread_index)
482 [kv->v.memory_owner_thread_index].
pool,
524 kv->v.reass_index = (reass - rt->
pool);
547 u32 * error0,
bool is_custom_app)
550 *error0 = IP6_ERROR_NONE;
551 ip6_frag_hdr_t *frag_hdr;
554 u32 total_length = 0;
557 u32 *vec_drop_compress = NULL;
561 u32 tmp_bi = sub_chain_bi;
564 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
565 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
568 goto free_buffers_and_return;
572 u32 trim_front =
vnet_buffer (tmp)->ip.reass.ip6_frag_hdr_offset +
579 if (0 != ip6_full_reass_buffer_get_data_offset (tmp))
582 goto free_buffers_and_return;
591 goto free_buffers_and_return;
604 vec_add1 (vec_drop_compress, tmp_bi);
606 if (!(tmp->
flags & VLIB_BUFFER_NEXT_PRESENT))
609 goto free_buffers_and_return;
611 tmp->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
626 last_b->
flags |= VLIB_BUFFER_NEXT_PRESENT;
630 if (keep_data <= tmp->current_length)
638 if (!(tmp->
flags & VLIB_BUFFER_NEXT_PRESENT))
641 goto free_buffers_and_return;
648 vec_add1 (vec_drop_compress, tmp_bi);
652 goto free_buffers_and_return;
656 if (tmp->
flags & VLIB_BUFFER_NEXT_PRESENT)
670 while (~0 != sub_chain_bi);
675 goto free_buffers_and_return;
677 last_b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
679 if (total_length < first_b->current_length)
682 goto free_buffers_and_return;
685 first_b->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
691 ip6_ext_header_t *prev_hdr;
697 prev_hdr->next_hdr = frag_hdr->next_hdr;
703 if (!((
u8 *) frag_hdr - (
u8 *) ip == ip6_frag_hdr_offset))
706 goto free_buffers_and_return;
708 memmove (frag_hdr, (
u8 *) frag_hdr +
sizeof (*frag_hdr),
710 sizeof (ip6_frag_hdr_t));
718 goto free_buffers_and_return;
720 first_b->
flags &= ~VLIB_BUFFER_EXT_HDR_VALID;
736 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
745 printf (
"%.*s\n",
vec_len (s), s);
763 free_buffers_and_return:
774 u32 prev_range_bi,
u32 new_next_bi)
779 if (~0 != prev_range_bi)
783 new_next_vnb->
ip.reass.next_range_bi = prev_vnb->
ip.reass.next_range_bi;
784 prev_vnb->
ip.reass.next_range_bi = new_next_bi;
790 new_next_vnb->
ip.reass.next_range_bi = reass->
first_bi;
802 u32 * error0, ip6_frag_hdr_t * frag_hdr,
803 bool is_custom_app,
u32 * handoff_thread_idx)
814 fvnb->
ip.reass.ip6_frag_hdr_offset =
818 fvnb->
ip.reass.ip6_frag_hdr_offset == 0 ||
824 u32 fragment_first = fvnb->
ip.reass.fragment_first =
826 u32 fragment_length =
828 (fvnb->
ip.reass.ip6_frag_hdr_offset +
sizeof (*frag_hdr));
829 u32 fragment_last = fvnb->
ip.reass.fragment_last =
830 fragment_first + fragment_length - 1;
833 u32 prev_range_bi = ~0;
834 fvnb->
ip.reass.range_first = fragment_first;
835 fvnb->
ip.reass.range_last = fragment_last;
836 fvnb->
ip.reass.next_range_bi = ~0;
849 goto check_if_done_maybe;
853 fvnb->
ip.reass.estimated_mtu);
854 while (~0 != candidate_range_bi)
858 if (fragment_first > candidate_vnb->
ip.reass.range_last)
861 prev_range_bi = candidate_range_bi;
862 candidate_range_bi = candidate_vnb->
ip.reass.next_range_bi;
863 if (candidate_vnb->
ip.reass.range_last < fragment_last &&
864 ~0 == candidate_range_bi)
868 prev_range_bi, *bi0);
874 if (fragment_last < candidate_vnb->
ip.reass.range_first)
878 prev_range_bi, *bi0);
881 else if (fragment_first == candidate_vnb->
ip.reass.range_first &&
882 fragment_last == candidate_vnb->
ip.reass.range_last)
897 *error0 = IP6_ERROR_REASS_OVERLAPPING_FRAGMENT;
917 ip6_full_reass_rc_t rc =
939 *error0 = IP6_ERROR_REASS_DUPLICATE_FRAGMENT;
948 ip6_frag_hdr_t * frag_hdr)
950 ip6_ext_header_t *tmp = (ip6_ext_header_t *) frag_hdr;
955 if (IP_PROTOCOL_IP6_NONXT == tmp->next_hdr)
958 ICMP6_parameter_problem_first_fragment_has_incomplete_header_chain,
960 b->
error = node->
errors[IP6_ERROR_REASS_MISSING_UPPER];
971 ip6_frag_hdr_t * frag_hdr)
976 u32 fragment_length =
978 (vnb->
ip.reass.ip6_frag_hdr_offset +
sizeof (*frag_hdr));
979 if (more_fragments && 0 != fragment_length % 8)
982 ICMP6_parameter_problem_erroneous_header_field,
993 ip6_frag_hdr_t * frag_hdr)
997 u32 fragment_length =
999 (vnb->
ip.reass.ip6_frag_hdr_offset +
sizeof (*frag_hdr));
1000 if (fragment_first + fragment_length > 65535)
1004 ICMP6_parameter_problem_erroneous_header_field,
1005 (
u8 *) & frag_hdr->fragment_offset_and_more
1019 u32 n_left_from, n_left_to_next, *to_next, next_index;
1026 while (n_left_from > 0)
1030 while (n_left_from > 0 && n_left_to_next > 0)
1035 u32 error0 = IP6_ERROR_NONE;
1042 ip6_frag_hdr_t *frag_hdr = NULL;
1043 ip6_ext_header_t *prev_hdr;
1048 IP_PROTOCOL_IPV6_FRAGMENTATION,
1061 (node, b0, frag_hdr))
1068 (vm, node, b0, frag_hdr)
1076 (
u8 *) frag_hdr - (
u8 *) ip0;
1088 (
u64) frag_hdr->identification;
1098 if (0 == fragment_first)
1107 vnet_buffer (b0)->ip.reass.owner_feature_thread_index =
1115 u32 handoff_thread_idx;
1117 (vm, node, rm, rt, reass, &bi0, &next0, &error0,
1118 frag_hdr, is_custom_app, &handoff_thread_idx))
1127 vnet_buffer (b0)->ip.reass.owner_feature_thread_index =
1135 IP6_ERROR_REASS_FRAGMENT_CHAIN_TOO_LONG,
1143 IP6_ERROR_REASS_NO_BUF, 1);
1150 IP6_ERROR_REASS_INTERNAL_ERROR,
1167 next0 = fvnb->
ip.reass.error_next_index;
1169 error0 = IP6_ERROR_REASS_LIMIT_REACHED;
1177 n_left_to_next -= 1;
1191 reass.owner_feature_thread_index);
1196 reass.owner_thread_index);
1199 else if (is_feature && IP6_ERROR_NONE == error0)
1204 n_left_to_next, bi0, next0);
1210 to_next[0] = icmp_bi;
1212 n_left_to_next -= 1;
1214 n_left_to_next, icmp_bi,
1230 #define _(sym, string) string, 1245 .name =
"ip6-full-reassembly",
1246 .vector_size =
sizeof (
u32),
1248 .n_errors =
ARRAY_LEN (ip6_full_reassembly_error_strings),
1271 .name =
"ip6-full-reassembly-feature",
1272 .vector_size =
sizeof (
u32),
1274 .n_errors =
ARRAY_LEN (ip6_full_reassembly_error_strings),
1289 .arc_name =
"ip6-unicast",
1290 .node_name =
"ip6-full-reassembly-feature",
1292 "ipsec6-input-feature"),
1297 #ifndef CLIB_MARCH_VARIANT 1307 for (i = 0; i < 31; i++)
1308 if ((1 << i) >= nbuckets)
1321 #ifndef CLIB_MARCH_VARIANT 1332 if (clib_bihash_add_del_48_8 (ctx->
new_hash, kv, 1))
1340 u32 max_reassembly_length,
1341 u32 expire_walk_interval_ms)
1345 ip6_full_reass_main.
max_reass_n = max_reassemblies;
1352 u32 max_reassembly_length,
u32 expire_walk_interval_ms)
1356 max_reassembly_length, expire_walk_interval_ms);
1361 if (ip6_full_reass_main.
max_reass_n > 0 && new_nbuckets > old_nbuckets)
1363 clib_bihash_48_8_t new_hash;
1368 clib_bihash_init_48_8 (&new_hash,
"ip6-full-reass", new_nbuckets,
1369 new_nbuckets * 1024);
1370 clib_bihash_foreach_key_value_pair_48_8 (&ip6_full_reass_main.
hash,
1374 clib_bihash_free_48_8 (&new_hash);
1379 clib_bihash_free_48_8 (&ip6_full_reass_main.
hash);
1381 sizeof (ip6_full_reass_main.
hash));
1390 u32 * max_reassembly_length,
1391 u32 * expire_walk_interval_ms)
1393 *timeout_ms = ip6_full_reass_main.
timeout_ms;
1394 *max_reassemblies = ip6_full_reass_main.
max_reass_n;
1428 clib_bihash_init_48_8 (&rm->
hash,
"ip6-full-reass", nbuckets,
1458 uword event_type, *event_data = 0;
1481 int *pool_indexes_to_free = NULL;
1483 uword thread_index = 0;
1486 u32 *vec_icmp_bi = NULL;
1487 for (thread_index = 0; thread_index < nthreads; ++thread_index)
1496 reass = pool_elt_at_index (rt->pool, index);
1497 if (now > reass->last_heard + rm->timeout)
1499 vec_add1 (pool_indexes_to_free, index);
1520 while (
vec_len (vec_icmp_bi) > 0)
1526 int trace_frame = 0;
1527 while (
vec_len (vec_icmp_bi) > 0 && n_left_to_next > 0)
1537 n_left_to_next -= 1;
1547 _vec_len (event_data) = 0;
1559 .name =
"ip6-full-reassembly-expire-walk",
1571 s =
format (s,
"xx_id: %u, src: %U, dst: %U, frag_id: %u, proto: %u",
1583 s =
format (s,
"ID: %lu, key: %U\n first_bi: %u, data_len: %u, " 1584 "last_packet_octet: %u, trace_op_counter: %u\n",
1594 s =
format (s,
" #%03u: range: [%u, %u], bi: %u, off: %d, len: %u, " 1595 "fragment[%u, %u]\n",
1596 counter, vnb->
ip.reass.range_first,
1597 vnb->
ip.reass.range_last, bi,
1600 vnb->
ip.reass.fragment_first, vnb->
ip.reass.fragment_last);
1601 if (b->
flags & VLIB_BUFFER_NEXT_PRESENT)
1622 bool details =
false;
1628 u32 sum_reass_n = 0;
1629 u64 sum_buffers_n = 0;
1633 for (thread_index = 0; thread_index < nthreads; ++thread_index)
1641 vlib_cli_output (vm,
"%U", format_ip6_full_reass, vm, reass);
1650 (
long unsigned) sum_reass_n);
1651 vlib_cli_output (vm,
"Maximum configured concurrent IP6 reassemblies per " 1652 "worker-thread: %lu\n", (
long unsigned) rm->
max_reass_n);
1654 (
long unsigned) sum_buffers_n);
1660 .path =
"show ip6-full-reassembly",
1661 .short_help =
"show ip6-full-reassembly [details]",
1666 #ifndef CLIB_MARCH_VARIANT 1671 "ip6-full-reassembly-feature",
1672 sw_if_index, enable_disable, 0, 0);
1676 #define foreach_ip6_full_reassembly_handoff_error \ 1677 _(CONGESTION_DROP, "congestion drop") 1682 #define _(sym,str) IP6_FULL_REASSEMBLY_HANDOFF_ERROR_##sym, 1689 #define _(sym,string) string, 1708 format (s,
"ip6-full-reassembly-handoff: next-worker %d",
1722 u32 n_enq, n_left_from, *from;
1731 ti = thread_indices;
1735 while (n_left_from > 0)
1739 reass.owner_feature_thread_index :
vnet_buffer (b[0])->ip.
1740 reass.owner_thread_index;
1744 && (b[0]->
flags & VLIB_BUFFER_IS_TRACED)))
1759 if (n_enq < frame->n_vectors)
1761 IP6_FULL_REASSEMBLY_HANDOFF_ERROR_CONGESTION_DROP,
1776 .name =
"ip6-full-reassembly-handoff",
1777 .vector_size =
sizeof (
u32),
1778 .n_errors =
ARRAY_LEN(ip6_full_reassembly_handoff_error_strings),
1799 .name =
"ip6-full-reass-feature-hoff",
1800 .vector_size =
sizeof (
u32),
1801 .n_errors =
ARRAY_LEN(ip6_full_reassembly_handoff_error_strings),
#define IP6_FULL_REASS_MAX_REASSEMBLIES_DEFAULT
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
vnet_api_error_t ip6_full_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip6 reassembly configuration
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 bool ip6_full_reass_verify_fragment_multiple_8(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
vlib_node_registration_t ip6_full_reassembly_handoff_node
(constructor) VLIB_REGISTER_NODE (ip6_full_reassembly_handoff_node)
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
static u32 ip6_full_reass_buffer_get_data_offset(vlib_buffer_t *b)
ip6_full_reass_trace_operation_e action
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...
void ip6_register_protocol(u32 protocol, u32 node_index)
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
ip6_full_reass_main_t ip6_full_reass_main
static void ip6_full_reass_insert_range_in_chain(vlib_main_t *vm, ip6_full_reass_main_t *rm, ip6_full_reass_per_thread_t *rt, ip6_full_reass_t *reass, u32 prev_range_bi, u32 new_next_bi)
#define pool_alloc(P, N)
Allocate N more free elements to pool (unspecified alignment).
static ip6_full_reass_rc_t ip6_full_reass_update(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_full_reass_main_t *rm, ip6_full_reass_per_thread_t *rt, ip6_full_reass_t *reass, u32 *bi0, u32 *next0, u32 *error0, ip6_frag_hdr_t *frag_hdr, bool is_custom_app, u32 *handoff_thread_idx)
#define clib_memcpy_fast(a, b, c)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
u32 memory_owner_thread_index
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
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 ip6_full_reass_t * ip6_full_reass_find_or_create(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_full_reass_main_t *rm, ip6_full_reass_per_thread_t *rt, ip6_full_reass_kv_t *kv, u32 *icmp_bi, u8 *do_handoff)
static void * ip6_ext_next_header(ip6_ext_header_t *ext_hdr)
static uword ip6_full_reassembly_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature, bool is_custom_app)
static void ip6_full_reass_free_ctx(ip6_full_reass_per_thread_t *rt, ip6_full_reass_t *reass)
#define VLIB_NODE_FN(node)
u32 ip6_full_reass_expire_node_idx
u32 memory_owner_thread_index
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.
vlib_node_registration_t ip6_full_reass_expire_node
(constructor) VLIB_REGISTER_NODE (ip6_full_reass_expire_node)
static bool ip6_full_reass_verify_upper_layer_present(vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static u8 * format_ip6_full_reass_trace(u8 *s, va_list *args)
#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...
struct vnet_buffer_opaque_t::@60::@62 ip
static char * ip6_full_reassembly_error_strings[]
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
u32 expire_walk_interval_ms
vlib_node_registration_t ip6_full_reass_node
(constructor) VLIB_REGISTER_NODE (ip6_full_reass_node)
static void ip6_full_reass_free(ip6_full_reass_main_t *rm, ip6_full_reass_per_thread_t *rt, ip6_full_reass_t *reass)
#define vlib_call_init_function(vm, x)
static void * ip6_ext_header_find(vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6_header, u8 header_type, ip6_ext_header_t **prev_ext_header)
static u32 ip6_full_reass_get_nbuckets()
void icmp6_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
static void clib_spinlock_init(clib_spinlock_t *p)
#define ip6_frag_hdr_more(hdr)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static vlib_cli_command_t show_ip6_full_reassembly_cmd
(constructor) VLIB_CLI_COMMAND (show_ip6_full_reassembly_cmd)
#define IP6_FULL_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT
static u32 vlib_buffer_chain_linearize(vlib_main_t *vm, vlib_buffer_t *b)
static ip6_full_reass_rc_t ip6_full_reass_finalize(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_full_reass_main_t *rm, ip6_full_reass_per_thread_t *rt, ip6_full_reass_t *reass, u32 *bi0, u32 *next0, u32 *error0, bool is_custom_app)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static clib_error_t * show_ip6_full_reass(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
ip6_full_reassembly_handoff_error_t
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static u8 * format_ip6_full_reassembly_handoff_trace(u8 *s, va_list *args)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
ip6_full_reass_trace_operation_e
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 ip6_full_reass_on_timeout(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_full_reass_main_t *rm, ip6_full_reass_t *reass, u32 *icmp_bi)
static char * ip6_full_reassembly_handoff_error_strings[]
u32 node_index
Node 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)
#define VLIB_REGISTER_NODE(x,...)
clib_error_t * ip_main_init(vlib_main_t *vm)
VNET_FEATURE_INIT(ip6_full_reassembly_feature, static)
#define IP6_FULL_REASS_HT_LOAD_FACTOR
ip6_full_reass_range_trace_t trace_range
#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...)
ip6_full_reass_per_thread_t * per_thread_data
static void ip6_full_reass_add_trace(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_full_reass_main_t *rm, ip6_full_reass_t *reass, u32 bi, ip6_full_reass_trace_operation_e action, u32 thread_id_to)
#define ip6_frag_hdr_offset_bytes(hdr)
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.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static u8 ip6_ext_hdr(u8 nexthdr)
vlib_node_registration_t ip6_full_reass_node_feature
(constructor) VLIB_REGISTER_NODE (ip6_full_reass_node_feature)
#define VLIB_CLI_COMMAND(x,...)
u32 fq_index
Worker handoff.
#define ip6_frag_hdr_offset(hdr)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#define IP6_FULL_REASS_TIMEOUT_DEFAULT_MS
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static u16 ip6_full_reass_buffer_get_data_len(vlib_buffer_t *b)
static uword ip6_full_reassembly_handoff_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature)
#define VNET_FEATURES(...)
static u8 * format_ip6_full_reass(u8 *s, va_list *args)
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)
static void ip6_full_reass_drop_all(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_full_reass_main_t *rm, ip6_full_reass_t *reass)
static void ip6_full_reass_trace_details(vlib_main_t *vm, u32 bi, ip6_full_reass_range_trace_t *trace)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 next_buffer
Next buffer for this linked-list of buffers.
#define foreach_ip6_full_reassembly_handoff_error
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vnet_api_error_t ip6_full_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip6 reassembly configuration
#define IP6_FULL_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS
#define foreach_ip6_error
vlib_node_registration_t ip6_full_reassembly_feature_handoff_node
(constructor) VLIB_REGISTER_NODE (ip6_full_reassembly_feature_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)
static void ip6_full_reass_set_params(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
static bool ip6_full_reass_verify_packet_size_lt_64k(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
clib_bihash_48_8_t * new_hash
static u32 vlib_num_workers()
#define vec_foreach(var, vec)
Vector iterator.
vnet_api_error_t ip6_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
u16 flags
Copy of main node flags.
static u8 * format_ip6_full_reass_key(u8 *s, va_list *args)
#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.
static clib_error_t * ip6_full_reass_init_function(vlib_main_t *vm)
static uword ip6_full_reass_walk_expired(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u32 * fib_index_by_sw_if_index
static void ip6_rehash_cb(clib_bihash_kv_48_8_t *kv, void *_ctx)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
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".
static u8 * format_ip6_full_reass_range_trace(u8 *s, va_list *args)