From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 18/23] ethdev: Helper to map to struct rte_pci_device Date: Thu, 22 Dec 2016 16:21:02 +0100 Message-ID: <2253386.A4pj8ELuPQ@xps13> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> <1482332986-7599-19-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, stephen@networkplumber.org To: Jan Blunck Return-path: Received: from mail-wj0-f182.google.com (mail-wj0-f182.google.com [209.85.210.182]) by dpdk.org (Postfix) with ESMTP id 41D1C10D82 for ; Thu, 22 Dec 2016 16:21:04 +0100 (CET) Received: by mail-wj0-f182.google.com with SMTP id sd9so45662341wjb.1 for ; Thu, 22 Dec 2016 07:21:04 -0800 (PST) In-Reply-To: <1482332986-7599-19-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" 2016-12-21 16:09, Jan Blunck: > PCI drivers could use this helper instead of directly accessing fields of > rte_eth_dev to map to rte_pci_device. [...] > +/** > + * @internal > + * Helper for drivers that need to convert from rte_eth_dev to rte_pci_device. > + */ > +static inline struct rte_pci_device *__attribute__((always_inline)) > +rte_eth_dev_to_pci(struct rte_eth_dev *eth_dev) > +{ > + return eth_dev->pci_dev; > +} Why adding this function instead of just using DEV_PCI_DEV(eth_dev->device)? I think we must try to avoid any PCI (or other bus) reference inside ethdev.h.