From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 2C5BE8DA4 for ; Thu, 29 Oct 2015 09:55:12 +0100 (CET) Received: by wmec75 with SMTP id c75so20617435wme.1 for ; Thu, 29 Oct 2015 01:55:12 -0700 (PDT) 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=Hgck/eC/r1bDOs+yWQlZGA8vkaexZG6ZDFxsNDsLvYE=; b=JDycg840y0vTo9dd6F2CzkqbJMCX4F7izbYVRk5tMOA6Ru6E5gee8UOdyd72PDdl3p 48ck2UhRic5edZRugNa+kXL5zYvZGT1pfeVZIUR2LxaEjBF4YDLk6NYqd6mhukrlYGxF fJxCginrUMxzB8WnyAAoBZiRk9DlDrfq/VKzbGTw5zMXsaRmhqej9hjnss9uX/EF4cdQ Mmso/6wwuLBrA25XIXkfRl/JL8K6pfdVdV1Jx6aRwmUbdSECSBTQD7SgoklMHksmyMWn CQu1SAkhpySuZYp7LX4o87dp9V/No2ZxJ94oouoz0+NkHvmXQgy8YSgWmerX+snuNVhI E94Q== 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=Hgck/eC/r1bDOs+yWQlZGA8vkaexZG6ZDFxsNDsLvYE=; b=VFYys2gagg0ebsHVy4RpwvQFXb/thhSudJHYuLqZLRgDehORxFGG2slV0yfUJRj9Cf +wq8hI+a5idVV6cYLPMU0GLxo5+UzKYzQ6/iYCp6TCLFEH8QiNO+yNoSTuBCjKFD7hWZ HkrbJRC5+cp1so+8h8Kl2wxZi4xu/Aoe2Gw4eP2kh1CvGFHsWO7q4pQkyeMIzyT2i4e0 +His3ZflfEeDC3Lkq5yFVHLSBn7cT20K/MQbdfwMogVGONuOKWUlEUucTTCcsjCSTt+5 dge8lHIDadnX/W+XmjCVCeTpxIeD+EAnHj2SKjYHNGhdC2MhgfCeSYDwpovhZQjKSKOB MHZA== X-Gm-Message-State: ALoCoQlOiQizVXukJGbbyWmkcPyWWRz6J2tJH7z8LTqgK1wsGTXgvIQyLtRj/Sx75aVaKS8GEuJP X-Received: by 10.28.138.148 with SMTP id m142mr2046482wmd.79.1446108912052; Thu, 29 Oct 2015 01:55:12 -0700 (PDT) Received: from gloops.dev.6wind.com (89-158-215-180.rev.numericable.fr. [89.158.215.180]) by smtp.gmail.com with ESMTPSA id xt1sm624273wjb.32.2015.10.29.01.55.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 01:55:11 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Thu, 29 Oct 2015 09:55:02 +0100 Message-Id: <1446108903-14412-3-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446108903-14412-1-git-send-email-david.marchand@6wind.com> References: <1446108903-14412-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 2/3] 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: , X-List-Received-Date: Thu, 29 Oct 2015 08:55:12 -0000 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 | 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