From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=FNwLLn0srjK0TytA4Dm9gu2L/VeRfZk/B1z3m/7Uqjc=; b=WO0rgNmDKfUhdtq6q6+EKje8aOQUvERGFKNlmEapeZUn2z6BFix9g0P/9jb6wZ2gWK YHF/ZF83IN2GgF+8MTtml5J+pqXQeQ26klL+gGl65Y/wDL8aluIehJrmQIzQ4GuN+tPB KakA6tsoVI4iLgS1uoE4POPmPDQn6CnSn6oexBj4H11iEkdIKi8fz08N5CC07I2ex1rj GQ81710YV/UFI8VbyWynX/wnctPIKygq6SHbBDhNwJkjYKsjw3EO258gQG7iELxyyLXU Rhl5efVVLtRzE5xoHdGNmuAsYMRc4RtvdWs2L55VrGn/RHtoowXhhggId2x8e6ADi5Om uacA== 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=FNwLLn0srjK0TytA4Dm9gu2L/VeRfZk/B1z3m/7Uqjc=; b=FshcOnExmDmPLGd8k/mh67a5s9tbJhI2wsgb0kSEN0pfpOxelLlwACPZmhXtaw2ySj rnYCwN17ZwUAev1b4SalRxPBhnBQECTOr3gUN2g5vHIjIBdmM77G97jl9etMXO2wRSh2 r2fSeA7RJQa85yIWL4e2o9EM3IrAUfZIG4iMUVeknL0jvl9Ugwm6+VfgqjPRauIP6Cnc g5WfcTDkvoeqK7vdRJ9CKb3i+2LPpiq8D3+HYNuSJAoWvlB7vcooYXksQIa2LA49mUpo xLkcMib7QIMl//uHKHHpcCx/meyyAPuRNcIYbD/JAozxlCzN59r5DQgMnbtmdBK8njFL OLmw== X-Gm-Message-State: AIkVDXIKjwd+2Nz3yJrLKfLTBTHd0pgEEg5MLf4M7lljgpRGPgX6Ad9sHH76HsGkjfUuiFAY X-Received: by 10.194.179.135 with SMTP id dg7mr9476811wjc.219.1482420063934; Thu, 22 Dec 2016 07:21:03 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id 63sm32680528wmg.2.2016.12.22.07.21.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 07:21:03 -0800 (PST) From: Thomas Monjalon To: Jan Blunck Cc: dev@dpdk.org, shreyansh.jain@nxp.com, david.marchand@6wind.com, stephen@networkplumber.org Date: Thu, 22 Dec 2016 16:21:02 +0100 Message-ID: <2253386.A4pj8ELuPQ@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1482332986-7599-19-git-send-email-jblunck@infradead.org> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> <1482332986-7599-19-git-send-email-jblunck@infradead.org> 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: Thu, 22 Dec 2016 15:21:04 -0000 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.