|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
22 int verbose = va_arg (*args,
int);
23 session_event_t _e, *e = &_e;
30 if (verbose > 2 && ss->
rx_fifo->shr->has_event)
33 s =
format (s,
" session node event: %s\n",
34 found ?
"found" :
"not found");
37 if (verbose > 2 && ss->
tx_fifo->shr->has_event)
40 s =
format (s,
" session node event: %s\n",
41 found ?
"found" :
"not found");
47 #define _(sym, str) str,
66 #define _(sym, str) str,
104 int verbose = va_arg (*args,
int);
120 str =
format (0,
"%-10u%-10u", rxf, txf);
129 s =
format (s,
"%v", str);
133 s =
format (s,
" session: state: %U opaque: 0x%x flags: %U\n",
147 if (ss->
flags & SESSION_F_HALF_OPEN)
167 u32 *fib_index = va_arg (*args,
u32 *);
168 ip46_address_t *lcl = va_arg (*args, ip46_address_t *);
169 ip46_address_t *rmt = va_arg (*args, ip46_address_t *);
170 u16 *lcl_port = va_arg (*args,
u16 *);
171 u16 *rmt_port = va_arg (*args,
u16 *);
172 u8 *is_ip4 = va_arg (*args,
u8 *);
181 *
proto = TRANSPORT_PROTO_TCP;
185 *
proto = TRANSPORT_PROTO_UDP;
190 if (
unformat (input,
"vrf %u", &vrf))
223 #define _(sym, str) \
224 if (unformat (input, str)) \
226 *state = SESSION_STATE_ ## sym; \
241 u32 lcl_port = 0, rmt_port = 0, fib_index = 0;
242 ip46_address_t lcl, rmt;
248 &lcl, &rmt, &lcl_port, &rmt_port, &is_ip4))
253 clib_host_to_net_u16 (lcl_port),
254 clib_host_to_net_u16 (rmt_port),
proto);
257 clib_host_to_net_u16 (lcl_port),
258 clib_host_to_net_u16 (rmt_port),
proto);
272 u32 suggested_proto = va_arg (*args,
u32);
275 ip46_address_t lcl, rmt;
276 u32 lcl_port = 0, rmt_port = 0, fib_index = 0;
280 &lcl, &rmt, &lcl_port, &rmt_port, &is_ip4))
288 clib_host_to_net_u16 (lcl_port),
289 clib_host_to_net_u16 (rmt_port),
proto);
292 clib_host_to_net_u16 (lcl_port),
293 clib_host_to_net_u16 (rmt_port),
proto);
330 "suppressed. For more details use filters.",
339 "Connection",
"State",
"Rx-f",
"Tx-f");
371 goto check_transport;
388 u8 output_suppressed = 0;
404 && (start == 0 &&
end == ~0))
424 if (
count > 50 || (verbose > 1 &&
count > 10))
426 output_suppressed = 1;
435 if (!output_suppressed)
480 #define _(sym, str) vlib_cli_output (vm, str);
489 u8 one_session = 0, do_listeners = 0, sst, do_elog = 0, do_filter = 0;
513 if (
unformat (line_input,
"verbose %d", &verbose))
515 else if (
unformat (line_input,
"verbose"))
545 else if (
unformat (line_input,
"proto %U index %u",
562 "thread %u does not exist", transport_index,
571 else if (
unformat (line_input,
"range %u %u", &start, &
end))
573 else if (
unformat (line_input,
"range %u", &start))
578 else if (
unformat (line_input,
"elog"))
580 else if (
unformat (line_input,
"protos"))
585 else if (
unformat (line_input,
"states"))
590 else if (
unformat (line_input,
"events"))
613 if (track_index != ~0)
672 .path =
"show session",
673 .short_help =
"show session [verbose [n]] [listeners <proto>] "
674 "[<session-id> [elog]] [thread <n> [index <n>] "
675 "[proto <proto>] [state <state>] [range <min> [<max>]] "
676 "[protos] [states] ",
696 u32 session_index = ~0;
708 else if (
unformat (input,
"session %d", &session_index))
717 if (!clear_all && session_index == ~0)
720 if (session_index != ~0)
747 .path =
"clear session",
748 .short_help =
"clear session thread <thread> session <index>",
759 u8 is_rx = 0, *str = 0;
797 .path =
"show session fifo trace",
798 .short_help =
"show session fifo trace <session>",
808 u8 is_rx = 0, *str = 0;
844 .path =
"session replay fifo",
845 .short_help =
"session replay fifo <session>",
863 if (
unformat (line_input,
"enable"))
865 else if (
unformat (line_input,
"disable"))
884 .short_help =
"session [enable|disable]",
transport_connection_t * session_lookup_connection6(u32 fib_index, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup connection with ip6 and transport layer information.
#define SESSION_CLI_STATE_LEN
u8 * format_session_flags(u8 *s, va_list *args)
static clib_error_t * clear_session_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define foreach_session_state
u32 session_index
Index in thread pool where session was allocated.
#define SESSION_CLI_ID_LEN
static clib_error_t * session_replay_fifo_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 * svm_fifo_dump_trace(u8 *s, svm_fifo_t *f)
elog_time_stamp_t init_time
Timestamps.
#define clib_error_return(e, args...)
static session_worker_t * session_main_get_worker_if_valid(u32 thread_index)
vlib_cli_command_t vlib_cli_show_session_command
(constructor) VLIB_CLI_COMMAND (vlib_cli_show_session_command)
u8 thread_index
Index of the thread that allocated the session.
session_type_t session_type
Type built from transport and network protocol types.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define clib_llist_elts(LP)
Get number of elements in supporting container.
vl_api_dhcp_client_state_t state
u8 session_node_lookup_fifo_event(svm_fifo_t *f, session_event_t *e)
u8 * format_session_state(u8 *s, va_list *args)
uword unformat_transport_connection(unformat_input_t *input, va_list *args)
struct _transport_connection transport_connection_t
transport_connection_t * session_lookup_connection4(u32 fib_index, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup connection with ip4 and transport layer information.
static clib_error_t * show_session_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
session_worker_t * wrk
Worker contexts.
session_t * session_lookup_safe6(u32 fib_index, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup session with ip6 and transport layer information.
uword unformat_session(unformat_input_t *input, va_list *args)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
u8 * svm_fifo_replay(u8 *s, svm_fifo_t *f, u8 no_read, u8 verbose)
u32 app_wrk_index
Index of the app worker that owns the session.
#define pool_foreach(VAR, POOL)
Iterate through pool.
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
uword unformat_transport_proto(unformat_input_t *input, va_list *args)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static void session_cli_print_session_states(vlib_main_t *vm)
u64 cpu
CPU cycle counter.
transport_connection_t * session_get_transport(session_t *s)
static vlib_cli_command_t show_session_fifo_trace_command
(constructor) VLIB_CLI_COMMAND (show_session_fifo_trace_command)
#define TRANSPORT_PROTO_INVALID
int app_worker_close_notify(app_worker_t *app_wrk, session_t *s)
static vlib_cli_command_t session_enable_disable_command
(constructor) VLIB_CLI_COMMAND (session_enable_disable_command)
static void session_cli_show_events(vlib_main_t *vm, u32 thread_index)
f64 end
end of the time range
vlib_global_main_t vlib_global_main
const char * session_flags_str[]
uword unformat_session_state(unformat_input_t *input, va_list *args)
static heap_elt_t * last(heap_header_t *h)
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
session_t * session_lookup_safe4(u32 fib_index, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup session with ip4 and transport layer information.
static int session_cli_filter_check(session_t *s, session_state_t *states, transport_proto_t tp)
session_main_t session_main
void session_cli_show_events_thread(vlib_main_t *vm, u32 thread_index)
#define VLIB_CLI_COMMAND(x,...)
u8 is_enabled
Session manager is enabled.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
uword unformat_stream_session_id(unformat_input_t *input, va_list *args)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u8 * format_transport_half_open_connection(u8 *s, va_list *args)
__clib_export u8 * format_elog_track(u8 *s, va_list *args)
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
session_evt_elt_t * event_elts
Pool of session event list elements.
#define vec_free(V)
Free vector's memory (no header).
#define pool_len(p)
Number of elements in pool vector.
description fragment has unexpected format
static clib_error_t * session_enable_disable_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static session_t * session_get_if_valid(u64 si, u32 thread_index)
u32 opaque
Opaque, for general use.
static vlib_cli_command_t session_replay_fifo_trace_command
(constructor) VLIB_CLI_COMMAND (session_replay_fifo_trace_command)
u8 * format_transport_listen_connection(u8 *s, va_list *args)
enum _transport_proto transport_proto_t
u8 * format_transport_connection(u8 *s, va_list *args)
app_worker_t * app_worker_get(u32 wrk_index)
#define vec_foreach(var, vec)
Vector iterator.
static uword pool_elts(void *v)
Number of active elements in a pool.
const u8 * application_name_from_index(u32 app_index)
Returns app name for app-index.
session_t * sessions
Worker session pool.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static transport_proto_t session_get_transport_proto(session_t *s)
static transport_connection_t * transport_get_connection(transport_proto_t tp, u32 conn_index, u8 thread_index)
session_evt_ctrl_data_t * ctrl_evts_data
Pool of ctrl events data buffers.
static u32 transport_elog_track_index(transport_connection_t *tc)
#define clib_warning(format, args...)
u8 * format_transport_protos(u8 *s, va_list *args)
static void session_pool_remove_peeker(u32 thread_index)
static int clear_session(session_t *s)
format_function_t format_svm_fifo
static void session_cli_show_all_sessions(vlib_main_t *vm, int verbose)
u32 app_index
Index of owning app.
#define session_cli_return_if_not_enabled()
static void session_cli_show_session_filter(vlib_main_t *vm, u32 thread_index, u32 start, u32 end, session_state_t *states, transport_proto_t tp, int verbose)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
const char * session_state_str[]
u8 * format_session_fifos(u8 *s, va_list *args)
volatile u8 session_state
State in session layer state machine.
u32 connection_index
Index of the transport connection associated to the session.
static clib_error_t * show_session_fifo_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_cli_command_t clear_session_command
(constructor) VLIB_CLI_COMMAND (clear_session_command)
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
Fifo max bytes to dequeue.
u8 * format_session(u8 *s, va_list *args)
Format stream session as per the following format.