[dpdk-dev,RFC,v2,12/28] ethdev: Change scope of rte_eth_dev_allocated to global
Commit Message
This function is used by virtual PMDs to support port hotplug framework.
So change scope of the function to global.
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
@@ -196,7 +196,7 @@ rte_eth_dev_data_alloc(void)
RTE_MAX_ETHPORTS * sizeof(*rte_eth_dev_data));
}
-static struct rte_eth_dev *
+struct rte_eth_dev *
rte_eth_dev_allocated(const char *name)
{
unsigned i;
@@ -1688,6 +1688,16 @@ extern int rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
extern int rte_eth_dev_check_detachable(uint8_t port_id);
/**
+ * Function for internal use by port hotplug functions.
+ * Returns a ethdev slot specified by the unique identifier name.
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+extern struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
* 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