From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 2/9] ethdev: Helper to convert to struct rte_pci_device Date: Tue, 20 Dec 2016 07:38:59 -0800 Message-ID: <20161220073859.6bf7c9a3@xeon-e3> References: <1482232315-21626-1-git-send-email-jblunck@infradead.org> <1482232315-21626-3-git-send-email-jblunck@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, shreyansh.jain@nxp.com, david.marchand@6wind.com To: Jan Blunck Return-path: Received: from mail-pg0-f46.google.com (mail-pg0-f46.google.com [74.125.83.46]) by dpdk.org (Postfix) with ESMTP id 9B2B3F931 for ; Tue, 20 Dec 2016 16:39:02 +0100 (CET) Received: by mail-pg0-f46.google.com with SMTP id f188so74169220pgc.3 for ; Tue, 20 Dec 2016 07:39:02 -0800 (PST) In-Reply-To: <1482232315-21626-3-git-send-email-jblunck@infradead.org> 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 Tue, 20 Dec 2016 12:11:48 +0100 Jan Blunck wrote: > Signed-off-by: Jan Blunck > Acked-by: Shreyansh Jain > --- > lib/librte_ether/rte_ethdev.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 9678179..3adbb2b 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1644,6 +1644,12 @@ struct rte_eth_dev { > uint8_t attached; /**< Flag indicating the port is attached */ > } __rte_cache_aligned; > > +/** > + * @internal > + * Helper for drivers that need to convert from rte_eth_dev to rte_pci_device. > + */ > +#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev) > + > struct rte_eth_dev_sriov { > uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */ > uint8_t nb_q_per_pool; /**< rx queue number per pool */ An inline might be better than macro, since a function is typed versus a macro.