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 AD26FA052A; Mon, 25 Jan 2021 12:04:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97013140EEE; Mon, 25 Jan 2021 12:04:53 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id DBF8C140EED for ; Mon, 25 Jan 2021 12:04:51 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 88ABF5C00FF; Mon, 25 Jan 2021 06:04:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 25 Jan 2021 06:04:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= BEIYDADmG4X7EkOTvyWxocPTd72XF2ubr1PMIveAcg4=; b=sd7xWPciqJEP47f0 jbQscFOZOWXxxmcviCNgJYz2RNJ8mM5tLDzda6jmQvzUdIGYd9naLB9aqF8yggYi +1ZEhBF9Llq/dNqHI/qEvKZzPzrWTKipFSSDTZXQqHiZiba3s0KkGI/zeqSc35yF GFv5U+cIKEzEy604QkYVwXvyUZVVlVawtKxFXEIEMnGlawz5JGUX9WPbt7wRBO0P YprEbbF4DCHxlVtjuSD7FTEDAJo92fZVyDpyTCfQCpaBfqaNAKJ1Px+WxQcIeCR8 DlfvF4KRWakgtaSSHTX0D+asHToJo4Px3gahuwtWqRBHhJvTNh4Un0PB6Diw/xxa W3OdrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=BEIYDADmG4X7EkOTvyWxocPTd72XF2ubr1PMIveAc g4=; b=LrEHjBX8KO4gJJnIw33orDuN5jswcL/bxOTMCqvyMvo/3yWRPrzEDg5BK 81WlDJpVETDQMHxKIleHyG6Ls182dOyexqeZ7QeUruzC3cR/utDHS5NVuQVTWj58 JRUxmaDRbKaS1R2MvP3yIEsyyUfu381jNaMsaMc9/eD/7hS0Too5QVabXx6u38RZ DH/pfE/d5tkrwef+CvSiMjfglnz/S1YzSsTL0mP92qne/Q8wQ3vpyrA1R6MZwdyz ETro6modukLKW+TfyBgUweEBnPKgUkig0AUeF84JxWYCIKD3GLACHIVP3oiOuCqh gk2qgbq4zhpr76ObrhzPbszIlnOlw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 08719108005F; Mon, 25 Jan 2021 06:04:49 -0500 (EST) From: Thomas Monjalon To: Maxime Coquelin Cc: dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com, amorenoz@redhat.com, david.marchand@redhat.com Date: Mon, 25 Jan 2021 12:04:47 +0100 Message-ID: <16788326.PYSOhK7Drb@thomas> In-Reply-To: <90731cf5-f1c3-b3c1-a3f2-7ed76b95bedb@redhat.com> References: <20210119212507.1043636-1-maxime.coquelin@redhat.com> <6000259.GDM0XGPNsY@thomas> <90731cf5-f1c3-b3c1-a3f2-7ed76b95bedb@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" 25/01/2021 11:53, Maxime Coquelin: > > 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) OK