|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
21 #define foreach_state_string_code \
22 _(STATE_DONE, "done") \
23 _(STATE_DISABLED, "disabled") \
24 _(STATE_TIME_WAIT, "time wait") \
25 _(STATE_EVENT_WAIT, "event wait") \
26 _(STATE_ANY_WAIT, "any wait") \
27 _(STATE_POLLING, "polling") \
28 _(STATE_INTERRUPT_WAIT, "interrupt wait") \
29 _(STATE_INTERNAL, "internal")
52 int include_nexts,
int include_stats)
66 for (j = 0; j <
vec_len (node_dups); j++)
81 state_code = STATE_INTERNAL;
93 state_code = STATE_DONE;
97 state_code = STATE_TIME_WAIT;
101 state_code = STATE_EVENT_WAIT;
112 state_code = STATE_POLLING;
113 if (n->
state == VLIB_NODE_STATE_DISABLED)
114 state_code = STATE_DISABLED;
115 else if (n->
state == VLIB_NODE_STATE_INTERRUPT)
116 state_code = STATE_INTERRUPT_WAIT;
123 memcpy (namep, n->
name, name_bytes);
179 _vec_len (nodes_by_thread) = 0;
181 for (
i = 0;
i < nstat_vms;
i++)
189 for (j = 0; j < nnodes; j++)
204 for (k = 0; k < nnexts; k++)
205 node->next_nodes[k] =
214 node->stats_total.clocks = l;
215 node->stats_last_clear.clocks = 0;
219 node->stats_total.calls =
c;
223 node->stats_total.vectors = v;
227 node->stats_total.suspends = d;
231 return nodes_by_thread;
248 u32 max_threads = (
u32) ~ 0;
249 int include_nexts = 0;
250 int include_stats = 0;
254 if (
unformat (input,
"max-threads %d", &max_threads))
273 include_nexts, include_stats);
281 for (
i = 0;
i <
vec_len (nodes_by_thread);
i++)
283 nodes = nodes_by_thread[
i];
287 for (j = 0; j <
vec_len (nodes); j++)
295 (
vm,
" clocks %lld calls %lld suspends"
296 " %lld vectors %lld",
297 node->stats_total.clocks,
298 node->stats_total.calls,
299 node->stats_total.suspends,
node->stats_total.vectors);
303 if (
node->next_nodes[k] != ~0)
305 next_node = nodes[
node->next_nodes[k]];
312 for (j = 0; j <
vec_len (nodes_by_thread); j++)
314 nodes = nodes_by_thread[j];
331 .path =
"test node serialize",
332 .short_help =
"test node serialize [max-threads NN] nexts stats",
333 .function = test_node_serialize_command_fn,
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static void serialize_integer(serialize_main_t *m, u64 x, u32 n_bytes)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
vlib_node_main_t node_main
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
__clib_export void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static vlib_process_t * vlib_get_process_from_node(vlib_main_t *vm, vlib_node_t *node)
static void serialize_likely_small_unsigned_integer(serialize_main_t *m, u64 x)
static void unserialize_integer(serialize_main_t *m, void *x, u32 n_bytes)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
__clib_export void unserialize_cstring(serialize_main_t *m, char **s)
#define vec_free(V)
Free vector's memory (no header).
u8 * vlib_node_serialize(vlib_main_t *vm, vlib_node_t ***node_dups, u8 *vector, int include_nexts, int include_stats)
#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT
__clib_export void * serialize_close_vector(serialize_main_t *m)
vlib_node_stats_t stats_total
#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK
#define foreach_state_string_code
vlib_node_stats_t stats_last_clear
static u64 unserialize_likely_small_unsigned_integer(serialize_main_t *m)
vlib_node_t *** vlib_node_unserialize(u8 *vector)
static char * state_strings[]
#define VLIB_PROCESS_IS_RUNNING
static void * serialize_get(serialize_main_t *m, uword n_bytes)