FD.io VPP  v18.04-17-g3a0d853
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) <current-year> <your-organization>
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 <svm/svm_fifo_segment.h>
28 #include <vnet/session/session.h>
30 
31 typedef struct
32 {
37 
40 
42 } session_t;
43 
44 typedef struct
45 {
46  /*
47  * Application setup parameters
48  */
49  svm_queue_t *vl_input_queue; /**< vpe input queue */
51 
52  u32 cli_node_index; /**< cli process node index */
53  u32 my_client_index; /**< loopback API client handle */
54  u32 app_index; /**< app index after attach */
55 
56  /*
57  * Configuration params
58  */
59  u8 *connect_uri; /**< URI for slave's connect */
60  u64 bytes_to_send; /**< Bytes to send */
63  u32 expected_connections; /**< Number of clients/connections */
64  u32 connections_per_batch; /**< Connections to rx/tx at once */
65  u32 private_segment_count; /**< Number of private fifo segs */
66  u32 private_segment_size; /**< size of private fifo segs */
67  u32 tls_engine; /**< TLS engine mbedtls/openssl */
68  /*
69  * Test state variables
70  */
71  session_t *sessions; /**< Session pool, shared */
73  u8 **rx_buf; /**< intermediate rx buffers */
74  u8 *connect_test_data; /**< Pre-computed test data */
76  u32 **connections_this_batch_by_thread; /**< active connection batch */
78 
81  volatile u64 rx_total;
82  volatile u64 tx_total;
83  volatile int run_test; /**< Signal start of test */
84 
89  /*
90  * Flags
91  */
97  int drop_packets; /**< drop all packets */
98  u8 prealloc_fifos; /**< Request fifo preallocation */
102 
105 
107 
109 
110 #endif /* __included_echo_client_h__ */
111 
112 /*
113  * fd.io coding-style-patch-verification: ON
114  *
115  * Local Variables:
116  * eval: (c-set-style "gnu")
117  * End:
118  */
vlib_main_t * vlib_main
Definition: echo_client.h:103
svm_queue_t ** vpp_event_queue
Definition: echo_client.h:50
u64 bytes_received
Definition: echo_client.h:36
u32 tls_engine
TLS engine mbedtls/openssl.
Definition: echo_client.h:67
u32 expected_connections
Number of clients/connections.
Definition: echo_client.h:63
u64 bytes_to_send
Bytes to send.
Definition: echo_client.h:60
u64 bytes_to_receive
Definition: echo_client.h:35
volatile int run_test
Signal start of test.
Definition: echo_client.h:83
u8 * connect_test_data
Pre-computed test data.
Definition: echo_client.h:74
struct _svm_fifo svm_fifo_t
u64 bytes_to_send
Definition: echo_client.h:33
svm_fifo_t * server_tx_fifo
Definition: echo_client.h:39
u32 app_index
app index after attach
Definition: echo_client.h:54
svm_queue_t * vl_input_queue
vpe input queue
Definition: echo_client.h:49
volatile u32 finished_connections
Definition: echo_client.h:80
unsigned long u64
Definition: types.h:89
volatile u32 ready_connections
Definition: echo_client.h:79
u32 ** connection_index_by_thread
Definition: echo_client.h:75
u64 bytes_sent
Definition: echo_client.h:34
u32 ** connections_this_batch_by_thread
active connection batch
Definition: echo_client.h:76
u32 private_segment_count
Number of private fifo segs.
Definition: echo_client.h:65
u32 connections_per_batch
Connections to rx/tx at once.
Definition: echo_client.h:64
echo_client_main_t echo_client_main
Definition: echo_client.c:23
u32 private_segment_size
size of private fifo segs
Definition: echo_client.h:66
unsigned int u32
Definition: types.h:88
u32 cli_node_index
cli process node index
Definition: echo_client.h:52
u32 my_client_index
loopback API client handle
Definition: echo_client.h:53
u8 ** rx_buf
intermediate rx buffers
Definition: echo_client.h:73
u8 prealloc_fifos
Request fifo preallocation.
Definition: echo_client.h:98
int drop_packets
drop all packets
Definition: echo_client.h:97
struct _vlib_node_registration vlib_node_registration_t
volatile u64 tx_total
Definition: echo_client.h:82
volatile u64 rx_total
Definition: echo_client.h:81
double f64
Definition: types.h:142
unsigned char u8
Definition: types.h:56
vlib_node_registration_t echo_clients_node
Definition: echo_client.h:108
u8 * connect_uri
URI for slave&#39;s connect.
Definition: echo_client.h:59
clib_spinlock_t sessions_lock
Definition: echo_client.h:72
struct _svm_queue svm_queue_t
u64 vpp_session_handle
Definition: echo_client.h:41
pthread_t client_thread_handle
Definition: echo_client.h:77
session_t * sessions
Session pool, shared.
Definition: echo_client.h:71
svm_fifo_t * server_rx_fifo
Definition: echo_client.h:38