xref: /dpdk/examples/multi_process/client_server_mp/mp_server/init.h (revision 3998e2a07220844d3f3c17f76a781ced3efe0de0)
1*3998e2a0SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
2*3998e2a0SBruce Richardson  * Copyright(c) 2010-2014 Intel Corporation
3af75078fSIntel  */
4af75078fSIntel 
5af75078fSIntel #ifndef _INIT_H_
6af75078fSIntel #define _INIT_H_
7af75078fSIntel 
8af75078fSIntel /*
9af75078fSIntel  * #include <rte_ring.h>
10af75078fSIntel  * #include "args.h"
11af75078fSIntel  */
12af75078fSIntel 
13af75078fSIntel /*
14af75078fSIntel  * Define a client structure with all needed info, including
15af75078fSIntel  * stats from the clients.
16af75078fSIntel  */
17af75078fSIntel struct client {
18af75078fSIntel 	struct rte_ring *rx_q;
19af75078fSIntel 	unsigned client_id;
20af75078fSIntel 	/* these stats hold how many packets the client will actually receive,
21af75078fSIntel 	 * and how many packets were dropped because the client's queue was full.
22af75078fSIntel 	 * The port-info stats, in contrast, record how many packets were received
23af75078fSIntel 	 * or transmitted on an actual NIC port.
24af75078fSIntel 	 */
25af75078fSIntel 	struct {
26af75078fSIntel 		volatile uint64_t rx;
27af75078fSIntel 		volatile uint64_t rx_drop;
28af75078fSIntel 	} stats;
29af75078fSIntel };
30af75078fSIntel 
31af75078fSIntel extern struct client *clients;
32af75078fSIntel 
33af75078fSIntel /* the shared port information: port numbers, rx and tx stats etc. */
34af75078fSIntel extern struct port_info *ports;
35af75078fSIntel 
36af75078fSIntel extern struct rte_mempool *pktmbuf_pool;
37af75078fSIntel extern uint8_t num_clients;
38af75078fSIntel extern unsigned num_sockets;
39af75078fSIntel extern struct port_info *ports;
40af75078fSIntel 
41af75078fSIntel int init(int argc, char *argv[]);
42af75078fSIntel 
43af75078fSIntel #endif /* ifndef _INIT_H_ */
44