From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 9C116D39B for ; Tue, 11 Apr 2017 17:45:43 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id u2so4142806wmu.0 for ; Tue, 11 Apr 2017 08:45:43 -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=G4yl+Rd0z05YF4aEeGUx49D6eKUm5NxXWMDOd5N5ZV0=; b=EDXBINot9Plk4FDHZ+oVtVtchVXpD7VJPcfTku0bqqFte676zoqLxJ3mchitVKlEsl KBCykfLUPWtkgjA5iV2yOOtlqnfk3ETww/q4nsk4RAdjuQSSMFqibCIGKGx79pBJyIg8 iRP2EqZCN8nIDYZ2nrGtQJsdyUkfF9P6FBEt1kOQEkoli0+ic5y9zf6q/GVqnUCGyT3W uSIrrqCRMXkBE3DOWmbyd6SC0VUeYDdiBehOC+mOkyB/N3iLC/jx6F9Y29lkAtMfZX8V 39BlRv6KeGNJCaHLFYgF22rysn7xFhrQQur5NNLXqm6Huq9Cp7zhJamXgqZKEXc+vBtg ycow== 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=G4yl+Rd0z05YF4aEeGUx49D6eKUm5NxXWMDOd5N5ZV0=; b=P8EcJSG2xk/64gmYCn/EyXi7CFl6HlbsisfVGFZ/Z0noVv+iuWH4Af1HzAvsZqxRdS pVvxGWqq4ij7lSRrI4cbh30nQZobTb53PNNVn2+zBmwBvqd4OWgalNllnmF56y37yvWA JISrxSWs279+sSB49s02OCu1kvbUQEsfD8uveqpxYtSJ31afnJKe0nAs3X3VUSlFqUeI 74O0G9FFRT30XfKjQBpXuY6f/RlthcVLk5mOW1LTroIunq+e8ED89wGtQmAgwyRPsZIb 0OcjiPfKdcZMi8Ye+YQb+RotZQj716BeCRyx0ovUev6JQ3qTvWAE+4gV281E24ZqPDlc O9MQ== X-Gm-Message-State: AN3rC/7Jn3jeFFjhcVm72WBdv0PR3wbo8mVVgFZnzO34mO9QBJKCL7IMKaVCFvbzxifgVXAM X-Received: by 10.28.214.133 with SMTP id n127mr14118263wmg.70.1491925543299; Tue, 11 Apr 2017 08:45:43 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:42 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:45 +0200 Message-Id: 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 38/42] 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: , X-List-Received-Date: Tue, 11 Apr 2017 15:45:44 -0000 From: Jan Blunck 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 | 10 +--- 4 files changed, 11 insertions(+), 121 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 6ed2321..5bb016d 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -285,103 +285,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 8cd1a11..abef70f 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4608,21 +4608,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 f2bed58..b95312f 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -134,14 +134,6 @@ DPDK_16.07 { } DPDK_16.04; -DPDK_16.11 { - global: - - rte_eth_dev_pci_probe; - rte_eth_dev_pci_remove; - -} DPDK_16.07; - DPDK_17.02 { global: @@ -153,7 +145,7 @@ DPDK_17.02 { rte_flow_query; rte_flow_validate; -} DPDK_16.11; +} DPDK_16.07; DPDK_17.05 { global: -- 2.1.4