xref: /dpdk/examples/server_node_efd/efd_server/init.h (revision 7faf4bd32566446fa0815eef743523ce6a95a355)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2017 Intel Corporation
3  */
4 
5 #ifndef _INIT_H_
6 #define _INIT_H_
7 
8 /*
9  * #include <rte_ring.h>
10  * #include "args.h"
11  */
12 
13 /*
14  * Define a node structure with all needed info, including
15  * stats from the nodes.
16  */
17 struct node {
18 	struct rte_ring *rx_q;
19 	unsigned int node_id;
20 	/* these stats hold how many packets the node will actually receive,
21 	 * and how many packets were dropped because the node's queue was full.
22 	 * The port-info stats, in contrast, record how many packets were received
23 	 * or transmitted on an actual NIC port.
24 	 */
25 	struct {
26 		uint64_t rx;
27 		uint64_t rx_drop;
28 	} stats;
29 };
30 
31 extern struct rte_efd_table *efd_table;
32 extern struct node *nodes;
33 
34 /*
35  * shared information between server and nodes: number of nodes,
36  * port numbers, rx and tx stats etc.
37  */
38 extern struct shared_info *info;
39 
40 extern struct rte_mempool *pktmbuf_pool;
41 extern uint8_t num_nodes;
42 extern unsigned int num_sockets;
43 extern uint32_t num_flows;
44 
45 int init(int argc, char *argv[]);
46 
47 #endif /* ifndef _INIT_H_ */
48