|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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 +
195 #ifndef CLIB_MARCH_VARIANT
260 trace->range_first = vnb->
ip.reass.range_first;
261 trace->range_last = vnb->
ip.reass.range_last;
264 trace->range_bi = bi;
273 format (s,
"range: [%u, %u], off %d, len %u, bi %u",
trace->range_first,
301 "first bi: %u, data len: %u, ip/fragment[%u, %u]",
341 u32 size_diff,
u32 thread_id_to)
349 b->
flags &= ~VLIB_BUFFER_IS_TRACED;
352 bool is_after_handoff =
false;
355 is_after_handoff =
true;
389 printf (
"%.*s\n",
vec_len (s), s);
411 clib_bihash_add_del_16_8 (&rm->
hash, &kv, 0);
423 while (~0 != range_bi)
432 if (
b->
flags & VLIB_BUFFER_NEXT_PRESENT)
435 b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
442 range_bi = range_vnb->
ip.reass.next_range_bi;
456 while (
vec_len (to_free) > 0 && n_left_to_next > 0)
500 if (!clib_bihash_search_16_8 (&rm->
hash, &kv->
kv, &kv->
kv))
548 int rv = clib_bihash_add_del_16_8 (&rm->
hash, &kv->
kv, 2);
566 u32 * next0,
u32 * error0,
bool is_custom)
571 u32 total_length = 0;
575 u32 tmp_bi = sub_chain_bi;
579 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
580 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
612 if (trim_front >
tmp->current_length)
615 u32 to_be_freed_bi = tmp_bi;
616 trim_front -=
tmp->current_length;
617 if (!(
tmp->flags & VLIB_BUFFER_NEXT_PRESENT))
621 tmp->flags &= ~VLIB_BUFFER_NEXT_PRESENT;
622 tmp_bi =
tmp->next_buffer;
623 tmp->next_buffer = 0;
638 last_b->
flags |= VLIB_BUFFER_NEXT_PRESENT;
642 if (keep_data <= tmp->current_length)
644 tmp->current_length = keep_data;
649 keep_data -=
tmp->current_length;
650 if (!(
tmp->flags & VLIB_BUFFER_NEXT_PRESENT))
655 total_length +=
tmp->current_length;
656 if (
tmp->flags & VLIB_BUFFER_NEXT_PRESENT)
658 tmp_bi =
tmp->next_buffer;
668 u32 to_be_freed_bi = tmp_bi;
673 if (
tmp->flags & VLIB_BUFFER_NEXT_PRESENT)
675 tmp->flags &= ~VLIB_BUFFER_NEXT_PRESENT;
676 tmp_bi =
tmp->next_buffer;
677 tmp->next_buffer = 0;
683 tmp->next_buffer = 0;
693 while (~0 != sub_chain_bi);
699 last_b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
701 if (total_length < first_b->current_length)
706 first_b->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
709 ip->flags_and_fragment_offset = 0;
717 first_b->
flags &= ~VLIB_BUFFER_EXT_HDR_VALID;
733 if (
b->
flags & VLIB_BUFFER_NEXT_PRESENT)
742 printf (
"%.*s\n",
vec_len (s), s);
759 *error0 = IP4_ERROR_NONE;
770 u32 prev_range_bi,
u32 new_next_bi)
774 if (~0 != prev_range_bi)
778 new_next_vnb->
ip.reass.next_range_bi = prev_vnb->
ip.reass.next_range_bi;
779 prev_vnb->
ip.reass.next_range_bi = new_next_bi;
785 new_next_vnb->
ip.reass.next_range_bi = reass->
first_bi;
790 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
791 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
804 u32 prev_range_bi,
u32 discard_bi)
808 if (~0 != prev_range_bi)
812 if (!(prev_vnb->
ip.reass.next_range_bi == discard_bi))
816 prev_vnb->
ip.reass.next_range_bi = discard_vnb->
ip.reass.next_range_bi;
820 reass->
first_bi = discard_vnb->
ip.reass.next_range_bi;
823 if (!(vnb->
ip.reass.range_first >= vnb->
ip.reass.fragment_first) &&
824 !(vnb->
ip.reass.range_last > vnb->
ip.reass.fragment_first))
831 u32 to_be_freed_bi = discard_bi;
837 if (discard_b->
flags & VLIB_BUFFER_NEXT_PRESENT)
839 discard_b->
flags &= ~VLIB_BUFFER_NEXT_PRESENT;
860 u32 * error0,
bool is_custom,
u32 * handoff_thread_idx)
874 const u32 fragment_length =
876 const u32 fragment_last = fragment_first + fragment_length - 1;
877 fvnb->
ip.reass.fragment_first = fragment_first;
878 fvnb->
ip.reass.fragment_last = fragment_last;
881 u32 prev_range_bi = ~0;
882 fvnb->
ip.reass.range_first = fragment_first;
883 fvnb->
ip.reass.range_last = fragment_last;
884 fvnb->
ip.reass.next_range_bi = ~0;
894 prev_range_bi, *bi0);
911 fvnb->
ip.reass.estimated_mtu);
912 while (~0 != candidate_range_bi)
916 if (fragment_first > candidate_vnb->
ip.reass.range_last)
919 prev_range_bi = candidate_range_bi;
920 candidate_range_bi = candidate_vnb->
ip.reass.next_range_bi;
921 if (candidate_vnb->
ip.reass.range_last < fragment_last &&
922 ~0 == candidate_range_bi)
927 prev_range_bi, *bi0);
937 if (fragment_last < candidate_vnb->
ip.reass.range_first)
942 prev_range_bi, *bi0);
951 if (fragment_first >= candidate_vnb->
ip.reass.range_first &&
952 fragment_last <= candidate_vnb->
ip.reass.range_last)
962 int discard_candidate = 0;
963 if (fragment_first < candidate_vnb->
ip.reass.range_first)
966 fragment_last - candidate_vnb->
ip.reass.range_first + 1;
969 candidate_vnb->
ip.reass.range_first += overlap;
993 discard_candidate = 1;
996 else if (fragment_last > candidate_vnb->
ip.reass.range_last)
999 candidate_vnb->
ip.reass.range_last - fragment_first + 1;
1002 fvnb->
ip.reass.range_first += overlap;
1003 if (~0 != candidate_vnb->
ip.reass.next_range_bi)
1005 prev_range_bi = candidate_range_bi;
1006 candidate_range_bi =
1007 candidate_vnb->
ip.reass.next_range_bi;
1027 discard_candidate = 1;
1032 discard_candidate = 1;
1034 if (discard_candidate)
1036 u32 next_range_bi = candidate_vnb->
ip.reass.next_range_bi;
1041 candidate_range_bi);
1046 if (~0 != next_range_bi)
1048 candidate_range_bi = next_range_bi;
1104 *error0 = IP4_ERROR_REASS_DUPLICATE_FRAGMENT;
1131 u32 error0 = IP4_ERROR_NONE;
1148 goto packet_enqueue;
1151 const u32 fragment_length =
1153 const u32 fragment_last = fragment_first + fragment_length - 1;
1154 if (fragment_first > fragment_last || fragment_first + fragment_length > UINT16_MAX - 20 || (fragment_length < 8 &&
ip4_get_fragment_more (ip0)))
1157 error0 = IP4_ERROR_REASS_MALFORMED_PACKET;
1158 goto packet_enqueue;
1178 if (0 == fragment_first)
1192 u32 handoff_thread_idx;
1194 (
vm,
node, rm,
rt, reass, &bi0, &next0,
1195 &error0,
CUSTOM ==
type, &handoff_thread_idx))
1208 IP4_ERROR_REASS_FRAGMENT_CHAIN_TOO_LONG,
1216 IP4_ERROR_REASS_NO_BUF, 1);
1224 IP4_ERROR_REASS_INTERNAL_ERROR,
1235 error0 = IP4_ERROR_REASS_LIMIT_REACHED;
1245 n_left_to_next -= 1;
1249 if (IP4_ERROR_NONE != error0)
1261 reass.owner_thread_index);
1264 else if (
FEATURE ==
type && IP4_ERROR_NONE == error0)
1269 to_next, n_left_to_next,
1283 return frame->n_vectors;
1287 #define _(sym, string) string,
1301 .name =
"ip4-full-reassembly",
1302 .vector_size =
sizeof (
u32),
1326 .name =
"ip4-full-reassembly-feature",
1327 .vector_size =
sizeof (
u32),
1343 .arc_name =
"ip4-unicast",
1344 .node_name =
"ip4-full-reassembly-feature",
1346 "ipsec4-input-feature"),
1360 .name =
"ip4-full-reassembly-custom",
1361 .vector_size =
sizeof (
u32),
1377 .arc_name =
"ip4-unicast",
1378 .node_name =
"ip4-full-reassembly-feature",
1380 "ipsec4-input-feature"),
1386 #ifndef CLIB_MARCH_VARIANT
1403 for (
i = 0;
i < 31;
i++)
1404 if ((1 <<
i) >= nbuckets)
1423 #ifndef CLIB_MARCH_VARIANT
1428 if (clib_bihash_add_del_16_8 (
ctx->new_hash, kv, 1))
1432 return (BIHASH_WALK_CONTINUE);
1437 u32 max_reassembly_length,
1438 u32 expire_walk_interval_ms)
1449 u32 max_reassembly_length,
u32 expire_walk_interval_ms)
1453 max_reassembly_length, expire_walk_interval_ms);
1460 clib_bihash_16_8_t new_hash;
1464 ctx.new_hash = &new_hash;
1465 clib_bihash_init_16_8 (&new_hash,
"ip4-dr", new_nbuckets,
1466 new_nbuckets * 1024);
1471 clib_bihash_free_16_8 (&new_hash);
1487 u32 * max_reassembly_length,
1488 u32 * expire_walk_interval_ms)
1525 clib_bihash_init_16_8 (&rm->
hash,
"ip4-dr", nbuckets, nbuckets * 1024);
1549 uword event_type, *event_data = 0;
1573 int *pool_indexes_to_free = NULL;
1610 _vec_len (event_data) = 0;
1621 .name =
"ip4-full-reassembly-expire-walk",
1635 "xx_id: %u, src: %U, dst: %U, frag_id: %u, proto: %u",
1637 &
key->dst, clib_net_to_host_u16 (
key->frag_id),
key->proto);
1647 s =
format (s,
"ID: %lu, key: %U\n first_bi: %u, data_len: %u, "
1648 "last_packet_octet: %u, trace_op_counter: %u\n",
1661 " #%03u: range: [%u, %u], bi: %u, off: %d, len: %u, "
1662 "fragment[%u, %u]\n", counter, vnb->
ip.reass.range_first,
1663 vnb->
ip.reass.range_last, bi,
1666 vnb->
ip.reass.fragment_first, vnb->
ip.reass.fragment_last);
1667 if (
b->
flags & VLIB_BUFFER_NEXT_PRESENT)
1689 bool details =
false;
1695 u32 sum_reass_n = 0;
1711 sum_reass_n +=
rt->reass_n;
1716 (
long unsigned) sum_reass_n);
1718 "Maximum configured concurrent full IP4 reassemblies per worker-thread: %lu\n",
1721 "Maximum configured amount of fragments "
1722 "per full IP4 reassembly: %lu\n",
1725 "Maximum configured full IP4 reassembly timeout: %lums\n",
1728 "Maximum configured full IP4 reassembly expire walk interval: %lums\n",
1735 .path =
"show ip4-full-reassembly",
1736 .short_help =
"show ip4-full-reassembly [details]",
1741 #ifndef CLIB_MARCH_VARIANT
1746 "ip4-full-reassembly-feature",
1752 #define foreach_ip4_full_reass_handoff_error \
1753 _(CONGESTION_DROP, "congestion drop")
1758 #define _(sym,str) IP4_FULL_REASS_HANDOFF_ERROR_##sym,
1765 #define _(sym,string) string,
1784 format (s,
"ip4-full-reassembly-handoff: next-worker %d",
1808 ti = thread_indices;
1832 && (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)))
1844 thread_indices,
frame->n_vectors, 1);
1848 IP4_FULL_REASS_HANDOFF_ERROR_CONGESTION_DROP,
1849 frame->n_vectors - n_enq);
1850 return frame->n_vectors;
1863 .name =
"ip4-full-reassembly-handoff",
1864 .vector_size =
sizeof (
u32),
1891 .name =
"ip4-full-reass-feature-hoff",
1892 .vector_size =
sizeof (
u32),
1918 .name =
"ip4-full-reass-custom-hoff",
1919 .vector_size =
sizeof (
u32),
1932 #ifndef CLIB_MARCH_VARIANT
1944 "ip4-full-reassembly-feature",
1954 "ip4-full-reassembly-feature",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static void clib_spinlock_init(clib_spinlock_t *p)
u32 next_buffer
Next buffer for this linked-list of buffers.
static u32 ip4_full_reass_get_nbuckets()
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_node_type_t
vlib_node_registration_t ip4_full_reass_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_node)
static u32 vlib_num_workers()
uword ip4_full_reass_custom_register_next_node(uword node_index)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
ip4_full_reass_per_thread_t * per_thread_data
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
static_always_inline u32 vlib_buffer_enqueue_to_thread(vlib_main_t *vm, vlib_node_runtime_t *node, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
ip4_full_reass_trace_operation_e action
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define clib_memcpy(d, s, n)
nat44_ei_hairpin_src_next_t next_index
vlib_node_registration_t ip4_full_reass_node_feature
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_node_feature)
ip4_main_t ip4_main
Global ip4 main structure.
int ip4_full_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
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, u32 *handoff_thread_idx)
vlib_node_registration_t ip4_full_reass_expire_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_expire_node)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static vlib_cli_command_t show_ip4_full_reass_cmd
(constructor) VLIB_CLI_COMMAND (show_ip4_full_reass_cmd)
vlib_get_buffers(vm, from, b, n_left_from)
static u8 * format_ip4_full_reass_trace(u8 *s, va_list *args)
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)
vlib_main_t vlib_node_runtime_t * node
VNET_FEATURE_INIT(ip4_full_reass_feature, static)
static int ip4_rehash_cb(clib_bihash_kv_16_8_t *kv, void *_ctx)
#define IP4_REASS_MAX_REASSEMBLIES_DEFAULT
static int ip4_get_fragment_offset_bytes(const ip4_header_t *i)
clib_bihash_16_8_t * new_hash
@ IP4_FULL_REASS_NEXT_HANDOFF
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void ip4_full_reass_trace_details(vlib_main_t *vm, u32 bi, ip4_full_reass_range_trace_t *trace)
static u32 vlib_buffer_get_trace_thread(vlib_buffer_t *b)
Extract the thread id from a trace handle.
u32 expire_walk_interval_ms
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
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
@ IP4_FULL_REASS_NEXT_INPUT
vlib_node_registration_t ip4_full_reass_feature_handoff_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_feature_handoff_node)
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
ip4_full_reass_handoff_error_t
struct vnet_buffer_opaque_t::@157::@159 ip
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define vec_elt(v, i)
Get vector value at index i.
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
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,...
#define pool_foreach(VAR, POOL)
Iterate through pool.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define IP4_REASS_TIMEOUT_DEFAULT_MS
#define foreach_ip4_full_reass_handoff_error
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
@ IP4_REASS_RC_TOO_MANY_FRAGMENTS
static u8 * format_ip4_full_reass_range_trace(u8 *s, va_list *args)
#define VLIB_NODE_FLAG_TRACE
vlib_node_registration_t ip4_full_reass_handoff_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_handoff_node)
static u8 * format_ip4_full_reass_key(u8 *s, va_list *args)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void ip4_full_reass_free_ctx(ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
ip4_full_reass_trace_operation_e
static u16 ip4_get_fragment_offset(const ip4_header_t *i)
static clib_error_t * show_ip4_reass(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
__clib_export void clib_bihash_copied(void *dst, void *src)
@ IP4_FULL_REASS_NEXT_DROP
u32 * feature_use_refcount_per_intf
static char * ip4_full_reass_error_strings[]
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
u32 memory_owner_thread_index
static u32 ip4_full_reass_buffer_get_data_offset(vlib_buffer_t *b)
sll srl srl sll sra u16x4 i
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static u8 * format_ip4_reass(u8 *s, va_list *args)
#define VLIB_CLI_COMMAND(x,...)
@ IP4_REASS_RC_INTERNAL_ERROR
vnet_api_error_t ip4_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
static uword ip4_full_reass_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip4_full_reass_node_type_t type)
static u32 vlib_buffer_chain_linearize(vlib_main_t *vm, vlib_buffer_t *b)
u32 memory_owner_thread_index
#define vec_pop(V)
Returns last element of a vector and decrements its length.
static uword ip4_full_reass_walk_expired(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
struct _vlib_node_registration vlib_node_registration_t
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u16 current_length
Nbytes between current data and the end of this buffer.
static u16 ip4_full_reass_buffer_get_data_len(vlib_buffer_t *b)
static u16 ip4_get_fragment_more(const ip4_header_t *i)
#define IP4_REASS_DEBUG_BUFFER(...)
@ IP4_EVENT_CONFIG_CHANGED
static u8 * format_ip4_full_reass_handoff_trace(u8 *s, va_list *args)
#define IP4_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS
static char * ip4_full_reass_handoff_error_strings[]
#define vec_free(V)
Free vector's memory (no header).
#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.
static void ip4_full_reass_init(ip4_full_reass_t *reass)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
vlib_node_registration_t ip4_full_reass_custom_handoff_node
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_custom_handoff_node)
#define pool_foreach_index(i, v)
static void ip4_full_reass_set_params(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
vlib_trace_header_t ** trace_buffer_pool
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...
description fragment has unexpected format
static uword ip4_full_reass_handoff_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip4_full_reass_node_type_t type)
#define IP4_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
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)
ip4_full_reass_main_t ip4_full_reass_main
u32 fq_index
Worker handoff.
u32 ip4_full_reass_expire_node_idx
#define vec_foreach(var, vec)
Vector iterator.
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
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)
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)
#define foreach_ip4_error
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static vlib_main_t * vlib_get_main(void)
#define VNET_FEATURES(...)
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)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_interface_output_runtime_t * rt
static u16 ip4_header_checksum(ip4_header_t *i)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
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 clib_warning(format, args...)
#define pool_alloc(P, N)
Allocate N more free elements to pool (unspecified alignment).
static clib_error_t * ip4_full_reass_init_function(vlib_main_t *vm)
static int ip4_header_bytes(const ip4_header_t *i)
@ IP4_FULL_REASS_HANDOFF_N_ERROR
static void vlib_buffer_free_one(vlib_main_t *vm, u32 buffer_index)
Free one buffer Shorthand to free a single buffer chain.
static f64 vlib_time_now(vlib_main_t *vm)
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
ip4_full_reass_range_trace_t trace_range
vlib_trace_main_t trace_main
static u32 vlib_buffer_get_trace_index(vlib_buffer_t *b)
Extract the trace (pool) index from a trace handle.
#define IP4_REASS_HT_LOAD_FACTOR
vl_api_mac_event_action_t action
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
vl_api_interface_index_t sw_if_index
#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).
vlib_node_registration_t ip4_full_reass_node_custom
(constructor) VLIB_REGISTER_NODE (ip4_full_reass_node_custom)
vl_api_fib_path_type_t type
static void ip4_full_reass_free(ip4_full_reass_main_t *rm, ip4_full_reass_per_thread_t *rt, ip4_full_reass_t *reass)
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,...)