From 0b33b68d12d0bc37246b5142b7fd06e9dce8d49d Mon Sep 17 00:00:00 2001 From: Intel Date: Wed, 18 Sep 2013 12:00:00 +0200 Subject: [PATCH] ethdev: export allocate function The function rte_eth_dev_allocate() was called by rte_eth_dev_init(). In order to use it for non-pci devices, it is now in public API. Signed-off-by: Intel --- lib/librte_ether/rte_ethdev.c | 2 +- lib/librte_ether/rte_ethdev.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 2fc2806013..419281186f 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -152,7 +152,7 @@ rte_eth_dev_data_alloc(void) RTE_MAX_ETHPORTS * sizeof(*rte_eth_dev_data)); } -static inline struct rte_eth_dev * +struct rte_eth_dev * rte_eth_dev_allocate(void) { struct rte_eth_dev *eth_dev; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 524ef4fee3..cd4d91e908 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1134,6 +1134,17 @@ extern struct rte_eth_dev rte_eth_devices[]; */ extern uint8_t rte_eth_dev_count(void); +/** + * Function for internal use by dummy drivers primarily, e.g. ring-based + * driver. + * Allocates a new ethdev slot for an ethernet device and returns the pointer + * to that slot for the driver to use. + * + * @return + * - Slot in the rte_dev_devices array for a new device; + */ +struct rte_eth_dev *rte_eth_dev_allocate(void); + struct eth_driver; /** * @internal -- 2.20.1