From patchwork Tue Nov 4 03:45:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuya Mukawa X-Patchwork-Id: 1098 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 8014F7F85; Tue, 4 Nov 2014 04:37:27 +0100 (CET) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id BE6DE7F74 for ; Tue, 4 Nov 2014 04:37:22 +0100 (CET) Received: by mail-pa0-f43.google.com with SMTP id eu11so13571567pac.2 for ; Mon, 03 Nov 2014 19:46:39 -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=v01QYICMNvd/fNe729qbWB5n47KX3PDbayCI1JB8Bc8=; b=JjIQXrY+fBUkPVR89ZzaluGuGJXMxY9C10pWOlOyXHojfGfB4YNtSJ8OqeFD8jA7GX W1pCI7tL7kvjfFUEJf0xM2WduyfnFm2dTZb7LaxPErY5gKXraiE6iXeMYcKJGQU8Ljuz Z7XE2F77RiPsHMmle4bwUQAyEFFxglqUuHBG8OJgPGyKaspjW3bB0BDF1zDraAQMrPjz TSNdsmZxTMCno2acizPysHPLyxGbHTDrA3kEZeuSzi1LKqQgHnOCOpsdj1DfIV9fYmZo 9JzHwDy/gt1D0W7Zx14eu3Rm/0hHX6TQglMkaTFoFzwXEpY5vH9QMY8H6tbZ3R0A2QD0 Ls1Q== X-Gm-Message-State: ALoCoQneorQaK6zLJrW+JxkUUffFbqXvUmqvCv3xFTgS2WUA0FzPtmcEoaM4aT8ISFmn/fuwKKfP X-Received: by 10.70.51.195 with SMTP id m3mr47070418pdo.27.1415072798875; Mon, 03 Nov 2014 19:46:38 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id jc3sm18430580pbb.49.2014.11.03.19.46.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Nov 2014 19:46:38 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Tue, 4 Nov 2014 12:45:32 +0900 Message-Id: <1415072748-31937-13-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415072748-31937-1-git-send-email-mukawa@igel.co.jp> References: <1414572576-21371-1-git-send-email-mukawa@igel.co.jp> <1415072748-31937-1-git-send-email-mukawa@igel.co.jp> Cc: nakajima.yoshihiro@lab.ntt.co.jp, masutani.hitoshi@lab.ntt.co.jp Subject: [dpdk-dev] [RFC PATCH v2 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 17f3ae4..db78271 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 5cc438c..c3e8ff8 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1688,6 +1688,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