[dpdk-dev] [RFC PATCH v2 12/28] ethdev: Change scope of rte_eth_dev_allocated to global
Tetsuya Mukawa
mukawa at igel.co.jp
Tue Nov 4 04:45:32 CET 2014
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 at igel.co.jp>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 17f3ae4..db78271 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -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;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 5cc438c..c3e8ff8 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -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
--
1.9.1
More information about the dev
mailing list