From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f195.google.com (mail-wj0-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id A8A7C10DB0 for ; Thu, 22 Dec 2016 19:13:25 +0100 (CET) Received: by mail-wj0-f195.google.com with SMTP id kp2so37315282wjc.0 for ; Thu, 22 Dec 2016 10:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zOUk63EiFWwdoTfkSnfi+UxqGwqbygNf8/Ja1ab53js=; b=djx6IFmRLmKO10b/4KtrDlnrEVNHQNiqcshts8m7r0sj6utJkyv6CdHCVhHyCs0nt0 wITivUoEMLRTf7M3weUEbdPv6GtlFIuEfgb8Y0BMgDXsETdX9XfE3ptLAcBXf4JsyR4D zb/UfUZgSeVjlHMuwWJUoG4e0wWyDAxvPpc/cSW3JTj4/3E9gBN/eZV5kyo3Ls18jYDD oXlSTTplImCaa0PBMLtHxjGlI7DG6y6j5VgzYB6l7v4rzLUHBXDc7/8Bmm49YWHHdzUK R0HUsJMMAKziYHPUjjjD3KzNh9HtVjXWHEuSxW+5V7GLXjfXCJ47Y4LYM707xtXMISUW Z2ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zOUk63EiFWwdoTfkSnfi+UxqGwqbygNf8/Ja1ab53js=; b=jOU3REcAWXRccfQZdJZhYj8zu0cnkISpmS50O0XYKWdhwiszKBgo+GHO1+n4g6uEmb x+CH0G9XNN3o03ATKmKPoBxQJ5UC4yLiVEsjfR9712c+3o+UiCzerOWn5Xdb/z+qXLdI Un94N86+tH38Wt26SI1sU+9xJsDOv5OwDB0PpmPWSXl6y1R2uAvFeOsVGmLaN6dY2GPH 4Zoh/RNeWiSV701izOtrdhsP8ZKWmYsRwu5L5QXZiYKEkkChmtMabXSqSxO91VuZg4uf ujvzQNu074s4cVaTzLtgYCfhmZ866QWLPy3F1E3xSzYEp6+b6CYTCDEsaKj+H0HZB6LV yIzA== X-Gm-Message-State: AIkVDXJH8Y9gEjoWe/6I5waPq/z5rLoUCz7Y51i1KTiYgMoPEuJUThS3gA0KOfUMWKCrZn9JqFZfZCu0c2LcLA== X-Received: by 10.194.95.194 with SMTP id dm2mr9877675wjb.207.1482430405428; Thu, 22 Dec 2016 10:13:25 -0800 (PST) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.63.83 with HTTP; Thu, 22 Dec 2016 10:13:24 -0800 (PST) In-Reply-To: <2253386.A4pj8ELuPQ@xps13> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> <1482332986-7599-19-git-send-email-jblunck@infradead.org> <2253386.A4pj8ELuPQ@xps13> From: Jan Blunck Date: Thu, 22 Dec 2016 19:13:24 +0100 X-Google-Sender-Auth: MjUzFZzjjh_vMrku1dMqh1-0Dp4 Message-ID: To: Thomas Monjalon Cc: dev@dpdk.org, Shreyansh Jain , David Marchand , Stephen Hemminger Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v4 18/23] ethdev: Helper to map to struct rte_pci_device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 18:13:25 -0000 On Thu, Dec 22, 2016 at 4:21 PM, Thomas Monjalon wrote: > 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. David requested to move it from rte_pci.h to rte_ethdev.h. It could get forward declared here if one doesn't use it. On the other hand the rte_pci.h would be required to include rte_ethdev.h if we move it.