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