From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 962E1A052A; Mon, 25 Jan 2021 18:15:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A8A3140FF7; Mon, 25 Jan 2021 18:15:06 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 4128C140FDF for ; Mon, 25 Jan 2021 18:15:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611594901; 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=pyDRdHhR9JqHiIY/Kt8dOz5DvVnYLy5moXvro+Ssc9c=; b=P44aLAVeC0tp9mlSyghbR5cBlBeEq5+iq9EZ34IvYav6mMN7EZGxzko4HpOoQ0cndIbgTJ vJqfNnN65IZsRG+e02XK6aZgPTX81PWSaUXRnguvS26YnNBzimRPbiKb8swzlRvE+nBPHQ ICeum0fDCFVogdGBxAPt6IcCOFrgN8E= 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-232-2D22XRYhMuGEhjYVg24ieQ-1; Mon, 25 Jan 2021 12:15:00 -0500 X-MC-Unique: 2D22XRYhMuGEhjYVg24ieQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2501801817; Mon, 25 Jan 2021 17:14:58 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60C945D9DB; Mon, 25 Jan 2021 17:14:57 +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: Mon, 25 Jan 2021 18:14:01 +0100 Message-Id: <20210125171444.167241-2-maxime.coquelin@redhat.com> In-Reply-To: <20210125171444.167241-1-maxime.coquelin@redhat.com> References: <20210125171444.167241-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 v3 01/44] bus/vdev: add helper to get vdev from ethdev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Reviewed-by: Chenbo Xia Reviewed-by: David Marchand --- 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