From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f196.google.com (mail-wj0-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 7796F10CB5 for ; Wed, 21 Dec 2016 16:10:27 +0100 (CET) Received: by mail-wj0-f196.google.com with SMTP id xy5so32460887wjc.1 for ; Wed, 21 Dec 2016 07:10:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=efKSzZytkDtbDP0THMFjwvzEZN70scWdzta1rlpnxjU=; b=EG2U+WrHQcttDTxI+eyypZszUE7o37/StCfAzwLyKmmXVD+UGgUKVt6gK4xgt0TlWJ BYtHwR7A6UjDe6SJesLpVCTaJi96LReE9FP66zAFh4KJN6AiGuSJb1bmehg7dOtkSDLb 8VPZ2lmouU2UHDcnu4ndIF9jZ13phOrS9LSqX8rQC+ajvgiM5lsjh0woN8u5lCPBUOnd YpYQmiuTODPqO8MHYEgp3pAYl2cwyGKWXY6jmmImcSuXDCFP7YS2XbQErDeqm+D4P+tX MyZEhEHP7RGgwm+3OhAUJ67zVg2ggdrF8rU0KpPPSoxgrNypOhzRyaXuKoXH6pmaREIK b0dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=efKSzZytkDtbDP0THMFjwvzEZN70scWdzta1rlpnxjU=; b=UJvZybBE2Ji2YeRdv8/ZTh+8Ds4AneD8X66EVfwOx6eXx0CfwsZLShckEeIpFm0EUL U+mRLvs/J5g7/3oMLyw8dSvJ6VKc9zJziHwW0JZiLxAEL5brfoBPEaXgUaPv2Fi9WCht eeJsd0NvJZKq6XAysnq4F4+1kowJ8Q/2CzDhKPMJIbYAUUYvT7NMN2d6plw5k5OU+S/G ZJ8lb5cQny67Y7UQ8JlEQCUiHUbHL4pEJm4NDaF7lX411ZD3veQIBGnasQXciRXll8kp FQJRPV2Ayici9nB0b2BEEw0Nelkhfng5jo5ayC3nHatK0d66YGtfLXg/uk9PHc2fHvos 9cLg== X-Gm-Message-State: AIkVDXL5VMLmo9q0JDL/LNTRipGjPbHOY1EUfjj8ouCoCniUzz5b8HHHGWD9zHQvB24EVw== X-Received: by 10.195.18.201 with SMTP id go9mr4843964wjd.200.1482333027207; Wed, 21 Dec 2016 07:10:27 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id 135sm27627375wmh.14.2016.12.21.07.10.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 07:10:26 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: shreyansh.jain@nxp.com, david.marchand@6wind.com, stephen@networkplumber.org Date: Wed, 21 Dec 2016 16:09:41 +0100 Message-Id: <1482332986-7599-19-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482332986-7599-1-git-send-email-jblunck@infradead.org> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> Subject: [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: Wed, 21 Dec 2016 15:10:27 -0000 PCI drivers could use this helper instead of directly accessing fields of rte_eth_dev to map to rte_pci_device. Signed-off-by: Jan Blunck Acked-by: Shreyansh Jain --- lib/librte_ether/rte_ethdev.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 9678179..d6e367c 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1644,6 +1644,16 @@ 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. + */ +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; +} + 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 */ -- 2.7.4