From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 8E5E5D45F for ; Tue, 11 Apr 2017 17:45:46 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id u2so4143875wmu.0 for ; Tue, 11 Apr 2017 08:45:46 -0700 (PDT) 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:in-reply-to:references :in-reply-to:references; bh=+c+QPS+qx+FcDFHCH+db01kCTUZxONJsGO2rT9QaV3o=; b=zbaQhipBh+TzKN8eHcuM4EuuKTEikZrhhVBt7NSYCmqn+OFImyhxTehoKVDmOA9nk5 hqs3yKFPNBuULn5Mru8F3DaQl1QhhCbI6gVzEK7bY9WJuj2ahz7zii6ZVPXhTqTyyUM2 IwmM221UNMLCfoxsq9t2KMAqwVmAUmC7IxrDqGwyH5cgZbgeh8p62b1tvaUMEp1xV5fx DN7QWfx4UD99zTU0uXGAefOL5qmDzAYcU69uPuqN/pueVhKlDwOiaJ1gVOvS3yDBLGSz raDZMO1MCfgNt5l5BC+HT5ex6MJ5iAqMH11ZEua17zY8Ek0HVcuDVUljx6NQVKcCU05E StQg== 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:in-reply-to :references:in-reply-to:references; bh=+c+QPS+qx+FcDFHCH+db01kCTUZxONJsGO2rT9QaV3o=; b=R0xUmopqBh6oCl8fo5vcpRoc4/sdSSPz21SqDw4fN4E3T3Rn/vzrbGP6KI8Kxkkxuc obML5a4I6FeQrQtATnY7+4nx9OqaOSYjAPS53T18iVGpDYTlKln6XShf9EYzzM57nLZQ W02zcBMr1o3BesbybxlBaN3siK7WVofHtcb7xI7KfN8bKuJlLj03wezNyGPpNXRsMqnV bZZEm0y0mWpLMj9/h5Y7CfI/MR54unqc+uwDsgCLc5gKvPM1jLyMr5fsRzUA72iMNPmj qmwkpWYnr9sJ69oYs/lmFUJ/H82tSzBpFY4WYRjrA1/rWBAn97GOuSFAB2pRDJDaZYJd Q2Kg== X-Gm-Message-State: AN3rC/52KDSsICUl+M45yT76eS+Z73h4hekq+yEHgDsf2PrcUsc9KWLf vg8YICHYVcYLPQ0B X-Received: by 10.28.32.193 with SMTP id g184mr3084722wmg.56.1491925546243; Tue, 11 Apr 2017 08:45:46 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id u63sm2933738wmu.22.2017.04.11.08.45.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:45 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:48 +0200 Message-Id: <89fd4c109f3a0cce2fc0adbf996cc6f037e381a0.1491924900.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 41/42] 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: Tue, 11 Apr 2017 15:45:47 -0000 From: Jan Blunck 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 5bb016d..474188c 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3117,26 +3117,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 9fb8432..bd538b0 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4422,20 +4422,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 b95312f..e6018ae 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.1.4