xref: /dpdk/lib/node/rte_node_eth_api.h (revision daa02b5cddbb8e11b31d41e2bf7bb1ae64dcae2f)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2020 Marvell International Ltd.
3  */
4 
5 #ifndef __INCLUDE_RTE_NODE_ETH_API_H__
6 #define __INCLUDE_RTE_NODE_ETH_API_H__
7 
8 /**
9  * @file rte_node_eth_api.h
10  *
11  * @warning
12  * @b EXPERIMENTAL:
13  * All functions in this file may be changed or removed without prior notice.
14  *
15  * This API allows to setup ethdev_rx and ethdev_tx nodes
16  * and its queue associations.
17  *
18  */
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include <rte_common.h>
25 #include <rte_mempool.h>
26 
27 /**
28  * Port config for ethdev_rx and ethdev_tx node.
29  */
30 struct rte_node_ethdev_config {
31 	uint16_t port_id;
32 	/**< Port identifier */
33 	uint16_t num_rx_queues;
34 	/**< Number of Rx queues. */
35 	uint16_t num_tx_queues;
36 	/**< Number of Tx queues. */
37 	struct rte_mempool **mp;
38 	/**< Array of mempools associated to Rx queue. */
39 	uint16_t mp_count;
40 	/**< Size of mp array. */
41 };
42 
43 /**
44  * Initializes ethdev nodes.
45  *
46  * @param cfg
47  *   Array of ethdev config that identifies which port's
48  *   ethdev_rx and ethdev_tx nodes need to be created
49  *   and queue association.
50  * @param cnt
51  *   Size of cfg array.
52  * @param nb_graphs
53  *   Number of graphs that will be used.
54  *
55  * @return
56  *   0 on successful initialization, negative otherwise.
57  */
58 __rte_experimental
59 int rte_node_eth_config(struct rte_node_ethdev_config *cfg,
60 			uint16_t cnt, uint16_t nb_graphs);
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* __INCLUDE_RTE_NODE_ETH_API_H__ */
66