From patchwork Thu Nov 20 09:06:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuya Mukawa X-Patchwork-Id: 1375 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 1DAD77FCF; Thu, 20 Nov 2014 09:57:21 +0100 (CET) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by dpdk.org (Postfix) with ESMTP id 577447FFE for ; Thu, 20 Nov 2014 09:57:17 +0100 (CET) Received: by mail-pd0-f177.google.com with SMTP id ft15so2664528pdb.8 for ; Thu, 20 Nov 2014 01:07:46 -0800 (PST) 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=DnISyanW52UW2ixtr3EiZxfVE6R6lLq+8R+vKBoDh6Y=; b=b7K+jfw7M4dl8q6+YtwH7okmpmHZg716j59OEDf2K4MYP1uUkq6dDH3aacDT1FbE++ eD8tx2gDd9TdegKNxX/9TF4cd8vcCgO9Jwwg7N0XAj4LkOROT7ahQAaAMEeWliag1cuW Vew3vxdhER7RUbjVk6SMptys22lZbYCuGIJo2wIYipJTN9xbYloEqMTTYGVA7OcKD4MY N3ZZfqwADp2Z19sqC9H+f0xZof9xXA+0MBY96oQmp6fLNMEozOnstrHihZCHKs/ReG5f CYxha7j8q5EmRJTVeDaa5j965S43ivSzs1akif2mD3DKgSPSveU2+d4lz1uSUE58xQ/x 2FQQ== X-Gm-Message-State: ALoCoQnxnjRsc4yFjaS14QP9Wv+6O4nvBexTIahwLdr/WoEfpzDKRtsdgEnzmgWC+o9edRKjdnMg X-Received: by 10.66.145.166 with SMTP id sv6mr28502101pab.140.1416474466098; Thu, 20 Nov 2014 01:07:46 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id a6sm1432407pbu.64.2014.11.20.01.07.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 01:07:45 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Thu, 20 Nov 2014 18:06:26 +0900 Message-Id: <1416474399-16851-13-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> References: <1414572576-21371-1-git-send-email-mukawa@igel.co.jp> <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> Cc: nakajima.yoshihiro@lab.ntt.co.jp, menrigh@brocade.com, masutani.hitoshi@lab.ntt.co.jp Subject: [dpdk-dev] [PATCH 12/25] ethdev: Change scope of rte_eth_dev_allocated to global 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" This function is used by virtual PMDs to support port hotplug framework. So change scope of the function to global. Signed-off-by: Tetsuya Mukawa --- lib/librte_ether/rte_ethdev.c | 2 +- lib/librte_ether/rte_ethdev.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0d2397b..c697d83 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -196,7 +196,7 @@ rte_eth_dev_data_alloc(void) RTE_MAX_ETHPORTS * sizeof(*rte_eth_dev_data)); } -static struct rte_eth_dev * +struct rte_eth_dev * rte_eth_dev_allocated(const char *name) { unsigned i; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 49b4e9b..0846bff 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1708,6 +1708,16 @@ extern int rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); extern int rte_eth_dev_check_detachable(uint8_t port_id); /** + * Function for internal use by port hotplug functions. + * Returns a ethdev slot specified by the unique identifier name. + * @param name + * The pointer to the Unique identifier name for each Ethernet device + * @return + * - The pointer to the ethdev slot, on success. NULL on error + */ +extern struct rte_eth_dev *rte_eth_dev_allocated(const char *name); + +/** * Function for internal use by dummy drivers primarily, e.g. ring-based * driver. * Allocates a new ethdev slot for an ethernet device and returns the pointer