From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] ethdev: export rte_eth_dev_is_detachable function
Date: Thu, 29 Oct 2015 09:55:02 +0100 [thread overview]
Message-ID: <1446108903-14412-3-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <1446108903-14412-1-git-send-email-david.marchand@6wind.com>
From: Maxime Leroy <maxime.leroy@6wind.com>
It can be useful for application to know if a port can be detached or not.
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 12 ++++++++++++
lib/librte_ether/rte_ether_version.map | 7 +++++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 396667c..7fa5717 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -500,7 +500,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name)
return 0;
}
-static int
+int
rte_eth_dev_is_detachable(uint8_t port_id)
{
uint32_t drv_flags;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8a8c82b..160edd4 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1558,6 +1558,18 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id);
*/
int rte_eth_dev_detach(uint8_t port_id, char *devname);
+/**
+ * Check if an Ethernet device specified by port identifer is detachable.
+ *
+ * @param port_id
+ * The port identifier of the device to check if is detachable
+ *
+ * @return
+ * 1 if device is detachable, else 0
+ */
+int
+rte_eth_dev_is_detachable(uint8_t port_id);
+
struct eth_driver;
/**
* @internal
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 8345a6c..7f872c2 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -127,3 +127,10 @@ DPDK_2.1 {
rte_eth_timesync_read_tx_timestamp;
} DPDK_2.0;
+
+DPDK_2.2 {
+ global:
+
+ rte_eth_dev_is_detachable;
+
+} DPDK_2.1;
--
1.9.1
next prev parent reply other threads:[~2015-10-29 8:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 8:55 [dpdk-dev] [PATCH 0/3] export hotplug capability David Marchand
2015-10-29 8:55 ` [dpdk-dev] [PATCH 1/3] ethdev: rework value return by rte_eth_dev_is_detachable David Marchand
2015-10-29 8:55 ` David Marchand [this message]
2015-10-29 8:55 ` [dpdk-dev] [PATCH 3/3] ethdev: prevent segfaults in rte_eth_dev_is_detachable David Marchand
2015-11-03 11:10 ` Thomas Monjalon
2015-11-03 11:19 ` David Marchand
2015-11-03 11:20 ` Thomas Monjalon
2015-11-03 11:34 ` [dpdk-dev] [PATCH v2 0/2] export hotplug capability David Marchand
2015-11-03 11:34 ` [dpdk-dev] [PATCH v2 1/2] ethdev: rework value return by rte_eth_dev_is_detachable David Marchand
2015-11-03 11:35 ` [dpdk-dev] [PATCH v2 2/2] ethdev: export rte_eth_dev_is_detachable function David Marchand
2015-11-03 13:50 ` Thomas Monjalon
2015-11-04 7:49 ` David Marchand
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=1446108903-14412-3-git-send-email-david.marchand@6wind.com \
--to=david.marchand@6wind.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).