FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
vpp_echo_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __included_vpp_echo_common_h__
17 #define __included_vpp_echo_common_h__
18 
20 #include <vnet/format_fns.h>
21 #include <vnet/session/session.api_enum.h>
22 #include <vnet/session/session.api_types.h>
23 
24 #define TIMEOUT 10.0
25 #define LOGGING_BATCH (100)
26 #define LOG_EVERY_N_IDLE_CYCLES (1e8)
27 #define ECHO_MQ_SEG_HANDLE ((u64) ~0 - 1)
28 
29 #define foreach_echo_fail_code \
30  _(ECHO_FAIL_NONE, "ECHO_FAIL_NONE") \
31  _(ECHO_FAIL_USAGE, "ECHO_FAIL_USAGE") \
32  _(ECHO_FAIL_SEND_IO_EVT, "ECHO_FAIL_SEND_IO_EVT") \
33  _(ECHO_FAIL_SOCKET_CONNECT, "ECHO_FAIL_SOCKET_CONNECT") \
34  _(ECHO_FAIL_INIT_SHM_API, "ECHO_FAIL_INIT_SHM_API") \
35  _(ECHO_FAIL_SHMEM_CONNECT, "ECHO_FAIL_SHMEM_CONNECT") \
36  _(ECHO_FAIL_TEST_BYTES_ERR, "ECHO_FAIL_TEST_BYTES_ERR") \
37  _(ECHO_FAIL_BIND, "ECHO_FAIL_BIND") \
38  _(ECHO_FAIL_SESSION_ACCEPTED_BAD_LISTENER, \
39  "ECHO_FAIL_SESSION_ACCEPTED_BAD_LISTENER") \
40  _(ECHO_FAIL_ACCEPTED_WAIT_FOR_SEG_ALLOC, \
41  "ECHO_FAIL_ACCEPTED_WAIT_FOR_SEG_ALLOC") \
42  _(ECHO_FAIL_SESSION_CONNECT, "ECHO_FAIL_SESSION_CONNECT") \
43  _(ECHO_FAIL_CONNECTED_WAIT_FOR_SEG_ALLOC, \
44  "ECHO_FAIL_CONNECTED_WAIT_FOR_SEG_ALLOC") \
45  _(ECHO_FAIL_APP_ATTACH, "ECHO_FAIL_APP_ATTACH") \
46  _(ECHO_FAIL_SERVER_DISCONNECT_TIMEOUT, \
47  "ECHO_FAIL_SERVER_DISCONNECT_TIMEOUT") \
48  _(ECHO_FAIL_INVALID_URI, "ECHO_FAIL_INVALID_URI") \
49  _(ECHO_FAIL_PROTOCOL_NOT_SUPPORTED, \
50  "ECHO_FAIL_PROTOCOL_NOT_SUPPORTED") \
51  _(ECHO_FAIL_CONNECT_TO_VPP, "ECHO_FAIL_CONNECT_TO_VPP") \
52  _(ECHO_FAIL_ATTACH_TO_VPP, "ECHO_FAIL_ATTACH_TO_VPP") \
53  _(ECHO_FAIL_1ST_PTHREAD_CREATE, "ECHO_FAIL_1ST_PTHREAD_CREATE") \
54  _(ECHO_FAIL_PTHREAD_CREATE, "ECHO_FAIL_PTHREAD_CREATE") \
55  _(ECHO_FAIL_DETACH, "ECHO_FAIL_DETACH") \
56  _(ECHO_FAIL_DEL_CERT_KEY, "ECHO_FAIL_DEL_CERT_KEY") \
57  _(ECHO_FAIL_MQ_PTHREAD, "ECHO_FAIL_MQ_PTHREAD") \
58  _(ECHO_FAIL_VL_API_APP_ATTACH, "ECHO_FAIL_VL_API_APP_ATTACH") \
59  _(ECHO_FAIL_VL_API_MISSING_SEGMENT_NAME, \
60  "ECHO_FAIL_VL_API_MISSING_SEGMENT_NAME") \
61  _(ECHO_FAIL_VL_API_NULL_APP_MQ, "ECHO_FAIL_VL_API_NULL_APP_MQ") \
62  _(ECHO_FAIL_VL_API_RECV_FD_MSG, "ECHO_FAIL_VL_API_RECV_FD_MSG") \
63  _(ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH, \
64  "ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH") \
65  _(ECHO_FAIL_VL_API_FIFO_SEG_ATTACH, \
66  "ECHO_FAIL_VL_API_FIFO_SEG_ATTACH") \
67  _(ECHO_FAIL_VL_API_DETACH_REPLY, "ECHO_FAIL_VL_API_DETACH_REPLY") \
68  _(ECHO_FAIL_VL_API_BIND_URI_REPLY, "ECHO_FAIL_VL_API_BIND_URI_REPLY") \
69  _(ECHO_FAIL_VL_API_UNBIND_REPLY, "ECHO_FAIL_VL_API_UNBIND_REPLY") \
70  _(ECHO_FAIL_SESSION_DISCONNECT, "ECHO_FAIL_SESSION_DISCONNECT") \
71  _(ECHO_FAIL_SESSION_RESET, "ECHO_FAIL_SESSION_RESET") \
72  _(ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY, \
73  "ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY") \
74  _(ECHO_FAIL_VL_API_CERT_KEY_DEL_REPLY, \
75  "ECHO_FAIL_VL_API_CERT_KEY_DEL_REPLY") \
76  _(ECHO_FAIL_GET_SESSION_FROM_HANDLE, \
77  "ECHO_FAIL_GET_SESSION_FROM_HANDLE") \
78  _(ECHO_FAIL_QUIC_WRONG_CONNECT, "ECHO_FAIL_QUIC_WRONG_CONNECT") \
79  _(ECHO_FAIL_QUIC_WRONG_ACCEPT, "ECHO_FAIL_QUIC_WRONG_ACCEPT") \
80  _(ECHO_FAIL_TCP_BAPI_CONNECT, "ECHO_FAIL_TCP_BAPI_CONNECT") \
81  _(ECHO_FAIL_UDP_BAPI_CONNECT, "ECHO_FAIL_UDP_BAPI_CONNECT") \
82  _(ECHO_FAIL_MISSING_START_EVENT, "ECHO_FAIL_MISSING_START_EVENT") \
83  _(ECHO_FAIL_MISSING_END_EVENT, "ECHO_FAIL_MISSING_END_EVENT") \
84  _(ECHO_FAIL_TEST_ASSERT_RX_TOTAL, "ECHO_FAIL_TEST_ASSERT_RX_TOTAL") \
85  _(ECHO_FAIL_UNIDIRECTIONAL, "ECHO_FAIL_UNIDIRECTIONAL") \
86  _(ECHO_FAIL_TEST_ASSERT_TX_TOTAL, "ECHO_FAIL_TEST_ASSERT_TX_TOTAL") \
87  _(ECHO_FAIL_TEST_ASSERT_ALL_SESSIONS_CLOSED, \
88  "ECHO_FAIL_TEST_ASSERT_ALL_SESSIONS_CLOSED") \
89  _(ECHO_FAIL_RPC_SIZE, "ECHO_FAIL_RPC_SIZE")
90 
91 typedef enum
92 {
93 #define _(sym, str) sym,
95 #undef _
96 } echo_fail_t;
97 
98 extern char *echo_fail_code_str[];
99 
100 #define CHECK_SAME(fail, expected, result, _fmt, _args...) \
101 do { \
102  if ((expected) != (result)) \
103  ECHO_FAIL ((fail), "expected same (%lld, got %lld) : "_fmt, \
104  (u64)(expected), (u64)(result), ##_args); \
105 } while (0)
106 
107 #define CHECK_DIFF(fail, expected, result, _fmt, _args...) \
108 do { \
109  if ((expected) == (result)) \
110  ECHO_FAIL ((fail), "expected different (both %lld) : "_fmt, \
111  (u64)(expected), ##_args); \
112 } while (0)
113 
114 #define ECHO_FAIL(fail, _fmt, _args...) \
115 do { \
116  echo_main_t *em = &echo_main; \
117  em->has_failed = (fail); \
118  if (vec_len(em->fail_descr)) \
119  em->fail_descr = format(em->fail_descr, " | %s (%u): "_fmt, \
120  echo_fail_code_str[fail], fail, ##_args); \
121  else \
122  em->fail_descr = format(0, "%s (%u): "_fmt, \
123  echo_fail_code_str[fail], fail, ##_args); \
124  em->time_to_stop = 1; \
125  if (em->log_lvl > 0) \
126  clib_warning ("%v", em->fail_descr); \
127 } while (0)
128 
129 #define ECHO_LOG(lvl, _fmt,_args...) \
130  { \
131  echo_main_t *em = &echo_main; \
132  if (em->log_lvl > lvl) \
133  clib_warning (_fmt, ##_args); \
134  }
135 
136 #define ECHO_REGISTER_PROTO(proto, vft) \
137  static void __clib_constructor \
138  vpp_echo_init_##proto () \
139  { \
140  echo_main_t *em = &echo_main; \
141  vec_validate (em->available_proto_cb_vft, proto); \
142  em->available_proto_cb_vft[proto] = &vft; \
143  }
144 
145 typedef struct
146 {
147  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
148 #define _(type, name) type name;
150 #undef _
154  volatile u64 bytes_received;
157  u32 listener_index; /* listener index in echo session pool */
158  u32 idle_cycles; /* consecutive enq/deq with no data */
159  volatile u64 accepted_session_count; /* sessions we accepted (as a listener) */
161 
162 typedef enum
163 {
168 } data_source_t;
169 
171 {
173  ECHO_CLOSE_F_PASSIVE, /* wait for close msg */
174  ECHO_CLOSE_F_ACTIVE, /* send close msg */
175  ECHO_CLOSE_F_NONE, /* don't bother sending close msg */
176 };
177 
179 {
183 };
184 
186 {
189  ECHO_SESSION_STATE_AWAIT_CLOSING, /* Data transfer is done, wait for close evt */
190  ECHO_SESSION_STATE_AWAIT_DATA, /* Peer closed, wait for outstanding data */
191  ECHO_SESSION_STATE_CLOSING, /* told vpp to close */
192  ECHO_SESSION_STATE_CLOSED, /* closed in vpp */
193 };
194 
195 typedef enum
196 {
207 
208 typedef enum echo_test_evt_
209 {
210  ECHO_EVT_START = 1, /* app starts */
211  ECHO_EVT_FIRST_QCONNECT = (1 << 1), /* First connect Quic session sent */
212  ECHO_EVT_LAST_QCONNECTED = (1 << 2), /* All Quic session are connected */
213  ECHO_EVT_FIRST_SCONNECT = (1 << 3), /* First connect Stream session sent */
214  ECHO_EVT_LAST_SCONNECTED = (1 << 4), /* All Stream session are connected */
215  ECHO_EVT_LAST_BYTE = (1 << 5), /* Last byte received */
216  ECHO_EVT_EXIT = (1 << 6), /* app exits */
218 
220 {
223 
224 typedef struct echo_proto_cb_vft_
225 {
226  void (*connected_cb) (session_connected_bundled_msg_t * mp, u32 session_index, u8 is_failed); /* Session is connected */
227  void (*accepted_cb) (session_accepted_msg_t * mp, echo_session_t * session); /* Session got accepted */
228  void (*bound_uri_cb) (session_bound_msg_t * mp, echo_session_t * session); /* Session got bound */
229  void (*reset_cb) (session_reset_msg_t * mp, echo_session_t * s); /* Received RESET on session */
230  void (*disconnected_cb) (session_disconnected_msg_t * mp, echo_session_t * s); /* Received DISCONNECT on session */
231  void (*sent_disconnect_cb) (echo_session_t * s); /* ACK disconnect we sent to vpp */
232  void (*cleanup_cb) (echo_session_t * s, u8 parent_died); /* Session should be cleaned up (parent listener may be dead) */
233  /* Add CLI options */
237  void (*print_usage_cb) (void);
239 
240 typedef enum
241 {
246 
247 typedef struct teardown_stat_
248 {
249  u32 q; /* quic sessions */
250  u32 s; /* stream sessions */
252 
253 typedef struct echo_stats_
254 {
259  teardown_stat_t reset_count; /* received reset from vpp */
260  teardown_stat_t close_count; /* received close from vpp */
261  teardown_stat_t active_count; /* sent close to vpp */
262  teardown_stat_t clean_count; /* cleaned up stale session */
263  teardown_stat_t connected_count; /* connected sessions count */
264  teardown_stat_t accepted_count; /* connected sessions count */
265 } echo_stats_t;
266 
267 typedef struct
268 {
269  svm_queue_t *vl_input_queue; /* vpe input queue */
270  u32 my_client_index; /* API client handle */
271  u8 *uri; /* The URI we're playing with */
272  u32 n_uris; /* Cycle through adjacent ips */
273  ip46_address_t lcl_ip; /* Local ip for client */
275  echo_session_t *sessions; /* Session pool */
276  svm_msg_q_t *app_mq; /* Our receiveing event queue */
277  svm_msg_q_t *ctrl_mq; /* Our control queue (towards vpp) */
278  clib_time_t clib_time; /* For deadman timers */
281  u32 *listen_session_indexes; /* vec of vpp listener sessions */
283 
284  uword *session_index_by_vpp_handles; /* Hash table : quic_echo s_id -> vpp s_handle */
285  clib_spinlock_t sid_vpp_handles_lock; /* Hash table lock */
286 
287  uword *shared_segment_handles; /* Hash table : segment_names -> 1 */
288  clib_spinlock_t segment_handles_lock; /* Hash table lock */
290  svm_msg_q_t rpc_msq_queue; /* MQ between quic_echo threads */
292 
293  /* State of the connection, shared between msg RX thread and main thread */
295  volatile u8 time_to_stop; /* Signal variables */
296  u8 rx_results_diff; /* Rx results will be different than cfg */
297  u8 tx_results_diff; /* Tx results will be different than cfg */
298  u8 has_failed; /* stores the exit code */
299  u8 *fail_descr; /* vector containing fail description */
300 
301  /** Flag that decides if socket, instead of svm, api is used to connect to
302  * vpp. If sock api is used, shm binary api is subsequently bootstrapped
303  * and all other messages are exchanged using shm IPC. */
305 
308  u64 bytes_to_send; /* target per stream */
309  u64 bytes_to_receive; /* target per stream */
314  data_source_t data_source; /* Use no/placeholder/mirrored data */
315  u8 send_stream_disconnects; /* actively send disconnect */
316  u8 output_json; /* Output stats as JSON */
317  volatile u8 wait_for_gdb; /* Wait for gdb to attach */
318  u8 log_lvl; /* Verbosity of the logging */
319  int max_test_msg; /* Limit the number of incorrect data messages */
320  u32 evt_q_size; /* Size of the vpp MQ (app<->vpp events) */
321  u32 ckpair_index; /* Cert key pair used */
322  u8 crypto_engine; /* crypto engine used */
323  u8 connect_flag; /* flags to pass to mq connect */
324  u32 periodic_stats_delta; /* seconds between periodic stats */
325 
329 
330  pthread_t *data_thread_handles; /* vec of data thread handles */
331  pthread_t mq_thread_handle; /* Message queue thread handle */
333 
334  u32 n_connects; /* Target number of connects to send */
335  u32 n_sessions; /* Number of sessions to prealloc */
336  u32 n_clients; /* Target number of clients doing RX/TX */
337  u32 n_rx_threads; /* Number of data threads */
338 
339  volatile u32 n_clients_connected; /* Number of STREAM sessions connected */
340  volatile u32 nxt_available_sidx; /* next unused prealloced session_index */
341 
342  volatile int max_sim_connects;
343 
344  /* VNET_API_ERROR_FOO -> "Foo" hash table */
347 
349  echo_stats_t last_stat_sampling; /* copy of stats at last sampling */
351 
352  struct /* Event based timing : start & end depend on CLI specified events */
353  {
359  } timing;
360 
361  struct
362  {
364  ip46_address_t ip;
367  } uri_elts;
368 } echo_main_t;
369 
370 extern echo_main_t echo_main;
371 
372 
373 typedef struct echo_connect_args_
374 {
377  ip46_address_t ip;
378  ip46_address_t lcl_ip;
380 
381 typedef struct echo_disconnect_args_
382 {
385 
386 typedef union
387 {
391 
392 typedef void (*echo_rpc_t) (echo_main_t * em, echo_rpc_args_t * arg);
393 
394 typedef struct
395 {
396  void *fp;
399 
400 
401 u8 *format_ip4_address (u8 * s, va_list * args);
402 u8 *format_ip6_address (u8 * s, va_list * args);
403 u8 *format_ip46_address (u8 * s, va_list * args);
404 u8 *format_api_error (u8 * s, va_list * args);
406 u8 *echo_format_session (u8 * s, va_list * args);
407 u8 *echo_format_session_type (u8 * s, va_list * args);
408 u8 *echo_format_session_state (u8 * s, va_list * args);
409 u8 *echo_format_app_state (u8 * s, va_list * args);
410 uword echo_unformat_close (unformat_input_t * input, va_list * args);
411 uword echo_unformat_timing_event (unformat_input_t * input, va_list * args);
412 u8 *echo_format_timing_event (u8 * s, va_list * args);
413 uword unformat_transport_proto (unformat_input_t * input, va_list * args);
414 u8 *format_transport_proto (u8 * s, va_list * args);
415 uword unformat_ip4_address (unformat_input_t * input, va_list * args);
416 uword unformat_ip6_address (unformat_input_t * input, va_list * args);
417 
418 void echo_session_handle_add_del (echo_main_t * em, u64 handle, u32 sid);
420 int echo_send_rpc (echo_main_t * em, void *fp, echo_rpc_args_t * args);
423  f64 timeout);
426 u8 *echo_format_crypto_engine (u8 * s, va_list * args);
427 uword echo_unformat_crypto_engine (unformat_input_t * input, va_list * args);
428 u8 *echo_format_bytes_per_sec (u8 * s, va_list * args);
429 int echo_segment_attach (u64 segment_handle, char *name,
430  ssvm_segment_type_t type, int fd);
431 u32 echo_segment_lookup (u64 segment_handle);
432 void echo_segment_detach (u64 segment_handle);
433 int echo_attach_session (uword segment_handle, uword rxf_offset,
434  uword mq_offset, uword txf_offset, echo_session_t *s);
435 int echo_segment_attach_mq (uword segment_handle, uword mq_offset,
436  u32 mq_index, svm_msg_q_t **mq);
438  u32 slice_index, u32 size,
439  uword *offset);
440 
441 /* Binary API */
442 
443 void echo_send_attach (echo_main_t * em);
444 void echo_send_detach (echo_main_t * em);
445 void echo_send_listen (echo_main_t * em, ip46_address_t * ip);
447 void echo_send_connect (echo_main_t * em, void *args);
448 void echo_send_disconnect_session (echo_main_t * em, void *args);
449 void echo_api_hookup (echo_main_t * em);
452 
453 #endif /* __included_vpp_echo_common_h__ */
454 
455 /*
456  * fd.io coding-style-patch-verification: ON
457  *
458  * Local Variables:
459  * eval: (c-set-style "gnu")
460  * End:
461  */
RETURN_PACKETS_ASSERT
@ RETURN_PACKETS_ASSERT
Definition: vpp_echo_common.h:244
echo_stats_
Definition: vpp_echo_common.h:253
echo_main_t::ckpair_index
u32 ckpair_index
Definition: vpp_echo_common.h:321
session_connected_bundled_msg_::mp
session_connected_msg_t * mp
Definition: vpp_echo_common.h:221
unformat_ip4_address
uword unformat_ip4_address(unformat_input_t *input, va_list *args)
Definition: ip4_format.c:76
echo_main_t::i_am_master
int i_am_master
Definition: vpp_echo_common.h:280
echo_unformat_close
uword echo_unformat_close(unformat_input_t *input, va_list *args)
Definition: vpp_echo_common.c:223
ECHO_EVT_LAST_BYTE
@ ECHO_EVT_LAST_BYTE
Definition: vpp_echo_common.h:215
STATE_CLEANED_CERT_KEY
@ STATE_CLEANED_CERT_KEY
Definition: vpp_echo_common.h:204
echo_segment_detach
void echo_segment_detach(u64 segment_handle)
Definition: vpp_echo_bapi.c:276
echo_main_t::log_lvl
u8 log_lvl
Definition: vpp_echo_common.h:318
echo_main_t::connect_test_data
u8 * connect_test_data
Definition: vpp_echo_common.h:306
echo_main_t::rx_buf_size
u64 rx_buf_size
Definition: vpp_echo_common.h:312
ECHO_CLOSE_F_NONE
@ ECHO_CLOSE_F_NONE
Definition: vpp_echo_common.h:175
echo_main_t::data_thread_args
u32 *volatile data_thread_args
Definition: vpp_echo_common.h:332
echo_session_handle_add_del
void echo_session_handle_add_del(echo_main_t *em, u64 handle, u32 sid)
Definition: vpp_echo_common.c:521
echo_send_connect
void echo_send_connect(echo_main_t *em, void *args)
Definition: vpp_echo_bapi.c:171
STATE_START
@ STATE_START
Definition: vpp_echo_common.h:197
echo_main_t::sessions
echo_session_t * sessions
Definition: vpp_echo_common.h:275
echo_format_app_state
u8 * echo_format_app_state(u8 *s, va_list *args)
Definition: vpp_echo_common.c:199
ECHO_EVT_START
@ ECHO_EVT_START
Definition: vpp_echo_common.h:210
echo_main_t::mq_thread_handle
pthread_t mq_thread_handle
Definition: vpp_echo_common.h:331
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
name
string name[64]
Definition: fib.api:25
echo_proto_cb_vft_::reset_cb
void(* reset_cb)(session_reset_msg_t *mp, echo_session_t *s)
Definition: vpp_echo_common.h:229
echo_main_t::n_clients_connected
volatile u32 n_clients_connected
Definition: vpp_echo_common.h:339
echo_session_t
Definition: vpp_echo_common.h:145
echo_connect_args_::context
u32 context
Definition: vpp_echo_common.h:375
echo_main_t::available_proto_cb_vft
echo_proto_cb_vft_t ** available_proto_cb_vft
Definition: vpp_echo_common.h:346
echo_attach_session
int echo_attach_session(uword segment_handle, uword rxf_offset, uword mq_offset, uword txf_offset, echo_session_t *s)
Definition: vpp_echo_bapi.c:294
echo_rpc_msg_t
Definition: vpp_echo_common.h:394
echo_format_session_type
u8 * echo_format_session_type(u8 *s, va_list *args)
Definition: vpp_echo_common.c:156
echo_stats_::rx_total
u64 rx_total
Definition: vpp_echo_common.h:256
echo_send_add_cert_key
void echo_send_add_cert_key(echo_main_t *em)
Definition: vpp_echo_bapi.c:72
echo_test_evt_
echo_test_evt_
Definition: vpp_echo_common.h:208
echo_rpc_args_t::disconnect
echo_disconnect_args_t disconnect
Definition: vpp_echo_common.h:389
echo_session_t::accepted_session_count
volatile u64 accepted_session_count
Definition: vpp_echo_common.h:159
echo_main_t::test_return_packets
u8 test_return_packets
Definition: vpp_echo_common.h:307
svm_queue_t
struct _svm_queue svm_queue_t
connection_state_t
connection_state_t
Definition: vpp_echo_common.h:195
ECHO_EVT_FIRST_QCONNECT
@ ECHO_EVT_FIRST_QCONNECT
Definition: vpp_echo_common.h:211
svm_fifo_chunk_
Definition: fifo_types.h:38
echo_main_t::state
volatile connection_state_t state
Definition: vpp_echo_common.h:294
ECHO_SESSION_TYPE_STREAM
@ ECHO_SESSION_TYPE_STREAM
Definition: vpp_echo_common.h:181
echo_main_t::has_failed
u8 has_failed
Definition: vpp_echo_common.h:298
session_connected_msg_
Definition: application_interface.h:428
state
vl_api_dhcp_client_state_t state
Definition: dhcp.api:201
echo_main_t::end_event
u8 end_event
Definition: vpp_echo_common.h:358
echo_proto_cb_vft_
Definition: vpp_echo_common.h:224
echo_session_print_stats
void echo_session_print_stats(echo_main_t *em, echo_session_t *session)
Definition: vpp_echo_common.c:616
echo_main_t::transport_proto
u32 transport_proto
Definition: vpp_echo_common.h:363
echo_main_t::time_to_stop
volatile u8 time_to_stop
Definition: vpp_echo_common.h:295
ECHO_SESSION_STATE_READY
@ ECHO_SESSION_STATE_READY
Definition: vpp_echo_common.h:188
unformat_input_t
struct _unformat_input_t unformat_input_t
echo_rpc_msg_t::fp
void * fp
Definition: vpp_echo_common.h:396
echo_main_t::n_rx_threads
u32 n_rx_threads
Definition: vpp_echo_common.h:337
echo_segment_attach
int echo_segment_attach(u64 segment_handle, char *name, ssvm_segment_type_t type, int fd)
Definition: vpp_echo_bapi.c:228
echo_connect_args_t
struct echo_connect_args_ echo_connect_args_t
echo_segment_attach_mq
int echo_segment_attach_mq(uword segment_handle, uword mq_offset, u32 mq_index, svm_msg_q_t **mq)
Definition: vpp_echo_bapi.c:338
echo_session_t::bytes_received
volatile u64 bytes_received
Definition: vpp_echo_common.h:154
data_source_t
data_source_t
Definition: vpp_echo_common.h:162
format_ip6_address
u8 * format_ip6_address(u8 *s, va_list *args)
Definition: ip6_format.c:44
echo_connect_args_
Definition: vpp_echo_common.h:373
echo_proto_cb_vft_::connected_cb
void(* connected_cb)(session_connected_bundled_msg_t *mp, u32 session_index, u8 is_failed)
Definition: vpp_echo_common.h:226
ECHO_SESSION_TYPE_LISTEN
@ ECHO_SESSION_TYPE_LISTEN
Definition: vpp_echo_common.h:182
echo_format_session_state
u8 * echo_format_session_state(u8 *s, va_list *args)
Definition: vpp_echo_common.c:174
echo_main_t::start_event
u8 start_event
Definition: vpp_echo_common.h:357
ssvm_segment_type_t
enum ssvm_segment_type_ ssvm_segment_type_t
echo_format_session
u8 * echo_format_session(u8 *s, va_list *args)
Definition: vpp_echo_common.c:146
echo_rpc_args_t::connect
echo_connect_args_t connect
Definition: vpp_echo_common.h:388
echo_main_t::segment_main
fifo_segment_main_t segment_main
Definition: vpp_echo_common.h:291
echo_main_t::periodic_stats_delta
u32 periodic_stats_delta
Definition: vpp_echo_common.h:324
echo_session_t::vpp_session_handle
foreach_app_session_field u64 vpp_session_handle
Definition: vpp_echo_common.h:151
echo_main_t::bytes_to_send
u64 bytes_to_send
Definition: vpp_echo_common.h:308
echo_main_t::session_index_by_vpp_handles
uword * session_index_by_vpp_handles
Definition: vpp_echo_common.h:284
teardown_stat_::s
u32 s
Definition: vpp_echo_common.h:250
STATE_READY
@ STATE_READY
Definition: vpp_echo_common.h:201
echo_main_t::data_source
data_source_t data_source
Definition: vpp_echo_common.h:314
echo_main_t::last_stat_sampling
echo_stats_t last_stat_sampling
Definition: vpp_echo_common.h:349
ECHO_SESSION_STATE_AWAIT_CLOSING
@ ECHO_SESSION_STATE_AWAIT_CLOSING
Definition: vpp_echo_common.h:189
echo_send_detach
void echo_send_detach(echo_main_t *em)
Definition: vpp_echo_bapi.c:58
ECHO_CLOSE_F_ACTIVE
@ ECHO_CLOSE_F_ACTIVE
Definition: vpp_echo_common.h:174
echo_main_t::error_string_by_error_number
uword * error_string_by_error_number
Definition: vpp_echo_common.h:345
ECHO_EVT_EXIT
@ ECHO_EVT_EXIT
Definition: vpp_echo_common.h:216
echo_stats_::tx_expected
u64 tx_expected
Definition: vpp_echo_common.h:257
STATE_ATTACHED_NO_CERT
@ STATE_ATTACHED_NO_CERT
Definition: vpp_echo_common.h:198
echo_proto_cb_vft_::accepted_cb
void(* accepted_cb)(session_accepted_msg_t *mp, echo_session_t *session)
Definition: vpp_echo_common.h:227
echo_session_t::start
f64 start
Definition: vpp_echo_common.h:156
echo_main_t::my_client_index
u32 my_client_index
Definition: vpp_echo_common.h:270
STATE_DISCONNECTED
@ STATE_DISCONNECTED
Definition: vpp_echo_common.h:203
echo_main_t::proto_cb_vft
echo_proto_cb_vft_t * proto_cb_vft
Definition: vpp_echo_common.h:289
echo_main_t::send_stream_disconnects
u8 send_stream_disconnects
Definition: vpp_echo_common.h:315
echo_fail_t
echo_fail_t
Definition: vpp_echo_common.h:91
echo_close_f_t
echo_close_f_t
Definition: vpp_echo_common.h:170
echo_send_rpc
int echo_send_rpc(echo_main_t *em, void *fp, echo_rpc_args_t *args)
Definition: vpp_echo_common.c:548
echo_format_bytes_per_sec
u8 * echo_format_bytes_per_sec(u8 *s, va_list *args)
Definition: vpp_echo_common.c:261
echo_session_t::bytes_to_send
u64 bytes_to_send
Definition: vpp_echo_common.h:153
STATE_DETACHED
@ STATE_DETACHED
Definition: vpp_echo_common.h:205
echo_main_t::is_ip4
u8 is_ip4
Definition: vpp_echo_common.h:366
echo_segment_lookup
u32 echo_segment_lookup(u64 segment_handle)
Definition: vpp_echo_bapi.c:258
echo_session_new
echo_session_t * echo_session_new(echo_main_t *em)
Definition: vpp_echo_common.c:538
echo_main_t::stats
echo_stats_t stats
Definition: vpp_echo_common.h:348
echo_main_t::fifo_size
u32 fifo_size
Definition: vpp_echo_common.h:310
echo_main_t::prealloc_fifo_pairs
u32 prealloc_fifo_pairs
Definition: vpp_echo_common.h:311
echo_send_disconnect_session
void echo_send_disconnect_session(echo_main_t *em, void *args)
Definition: vpp_echo_bapi.c:201
unformat_ip6_address
uword unformat_ip6_address(unformat_input_t *input, va_list *args)
Definition: ip6_format.c:138
echo_disconnect_args_::session_handle
u64 session_handle
Definition: vpp_echo_common.h:383
echo_proto_cb_vft_::bound_uri_cb
void(* bound_uri_cb)(session_bound_msg_t *mp, echo_session_t *session)
Definition: vpp_echo_common.h:228
foreach_echo_fail_code
#define foreach_echo_fail_code
Definition: vpp_echo_common.h:29
echo_main_t::appns_id
u8 * appns_id
Definition: vpp_echo_common.h:326
clib_spinlock_s
Definition: lock.h:51
teardown_stat_::q
u32 q
Definition: vpp_echo_common.h:249
test_return_packets_t
test_return_packets_t
Definition: vpp_echo_common.h:240
STATE_LISTEN
@ STATE_LISTEN
Definition: vpp_echo_common.h:200
uword
u64 uword
Definition: types.h:112
echo_main_t::listen_session_cnt
volatile u32 listen_session_cnt
Definition: vpp_echo_common.h:282
echo_proto_cb_vft_::cleanup_cb
void(* cleanup_cb)(echo_session_t *s, u8 parent_died)
Definition: vpp_echo_common.h:232
echo_get_session_from_handle
echo_session_t * echo_get_session_from_handle(echo_main_t *em, u64 handle)
Definition: vpp_echo_common.c:573
echo_main_t::last_stat_sampling_ts
f64 last_stat_sampling_ts
Definition: vpp_echo_common.h:350
echo_main_t::tx_results_diff
u8 tx_results_diff
Definition: vpp_echo_common.h:297
echo_main_t::lcl_ip
ip46_address_t lcl_ip
Definition: vpp_echo_common.h:273
echo_main_t::end_time
f64 end_time
Definition: vpp_echo_common.h:355
echo_stats_::rx_expected
u64 rx_expected
Definition: vpp_echo_common.h:258
echo_rpc_args_t
Definition: vpp_echo_common.h:386
f64
double f64
Definition: types.h:142
echo_send_attach
void echo_send_attach(echo_main_t *em)
Definition: vpp_echo_bapi.c:31
echo_disconnect_args_t
struct echo_disconnect_args_ echo_disconnect_args_t
ECHO_SESSION_STATE_AWAIT_DATA
@ ECHO_SESSION_STATE_AWAIT_DATA
Definition: vpp_echo_common.h:190
ECHO_SESSION_STATE_CLOSING
@ ECHO_SESSION_STATE_CLOSING
Definition: vpp_echo_common.h:191
echo_main_t::rpc_msq_queue
svm_msg_q_t rpc_msq_queue
Definition: vpp_echo_common.h:290
echo_main_t::wait_for_gdb
volatile u8 wait_for_gdb
Definition: vpp_echo_common.h:317
ECHO_INVALID_DATA_SOURCE
@ ECHO_INVALID_DATA_SOURCE
Definition: vpp_echo_common.h:167
echo_connect_args_::lcl_ip
ip46_address_t lcl_ip
Definition: vpp_echo_common.h:378
echo_stats_::tx_total
u64 tx_total
Definition: vpp_echo_common.h:255
echo_stats_t
struct echo_stats_ echo_stats_t
ECHO_SESSION_TYPE_QUIC
@ ECHO_SESSION_TYPE_QUIC
Definition: vpp_echo_common.h:180
echo_main_t::segment_handles_lock
clib_spinlock_t segment_handles_lock
Definition: vpp_echo_common.h:288
svm_msg_q_
Definition: message_queue.h:72
ECHO_EVT_LAST_QCONNECTED
@ ECHO_EVT_LAST_QCONNECTED
Definition: vpp_echo_common.h:212
session_connected_bundled_msg_
Definition: vpp_echo_common.h:219
ECHO_EVT_FIRST_SCONNECT
@ ECHO_EVT_FIRST_SCONNECT
Definition: vpp_echo_common.h:213
echo_stats_::active_count
teardown_stat_t active_count
Definition: vpp_echo_common.h:261
echo_main_t::n_uris
u32 n_uris
Definition: vpp_echo_common.h:272
echo_main_t::shared_segment_handles
uword * shared_segment_handles
Definition: vpp_echo_common.h:287
ECHO_SESSION_STATE_INITIAL
@ ECHO_SESSION_STATE_INITIAL
Definition: vpp_echo_common.h:187
session_disconnected_msg_
Definition: application_interface.h:458
echo_api_hookup
void echo_api_hookup(echo_main_t *em)
Definition: vpp_echo_bapi.c:560
echo_main_t::max_sim_connects
volatile int max_sim_connects
Definition: vpp_echo_common.h:342
echo_main_t::appns_flags
u64 appns_flags
Definition: vpp_echo_common.h:327
session_reset_msg_
Definition: application_interface.h:472
size
u32 size
Definition: vhost_user.h:125
echo_main_t::n_sessions
u32 n_sessions
Definition: vpp_echo_common.h:335
clib_bihash_value
template key/value backing page structure
Definition: bihash_doc.h:44
echo_main_t::output_json
u8 output_json
Definition: vpp_echo_common.h:316
echo_main_t::max_test_msg
int max_test_msg
Definition: vpp_echo_common.h:319
echo_stats_::accepted_count
teardown_stat_t accepted_count
Definition: vpp_echo_common.h:264
echo_session_t::bytes_to_receive
volatile u64 bytes_to_receive
Definition: vpp_echo_common.h:155
session_connected_bundled_msg_t
union session_connected_bundled_msg_ session_connected_bundled_msg_t
clib_time_t
Definition: time.h:44
echo_main_t::start_time
f64 start_time
Definition: vpp_echo_common.h:354
echo_main_t::sid_vpp_handles_lock
clib_spinlock_t sid_vpp_handles_lock
Definition: vpp_echo_common.h:285
echo_stats_::connected_count
teardown_stat_t connected_count
Definition: vpp_echo_common.h:263
format_fns.h
echo_main_t::socket_name
u8 * socket_name
Definition: vpp_echo_common.h:279
u64
unsigned long u64
Definition: types.h:89
echo_main_t::n_clients
u32 n_clients
Definition: vpp_echo_common.h:336
echo_proto_cb_vft_t
struct echo_proto_cb_vft_ echo_proto_cb_vft_t
u32
unsigned int u32
Definition: types.h:88
echo_format_crypto_engine
u8 * echo_format_crypto_engine(u8 *s, va_list *args)
Definition: vpp_echo_common.c:481
echo_rpc_t
void(* echo_rpc_t)(echo_main_t *em, echo_rpc_args_t *arg)
Definition: vpp_echo_common.h:392
ECHO_EVT_LAST_SCONNECTED
@ ECHO_EVT_LAST_SCONNECTED
Definition: vpp_echo_common.h:214
echo_main_t::rx_results_diff
u8 rx_results_diff
Definition: vpp_echo_common.h:296
echo_main
echo_main_t echo_main
Definition: vpp_echo.c:24
echo_proto_cb_vft_::set_defaults_before_opts_cb
void(* set_defaults_before_opts_cb)(void)
Definition: vpp_echo_common.h:235
echo_segment_alloc_chunk
svm_fifo_chunk_t * echo_segment_alloc_chunk(uword segment_handle, u32 slice_index, u32 size, uword *offset)
Definition: vpp_echo_bapi.c:364
echo_main_t::data_thread_handles
pthread_t * data_thread_handles
Definition: vpp_echo_common.h:330
echo_main_t::connect_flag
u8 connect_flag
Definition: vpp_echo_common.h:323
echo_stats_::reset_count
teardown_stat_t reset_count
Definition: vpp_echo_common.h:259
echo_main_t::appns_secret
u64 appns_secret
Definition: vpp_echo_common.h:328
echo_format_timing_event
u8 * echo_format_timing_event(u8 *s, va_list *args)
Definition: vpp_echo_common.c:275
format_transport_proto
u8 * format_transport_proto(u8 *s, va_list *args)
Definition: transport.c:52
format_ip46_address
u8 * format_ip46_address(u8 *s, va_list *args)
Definition: ip6_format.c:395
echo_main_t::vl_input_queue
svm_queue_t * vl_input_queue
Definition: vpp_echo_common.h:269
fifo_segment_main_t
Definition: fifo_segment.h:81
unformat_transport_proto
uword unformat_transport_proto(unformat_input_t *input, va_list *args)
Definition: transport.c:155
foreach_app_session_field
#define foreach_app_session_field
flag for dgram mode
Definition: application_interface.h:299
echo_main_t::lcl_ip_set
u8 lcl_ip_set
Definition: vpp_echo_common.h:274
echo_main_t
Definition: vpp_echo_common.h:267
echo_main_t::uri
u8 * uri
Definition: vpp_echo_common.h:271
echo_rpc_msg_t::args
echo_rpc_args_t args
Definition: vpp_echo_common.h:397
echo_main_t::listen_session_indexes
u32 * listen_session_indexes
Definition: vpp_echo_common.h:281
echo_main_t::evt_q_size
u32 evt_q_size
Definition: vpp_echo_common.h:320
echo_connect_args_::ip
ip46_address_t ip
Definition: vpp_echo_common.h:377
echo_main_t::tx_buf_size
u64 tx_buf_size
Definition: vpp_echo_common.h:313
echo_main_t::clib_time
clib_time_t clib_time
Definition: vpp_echo_common.h:278
echo_main_t::use_sock_api
u8 use_sock_api
Flag that decides if socket, instead of svm, api is used to connect to vpp.
Definition: vpp_echo_common.h:304
echo_stats_::clean_count
teardown_stat_t clean_count
Definition: vpp_echo_common.h:262
format_ip4_address
u8 * format_ip4_address(u8 *s, va_list *args)
Definition: pnat_test_stubs.h:33
echo_session_t::bytes_sent
u64 bytes_sent
Definition: vpp_echo_common.h:152
echo_main_t::nxt_available_sidx
volatile u32 nxt_available_sidx
Definition: vpp_echo_common.h:340
STATE_DATA_DONE
@ STATE_DATA_DONE
Definition: vpp_echo_common.h:202
echo_proto_cb_vft_::print_usage_cb
void(* print_usage_cb)(void)
Definition: vpp_echo_common.h:237
application_interface.h
u8
unsigned char u8
Definition: types.h:56
echo_disconnect_args_
Definition: vpp_echo_common.h:381
a
a
Definition: bitmap.h:525
echo_main_t::events_sent
u8 events_sent
Definition: vpp_echo_common.h:356
ip
vl_api_address_t ip
Definition: l2.api:558
echo_fail_code_str
char * echo_fail_code_str[]
Definition: vpp_echo_common.c:21
echo_test_evt_t
enum echo_test_evt_ echo_test_evt_t
ECHO_CLOSE_F_PASSIVE
@ ECHO_CLOSE_F_PASSIVE
Definition: vpp_echo_common.h:173
echo_main_t::bytes_to_receive
u64 bytes_to_receive
Definition: vpp_echo_common.h:309
echo_main_t::port
u32 port
Definition: vpp_echo_common.h:365
echo_send_listen
void echo_send_listen(echo_main_t *em, ip46_address_t *ip)
Definition: vpp_echo_bapi.c:132
quic_session_type_t
quic_session_type_t
Definition: vpp_echo_common.h:178
ECHO_RX_DATA_SOURCE
@ ECHO_RX_DATA_SOURCE
Definition: vpp_echo_common.h:166
ECHO_TEST_DATA_SOURCE
@ ECHO_TEST_DATA_SOURCE
Definition: vpp_echo_common.h:165
session_bound_msg_
Definition: application_interface.h:344
quic_session_state_t
quic_session_state_t
Definition: vpp_echo_common.h:185
echo_proto_cb_vft_::sent_disconnect_cb
void(* sent_disconnect_cb)(echo_session_t *s)
Definition: vpp_echo_common.h:231
STATE_ATTACHED
@ STATE_ATTACHED
Definition: vpp_echo_common.h:199
echo_send_del_cert_key
void echo_send_del_cert_key(echo_main_t *em)
Definition: vpp_echo_bapi.c:93
echo_proto_cb_vft_::process_opts_cb
int(* process_opts_cb)(unformat_input_t *a)
Definition: vpp_echo_common.h:234
ECHO_NO_DATA_SOURCE
@ ECHO_NO_DATA_SOURCE
Definition: vpp_echo_common.h:164
echo_main_t::app_mq
svm_msg_q_t * app_mq
Definition: vpp_echo_common.h:276
format_api_error
u8 * format_api_error(u8 *s, va_list *args)
Definition: vpp_echo_common.c:117
echo_session_t::listener_index
u32 listener_index
Definition: vpp_echo_common.h:157
RETURN_PACKETS_LOG_WRONG
@ RETURN_PACKETS_LOG_WRONG
Definition: vpp_echo_common.h:243
RETURN_PACKETS_NOTEST
@ RETURN_PACKETS_NOTEST
Definition: vpp_echo_common.h:242
echo_stats_::close_count
teardown_stat_t close_count
Definition: vpp_echo_common.h:260
echo_proto_cb_vft_::set_defaults_after_opts_cb
void(* set_defaults_after_opts_cb)(void)
Definition: vpp_echo_common.h:236
echo_main_t::fail_descr
u8 * fail_descr
Definition: vpp_echo_common.h:299
echo_proto_cb_vft_::disconnected_cb
void(* disconnected_cb)(session_disconnected_msg_t *mp, echo_session_t *s)
Definition: vpp_echo_common.h:230
ECHO_CLOSE_F_INVALID
@ ECHO_CLOSE_F_INVALID
Definition: vpp_echo_common.h:172
ECHO_SESSION_STATE_CLOSED
@ ECHO_SESSION_STATE_CLOSED
Definition: vpp_echo_common.h:192
session_accepted_msg_
Definition: application_interface.h:374
echo_connect_args_::parent_session_handle
u64 parent_session_handle
Definition: vpp_echo_common.h:376
echo_unformat_timing_event
uword echo_unformat_timing_event(unformat_input_t *input, va_list *args)
Definition: vpp_echo_common.c:238
echo_main_t::n_connects
u32 n_connects
Definition: vpp_echo_common.h:334
echo_send_unbind
void echo_send_unbind(echo_main_t *em, echo_session_t *s)
Definition: vpp_echo_bapi.c:154
echo_main_t::ip
ip46_address_t ip
Definition: vpp_echo_common.h:364
init_error_string_table
void init_error_string_table()
Definition: vpp_echo_common.c:133
teardown_stat_t
struct teardown_stat_ teardown_stat_t
wait_for_state_change
int wait_for_state_change(echo_main_t *em, connection_state_t state, f64 timeout)
Definition: vpp_echo_common.c:588
echo_unformat_crypto_engine
uword echo_unformat_crypto_engine(unformat_input_t *input, va_list *args)
Definition: vpp_echo_common.c:497
teardown_stat_
Definition: vpp_echo_common.h:247
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
echo_notify_event
void echo_notify_event(echo_main_t *em, echo_test_evt_t e)
Definition: vpp_echo_common.c:604
echo_main_t::ctrl_mq
svm_msg_q_t * ctrl_mq
Definition: vpp_echo_common.h:277
echo_main_t::crypto_engine
u8 crypto_engine
Definition: vpp_echo_common.h:322
echo_session_t::idle_cycles
u32 idle_cycles
Definition: vpp_echo_common.h:158