From patchwork Tue Dec 9 06:30:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuya Mukawa X-Patchwork-Id: 1868 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 B970F8069; Tue, 9 Dec 2014 07:31:16 +0100 (CET) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id BAC1480A2 for ; Tue, 9 Dec 2014 07:31:14 +0100 (CET) Received: by mail-pd0-f173.google.com with SMTP id ft15so6677836pdb.18 for ; Mon, 08 Dec 2014 22:31:14 -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=dE3YKrwnj6KJY0kKh87+hgQwaMjzg8ttmXRhSRNLoFE=; b=TaS5nmMYnCAI9xQ69ozuDixxy0OuLw96R+OgrdJ8ucSePhvIU5+bfj3NpiUdBPMggs BVSrvYVk3ytJ4cUWoXpciZJ+i7G2fBLUPBc4FLIiHQGN4lEM7w8KWNEY6UyYCygJqbSj 2lPsZIHjMU7W8wGzI1p5VEbttDMHDTb6n27ddEeu27aWE/3vSvCnhkkX/6VcgHoohZPb y65Ptf75G98SClAMtwTHiD4NLvaqccttHnqkAsXfQ4m4c3MLSJico1ZkedgO+pRvdfEG jKx4Wtn4wcZzwqzYs9yCvPem7Rvdd/n3DimeEHh7woeHcRyOLyl/CqJ7ksUPAyF3gLT1 eENQ== X-Gm-Message-State: ALoCoQk8DSxKkPmgyYULJyGPM5BAk/dZHdZbtA09RimvrIUHMmNg6PXUshTy3hAfciJS+MV4HYno X-Received: by 10.68.224.6 with SMTP id qy6mr2321603pbc.35.1418106674060; Mon, 08 Dec 2014 22:31:14 -0800 (PST) Received: from eris.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id f12sm403088pat.43.2014.12.08.22.31.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Dec 2014 22:31:13 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Tue, 9 Dec 2014 15:30:13 +0900 Message-Id: <1418106629-22227-13-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418106629-22227-1-git-send-email-mukawa@igel.co.jp> References: <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> <1418106629-22227-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 v3 12/28] 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 ed53e66..86200e0 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -206,7 +206,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 404c41f..47622a2 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1712,6 +1712,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