xref: /dpdk/lib/ethdev/ethdev_private.h (revision daa02b5cddbb8e11b31d41e2bf7bb1ae64dcae2f)
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 /*
13  * Convert rte_eth_dev pointer to port ID.
14  * NULL will be translated to RTE_MAX_ETHPORTS.
15  */
16 uint16_t eth_dev_to_id(const struct rte_eth_dev *dev);
17 
18 /* Generic rte_eth_dev comparison function. */
19 typedef int (*rte_eth_cmp_t)(const struct rte_eth_dev *, const void *);
20 
21 /* Generic rte_eth_dev iterator. */
22 struct rte_eth_dev *
23 eth_find_device(const struct rte_eth_dev *_start, rte_eth_cmp_t cmp,
24 		const void *data);
25 
26 /* Parse devargs value for representor parameter. */
27 int rte_eth_devargs_parse_representor_ports(char *str, void *data);
28 
29 /* reset eth fast-path API to dummy values */
30 void eth_dev_fp_ops_reset(struct rte_eth_fp_ops *fpo);
31 
32 /* setup eth fast-path API to ethdev values */
33 void eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,
34 		const struct rte_eth_dev *dev);
35 
36 #endif /* _ETH_PRIVATE_H_ */
37