|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
36 session->session_index = session - em->
sessions;
60 CHECK_SAME (ECHO_FAIL_TEST_ASSERT_ALL_SESSIONS_CLOSED,
62 "Some sessions are still open");
73 s->rx_fifo->shr->master_session_index,
75 ECHO_FAIL (ECHO_FAIL_SEND_IO_EVT,
"app_send_io_evt_to_vpp errored %d",
98 ECHO_FAIL (ECHO_FAIL_SOCKET_CONNECT,
"socket connect failed");
104 ECHO_FAIL (ECHO_FAIL_INIT_SHM_API,
"init shm api failed");
112 ECHO_FAIL (ECHO_FAIL_SHMEM_CONNECT,
"shmem connect failed");
131 f64 deltat = start_evt_missing || end_evt_missing ? 0 :
134 if (start_evt_missing)
135 ECHO_FAIL (ECHO_FAIL_MISSING_START_EVENT,
136 "Expected event %v to happen, but it did not!", start_evt);
140 "Expected event %v to happen, but it did not!", end_evt);
142 fformat (stdout,
"vpp_echo JSON stats:\n{\n");
143 fformat (stdout,
" \"role\": \"%s\",\n",
145 fformat (stdout,
" \"time\": \"%.9f\",\n", deltat);
146 fformat (stdout,
" \"start_evt\": \"%v\",\n", start_evt);
147 fformat (stdout,
" \"start_evt_missing\": \"%s\",\n",
148 start_evt_missing ?
"True" :
"False");
149 fformat (stdout,
" \"end_evt\": \"%v\",\n", end_evt);
150 fformat (stdout,
" \"end_evt_missing\": \"%s\",\n",
151 end_evt_missing ?
"True" :
"False");
154 fformat (stdout,
" \"rx_bits_per_second\": %.1f,\n",
156 fformat (stdout,
" \"tx_bits_per_second\": %.1f,\n",
158 fformat (stdout,
" \"closing\": {\n");
159 fformat (stdout,
" \"reset\": { \"q\": %d, \"s\": %d },\n",
161 fformat (stdout,
" \"recv evt\": { \"q\": %d, \"s\": %d },\n",
163 fformat (stdout,
" \"send evt\": { \"q\": %d, \"s\": %d },\n",
165 fformat (stdout,
" \"clean\": { \"q\": %d, \"s\": %d },\n",
167 fformat (stdout,
" \"accepted\": { \"q\": %d, \"s\": %d },\n",
169 fformat (stdout,
" \"connected\": { \"q\": %d, \"s\": %d }\n",
172 fformat (stdout,
" \"results\": {\n");
192 f64 deltat = start_evt_missing || end_evt_missing ? 0 :
195 if (start_evt_missing)
196 ECHO_FAIL (ECHO_FAIL_MISSING_START_EVENT,
197 "Expected event %v to happen, but it did not!", start_evt);
201 "Expected event %v to happen, but it did not!", end_evt);
203 fformat (stdout,
"Timing %v:%v\n", start_evt, end_evt);
204 if (start_evt_missing)
205 fformat (stdout,
"Missing Start Timing Event (%v)!\n", start_evt);
207 fformat (stdout,
"Missing End Timing Event (%v)!\n", end_evt);
208 fformat (stdout,
"-------- TX --------\n");
209 fformat (stdout,
"%lld bytes (%lld mbytes, %lld gbytes) in %.6f seconds\n",
213 fformat (stdout,
"%.4f Gbit/second\n",
215 fformat (stdout,
"-------- RX --------\n");
216 fformat (stdout,
"%lld bytes (%lld mbytes, %lld gbytes) in %.6f seconds\n",
220 fformat (stdout,
"%.4f Gbit/second\n",
222 fformat (stdout,
"--------------------\n");
223 fformat (stdout,
"Received close on %d streams (and %d Quic conn)\n",
225 fformat (stdout,
"Received reset on %d streams (and %d Quic conn)\n",
227 fformat (stdout,
"Sent close on %d streams (and %d Quic conn)\n",
229 fformat (stdout,
"Discarded %d streams (and %d Quic conn)\n",
231 fformat (stdout,
"--------------------\n");
232 fformat (stdout,
"Got accept on %d streams (and %d Quic conn)\n",
234 fformat (stdout,
"Got connected on %d streams (and %d Quic conn)\n",
247 ECHO_LOG (2,
"[%lu/%lu] -> %U -> [%lu/%lu]",
270 s->rx_fifo->segment_index);
287 u32 *session_indexes = 0, *session_index;
293 vec_add1 (session_indexes, s->session_index);
314 for (
i = 0;
i < n_read;
i++)
319 ECHO_LOG (1,
"Session 0x%lx byte %lld was 0x%x expected 0x%x",
324 ECHO_LOG (1,
"Too many errors, hiding next ones");
326 ECHO_FAIL (ECHO_FAIL_TEST_BYTES_ERR,
"test-bytes errored");
343 s->bytes_received += n_read;
344 s->bytes_to_receive -= n_read;
356 if (!bytes_this_chunk)
362 s->bytes_to_send -= n_sent;
363 s->bytes_sent += n_sent;
372 while (n_sent < len && !em->time_to_stop)
384 ECHO_LOG (3,
"%U: listener_index == SESSION_INVALID_INDEX",
391 ECHO_LOG (3,
"%U: ls->session_state (%d) < "
392 "ECHO_SESSION_STATE_CLOSING (%d)",
410 int n_read, n_sent = 0;
447 if (n_sent || n_read)
454 ECHO_LOG (2,
"Idle FIFOs TX:%dB RX:%dB",
473 ECHO_LOG (2,
"Thread %u exiting, no sessions to care for", idx);
479 u32 n_closed_sessions = 0;
487 n_closed_sessions =
i == 0 ? 0 : n_closed_sessions;
492 switch (s->session_state)
516 if (n_closed_sessions == thread_n_sessions)
519 ECHO_LOG (2,
"Mission accomplished!");
546 clib_net_to_host_u32 (mp->
retval));
551 clib_net_to_host_u16 (mp->
lcl_port));
575 ECHO_FAIL (ECHO_FAIL_SESSION_ACCEPTED_BAD_LISTENER,
587 ECHO_FAIL (ECHO_FAIL_ACCEPTED_WAIT_FOR_SEG_ALLOC,
588 "accepted wait_for_segment_allocation errored");
596 sizeof (ip46_address_t));
597 session->transport.is_ip4 = mp->
rmt.is_ip4;
598 session->transport.rmt_port = mp->
rmt.port;
600 sizeof (ip46_address_t));
608 ECHO_LOG (2,
"Accepted session 0x%lx S[%u] -> 0x%lx S[%u]",
609 mp->
handle, session->session_index,
646 ECHO_FAIL (ECHO_FAIL_CONNECTED_WAIT_FOR_SEG_ALLOC,
647 "connected wait_for_segment_allocation errored");
656 sizeof (ip46_address_t));
657 session->transport.is_ip4 = mp->
lcl.is_ip4;
658 session->transport.lcl_port = mp->
lcl.port;
660 sizeof (ip46_address_t));
665 session->session_index, 0 );
688 ECHO_LOG (2,
"%U: already in ECHO_SESSION_STATE_CLOSED",
737 if (mp->
fd_flags & SESSION_FD_F_MEMFD_SEGMENT)
743 "vl_socket_client_recv_fd_msg failed");
750 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
751 "svm_fifo_segment_attach ('%s') "
752 "failed on SSVM_SEGMENT_MEMFD", seg_name);
760 a->segment_name = seg_name;
765 ECHO_FAIL (ECHO_FAIL_VL_API_FIFO_SEG_ATTACH,
766 "fifo_segment_attach ('%s') failed", seg_name);
770 ECHO_LOG (2,
"Mapped segment 0x%lx", segment_handle);
795 switch (e->event_type)
823 ECHO_LOG (1,
"unhandled event %u", e->event_type);
854 if (delta < em->periodic_stats_delta)
892 ECHO_FAIL (ECHO_FAIL_APP_ATTACH,
"Application failed to attach");
937 while (ipu8[l] == 0xf)
970 ip46_address_t _ip, *
ip = &_ip;
971 u32 *listen_session_index;
991 ECHO_FAIL (ECHO_FAIL_SERVER_DISCONNECT_TIMEOUT,
992 "Timeout waiting for state disconnected");
1003 "Usage: vpp_echo [socket-name SOCKET] [client|server] [uri URI] [OPTIONS]\n"
1004 "Generates traffic and assert correct teardown of the hoststack\n"
1006 " socket-name PATH Specify the binary socket path to connect to VPP\n"
1007 " use-svm-api Use SVM API to connect to VPP\n"
1008 " test-bytes[:assert] Check data correctness when receiving (assert fails on first error)\n"
1009 " fifo-size N[K|M|G] Use N[K|M|G] fifos\n"
1010 " mq-size N Use mq with N slots for [vpp_echo->vpp] communication\n"
1011 " max-sim-connects N Do not allow more than N mq events inflight\n"
1012 " rx-buf N[K|M|G] Use N[Kb|Mb|GB] RX buffer\n"
1013 " tx-buf N[K|M|G] Use N[Kb|Mb|GB] TX test buffer\n"
1014 " appns NAMESPACE Use the namespace NAMESPACE\n"
1015 " all-scope all-scope option\n"
1016 " local-scope local-scope option\n"
1017 " global-scope global-scope option\n"
1018 " secret SECRET set namespace secret\n"
1019 " chroot prefix PATH Use PATH as memory root path\n"
1020 " sclose=[Y|N|W] When stream is done, send[Y]|nop[N]|wait[W] for close\n"
1021 " nuris N Cycle through N consecutive (src&dst) ips when creating connections\n"
1022 " lcl IP Set the local ip to use as a client (use with nuris to set first src ip)\n"
1024 " time START:END Time between evts START & END, events being :\n"
1025 " start - Start of the app\n"
1026 " qconnect - first Connection connect sent\n"
1027 " qconnected - last Connection connected\n"
1028 " sconnect - first Stream connect sent\n"
1029 " sconnected - last Stream got connected\n"
1030 " lastbyte - Last expected byte received\n"
1031 " exit - Exiting of the app\n"
1032 " rx-results-diff Rx results different to pass test\n"
1033 " tx-results-diff Tx results different to pass test\n"
1034 " json Output global stats in json\n"
1035 " stats N Output stats evry N secs\n"
1036 " log=N Set the log level to [0: no output, 1:errors, 2:log]\n"
1037 " crypto [engine] Set the crypto engine [openssl, vpp, picotls, mbedtls]\n"
1039 " nclients N Open N clients sending data\n"
1040 " nthreads N Use N busy loop threads for data [in addition to main & msg queue]\n"
1041 " TX=1337[K|M|G]|RX Send 1337 [K|M|G]bytes, use TX=RX to reflect the data\n"
1042 " RX=1337[K|M|G] Expect 1337 [K|M|G]bytes\n" "\n");
1049 fprintf (stderr,
"\nDefault configuration is :\n"
1050 " server nclients 1 [quic-streams 1] RX=64Kb TX=RX\n"
1051 " client nclients 1 [quic-streams 1] RX=64Kb TX=64Kb\n");
1052 exit (ECHO_FAIL_USAGE);
1089 u8 default_f_active;
1097 else if (
unformat (
a,
"chroot prefix %s", &chroot_prefix))
1109 else if (
unformat (
a,
"test-bytes:assert"))
1119 if (
tmp >= 0x100000000ULL)
1122 "ERROR: fifo-size %ld (0x%lx) too large\n",
tmp,
tmp);
1149 em->
appns_flags |= (APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE
1150 | APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE);
1152 em->
appns_flags = APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
1154 em->
appns_flags = APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
1164 else if (
unformat (
a,
"rx-results-diff"))
1222 volatile u64 nop = 0;
1249 ECHO_FAIL (ECHO_FAIL_INVALID_URI,
"Unable to process uri");
1254 static void __clib_constructor
1271 u32 rpc_queue_size = 256 << 10;
1299 em->
uri =
format (0,
"%s%c",
"tcp://0.0.0.0/1234", 0);
1310 ECHO_FAIL (ECHO_FAIL_PROTOCOL_NOT_SUPPORTED,
1311 "Protocol %U is not supported",
1337 cfg->consumer_pid = getpid ();
1339 cfg->q_nitems = rpc_queue_size;
1340 cfg->ring_cfgs = rc;
1348 app_name = em->i_am_master ?
"echo_server" :
"echo_client";
1352 ECHO_FAIL (ECHO_FAIL_CONNECT_TO_VPP,
"Couldn't connect to vpp");
1363 "Couldn't attach to vpp, did you run <session enable> ?");
1367 if (em->uri_elts.transport_proto != TRANSPORT_PROTO_QUIC
1368 && em->uri_elts.transport_proto != TRANSPORT_PROTO_TLS)
1378 "Couldn't add crypto context to vpp\n");
1383 if (pthread_create (&em->mq_thread_handle,
1386 ECHO_FAIL (ECHO_FAIL_PTHREAD_CREATE,
"pthread create errored");
1390 for (
i = 0;
i < em->n_rx_threads;
i++)
1391 if (pthread_create (&em->data_thread_handles[
i],
1395 "pthread create errored (index %d)",
i);
1398 if (em->i_am_master)
1407 ECHO_FAIL (ECHO_FAIL_DEL_CERT_KEY,
"Couldn't cleanup cert and key");
1414 ECHO_FAIL (ECHO_FAIL_DETACH,
"Couldn't detach from vpp");
1418 pthread_join (em->mq_thread_handle, (
void **) &
rv);
1421 ECHO_FAIL (ECHO_FAIL_MQ_PTHREAD,
"mq pthread errored %d",
rv);
1424 if (em->use_sock_api)
1431 if (em->output_json)
1436 vec_free (em->available_proto_cb_vft);
1437 exit (em->has_failed);
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static u32 svm_msg_q_size(svm_msg_q_t *mq)
Check length of message queue.
static void clib_spinlock_init(clib_spinlock_t *p)
static u8 svm_fifo_set_event(svm_fifo_t *f)
Set fifo event flag.
static void session_disconnected_handler(session_disconnected_msg_t *mp)
static int recv_data_chunk(echo_main_t *em, echo_session_t *s, u8 *rx_buf)
static void handle_mq_event(session_event_t *e)
void svm_region_exit(void)
int echo_segment_attach(u64 segment_handle, char *name, ssvm_segment_type_t type, int fd)
u32 *volatile data_thread_args
description security check failed
static void * echo_mq_thread_fn(void *arg)
int echo_attach_session(uword segment_handle, uword rxf_offset, uword txf_offset, uword mq_offset, echo_session_t *s)
clib_error_t * vl_socket_client_recv_fd_msg(int fds[], int n_fds, u32 wait)
int main(int argc, char **argv)
#define ECHO_FAIL(fail, _fmt, _args...)
echo_session_t * sessions
void echo_api_hookup(echo_main_t *em)
@ SESSION_CTRL_EVT_CONNECTED
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void(* reset_cb)(session_reset_msg_t *mp, echo_session_t *s)
@ SESSION_CTRL_EVT_DISCONNECTED
#define clib_atomic_add_fetch(a, b)
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queue.
echo_proto_cb_vft_t ** available_proto_cb_vft
#define LOG_EVERY_N_IDLE_CYCLES
static u8 svm_fifo_needs_deq_ntf(svm_fifo_t *f, u32 n_last_deq)
Check if fifo needs dequeue notification.
u8 * echo_format_session_state(u8 *s, va_list *args)
static void session_unlisten_handler(session_unlisten_reply_msg_t *mp)
static void echo_session_prealloc(echo_main_t *em)
uword vpp_event_queue_address
@ ECHO_EVT_FIRST_QCONNECT
static void echo_set_each_proto_defaults_before_opts(echo_main_t *em)
volatile connection_state_t state
#define SESSION_INVALID_INDEX
static void session_accepted_handler(session_accepted_msg_t *mp)
#define pool_put(P, E)
Free an object E in pool P.
static int app_send_io_evt_to_vpp(svm_msg_q_t *mq, u32 session_index, u8 evt_type, u8 noblock)
Send fifo io event to vpp worker thread.
void vl_client_disconnect_from_vlib(void)
static void del_segment_handler(session_app_del_segment_msg_t *mp)
svm_msg_q_shared_t * svm_msg_q_alloc(svm_msg_q_cfg_t *cfg)
Allocate message queue.
@ ECHO_SESSION_STATE_READY
static void clib_mem_set_thread_index(void)
#define hash_create(elts, value_bytes)
volatile u64 bytes_received
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static void session_bound_handler(session_bound_msg_t *mp)
static void clients_run(echo_main_t *em)
static void app_send_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt)
#define CHECK_SAME(fail, expected, result, _fmt, _args...)
static int app_recv(app_session_t *s, u8 *data, u32 len)
void(* connected_cb)(session_connected_bundled_msg_t *mp, u32 session_index, u8 is_failed)
@ ECHO_SESSION_TYPE_LISTEN
int vl_socket_client_connect(char *socket_path, char *client_name, u32 socket_buffer_size)
static void __clib_constructor vpp_echo_init()
fifo_segment_main_t segment_main
__clib_export void clib_time_init(clib_time_t *c)
foreach_app_session_field u64 vpp_session_handle
static int send_data_chunk(echo_session_t *s, u8 *tx_buf, int offset, int len)
uword * session_index_by_vpp_handles
static void echo_process_rpcs(echo_main_t *em)
data_source_t data_source
echo_stats_t last_stat_sampling
@ ECHO_SESSION_STATE_AWAIT_CLOSING
static void session_connected_handler(session_connected_msg_t *mp)
static u8 svm_msg_q_is_empty(svm_msg_q_t *mq)
Check if message queue is empty.
int echo_send_rpc(echo_main_t *em, void *fp, echo_rpc_args_t *args)
void(* accepted_cb)(session_accepted_msg_t *mp, echo_session_t *session)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static void * echo_data_thread_fn(void *arg)
void echo_send_detach(echo_main_t *em)
echo_proto_cb_vft_t * proto_cb_vft
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
@ SESSION_CTRL_EVT_UNLISTEN_REPLY
void echo_send_disconnect_session(echo_main_t *em, void *args)
uword unformat_transport_proto(unformat_input_t *input, va_list *args)
u8 send_stream_disconnects
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static int mirror_data_chunk(echo_main_t *em, echo_session_t *s, u8 *tx_buf, u64 len)
static void svm_fifo_clear_deq_ntf(svm_fifo_t *f)
Clear the want notification flag and set has notification.
static void stop_signal(int signum)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
fifo_segment_t * fifo_segment_get_segment_if_valid(fifo_segment_main_t *sm, u32 segment_index)
static void init_error_string_table(vat_main_t *vam)
@ SESSION_CTRL_EVT_CLEANUP
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
static u8 * format_api_error(u8 *s, va_list *args)
void(* bound_uri_cb)(session_bound_msg_t *mp, echo_session_t *session)
static int app_send(app_session_t *s, u8 *data, u32 len, u8 noblock)
int fifo_segment_attach(fifo_segment_main_t *sm, fifo_segment_create_args_t *a)
Attach as slave to a fifo segment.
void fifo_segment_free_client_fifo(fifo_segment_t *fs, svm_fifo_t *f)
Free fifo allocated by external applications.
static void echo_free_sessions(echo_main_t *em)
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
volatile u32 listen_session_cnt
void(* cleanup_cb)(echo_session_t *s, u8 parent_died)
void vl_set_memory_root_path(const char *name)
f64 last_stat_sampling_ts
static void echo_cycle_ip(echo_main_t *em, ip46_address_t *ip, ip46_address_t *src_ip, u32 i)
@ SESSION_CTRL_EVT_DISCONNECTED_REPLY
static void echo_check_closed_listener(echo_main_t *em, echo_session_t *s)
static api_main_t * vlibapi_get_main(void)
sll srl srl sll sra u16x4 i
static void session_reset_handler(session_reset_msg_t *mp)
int connect_to_vpp(char *name)
void vl_socket_client_disconnect(void)
static int echo_process_each_proto_opts(unformat_input_t *a)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
@ ECHO_SESSION_STATE_AWAIT_DATA
@ ECHO_SESSION_STATE_CLOSING
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
svm_msg_q_t rpc_msq_queue
uword echo_unformat_close(unformat_input_t *input, va_list *args)
@ ECHO_INVALID_DATA_SOURCE
static f64 clib_time_now(clib_time_t *c)
void svm_msg_q_attach(svm_msg_q_t *mq, void *smq_base)
static void app_alloc_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt, u8 evt_type)
static void cleanup_handler(session_cleanup_msg_t *mp)
echo_session_t * echo_session_new(echo_main_t *em)
void echo_send_connect(echo_main_t *em, void *args)
clib_spinlock_t segment_handles_lock
void echo_process_uri(echo_main_t *em)
static void echo_session_detach_fifos(echo_session_t *s)
void echo_update_count_on_session_close(echo_main_t *em, echo_session_t *s)
teardown_stat_t active_count
void echo_process_opts(int argc, char **argv)
static void echo_handle_data(echo_main_t *em, echo_session_t *s, u8 *rx_buf)
static void print_global_json_stats(echo_main_t *em)
u8 * echo_format_timing_event(u8 *s, va_list *args)
#define clib_atomic_fetch_add(a, b)
uword echo_unformat_timing_event(unformat_input_t *input, va_list *args)
@ SESSION_CTRL_EVT_RESET_REPLY
API main structure, used by both vpp and binary API clients.
uword * shared_segment_handles
void * clib_mem_init_thread_safe(void *memory, uword memory_size)
@ ECHO_SESSION_STATE_INITIAL
static uword hash_elts(void *v)
u8 * echo_format_session(u8 *s, va_list *args)
volatile int max_sim_connects
#define vec_free(V)
Free vector's memory (no header).
static void echo_assert_test_suceeded(echo_main_t *em)
int svm_msg_q_timedwait(svm_msg_q_t *mq, double timeout)
Timed wait for message queue event.
void svm_msg_q_free_msg(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Free message buffer.
template key/value backing page structure
void echo_segment_detach(u64 segment_handle)
@ SESSION_CTRL_EVT_ACCEPTED
void fifo_segment_main_init(fifo_segment_main_t *sm, u64 baseva, u32 timeout_in_seconds)
static void add_segment_handler(session_app_add_segment_msg_t *mp)
teardown_stat_t accepted_count
volatile u64 bytes_to_receive
#define CHECK_DIFF(fail, expected, result, _fmt, _args...)
clib_spinlock_t sid_vpp_handles_lock
teardown_stat_t connected_count
description fragment has unexpected format
format_function_t format_ip46_address
void echo_send_unbind(echo_main_t *em, echo_session_t *s)
void(* echo_rpc_t)(echo_main_t *em, echo_rpc_args_t *arg)
static void print_usage_and_exit(void)
u8 * echo_format_bytes_per_sec(u8 *s, va_list *args)
void(* set_defaults_before_opts_cb)(void)
pthread_t * data_thread_handles
teardown_stat_t reset_count
#define vec_foreach(var, vec)
Vector iterator.
svm_queue_t * vl_input_queue
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
struct echo_main_t::@680 timing
#define SESSION_INVALID_HANDLE
void echo_session_handle_add_del(echo_main_t *em, u64 handle, u32 sid)
u32 * listen_session_indexes
struct echo_main_t::@681 uri_elts
static void print_global_stats(echo_main_t *em)
u8 use_sock_api
Flag that decides if socket, instead of svm, api is used to connect to vpp.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
teardown_stat_t clean_count
void(* print_usage_cb)(void)
u8 * format_transport_proto(u8 *s, va_list *args)
u8 * echo_format_crypto_engine(u8 *s, va_list *args)
#define clib_warning(format, args...)
@ SESSION_CTRL_EVT_ACCEPTED_REPLY
#define HIGH_SEGMENT_BASEVA
#define ECHO_LOG(lvl, _fmt, _args...)
int(* process_opts_cb)(unformat_input_t *a)
void echo_send_attach(echo_main_t *em)
@ RETURN_PACKETS_LOG_WRONG
@ SVM_Q_WAIT
blocking call - best used in combination with condvars, for eventfds we don't yield the cpu
static void echo_session_dequeue_notify(echo_session_t *s)
teardown_stat_t close_count
int vl_client_connect_to_vlib(const char *svm_name, const char *client_name, int rx_queue_size)
uword echo_unformat_crypto_engine(unformat_input_t *input, va_list *args)
void(* set_defaults_after_opts_cb)(void)
void(* disconnected_cb)(session_disconnected_msg_t *mp, echo_session_t *s)
@ ECHO_SESSION_STATE_CLOSED
static void test_recv_bytes(echo_main_t *em, echo_session_t *s, u8 *rx_buf, u32 n_read)
void echo_notify_event(echo_main_t *em, echo_test_evt_t e)
void echo_send_listen(echo_main_t *em, ip46_address_t *ip)
static void server_run(echo_main_t *em)
uword vpp_event_queue_address
int svm_msg_q_sub_raw(svm_msg_q_t *mq, svm_msg_q_msg_t *elem)
Consumer dequeue one message from queue.
static void echo_print_periodic_stats(echo_main_t *em)
int vl_socket_client_init_shm(vl_api_shm_elem_config_t *config, int want_pthread)
void echo_send_add_cert_key(echo_main_t *em)
void echo_send_del_cert_key(echo_main_t *em)
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
Fifo max bytes to dequeue.
echo_session_t * echo_get_session_from_handle(echo_main_t *em, u64 handle)
@ SESSION_CTRL_EVT_APP_ADD_SEGMENT
int wait_for_state_change(echo_main_t *em, connection_state_t state, f64 timeout)
@ SESSION_CTRL_EVT_APP_DEL_SEGMENT