FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
echo_client.h
Go to the documentation of this file.
1 
2 /*
3  * echo_client.h - built-in application layer echo client
4  *
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:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18 #ifndef __included_echo_client_h__
19 #define __included_echo_client_h__
20 
21 #include <vnet/vnet.h>
22 #include <vnet/ip/ip.h>
23 #include <vnet/ethernet/ethernet.h>
24 
25 #include <vppinfra/hash.h>
26 #include <vppinfra/error.h>
27 #include <vnet/session/session.h>
29 
30 typedef struct
31 {
32  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
41 
42 typedef struct
43 {
44  /*
45  * Application setup parameters
46  */
47  svm_queue_t *vl_input_queue; /**< vpe input queue */
49 
50  u32 cli_node_index; /**< cli process node index */
51  u32 my_client_index; /**< loopback API client handle */
52  u32 app_index; /**< app index after attach */
53 
54  /*
55  * Configuration params
56  */
57  u8 *connect_uri; /**< URI for slave's connect */
58  u64 bytes_to_send; /**< Bytes to send */
61  u32 expected_connections; /**< Number of clients/connections */
62  u32 connections_per_batch; /**< Connections to rx/tx at once */
63  u32 private_segment_count; /**< Number of private fifo segs */
64  u32 private_segment_size; /**< size of private fifo segs */
65  u32 tls_engine; /**< TLS engine mbedtls/openssl */
67  u32 no_copy; /**< Don't memcpy data to tx fifo */
68  u32 quic_streams; /**< QUIC streams per connection */
69  u32 ckpair_index; /**< Cert key pair for tls/quic */
70 
71  /*
72  * Test state variables
73  */
74  eclient_session_t *sessions; /**< Session pool, shared */
76  u8 **rx_buf; /**< intermediate rx buffers */
77  u8 *connect_test_data; /**< Pre-computed test data */
80  u32 **connections_this_batch_by_thread; /**< active connection batch */
82 
85  volatile u64 rx_total;
86  volatile u64 tx_total;
87  volatile int run_test; /**< Signal start of test */
88 
93  /*
94  * Flags
95  */
101  int drop_packets; /**< drop all packets */
102  u8 prealloc_fifos; /**< Request fifo preallocation */
107 
110 
111 enum
112 {
118 
120 
121 #endif /* __included_echo_client_h__ */
122 
123 /*
124  * fd.io coding-style-patch-verification: ON
125  *
126  * Local Variables:
127  * eval: (c-set-style "gnu")
128  * End:
129  */
echo_client_main_t::test_client_attached
u8 test_client_attached
Definition: echo_client.h:97
app_session_t
Definition: application_interface.h:310
echo_client_main_t::connection_index_by_thread
u32 ** connection_index_by_thread
Definition: echo_client.h:79
echo_client_main_t::private_segment_count
u32 private_segment_count
Number of private fifo segs.
Definition: echo_client.h:63
eclient_session_t::bytes_to_send
u64 bytes_to_send
Definition: echo_client.h:34
echo_client_main_t::private_segment_size
u32 private_segment_size
size of private fifo segs
Definition: echo_client.h:64
ECHO_CLIENTS_RUNNING
@ ECHO_CLIENTS_RUNNING
Definition: echo_client.h:114
echo_client_main_t::no_copy
u32 no_copy
Don't memcpy data to tx fifo.
Definition: echo_client.h:67
echo_client_main_t::connections_per_batch
u32 connections_per_batch
Connections to rx/tx at once.
Definition: echo_client.h:62
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
eclient_session_t::bytes_to_receive
u64 bytes_to_receive
Definition: echo_client.h:36
echo_client_main_t::my_client_index
u32 my_client_index
loopback API client handle
Definition: echo_client.h:51
echo_client_main_t::repeats
u32 repeats
Definition: echo_client.h:92
svm_queue_t
struct _svm_queue svm_queue_t
echo_client_main_t::cli_node_index
u32 cli_node_index
cli process node index
Definition: echo_client.h:50
echo_client_main_t::quic_session_index_by_thread
u32 ** quic_session_index_by_thread
Definition: echo_client.h:78
echo_client_main_t::rx_total
volatile u64 rx_total
Definition: echo_client.h:85
ECHO_CLIENTS_EXITING
@ ECHO_CLIENTS_EXITING
Definition: echo_client.h:115
echo_client_main_t::fifo_size
u32 fifo_size
Definition: echo_client.h:60
echo_client_main_t::i_am_master
int i_am_master
Definition: echo_client.h:100
ethernet.h
echo_client_main_t::rx_buf
u8 ** rx_buf
intermediate rx buffers
Definition: echo_client.h:76
echo_clients_test_state_e
enum @689 echo_clients_test_state_e
echo_client_main_t::drop_packets
int drop_packets
drop all packets
Definition: echo_client.h:101
echo_client_main_t::prealloc_fifos
u8 prealloc_fifos
Request fifo preallocation.
Definition: echo_client.h:102
echo_client_main_t::tx_total
volatile u64 tx_total
Definition: echo_client.h:86
eclient_session_t::vpp_session_handle
u64 vpp_session_handle
Definition: echo_client.h:38
hash.h
echo_client_main_t::connect_uri
u8 * connect_uri
URI for slave's connect.
Definition: echo_client.h:57
echo_client_main_t::sessions_lock
clib_spinlock_t sessions_lock
Definition: echo_client.h:75
echo_client_main_t::ckpair_index
u32 ckpair_index
Cert key pair for tls/quic.
Definition: echo_client.h:69
error.h
echo_client_main_t::is_dgram
u8 is_dgram
Definition: echo_client.h:66
echo_client_main_t::configured_segment_size
u32 configured_segment_size
Definition: echo_client.h:59
clib_spinlock_s
Definition: lock.h:51
echo_client_main_t::vlib_main
vlib_main_t * vlib_main
Definition: echo_client.h:108
echo_client_main_t::client_thread_handle
pthread_t client_thread_handle
Definition: echo_client.h:81
f64
double f64
Definition: types.h:142
echo_clients_node
vlib_node_registration_t echo_clients_node
Definition: echo_client.h:119
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
svm_msg_q_
Definition: message_queue.h:72
echo_client_main_t::tls_engine
u32 tls_engine
TLS engine mbedtls/openssl.
Definition: echo_client.h:65
eclient_session_t::bytes_received
u64 bytes_received
Definition: echo_client.h:37
eclient_session_t::data
app_session_t data
Definition: echo_client.h:33
echo_client_main_t::expected_connections
u32 expected_connections
Number of clients/connections.
Definition: echo_client.h:61
echo_client_main_t
Definition: echo_client.h:42
echo_client_main_t::test_start_time
f64 test_start_time
Definition: echo_client.h:89
eclient_session_t
Definition: echo_client.h:30
echo_client_main_t::sessions
eclient_session_t * sessions
Session pool, shared.
Definition: echo_client.h:74
echo_client_main_t::bytes_to_send
u64 bytes_to_send
Bytes to send.
Definition: echo_client.h:58
echo_client_main_t::no_return
u8 no_return
Definition: echo_client.h:98
ECHO_CLIENTS_STARTING
@ ECHO_CLIENTS_STARTING
Definition: echo_client.h:113
echo_client_main_t::quic_streams
u32 quic_streams
QUIC streams per connection.
Definition: echo_client.h:68
u64
unsigned long u64
Definition: types.h:89
ip.h
u32
unsigned int u32
Definition: types.h:88
echo_client_main_t::transport_proto
u8 transport_proto
Definition: echo_client.h:106
echo_client_main_t::test_end_time
f64 test_end_time
Definition: echo_client.h:90
echo_client_main_t::test_failed
u8 test_failed
Definition: echo_client.h:105
echo_client_main_t::run_test
volatile int run_test
Signal start of test.
Definition: echo_client.h:87
echo_client_main_t::no_output
u8 no_output
Definition: echo_client.h:103
echo_client_main_t::prev_conns
u32 prev_conns
Definition: echo_client.h:91
vlib_main_t
Definition: main.h:102
echo_client_main_t::app_index
u32 app_index
app index after attach
Definition: echo_client.h:52
application_interface.h
echo_client_main_t::connect_test_data
u8 * connect_test_data
Pre-computed test data.
Definition: echo_client.h:77
echo_client_main_t::vl_input_queue
svm_queue_t * vl_input_queue
vpe input queue
Definition: echo_client.h:47
echo_client_main_t::finished_connections
volatile u32 finished_connections
Definition: echo_client.h:84
u8
unsigned char u8
Definition: types.h:56
eclient_session_t::bytes_sent
u64 bytes_sent
Definition: echo_client.h:35
session.h
eclient_session_t::thread_index
u8 thread_index
Definition: echo_client.h:39
echo_client_main_t::ready_connections
volatile u32 ready_connections
Definition: echo_client.h:83
vnet.h
echo_client_main_t::vpp_event_queue
svm_msg_q_t ** vpp_event_queue
Definition: echo_client.h:48
echo_client_main
echo_client_main_t echo_client_main
Definition: echo_client.c:23
echo_client_main_t::is_init
u8 is_init
Definition: echo_client.h:96
echo_client_main_t::connections_this_batch_by_thread
u32 ** connections_this_batch_by_thread
active connection batch
Definition: echo_client.h:80
echo_client_main_t::test_bytes
u8 test_bytes
Definition: echo_client.h:104
echo_client_main_t::test_return_packets
u8 test_return_packets
Definition: echo_client.h:99