From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 0F8B9952 for ; Mon, 6 Mar 2017 11:57:11 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id u132so5031950wmg.1 for ; Mon, 06 Mar 2017 02:57:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=buBBfNrQlLB74t25vkKilknfROEZyz9TtcyiiLxNxWY=; b=R/9Es6dwPLDVZoDmS6aUSObiDRxL/4WPjS7tGiHpkQMT5mv3cmdgSoEGfZ/5aXsrYR t0d3l1hlFQOdJW2mSIDPUitLVDeztffRmw2z5VXsv7ULH3cYYd2s8YT/STK5nwrnN/b6 0RSnhdaf8WMyUGWI2gCWGd6z/jOJX1LCJvcSuJnQuCVCx+mLY2of9dXhOifg9JnZiabU oSDu2IXCXJRuDEWnEJXAin4gkra5m6+XSnoqErj7SGT0BxcPaBccX1TZJE5l/n5HQM56 bCIoGB/AUyrEGDRxdPrOcrNf5j4xhRee+SsVkn+8eJVfs88rKYHQUsFEv7spUj6+R4Ne cfOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=buBBfNrQlLB74t25vkKilknfROEZyz9TtcyiiLxNxWY=; b=ogJbZq1pjstaCtOeJYodkNzTwJ9LgE8kaxCCayBj9YeLuLse5NAOYU9KuA4Hvoufrm PefIXq+vHaY77lDP9u222MTvP63QVnxRSXI1lvPxEzmCZTG46wXbC4mZSGGK4QgEPIqD q5CtdJ+2Azfu1LbNB0wPmHXUt4T52PInNG4dhbFgakzhsWqG7qpzWAIY94zCOXk/TNLF z3WsB7Gp8zcf5pArcONhrbodSG+3DlgKKcfTnCw5KtBQnsIrpEqjud/kxAhVV5GOhbfZ 04XNlKEOpUNEL3pSRLROhuBWmAouhdw+K4FTG8a3N7biTcg670lpQ1ePz3wBs4vR/cFS wp+w== X-Gm-Message-State: AMke39kWjdOesHucrV6KkRrQZO0zFq+tTHa0UqMwFtb7U4SYqSKaXmDUxbMZM3SKGjLeQw== X-Received: by 10.28.180.135 with SMTP id d129mr12547159wmf.135.1488797830703; Mon, 06 Mar 2017 02:57:10 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id o63sm14277896wmo.30.2017.03.06.02.57.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:57:09 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: david.marchand@6wind.com, shreyansh.jain@nxp.com, ferruh.yigit@intel.com Date: Mon, 6 Mar 2017 11:56:46 +0100 Message-Id: <1488797809-12917-8-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488797809-12917-1-git-send-email-jblunck@infradead.org> References: <1488797809-12917-1-git-send-email-jblunck@infradead.org> In-Reply-To: <1488018496-995-1-git-send-email-jblunck@infradead.org> References: <1488018496-995-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v4 07/10] 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: Mon, 06 Mar 2017 10:57:11 -0000 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.7.4