From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 322FA5A3E for ; Sat, 25 Feb 2017 11:28:38 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id 89so4905794wrr.1 for ; Sat, 25 Feb 2017 02:28:38 -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=btlFXYq2MIbwLafo4Iki2GouG8uXWBqVs39VmAHkAxi2VnOw0E21oPkP7KR30HXcd7 llziEk5nrZBOlQhaQEn9F6lnPJP9qa4LhG32tCaZ0ODdsmHyw1VR0Zb0yNRiEfPWgD75 z+BUaAffwbfhzYcXgCclXFgh+px0QY1Dj6forKi94SlSKcs5P3Gw2SkPmyRcxcK7+cNE sdSx88cL9OU4nUT/icsByrx+BvbOJhUQ8w4mWIuVbuNekJUOQT4u9OI6m+dwmvUS879s cQbMCHjmnDhnlX+EHFt5ri9uof+KrgmtH5ZEx5tf4treBaVM+7ksx8Mka6pZNi/9cx1L zMYA== 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=CLDgGDk6JuNfuNL6HUf8cA4ldUpcPO1nVkMrL69bGoFh7w6qEEaU/KuPp8OweYBw47 vuq0goM1SECtsGq4vLghT0PDxeODpw/83xud25KfHG5JBEMoHnL5EGnlfui5fXSioN5l ICCV5yB9eMWHennl0wRNeQeVY6NtzpI1DIlPts1OfHSW106q4CPm0Zbef4Cafasaulyp zZsEI0iydu/0IR+x67GXJl1A9XbWXeCeDdV3YCX2ERU9hsuhFPGg/x+EOtqV4EtiJISS KRS66xiTVYlhyOcKKv0IbkaF4N+oQEKYKxtAj2EKdEV0+DCN+b99WMob3OQOMQlLRZIT U9/w== X-Gm-Message-State: AMke39nbeqqUP32MLFA0v1s8Armqg9MiAyhyOp6aYW17NRqrKiWJirq6v9+xIz8ItDJ2Yg== X-Received: by 10.223.139.93 with SMTP id v29mr6017126wra.144.1488018517866; Sat, 25 Feb 2017 02:28:37 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id e72sm5830893wma.16.2017.02.25.02.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Feb 2017 02:28:36 -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: Sat, 25 Feb 2017 11:28:13 +0100 Message-Id: <1488018496-995-8-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488018496-995-1-git-send-email-jblunck@infradead.org> References: <1488018496-995-1-git-send-email-jblunck@infradead.org> In-Reply-To: <1487600262-14382-1-git-send-email-jblunck@infradead.org> References: <1487600262-14382-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v3 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: Sat, 25 Feb 2017 10:28:38 -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