xref: /dpdk/lib/ethdev/ethdev_private.h (revision 99a2dd955fba6e4cc23b77d590a033650ced9c45)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Gaëtan Rivet
3  */
4 
5 #ifndef _ETH_PRIVATE_H_
6 #define _ETH_PRIVATE_H_
7 
8 #include <rte_os_shim.h>
9 
10 #include "rte_ethdev.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /*
17  * Convert rte_eth_dev pointer to port id.
18  * NULL will be translated to RTE_MAX_ETHPORTS.
19  */
20 uint16_t eth_dev_to_id(const struct rte_eth_dev *dev);
21 
22 /* Generic rte_eth_dev comparison function. */
23 typedef int (*rte_eth_cmp_t)(const struct rte_eth_dev *, const void *);
24 
25 /* Generic rte_eth_dev iterator. */
26 struct rte_eth_dev *
27 eth_find_device(const struct rte_eth_dev *_start, rte_eth_cmp_t cmp,
28 		const void *data);
29 
30 /* Parse devargs value for representor parameter. */
31 int rte_eth_devargs_parse_representor_ports(char *str, void *data);
32 
33 #ifdef __cplusplus
34 }
35 #endif
36 
37 #endif /* _ETH_PRIVATE_H_ */
38