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 2100FA052A; Mon, 25 Jan 2021 11:54:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C39A6140EDC; Mon, 25 Jan 2021 11:54:03 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id EA3CD140E8C for ; Mon, 25 Jan 2021 11:54:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611572041; 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=RoXpwT1IW2V5R/Nnn6MYS3y5gTaAKHZu2oZfTwEFFwY=; b=hSpT0PYLHPKYyd7X8H5BhIGZFuS0s/ZMfcroQaof/bGPcXblnBNBXTDHM48MHif3eoRrsq w5AVfMWVQ0gLeo2jGyG8/1fNW+sK5F4ZirpA9gWvwWDf03kRtE9bz5Uydd0UUdvrOHFAfb ba4I5DVyhqo5lYdHnfAdRyq+Yw8PrfA= 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-417-TgNiw_iIOuOnx_BhK8CqhA-1; Mon, 25 Jan 2021 05:53:59 -0500 X-MC-Unique: TgNiw_iIOuOnx_BhK8CqhA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 15C8759; Mon, 25 Jan 2021 10:53:58 +0000 (UTC) Received: from [10.36.110.31] (unknown [10.36.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FBC31A8A0; Mon, 25 Jan 2021 10:53:53 +0000 (UTC) To: Thomas Monjalon Cc: dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com, amorenoz@redhat.com, david.marchand@redhat.com References: <20210119212507.1043636-1-maxime.coquelin@redhat.com> <20210119212507.1043636-2-maxime.coquelin@redhat.com> <6000259.GDM0XGPNsY@thomas> From: Maxime Coquelin Message-ID: <90731cf5-f1c3-b3c1-a3f2-7ed76b95bedb@redhat.com> Date: Mon, 25 Jan 2021 11:53:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <6000259.GDM0XGPNsY@thomas> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 01/44] bus/vdev: add helper to get vdev from eth dev 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" On 1/20/21 1:56 AM, Thomas Monjalon wrote: > 19/01/2021 22:24, Maxime Coquelin: >> 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(). > [...] >> --- 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_ETH_DEV_TO_VDEV(eth_dev) RTE_DEV_TO_VDEV((eth_dev)->device) > > Why these macros (vdev and PCI) are not in ethdev? > > I think because that would put a dependency on vdev & pci bus drivers in ethdev library. Indeed, RTE_DEV_TO_VDEV needs to know about rte_vdev_device layout: #define RTE_DEV_TO_VDEV(ptr) \ container_of(ptr, struct rte_vdev_device, device) Regards, Maxime