From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 ; Tue, 11 Apr 2017 17:44:35 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id u2so4115486wmu.0 for ; 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 To: dev@dpdk.org Cc: Jan Blunck 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: References: <1488797809-12917-1-git-send-email-jblunck@infradead.org> In-Reply-To: References: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 15:44:36 -0000 From: Jan Blunck 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 Acked-by: Shreyansh Jain --- 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 #include +#include 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