From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 2/2] ethdev: export rte_eth_dev_is_detachable function Date: Tue, 03 Nov 2015 14:50:14 +0100 Message-ID: <4007343.9j0i5nBSyu@xps13> References: <1446108903-14412-1-git-send-email-david.marchand@6wind.com> <1446550500-24029-1-git-send-email-david.marchand@6wind.com> <1446550500-24029-3-git-send-email-david.marchand@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: David Marchand Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 42E818DAA for ; Tue, 3 Nov 2015 14:51:27 +0100 (CET) Received: by wicfv8 with SMTP id fv8so12034863wic.0 for ; Tue, 03 Nov 2015 05:51:27 -0800 (PST) In-Reply-To: <1446550500-24029-3-git-send-email-david.marchand@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-11-03 12:35, David Marchand: > From: Maxime Leroy > > It can be useful for application to know if a port can be detached or not. > > Signed-off-by: Maxime Leroy > Signed-off-by: David Marchand > --- > lib/librte_ether/rte_ethdev.c | 2 +- > lib/librte_ether/rte_ethdev.h | 12 ++++++++++++ > lib/librte_ether/rte_ether_version.map | 1 + > 3 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index ec1b632..373d29b 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -503,7 +503,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 7cf4af8..350733b 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1640,6 +1640,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); After more thoughts, we do not need such function to query a capability. The Bernard's patch add a bit-field to expose such capabilities. So this patchset is rejected, sorry.