From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id F116BD592 for ; Mon, 6 Mar 2017 11:01:27 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id u48so21047938wrc.1 for ; Mon, 06 Mar 2017 02:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=80A1YNbK8o9cp9PTW94LU1+dCwTGaUoWePsdp5s5xsU=; b=GTlhvwq6gO5AJfZZ5DFgTrkq5FL3R74gsq9D5h6qdCbea7XtxTL3dtdbyFD7VQWXHO G75eEZlbGGwnc7/mdi0WLL9UqONyziKzLfZq0SjIy6gc7Jh8MmVpoc/DObdpp0PawWJn lAKhz+QMVyNCsdY49hW8bSRinrqggWBmKPxw1XrTwSd4LaCbWo38XUFhkwyq0mv2T4hS P1pZY756kgktHbkkihAh7lN3nP0ihVT6t2GkEa/0R3l301KYmXvtESpMVchS0oZV4g3v 2d3/9eDJvxrsRaKZbLZm/HMnAJVlrK2rvGokwg/kfPShItVVkxPWOjTu5y7jHJ7SAlGJ I+IA== 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:subject:date:message-id :in-reply-to:references; bh=80A1YNbK8o9cp9PTW94LU1+dCwTGaUoWePsdp5s5xsU=; b=eVwkQclyY4Y03v+jbsurEbL4DGJoYq74SGxo6Zx6YuiKf/ouoI+VWQQSROdlMbttPq bUyviEHMGHSIL7a5dXym1gXmWUYpYjZtUWpTzXM+APdbGPYagyIIbrhUHLbyAAlBZXON XK/A0mIdnK2C3HTMKEEv36l5ZK+2z/GQrsd50lDoBvvyL94npozwvxuGDJB1fmDuHZXa x6OYQHjfGvG+Ah28/Lwaqu77sqoRvclMJj35jSWN6z6t2woIvab1ahBAjCpop4FtmgLT V1acTUwtOHcq1WTU4C6GJmasFq1AB9ty9kBUsImuRMTFdtxfFTo3VoB/wf3AC4oVvB7y NExg== X-Gm-Message-State: AMke39kHiLC+vFX8HI6mzpgDM8Pe1NUFZWWX3k4f5ed/+5W6GuabdyHRGt/ayXZsknEfaQ== X-Received: by 10.223.135.47 with SMTP id a44mr12179066wra.197.1488794487357; Mon, 06 Mar 2017 02:01:27 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id u145sm3829237wmu.1.2017.03.06.02.01.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:26 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:29 +0100 Message-Id: <1488794430-25179-38-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488794430-25179-1-git-send-email-jblunck@infradead.org> References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH 37/38] ethdev: remove PCI specific helper from generic ethdev header 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: Mon, 06 Mar 2017 10:01:28 -0000 This moves the rte_eth_copy_pci_info() into the PCI specific ethdev header. As a side effect this also removes it from the list of symbols exported by the rte_ethdev library. Signed-off-by: Jan Blunck --- drivers/net/cxgbe/cxgbe_main.c | 1 + lib/librte_ether/rte_ethdev.c | 20 -------------------- lib/librte_ether/rte_ethdev.h | 14 -------------- lib/librte_ether/rte_ethdev_pci.h | 32 ++++++++++++++++++++++++++++++++ lib/librte_ether/rte_ether_version.map | 1 - 5 files changed, 33 insertions(+), 35 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index f895b18..1f230cd 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 4669f80..80c2769 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3103,26 +3103,6 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, return (*dev->dev_ops->get_dcb_info)(dev, dcb_info); } -void -rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev) -{ - if ((eth_dev == NULL) || (pci_dev == NULL)) { - RTE_PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n", - eth_dev, pci_dev); - return; - } - - eth_dev->intr_handle = &pci_dev->intr_handle; - - eth_dev->data->dev_flags = 0; - if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) - eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; - - eth_dev->data->kdrv = pci_dev->kdrv; - eth_dev->data->numa_node = pci_dev->device.numa_node; - eth_dev->data->drv_name = pci_dev->driver->driver.name; -} - int rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 87c33bb..7259cb8 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4233,20 +4233,6 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); /** - * Copy pci device info to the Ethernet device data. - * - * @param eth_dev - * The *eth_dev* pointer is the address of the *rte_eth_dev* structure. - * @param pci_dev - * The *pci_dev* pointer is the address of the *rte_pci_device* structure. - * - * @return - * - 0 on success, negative on error - */ -void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, - struct rte_pci_device *pci_dev); - -/** * Create memzone for HW rings. * malloc can't be used as the physical address is needed. * If the memzone is already created, then this function returns a ptr diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h index f85d26f..2953579 100644 --- a/lib/librte_ether/rte_ethdev_pci.h +++ b/lib/librte_ether/rte_ethdev_pci.h @@ -39,6 +39,38 @@ #include /** + * Copy pci device info to the Ethernet device data. + * + * @param eth_dev + * The *eth_dev* pointer is the address of the *rte_eth_dev* structure. + * @param pci_dev + * The *pci_dev* pointer is the address of the *rte_pci_device* structure. + * + * @return + * - 0 on success, negative on error + */ +static inline void +rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, + struct rte_pci_device *pci_dev) +{ + if ((eth_dev == NULL) || (pci_dev == NULL)) { + RTE_PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n", + eth_dev, pci_dev); + return; + } + + eth_dev->intr_handle = &pci_dev->intr_handle; + + eth_dev->data->dev_flags = 0; + if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) + eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; + + eth_dev->data->kdrv = pci_dev->kdrv; + eth_dev->data->numa_node = pci_dev->device.numa_node; + eth_dev->data->drv_name = pci_dev->driver->driver.name; +} + +/** * @internal * Allocates a new ethdev slot for an ethernet device and returns the pointer * to that slot for the driver to use. diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index e2b6d0e..a025119 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -7,7 +7,6 @@ DPDK_2.2 { rte_eth_allmulticast_disable; rte_eth_allmulticast_enable; rte_eth_allmulticast_get; - rte_eth_copy_pci_info; rte_eth_dev_allocate; rte_eth_dev_allocated; rte_eth_dev_attach; -- 2.7.4