From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D35B8A04B1; Mon, 5 Oct 2020 19:09:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3D4A1B812; Mon, 5 Oct 2020 19:08:43 +0200 (CEST) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by dpdk.org (Postfix) with ESMTP id 46BA91B812 for ; Mon, 5 Oct 2020 19:08:42 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id EAB2F580497; Mon, 5 Oct 2020 13:08:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 05 Oct 2020 13:08:40 -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=fm2; bh=yHsBMHBCOprRG u20cQn+3tiBixdtMSlkb73IP7DM69I=; b=ayoWgrPRKXB3iScF3Jl2xiJ3G7EGt Jc0S90iENbGiE0P7ROFSRHcK5KwBBBOXLwSCHk+9m1FiDqOfomNR0O/eYlN5piSS 0Zu/9Nq+Tp4iJsBFVfYQqhnHTO8EDyx1leFq2OxhGiP52L2YXU0FaiQUr7edz2+G BdxOe8uW82qXFiUnv6POXFgR7QoMBnwtbXQLvfUlPL7bS/ulygzi0iwa6VtqKixx eD/uSBQWUhMVMEEo/1uKE9gBByx88IDMp5C4oEkJGgbHprb2Tg35Ag6qZYJSDav6 xPSaZSjPdL9KWRaDMWfiHEz41e7dr87WHxLv8WoYIykUJx7imykQ69upw== 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=yHsBMHBCOprRGu20cQn+3tiBixdtMSlkb73IP7DM69I=; b=EWD70uPJ Epi2aCZWjHnYmsiVCIIxbC4X5g5yrW/IQvB985hf7pfljZULiFrjIfjjUf4aLTdr /dQ7rJg6dV0/Su31jCrGnJdDZj3k4kCTBWirGRzpvuoSes6uscpNHCg0ZNi7A7yB lb/PmoHxxWc+oLoLiOHFZys/krYX5kLWhk+W3IvbRLq/ibmY8kJ5dCxCVhNkylI8 P5Cs0EtTx6qGvTQenK4rpvPWa+FZ6HhMMIBhIXz9C1ntRLwzhxOwQk2z+M4iBzg/ Sv4wRQHfFty+TjVh8No+ZRuvt6s2MEfMpcOmO4fOEtHxc3rNR5GPZ/A25S9I3sLx CTZ1Ynqivsqk9Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgedvgdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 EC2103280063; Mon, 5 Oct 2020 13:08:35 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, arybchenko@solarflare.com, Stephen Hemminger , Haiyue Wang , Jeff Guo , Shepard Siegel , Ed Czeck , John Miller , Igor Russkikh , Pavel Belous , Somalapuram Amaranath , Ajit Khaparde , Somnath Kotur , Chas Williams , "Wei Hu (Xavier)" , Hemant Agrawal , Sachin Saxena , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Igor Chauskin , Qi Zhang , Xiao Wang , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Min Hu (Connor)" , Yisen Zhuang , Beilei Xing , Jingjing Wu , Qiming Yang , Alfredo Cardigliano , Shijith Thotton , Srisivasubramanian Srinivasan , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Long Li , Harman Kalra , Rasesh Mody , Shahed Shaikh , Keith Wiles , Maxime Coquelin , Chenbo Xia , Zhihong Wang , Yong Wang Date: Mon, 5 Oct 2020 19:08:18 +0200 Message-Id: <20201005170820.1018715-3-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005170820.1018715-1-thomas@monjalon.net> References: <20200913220711.3768597-1-thomas@monjalon.net> <20201005170820.1018715-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 2/3] ethdev: reset all when releasing a port 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" The function rte_eth_dev_release_port() is partially resetting the struct rte_eth_dev. The drivers were completing this reset with more pointers set to NULL in the close or remove operations. More pointers are reset at ethdev level, and some redundant assignments are removed from PMDs. Signed-off-by: Thomas Monjalon Acked-by: Stephen Hemminger Reviewed-by: Haiyue Wang Acked-by: Jeff Guo Reviewed-by: Andrew Rybchenko --- drivers/net/ark/ark_ethdev.c | 3 --- drivers/net/atlantic/atl_ethdev.c | 4 ---- drivers/net/axgbe/axgbe_ethdev.c | 3 --- drivers/net/bnxt/bnxt_ethdev.c | 4 ---- drivers/net/bnxt/bnxt_reps.c | 1 - drivers/net/bonding/rte_eth_bond_pmd.c | 4 ---- drivers/net/dpaa/dpaa_ethdev.c | 4 ---- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ---- drivers/net/e1000/em_ethdev.c | 4 ---- drivers/net/e1000/igb_ethdev.c | 8 -------- drivers/net/ena/ena_ethdev.c | 5 ----- drivers/net/fm10k/fm10k_ethdev.c | 4 ---- drivers/net/hinic/hinic_pmd_ethdev.c | 4 ---- drivers/net/hns3/hns3_ethdev.c | 4 ---- drivers/net/hns3/hns3_ethdev_vf.c | 5 ----- drivers/net/i40e/i40e_ethdev.c | 4 ---- drivers/net/i40e/i40e_ethdev_vf.c | 4 ---- drivers/net/iavf/iavf_ethdev.c | 4 ---- drivers/net/ice/ice_dcf_ethdev.c | 4 ---- drivers/net/ice/ice_ethdev.c | 4 ---- drivers/net/ionic/ionic_ethdev.c | 5 ----- drivers/net/ixgbe/ixgbe_ethdev.c | 8 -------- drivers/net/liquidio/lio_ethdev.c | 4 ---- drivers/net/netvsc/hn_ethdev.c | 4 ---- drivers/net/octeontx/octeontx_ethdev.c | 3 --- drivers/net/qede/qede_ethdev.c | 4 ---- drivers/net/sfc/sfc_ethdev.c | 7 +------ drivers/net/tap/rte_eth_tap.c | 1 - drivers/net/virtio/virtio_ethdev.c | 4 ---- drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 ----- lib/librte_ethdev/rte_ethdev.c | 9 +++++++++ 31 files changed, 10 insertions(+), 125 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index f1355581f1..dc14f0fb1a 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -504,9 +504,6 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev) ark_pktgen_uninit(ark->pg); ark_pktchkr_uninit(ark->pc); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; return 0; } diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index f2e48e1c11..d96865d5b4 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -702,10 +702,6 @@ atl_dev_close(struct rte_eth_dev *dev) atl_free_queues(dev); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* disable uio intr before callback unregister */ rte_intr_disable(intr_handle); rte_intr_callback_unregister(intr_handle, diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index cf085487cc..39087f36f0 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -2134,9 +2134,6 @@ axgbe_dev_close(struct rte_eth_dev *eth_dev) return 0; pci_dev = RTE_DEV_TO_PCI(eth_dev->device); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; axgbe_dev_clear_queues(eth_dev); /* disable uio intr before callback unregister */ diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index a6812c1a66..2789079b19 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1429,10 +1429,6 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) bnxt_free_pf_info(bp); bnxt_free_parent_info(bp); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone); bp->tx_mem_zone = NULL; rte_memzone_free((const struct rte_memzone *)bp->rx_mem_zone); diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index 74a76fce57..012ccc73fe 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -255,7 +255,6 @@ int bnxt_representor_uninit(struct rte_eth_dev *eth_dev) PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id); eth_dev->data->mac_addrs = NULL; - eth_dev->dev_ops = NULL; parent_bp = rep->parent_dev->data->dev_private; if (!parent_bp) { diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 1f761c7c9e..ce8fe254af 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2130,10 +2130,6 @@ bond_ethdev_close(struct rte_eth_dev *dev) */ rte_mempool_free(internals->mode6.mempool); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - return 0; } diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0ac9ef9fa1..0a46859d9e 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -442,10 +442,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev) rte_free(dpaa_intf->tx_queues); dpaa_intf->tx_queues = NULL; - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - return 0; } diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index d8624514df..ba99a524f9 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1284,10 +1284,6 @@ dpaa2_dev_close(struct rte_eth_dev *dev) if (priv->extract.qos_extract_param) rte_free((void *)(size_t)priv->extract.qos_extract_param); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - DPAA2_PMD_INFO("%s: netdev deleted", dev->data->name); return 0; } diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index dd9238a616..304c040421 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -774,10 +774,6 @@ eth_em_close(struct rte_eth_dev *dev) em_release_manageability(hw); em_hw_control_release(hw); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* disable uio intr before callback unregister */ rte_intr_disable(intr_handle); rte_intr_callback_unregister(intr_handle, diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 76746c9484..f7c62f473d 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1565,10 +1565,6 @@ eth_igb_close(struct rte_eth_dev *dev) memset(&link, 0, sizeof(link)); rte_eth_linkstatus_set(dev, &link); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* Reset any pending lock */ igb_reset_swfw_lock(hw); @@ -3404,10 +3400,6 @@ igbvf_dev_close(struct rte_eth_dev *dev) memset(&addr, 0, sizeof(addr)); igbvf_default_mac_addr_set(dev, &addr); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - rte_intr_callback_unregister(&pci_dev->intr_handle, eth_igbvf_interrupt_handler, (void *)dev); diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index e02d340c33..bdb8fe79c6 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1956,11 +1956,6 @@ static int eth_ena_dev_uninit(struct rte_eth_dev *eth_dev) ena_destroy_device(eth_dev); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->tx_pkt_prepare = NULL; - return 0; } diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 51b36a1d7b..949fe8fea3 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2803,10 +2803,6 @@ fm10k_dev_close(struct rte_eth_dev *dev) fm10k_dev_queue_release(dev); fm10k_stop_hw(hw); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* disable uio/vfio intr */ rte_intr_disable(intr_handle); diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index daf8f33cf3..2504228d94 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -3253,10 +3253,6 @@ static int hinic_dev_uninit(struct rte_eth_dev *dev) hinic_dev_close(dev); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - rte_free(nic_dev->mc_list); return HINIC_OK; diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index a607824162..2a6ee797b7 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5739,10 +5739,6 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return -EPERM; - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->tx_pkt_prepare = NULL; if (hw->adapter_state < HNS3_NIC_CLOSING) hns3_dev_close(eth_dev); diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 173983a91f..041c6a3d93 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -2747,11 +2747,6 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return -EPERM; - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->tx_pkt_prepare = NULL; - if (hw->adapter_state < HNS3_NIC_CLOSING) hns3vf_dev_close(eth_dev); diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 825de51fbb..605a1792b6 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2693,10 +2693,6 @@ i40e_dev_close(struct rte_eth_dev *dev) (reg | I40E_PFGEN_CTRL_PFSWR_MASK)); I40E_WRITE_FLUSH(hw); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* Clear PXE mode */ i40e_clear_pxe_mode(hw); diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 40c9745433..3dcd50c428 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2421,10 +2421,6 @@ i40evf_dev_close(struct rte_eth_dev *dev) i40e_shutdown_adminq(hw); i40evf_disable_irq0(hw); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - rte_free(vf->vf_res); vf->vf_res = NULL; rte_free(vf->aq_resp); diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 90949521b1..241ab62a49 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1484,10 +1484,6 @@ iavf_dev_close(struct rte_eth_dev *dev) iavf_dev_interrupt_handler, dev); iavf_disable_irq0(hw); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) { if (vf->rss_lut) { rte_free(vf->rss_lut); diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index 33dd0c44f2..f2056e2aba 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -855,10 +855,6 @@ ice_dcf_dev_close(struct rte_eth_dev *dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - ice_dcf_uninit_parent_adapter(dev); ice_dcf_uninit_hw(dev, &adapter->real_hw); diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 1db4015c23..33b2828703 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2417,10 +2417,6 @@ ice_dev_close(struct rte_eth_dev *dev) rte_free(pf->proto_xtr); pf->proto_xtr = NULL; - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* disable uio intr before callback unregister */ rte_intr_disable(intr_handle); diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index ef7d06e526..1387253dc8 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -1065,11 +1065,6 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev) ionic_lif_deinit(lif); ionic_lif_free(lif); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->tx_pkt_prepare = NULL; - return 0; } diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index bd83b0e31a..a7f8a31488 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3010,10 +3010,6 @@ ixgbe_dev_close(struct rte_eth_dev *dev) /* reprogram the RAR[0] in case user changed it. */ ixgbe_set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - /* Unlock any pending hardware semaphore */ ixgbe_swfw_lock_reset(hw); @@ -5467,10 +5463,6 @@ ixgbevf_dev_close(struct rte_eth_dev *dev) **/ ixgbevf_remove_mac_addr(dev, 0); - dev->dev_ops = NULL; - dev->rx_pkt_burst = NULL; - dev->tx_pkt_burst = NULL; - rte_intr_disable(intr_handle); rte_intr_callback_unregister(intr_handle, ixgbevf_dev_interrupt_handler, dev); diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 52bcefc819..1b01502e49 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -2068,10 +2068,6 @@ lio_eth_dev_uninit(struct rte_eth_dev *eth_dev) /* lio_free_sc_buffer_pool */ lio_free_sc_buffer_pool(lio_dev); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - return 0; } diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index be3713dfa0..8743e6e69a 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -1050,10 +1050,6 @@ eth_hn_dev_uninit(struct rte_eth_dev *eth_dev) hn_dev_stop(eth_dev); hn_dev_close(eth_dev); - eth_dev->dev_ops = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->rx_pkt_burst = NULL; - hn_detach(hv); hn_chim_uninit(eth_dev); rte_vmbus_chan_close(hv->primary->chan); diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index aa9ef3bb70..0ea6de448a 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -513,9 +513,6 @@ octeontx_dev_close(struct rte_eth_dev *dev) octeontx_port_close(nic); - dev->tx_pkt_burst = NULL; - dev->rx_pkt_burst = NULL; - return 0; } diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 88389c9e4f..0dd2f78820 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1594,10 +1594,6 @@ static int qede_dev_close(struct rte_eth_dev *eth_dev) if (ECORE_IS_CMT(edev)) rte_eal_alarm_cancel(qede_poll_sp_sb_cb, (void *)eth_dev); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - return 0; } diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index f41d0f5fe2..620e541a10 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -324,11 +324,7 @@ static void sfc_eth_dev_secondary_clear_ops(struct rte_eth_dev *dev) { free(dev->process_private); - dev->process_private = NULL; - dev->dev_ops = NULL; - dev->tx_pkt_prepare = NULL; - dev->tx_pkt_burst = NULL; - dev->rx_pkt_burst = NULL; + rte_eth_dev_release_port(dev); } static int @@ -380,7 +376,6 @@ sfc_dev_close(struct rte_eth_dev *dev) /* Required for logging, so cleanup last */ sa->eth_dev = NULL; - dev->process_private = NULL; free(sa); return 0; diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index b127ce62dc..0598de00ed 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1134,7 +1134,6 @@ tap_dev_close(struct rte_eth_dev *dev) internals->ioctl_sock = -1; } rte_free(dev->process_private); - dev->process_private = NULL; if (tap_devices_count == 1) rte_mp_action_unregister(TAP_MP_KEY); tap_devices_count--; diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index ea6496acce..8683763aa8 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -2001,10 +2001,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) virtio_dev_stop(eth_dev); virtio_dev_close(eth_dev); - eth_dev->dev_ops = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->rx_pkt_burst = NULL; - PMD_INIT_LOG(DEBUG, "dev_uninit completed"); return 0; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 828043a65a..1d070fbd79 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -368,11 +368,6 @@ eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev) return -EBUSY; } - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->tx_pkt_prepare = NULL; - return 0; } diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 0b8e8e3e8d..7b33faa58b 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -556,7 +556,16 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) eth_dev->state = RTE_ETH_DEV_UNUSED; eth_dev->device = NULL; + eth_dev->process_private = NULL; eth_dev->intr_handle = NULL; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; + eth_dev->tx_pkt_prepare = NULL; + eth_dev->rx_queue_count = NULL; + eth_dev->rx_descriptor_done = NULL; + eth_dev->rx_descriptor_status = NULL; + eth_dev->tx_descriptor_status = NULL; + eth_dev->dev_ops = NULL; if (rte_eal_process_type() == RTE_PROC_PRIMARY) { rte_free(eth_dev->data->rx_queues); -- 2.28.0