From patchwork Mon Mar 6 10:00:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Blunck X-Patchwork-Id: 21453 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 30700FA78; Mon, 6 Mar 2017 11:02:29 +0100 (CET) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 50A94C304 for ; Mon, 6 Mar 2017 11:01:26 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id z63so10615402wmg.2 for ; Mon, 06 Mar 2017 02:01:26 -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=TpUIdMf3buhNqLuPwcLcqehMoqs0v6GyI32bvrmGj3o=; b=gifRSkGkla7wIlXaSfGO4kaxs1G+/rmrvS6mlr3UTgdUgbnsh0a5nMof6nflBcvCQr STq+AfYhfVqKxCeMOHoJPj3fniaiI7ZfP2GmTqBxEOb4BzZH6dDX8T+Y06Aqf+EZLMFR 1kQbSdXLzvIp9aObOx/+3R2rp4X/Qce0TocMCcyBgdq+z+YB3tSL6g3lCCFdu9cPL23A dtcdXHpXSGtkeYCvAov8V1tLYyLvfVn+WA3BmUcgyuxszRgRlKxXIC94A49Lef5eCfov JK3oXtcrvYBQq5YTaeEj/5DoV1snbbVrmqf8CdXer56shXGA6qU5Du1F7qPPREJjDt9y Zdzg== 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=TpUIdMf3buhNqLuPwcLcqehMoqs0v6GyI32bvrmGj3o=; b=fJnVouA+xZOLlxYO+pyU39zyQIwmpbOinHS+FFU+mvWcQ7ZtG0UfkUYA/7QlZfyd2F 724gKYe4gRwuVGKbGaw80tYkVP97/DYUpjFvHB10ORSEFnD6zAsTZ1uaf64UoxvhvprD 8C3pnTm5Kvzot5pv52CHnr/uipRdAUK/Ump0DmcpzPTLP50Vawxp8nlUiaEYXU8z738Z nu8vXL9ZPGj7mCxhV8M2TGTRGmXa8SQhuW94WPSWIOeO80YkMtCkQRCKh+LABGSnGo5D YSxTXwmEHehcQaOtHltLE9RNU/8JQdunoBIzLkBcbuuDcyrGf/uyPFoHkv3/XG72qvJN YUfA== X-Gm-Message-State: AMke39ladbtGZCHWY6RTUxrP7s0hrjSrFBny1lkpUOWJXzapnfAYJSR/U6vpgnRhGydhbg== X-Received: by 10.28.8.147 with SMTP id 141mr5940906wmi.43.1488794485706; Mon, 06 Mar 2017 02:01:25 -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.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:24 -0800 (PST) From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:27 +0100 Message-Id: <1488794430-25179-36-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 35/38] ethdev: remove unused ethdev PCI probe/remove 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This removes the now unused rte_eth_dev_pci_probe() and rte_eth_dev_pci_remove() functions. Signed-off-by: Jan Blunck --- lib/librte_ether/rte_ethdev.c | 97 ---------------------------------- lib/librte_ether/rte_ethdev.h | 15 ------ lib/librte_ether/rte_ethdev_pci.h | 10 ++++ lib/librte_ether/rte_ether_version.map | 3 -- 4 files changed, 10 insertions(+), 115 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 86ee5bb..4669f80 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -277,103 +277,6 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev) -{ - struct eth_driver *eth_drv; - struct rte_eth_dev *eth_dev; - char ethdev_name[RTE_ETH_NAME_MAX_LEN]; - - int diag; - - eth_drv = (struct eth_driver *)pci_drv; - - rte_eal_pci_device_name(&pci_dev->addr, ethdev_name, - sizeof(ethdev_name)); - - if (rte_eal_process_type() == RTE_PROC_PRIMARY) { - eth_dev = rte_eth_dev_allocate(ethdev_name); - if (eth_dev == NULL) - return -ENOMEM; - - eth_dev->data->dev_private = rte_zmalloc("ethdev private structure", - eth_drv->dev_private_size, - RTE_CACHE_LINE_SIZE); - if (eth_dev->data->dev_private == NULL) - rte_panic("Cannot allocate memzone for private port data\n"); - } else { - eth_dev = rte_eth_dev_attach_secondary(ethdev_name); - if (eth_dev == NULL) { - /* - * if we failed to attach a device, it means the - * device is skipped in primary process, due to - * some errors. If so, we return a positive value, - * to let EAL skip it for the secondary process - * as well. - */ - return 1; - } - } - eth_dev->device = &pci_dev->device; - eth_dev->intr_handle = &pci_dev->intr_handle; - eth_dev->driver = eth_drv; - - /* Invoke PMD device initialization function */ - diag = (*eth_drv->eth_dev_init)(eth_dev); - if (diag == 0) - return 0; - - RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%x device_id=0x%x) failed\n", - pci_drv->driver.name, - (unsigned) pci_dev->id.vendor_id, - (unsigned) pci_dev->id.device_id); - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - rte_free(eth_dev->data->dev_private); - rte_eth_dev_release_port(eth_dev); - return diag; -} - -int -rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev) -{ - const struct eth_driver *eth_drv; - struct rte_eth_dev *eth_dev; - char ethdev_name[RTE_ETH_NAME_MAX_LEN]; - int ret; - - if (pci_dev == NULL) - return -EINVAL; - - rte_eal_pci_device_name(&pci_dev->addr, ethdev_name, - sizeof(ethdev_name)); - - eth_dev = rte_eth_dev_allocated(ethdev_name); - if (eth_dev == NULL) - return -ENODEV; - - eth_drv = (const struct eth_driver *)pci_dev->driver; - - /* Invoke PMD device uninit function */ - if (*eth_drv->eth_dev_uninit) { - ret = (*eth_drv->eth_dev_uninit)(eth_dev); - if (ret) - return ret; - } - - /* free ether device */ - rte_eth_dev_release_port(eth_dev); - - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - rte_free(eth_dev->data->dev_private); - - eth_dev->device = NULL; - eth_dev->driver = NULL; - eth_dev->data = NULL; - - return 0; -} - -int rte_eth_dev_is_valid_port(uint8_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 9d5848b..1bfb8e7 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4419,21 +4419,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); int rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); -/** - * @internal - * Wrapper for use by pci drivers as a .probe function to attach to a ethdev - * interface. - */ -int rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev); - -/** - * @internal - * Wrapper for use by pci drivers as a .remove function to detach a ethdev - * interface. - */ -int rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev); - #ifdef __cplusplus } #endif diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h index 4b728db..fe62589 100644 --- a/lib/librte_ether/rte_ethdev_pci.h +++ b/lib/librte_ether/rte_ethdev_pci.h @@ -108,6 +108,11 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev) typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev); +/** + * @internal + * Wrapper for use by pci drivers in a .probe function to attach to a ethdev + * interface. + */ static inline int rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev, size_t private_data_size, eth_dev_pci_callback_t dev_init) @@ -127,6 +132,11 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev, return ret; } +/** + * @internal + * Wrapper for use by pci drivers in a .remove function to detach a ethdev + * interface. + */ static inline int rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev, eth_dev_pci_callback_t dev_uninit) diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index d34c57a..e2b6d0e 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -137,9 +137,6 @@ DPDK_16.07 { DPDK_16.11 { global: - rte_eth_dev_pci_probe; - rte_eth_dev_pci_remove; - } DPDK_16.07; DPDK_17.02 {