xref: /dpdk/lib/node/rte_node_eth_api.h (revision af0785a2447b307965377b62f46a5f39457a85a3)
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_compat.h>
25 #include <rte_common.h>
26 #include <rte_mempool.h>
27 
28 /**
29  * Port config for ethdev_rx and ethdev_tx node.
30  */
31 struct rte_node_ethdev_config {
32 	uint16_t port_id;
33 	/**< Port identifier */
34 	uint16_t num_rx_queues;
35 	/**< Number of Rx queues. */
36 	uint16_t num_tx_queues;
37 	/**< Number of Tx queues. */
38 	struct rte_mempool **mp;
39 	/**< Array of mempools associated to Rx queue. */
40 	uint16_t mp_count;
41 	/**< Size of mp array. */
42 };
43 
44 /**
45  * Initializes ethdev nodes.
46  *
47  * @param cfg
48  *   Array of ethdev config that identifies which port's
49  *   ethdev_rx and ethdev_tx nodes need to be created
50  *   and queue association.
51  * @param cnt
52  *   Size of cfg array.
53  * @param nb_graphs
54  *   Number of graphs that will be used.
55  *
56  * @return
57  *   0 on successful initialization, negative otherwise.
58  */
59 __rte_experimental
60 int rte_node_eth_config(struct rte_node_ethdev_config *cfg,
61 			uint16_t cnt, uint16_t nb_graphs);
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* __INCLUDE_RTE_NODE_ETH_API_H__ */
67