From patchwork Tue Nov 3 11:35:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 8566 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5AB4A8E99; Tue, 3 Nov 2015 12:35:27 +0100 (CET) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id EE5BE8E95 for ; Tue, 3 Nov 2015 12:35:25 +0100 (CET) Received: by wmff134 with SMTP id f134so12257585wmf.0 for ; Tue, 03 Nov 2015 03:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0aOwZ0ISkAPwy2AQ1wbmDkgxNTA43+A4NJPsMpGz5gU=; b=ZJOfNqx/n4fpXa3M3LhekFTeoq40wNJzmp+J7N0Oc7AUr+QXrKXWq/7ACbTtUx14jP jz8kP1SghcIT9HV3KHmv3ce2gW+OV4l0JAilUbiTFxunx4d0cvJVXuMjlBWOlmjIqSUX BZCK3ap5qwYlya4rFzrZrBvonw/5uy4Pg1JVK3KV8v8h6Z+6xeGG1Fjq9eGTw8mu1mny 9BOh0bsAR5TLFTJrPpmEYufeiMccnzjEpvNg+WMnIf7OKbLBQc170QtkhRSzoNs4j8ip Vh8MJLe0VSEwEncqeq4rcMmjweDTg0dBazUkR0yIM9UrbHb3zIuVuJhBaqNV1BrXeyPs fTtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0aOwZ0ISkAPwy2AQ1wbmDkgxNTA43+A4NJPsMpGz5gU=; b=UK7JdLBWmf6XpGZi8tNy9FrLWMFi0nLKtZjZJccioATb9bwlYnqJahgWI/EF4OG7wR +NzL0JPOO1rvCT6Sfy5MGrzUmFk2Vr1NNHD537tOrM8tun4+P+yh8IkaKJiatOK+m9KX 5QcZLTS8z/9gUxtz8/rbUJcaLBH1H2WAEICfBDWS0kr1IJRiQ3eXuBmJrmSDdMJ9obgu xh8pJzz1B2zxyW/BBqgO2gqZnarX5sOb1ploUUub29oxpzXnraCErX1L+PFHwRvzoBji xi5oxJGR09SF/UFx201QcGTqHplvlauFHA/dT6nBWbEajE8xSXXGkWBGEXy2bhqMSGSt mxYw== X-Gm-Message-State: ALoCoQnSRVvWSsA2lzgY3R/ZMtQRrhGQvtlC6qy2eM/5/ewCDv4J0M8CMenl2EIOtp2fYV/4dz1s X-Received: by 10.28.13.75 with SMTP id 72mr18136593wmn.20.1446550525796; Tue, 03 Nov 2015 03:35:25 -0800 (PST) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id pc2sm5536175wjb.11.2015.11.03.03.35.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 03:35:25 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Tue, 3 Nov 2015 12:35:00 +0100 Message-Id: <1446550500-24029-3-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1446550500-24029-1-git-send-email-david.marchand@6wind.com> References: <1446108903-14412-1-git-send-email-david.marchand@6wind.com> <1446550500-24029-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 2/2] ethdev: export rte_eth_dev_is_detachable function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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" 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); + struct eth_driver; /** * @internal diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index 7b04e95..40c2a02 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -132,6 +132,7 @@ DPDK_2.2 { global: rte_eth_dev_get_dcb_info; + rte_eth_dev_is_detachable; rte_eth_rx_queue_info_get; rte_eth_tx_queue_info_get;