3 * echo_client.h - built-in application layer echo client
5 * Copyright (c) 2017-2019 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 #ifndef __included_echo_client_h__
19 #define __included_echo_client_h__
21 #include <vnet/vnet.h>
22 #include <vnet/ip/ip.h>
23 #include <vnet/ethernet/ethernet.h>
25 #include <vppinfra/hash.h>
26 #include <vppinfra/error.h>
27 #include <vnet/session/session.h>
28 #include <vnet/session/application_interface.h>
32 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
38 u64 vpp_session_handle;
45 * Test state variables
47 eclient_session_t *sessions; /**< Session pool, shared */
48 clib_spinlock_t sessions_lock; /**< Session pool lock */
49 u8 **rx_buf; /**< intermediate rx buffers */
50 u8 *connect_test_data; /**< Pre-computed test data */
51 u32 **quic_session_index_by_thread;
52 u32 **connection_index_by_thread;
53 u32 **connections_this_batch_by_thread; /**< active connection batch */
55 volatile u32 ready_connections;
56 volatile u32 finished_connections;
57 volatile u64 rx_total;
58 volatile u64 tx_total;
59 volatile int run_test; /**< Signal start of test */
67 u32 connect_conn_index; /**< Conencts attempted progress */
70 * Application setup parameters
72 svm_msg_q_t **vpp_event_queue;
74 u32 cli_node_index; /**< cli process node index */
75 u32 app_index; /**< app index after attach */
76 pthread_t client_thread_handle;
79 * Configuration params
81 u32 n_clients; /**< Number of clients */
82 u8 *connect_uri; /**< URI for slave's connect */
83 session_endpoint_cfg_t connect_sep; /**< Sever session endpoint */
84 u64 bytes_to_send; /**< Bytes to send */
85 u32 configured_segment_size;
87 u32 expected_connections; /**< Number of clients/connections */
88 u32 connections_per_batch; /**< Connections to rx/tx at once */
89 u32 private_segment_count; /**< Number of private fifo segs */
90 u64 private_segment_size; /**< size of private fifo segs */
91 u32 tls_engine; /**< TLS engine mbedtls/openssl */
93 u32 no_copy; /**< Don't memcpy data to tx fifo */
94 u32 quic_streams; /**< QUIC streams per connection */
95 u32 ckpair_index; /**< Cert key pair for tls/quic */
96 u64 attach_flags; /**< App attach flags */
97 u8 *appns_id; /**< App namespaces id */
98 u64 appns_secret; /**< App namespace secret */
99 f64 syn_timeout; /**< Test syn timeout (s) */
100 f64 test_timeout; /**< Test timeout (s) */
106 u8 test_client_attached;
108 u8 test_return_packets;
109 int drop_packets; /**< drop all packets */
110 u8 prealloc_fifos; /**< Request fifo preallocation */
111 u8 prealloc_sessions;
116 u8 barrier_acq_needed;
118 vlib_main_t *vlib_main;
119 } echo_client_main_t;
123 ECHO_CLIENTS_STARTING,
124 ECHO_CLIENTS_RUNNING,
126 } echo_clients_test_state_e;
128 extern echo_client_main_t echo_client_main;
129 vlib_node_registration_t echo_clients_node;
131 void echo_clients_program_connects (void);
133 #endif /* __included_echo_client_h__ */
136 * fd.io coding-style-patch-verification: ON
139 * eval: (c-set-style "gnu")