From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C48625B12 for ; Wed, 17 Oct 2018 03:54:52 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 659E52216B; Tue, 16 Oct 2018 21:54:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 16 Oct 2018 21:54:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=rZN3tHVAMR AB5MlgcJdZu2brFUYjxNb11oxkfBhvedE=; b=LuCld6eR448DGHMKxg83RiMe2w Vz9dr6ttClRBzBN/EJAYjHqKq176NgrTZhh5UgmACH/gpEjL/VZDzYfXanE8EvP8 POFftM9IwrDKVvTJ9v6PHRnK6l/K0m7oi6Qj4/wVLjuwGALPwZfOG6DJfyQfFvG/ 5RgDVvxR6fHJ6Hqnk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=rZN3tHVAMRAB5MlgcJdZu2brFUYjxNb11oxkfBhvedE=; b=MrnmJuS3 5fJsKuRoeoxFBMkGNMRWttcvdsr+o0IAQiCPbVsf2DNELDXAaHUpMim1maAC8qVC tnpmNiWDYmJxT3wD3jOuZg9iPFuaMQ8uuLU/j7s7Zk7+CEUMK7k0AJ82BM1q0CcV fJ5yo+GU0rO/6+JFX2DSS7DYJjjdDNaTawXCGM0WD81ULm9EW+XCTztKEVRHfEay 6sj0PJIlMcRxlWk85Ry4eucTAfOvl+w9Rcy7OCSlROCZia6oADqETt6FHeBaaTdE vAdkwYenS9I0ebdvtyiEGBy/UG4ThJzSx6P2EMfZuwUjgX2lQgYDgWF01c9qARtP JQRDviBtZ3nlLA== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6DFAF102DE; Tue, 16 Oct 2018 21:54:51 -0400 (EDT) From: Thomas Monjalon To: ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org, ophirmu@mellanox.com Date: Wed, 17 Oct 2018 03:54:49 +0200 Message-Id: <20181017015450.15783-4-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181017015450.15783-1-thomas@monjalon.net> References: <20180907233929.21950-1-thomas@monjalon.net> <20181017015450.15783-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 3/4] ethdev: remove release function for secondary process 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, 17 Oct 2018 01:54:53 -0000 After previous changes, the function rte_eth_dev_release_port() can be used for primary or secondary process as well. The only difference with rte_eth_dev_release_port_secondary() is the shared lock used in rte_eth_dev_release_port(). The function rte_eth_dev_release_port_secondary() was recently added in 18.11 cycle. Signed-off-by: Thomas Monjalon --- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- drivers/net/kni/rte_eth_kni.c | 2 +- drivers/net/null/rte_eth_null.c | 3 --- drivers/net/octeontx/octeontx_ethdev.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 3 --- drivers/net/tap/rte_eth_tap.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 2 +- lib/librte_ethdev/rte_ethdev.c | 15 --------------- lib/librte_ethdev/rte_ethdev_driver.h | 14 -------------- lib/librte_ethdev/rte_ethdev_pci.h | 7 ------- lib/librte_ethdev/rte_ethdev_version.map | 7 ------- 12 files changed, 6 insertions(+), 55 deletions(-) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 2efc17725..95a98c6b8 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -990,7 +990,7 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev) eth_dev->data->mac_addrs = NULL; if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); + return rte_eth_dev_release_port(eth_dev); internals = eth_dev->data->dev_private; for (q = 0; q < internals->nb_queues; q++) { diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 082fc9d52..860f3fdce 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3265,7 +3265,7 @@ bond_remove(struct rte_vdev_device *dev) return -ENODEV; if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); + return rte_eth_dev_release_port(eth_dev); RTE_ASSERT(eth_dev->device == &dev->device); diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index f43ee7d2e..a1e9970df 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -467,7 +467,7 @@ eth_kni_remove(struct rte_vdev_device *vdev) eth_dev->data->mac_addrs = NULL; if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); + return rte_eth_dev_release_port(eth_dev); eth_kni_dev_stop(eth_dev); diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index b77283ae7..c9bf15d75 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -679,9 +679,6 @@ rte_pmd_null_remove(struct rte_vdev_device *dev) if (eth_dev == NULL) return -1; - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); - /* mac_addrs must not be freed alone because part of dev_private */ eth_dev->data->mac_addrs = NULL; rte_eth_dev_release_port(eth_dev); diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 746507912..068148624 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -1129,7 +1129,7 @@ octeontx_remove(struct rte_vdev_device *dev) return -ENODEV; if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - rte_eth_dev_release_port_secondary(eth_dev); + rte_eth_dev_release_port(eth_dev); continue; } diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 1790a8064..bfb5d710d 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -1228,9 +1228,6 @@ pmd_pcap_remove(struct rte_vdev_device *dev) if (eth_dev == NULL) return -1; - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); - internals = eth_dev->data->dev_private; if (internals != NULL && internals->phy_mac == 0) /* not dynamically allocated, must not be freed */ diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 2327fbf8c..53d37b3cb 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -2082,7 +2082,7 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev) eth_dev->data->mac_addrs = NULL; if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); + return rte_eth_dev_release_port(eth_dev); internals = eth_dev->data->dev_private; diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index cf51c072d..0cd1a4642 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1433,7 +1433,7 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev) return -ENODEV; if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(eth_dev); + return rte_eth_dev_release_port(eth_dev); eth_dev_close(eth_dev); diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 3bc05f4c3..178800a5b 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -362,18 +362,6 @@ rte_eth_dev_attach_secondary(const char *name) return eth_dev; } -int -rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev) -{ - if (eth_dev == NULL) - return -EINVAL; - - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL); - eth_dev->state = RTE_ETH_DEV_UNUSED; - - return 0; -} - int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) { @@ -3591,9 +3579,6 @@ rte_eth_dev_destroy(struct rte_eth_dev *ethdev, return ret; } - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port_secondary(ethdev); - return rte_eth_dev_release_port(ethdev); } diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index a1398a80c..a539d3636 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -76,20 +76,6 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name); */ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); -/** - * @internal - * Release the specified ethdev port in the local process. - * Only set ethdev state to unused, but not reset shared data since - * it assume other processes is still using it. typically it is - * called by a secondary process. - * - * @param eth_dev - * Device to be detached. - * @return - * - 0 on success, negative on error - */ -int rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev); - /** * @internal * Release device queues and clear its configuration to force the user diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h index 8ff4f6b89..23257e986 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -135,13 +135,6 @@ rte_eth_dev_pci_allocate(struct rte_pci_device *dev, size_t private_data_size) static inline void rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev) { - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - eth_dev->device = NULL; - eth_dev->intr_handle = NULL; - rte_eth_dev_release_port_secondary(eth_dev); - return; - } - eth_dev->device = NULL; eth_dev->intr_handle = NULL; diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index 3a4dd4790..dfa122c1a 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -220,13 +220,6 @@ DPDK_18.08 { } DPDK_18.05; -DPDK_18.11 { - global: - - rte_eth_dev_release_port_secondary; - -} DPDK_18.08; - EXPERIMENTAL { global: -- 2.19.0