From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gaetan.rivet@6wind.com>
Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45])
 by dpdk.org (Postfix) with ESMTP id 9B4C0695C
 for <dev@dpdk.org>; Tue, 11 Apr 2017 17:44:35 +0200 (CEST)
Received: by mail-wm0-f45.google.com with SMTP id u2so4115486wmu.0
 for <dev@dpdk.org>; Tue, 11 Apr 2017 08:44:35 -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
 :in-reply-to:references;
 bh=MbEKC1n5rJLBo4TqsoSgjcn24KAX+WXlr+8bRycfoMM=;
 b=c2+QIAX3I5DkX4cQ1zWK0cQWB19jHfXWLoicezRTvVB6gQYnoFofVDZHG0xvWAPDY1
 mGVZl/gGkvYV1xAgPmQoA5H0lsNugEPsKLO7hOLSxMAQ7GbqZFl2v19exRZqnr2I2phy
 ckWxP5ts8qQnTLht9E3UTK6sbNHTnOSc+4TR7NVAKkkjkzPqSCIeuMDkSX5Ffdh8geJx
 CzkRbHMHOmZ4eqcCz8m7L175/keAKK4aD3Ry2WiutZDuduLMHZ26NdL6rUqDNBXAFfsU
 qydPqLDnjfRriWCppZIL9SISQ+bqXF6zqeZl4C+0HRwQKLQYpf0Px93Aa/bhpUlbEAPm
 GWtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:in-reply-to:references;
 bh=MbEKC1n5rJLBo4TqsoSgjcn24KAX+WXlr+8bRycfoMM=;
 b=Hd4Oi9ChiNC/pFEuEkhnfXqlFtPDdXdcfpE84/evklibN8bCE3TQJSIBVBz2xPXNJN
 Za1NDWe6uUkLnIn7rCnfzqcIJcPK7SlQQf+ygHczol8OqppCQhYS4OdfwuQHr0MRlm7F
 TAqGFWVjSsEi+Qfr3LXoSJLkQpJWoNepuXxJPpEQClkkimeiiiUSkYawQ7Z/4MDS7dHm
 e8u07/X/0nIiD6sBw6THoKXTTm3XhiEcniyvxJ49vzEBwBxNa/MgQCmwNGTfBtgDtJjk
 RKgGEJPPw6fcJVrAaEgmopXChXS3l0M5a1hQP4jSyb70nMnXWOfxHwTdfFsgNA4lkTR7
 G5AA==
X-Gm-Message-State: AN3rC/41/F3i05PYWZNb6BQ9CWU7An6hECmOT9jS765vAS04ZG8SwTQl
 F3qrKvPxQUXiwmPgIok=
X-Received: by 10.28.184.66 with SMTP id i63mr15715301wmf.39.1491925475097;
 Tue, 11 Apr 2017 08:44:35 -0700 (PDT)
Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com.
 [62.23.145.78])
 by smtp.gmail.com with ESMTPSA id v14sm2936830wmv.24.2017.04.11.08.44.34
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Tue, 11 Apr 2017 08:44:34 -0700 (PDT)
From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Jan Blunck <jblunck@infradead.org>
Date: Tue, 11 Apr 2017 17:44:10 +0200
Message-Id: <538a76678417f79822e54df14ed59b8108adf3b4.1491925092.git.gaetan.rivet@6wind.com>
X-Mailer: git-send-email 2.1.4
In-Reply-To: <cover.1491925092.git.gaetan.rivet@6wind.com>
References: <1488797809-12917-1-git-send-email-jblunck@infradead.org>
 <cover.1491925092.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1491925092.git.gaetan.rivet@6wind.com>
References: <cover.1491925092.git.gaetan.rivet@6wind.com>
Subject: [dpdk-dev] [PATCH v5 06/12] eal: add virtual device name helper
	function
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 11 Apr 2017 15:44:36 -0000

From: Jan Blunck <jblunck@infradead.org>

This adds the rte_vdev_device_name() helper function to retrieve the
rte_vdev_device name which makes moving the name of the low-level
device into struct rte_device easier in the future.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 lib/librte_eal/common/include/rte_vdev.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h
index 8f98372..abdefab 100644
--- a/lib/librte_eal/common/include/rte_vdev.h
+++ b/lib/librte_eal/common/include/rte_vdev.h
@@ -39,12 +39,21 @@ extern "C" {
 
 #include <sys/queue.h>
 #include <rte_dev.h>
+#include <rte_devargs.h>
 
 struct rte_vdev_device {
 	TAILQ_ENTRY(rte_vdev_device) next;      /**< Next attached vdev */
 	struct rte_device device;               /**< Inherit core device */
 };
 
+static inline const char *
+rte_vdev_device_name(const struct rte_vdev_device *dev)
+{
+	if (dev && dev->device.devargs)
+		return dev->device.devargs->virt.drv_name;
+	return NULL;
+}
+
 /** Double linked list of virtual device drivers. */
 TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);
 
-- 
2.1.4