From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 442FE10DF3 for ; Fri, 23 Dec 2016 09:30:35 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id a197so194067621wmd.0 for ; Fri, 23 Dec 2016 00:30:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=b2Qc5hp2QLO/NkMpMO5afsxfuO3en2TaVNLTOwG6w4c=; b=Wy68njdWjJp+UIfwn4y+Bl1hWyVNA1jp1zuEGudlwEIQaZ72sqJzzUbwoBG3h9HWTR y9qkZoHMyN7iL1pyWUgU15o5Rjdc0oeUrm4oA+An8HPDs0fBo3MqjMI5SaglP9R7JAOx EhpToTqUImycSiRJqyKrFoo1mqvhBpwutzbMKjmNUoZdFbbsku/cjCc5hu/WKTjcwhM2 VonpJXTxovbGwyMPeBrRlrox92P5iFqhRr2pa1+GNxaBiFdkbnYTvZ4Q4dKcDNj1fBUW bB76GvaN/1Vd6wXNM8tbO9NRN/J6vRP5VFX3zntDA6gLj717+RzeuZKHjw+AD+ROMc4P JVZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=b2Qc5hp2QLO/NkMpMO5afsxfuO3en2TaVNLTOwG6w4c=; b=oqNMkivAxIbrJWTRcwHOeXRfniKVzD3qcVTPSoPVkTdMu/qB3nLOumW0ohQvz1A+9Z IIVl4RYl5Aw90aW2LKFe2SXcpleUCAz+36d7DcNikmhWgAoVo2cltSkACFo/zqadXd2Q cYtCHO8ymBWsF9NLdGQrvJ/o46iv0T6LIhk+n7E/2IGqrRRRAq4Ff0oFrimF5SwEjgM0 3Eo3EJtcq9wlpTeLvZAsfKOCgowbMOMcK7mlly44+c/+S2MzGCWBmuWa+TNuUYEmJGcS P1ECNlAsNtwU9BYZ0dGcGqXsxHuJj2CdnY6LWcmfX+ThKUdcjhl2vXYk+hCP9MLnZu4+ 4FSw== X-Gm-Message-State: AIkVDXKbSh/2rXORF4BUqHmpXh6c/EIpM8tiuejh4/et5kgzgDH6e+F383TGewtJB29NeDDm X-Received: by 10.28.18.129 with SMTP id 123mr12212029wms.2.1482481835031; Fri, 23 Dec 2016 00:30:35 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id ke6sm39367323wjb.21.2016.12.23.00.30.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 00:30:34 -0800 (PST) From: Thomas Monjalon To: Jan Blunck Cc: dev@dpdk.org, Shreyansh Jain , David Marchand , Stephen Hemminger Date: Fri, 23 Dec 2016 09:30:32 +0100 Message-ID: <4070328.Wvu0M6jAFZ@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> <2253386.A4pj8ELuPQ@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Fri, 23 Dec 2016 08:30:35 -0000 2016-12-22 19:13, Jan Blunck: > 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. I think there is a misunderstanding. I was just suggesting to drop this function.