2018-09-19 16:03:35 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2018 Gaëtan Rivet
|
|
|
|
*/
|
|
|
|
|
2019-10-22 00:19:45 +00:00
|
|
|
#ifndef _ETH_PRIVATE_H_
|
|
|
|
#define _ETH_PRIVATE_H_
|
2018-09-19 16:03:35 +00:00
|
|
|
|
|
|
|
#include "rte_ethdev.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-10-23 08:28:37 +00:00
|
|
|
/*
|
|
|
|
* Convert rte_eth_dev pointer to port id.
|
|
|
|
* NULL will be translated to RTE_MAX_ETHPORTS.
|
|
|
|
*/
|
|
|
|
uint16_t eth_dev_to_id(const struct rte_eth_dev *dev);
|
|
|
|
|
2018-09-19 16:03:35 +00:00
|
|
|
/* Generic rte_eth_dev comparison function. */
|
|
|
|
typedef int (*rte_eth_cmp_t)(const struct rte_eth_dev *, const void *);
|
|
|
|
|
|
|
|
/* Generic rte_eth_dev iterator. */
|
|
|
|
struct rte_eth_dev *
|
|
|
|
eth_find_device(const struct rte_eth_dev *_start, rte_eth_cmp_t cmp,
|
|
|
|
const void *data);
|
|
|
|
|
2018-10-22 13:15:28 +00:00
|
|
|
/* Parse devargs value for representor parameter. */
|
|
|
|
typedef int (*rte_eth_devargs_callback_t)(char *str, void *data);
|
|
|
|
int rte_eth_devargs_parse_list(char *str, rte_eth_devargs_callback_t callback,
|
|
|
|
void *data);
|
|
|
|
int rte_eth_devargs_parse_representor_ports(char *str, void *data);
|
|
|
|
|
2018-09-19 16:03:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-10-22 00:19:45 +00:00
|
|
|
#endif /* _ETH_PRIVATE_H_ */
|