From: Intel Date: Wed, 18 Sep 2013 10:00:00 +0000 (+0200) Subject: ethdev: export allocate function X-Git-Tag: spdx-start~11139 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0b33b68d12d0bc37246b5142b7fd06e9dce8d49d;p=dpdk.git 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 --- 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