From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A30E5A09FD; Sun, 20 Dec 2020 22:14:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 258F4CB7B; Sun, 20 Dec 2020 22:14:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 0A72FCB7A for ; Sun, 20 Dec 2020 22:14:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608498866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wo1TyA2gOdKM+lwK2sOt5nFiulfHbnpjmWdjKymbOdI=; b=OIFt+B2m855b16US0dW8fMhKmXyDtamtsmcEplHiV5kgEsaU4cImoT7v81hM3/XXiZx6ht 8CRa+WAzlsFHNESp6RoW40Sj5MeUApPeAcGizfqManCKC7xCXlxBjEFha/3ejmQnPO6Opv 0ATl+Ma03x5Xdl5KxhYXCVtbEgNjHXE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-zBTqUbtWOdyKiMAWCRk4CA-1; Sun, 20 Dec 2020 16:14:24 -0500 X-MC-Unique: zBTqUbtWOdyKiMAWCRk4CA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 751C8107ACE3; Sun, 20 Dec 2020 21:14:23 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE61360C43; Sun, 20 Dec 2020 21:14:18 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com, amorenoz@redhat.com, david.marchand@redhat.com Cc: Maxime Coquelin Date: Sun, 20 Dec 2020 22:13:26 +0100 Message-Id: <20201220211405.313012-2-maxime.coquelin@redhat.com> In-Reply-To: <20201220211405.313012-1-maxime.coquelin@redhat.com> References: <20201220211405.313012-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH 01/40] bus/vdev: add helper to get vdev from eth dev 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds an helper macro to get the rte_vdev_device pointer from a rte_eth_dev pointer. This is similar to RTE_ETH_DEV_TO_PCI(). Signed-off-by: Maxime Coquelin --- drivers/bus/vdev/rte_bus_vdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h index d14eeb41b0..f99a41f825 100644 --- a/drivers/bus/vdev/rte_bus_vdev.h +++ b/drivers/bus/vdev/rte_bus_vdev.h @@ -34,6 +34,8 @@ struct rte_vdev_device { #define RTE_DEV_TO_VDEV_CONST(ptr) \ container_of(ptr, const struct rte_vdev_device, device) +#define RTE_ETH_DEV_TO_VDEV(eth_dev) RTE_DEV_TO_VDEV((eth_dev)->device) + static inline const char * rte_vdev_device_name(const struct rte_vdev_device *dev) { -- 2.29.2