From: <krytarowski@caviumnetworks.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 2/2] ethdev: Export rte_eth_dev_create_unique_device_name() to public API
Date: Tue, 2 Feb 2016 15:27:19 +0100 [thread overview]
Message-ID: <1454423239-16382-2-git-send-email-krytarowski@caviumnetworks.com> (raw)
In-Reply-To: <1454423239-16382-1-git-send-email-krytarowski@caviumnetworks.com>
From: Kamil Rytarowski <Kamil.Rytarowski@caviumnetworks.com>
Once pci_drv.devinit is overloaded, it's a function used in the original
rte_eth_dev_init(), still reusable in altered versions.
Signed-off-by: Kamil Rytarowski <Kamil.Rytarowski@caviumnetworks.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ac4aeab..7f5e741 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -214,7 +214,7 @@ rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type)
return eth_dev;
}
-static int
+int
rte_eth_dev_create_unique_device_name(char *name, size_t size,
struct rte_pci_device *pci_dev)
{
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8710dd7..b19db9d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3880,6 +3880,24 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
uint16_t queue_id, size_t size,
unsigned align, int socket_id);
+/**
+ * Create unique device name
+ *
+ * @param name
+ * The port identifier of the Ethernet device.
+ * @param size
+ * Maximum string length of the generated name
+ * @param pci_dev
+ * PCI device pointer
+ *
+ * @return
+ * - 0: Success.
+ * - <0: Error during generatin
+ * - -EINVAL: Invalid input parameters.
+ */
+int rte_eth_dev_create_unique_device_name(char *name, size_t size,
+ struct rte_pci_device *pci_dev);
+
#ifdef __cplusplus
}
#endif
--
1.9.1
next prev parent reply other threads:[~2016-02-02 14:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 14:27 [dpdk-dev] [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit krytarowski
2016-02-02 14:27 ` krytarowski [this message]
2016-02-11 16:56 ` [dpdk-dev] [PATCH 2/2] ethdev: Export rte_eth_dev_create_unique_device_name() to public API Panu Matilainen
2016-02-11 17:15 ` David Marchand
2016-02-03 8:47 ` [dpdk-dev] [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit David Marchand
2016-02-03 11:39 ` Kamil Rytarowski
2016-02-03 14:08 ` David Marchand
2016-02-03 15:49 ` Kamil Rytarowski
2016-02-03 15:59 ` Kamil Rytarowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454423239-16382-2-git-send-email-krytarowski@caviumnetworks.com \
--to=krytarowski@caviumnetworks.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).