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 9D412A04AB; Thu, 7 Nov 2019 06:50:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B9F51E871; Thu, 7 Nov 2019 06:50:06 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CCDE01E53A for ; Thu, 7 Nov 2019 06:50:04 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 21:50:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,276,1569308400"; d="scan'208";a="285898506" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga001.jf.intel.com with ESMTP; 06 Nov 2019 21:50:02 -0800 Date: Thu, 7 Nov 2019 13:45:59 +0800 From: Ye Xiaolong To: "Di, ChenxuX" Cc: "dev@dpdk.org" , "Lu, Wenzhuo" , "Yang, Qiming" , "Yigit, Ferruh" Message-ID: <20191107054559.GA4499@intel.com> References: <20191024010310.35882-1-chenxux.di@intel.com> <20191106050847.82673-1-chenxux.di@intel.com> <20191107025029.GB68021@intel.com> <3B926E44943CB04AA3A39AC16328CE39B6B1F8@SHSMSX101.ccr.corp.intel.com> <20191107031119.GC68021@intel.com> <3B926E44943CB04AA3A39AC16328CE39B6B4AF@SHSMSX101.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3B926E44943CB04AA3A39AC16328CE39B6B4AF@SHSMSX101.ccr.corp.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug 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" On 11/07, Di, ChenxuX wrote: >Hi, > >> -----Original Message----- >> From: Ye, Xiaolong >> Sent: Thursday, November 7, 2019 11:11 AM >> To: Di, ChenxuX >> Cc: dev@dpdk.org; Lu, Wenzhuo ; Yang, Qiming >> ; Yigit, Ferruh >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove >> >> Hi, >> >> On 11/07, Di, ChenxuX wrote: >> >Hi, Xiaolong >> > >> >About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e pf >> >and ixgbe vf use >> >> For fm10k, e1000, igb, ice, please check whether they have called >> rte_eth_dev_release_port in the remove ops. >> > >The function rte_eth_dev_pci_generic_remove will call rte_eth_dev_release_port >After the uninit function of drivers. Emm, yes, just double checked, rte_eth_dev_pci_generic_remove will call rte_eth_dev_pci_release which finally invokes rte_eth_dev_release_port. > >> >Rte_eth_dev_destory() in their remove function, others have already use the >> generic remove function. >> > >> >I have send another patch about ixgbe because they fix different commits. >> >> For i40e and ixgbe, please address the comments I raised in previous mail. >> > >When app detach a port without a close, it will call the remove function, >What will uninit the port and rte_eth_dev_release_port. You'll still need to handle i40e_vf_representor_uninit. Thanks, Xiaolong > >Thx >Di Chenxu > >> Thanks, >> Xiaolong >> >> > >> >Thanks >> >Di Chenxu >> > >> >> -----Original Message----- >> >> From: Ye, Xiaolong >> >> Sent: Thursday, November 7, 2019 10:50 AM >> >> To: Di, ChenxuX >> >> Cc: dev@dpdk.org; Lu, Wenzhuo ; Yang, Qiming >> >> ; Yigit, Ferruh >> >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug >> >> remove >> >> >> >> On 11/06, Di ChenxuX wrote: >> >> >testpmd will occur infinite loops when device hotplug remove. >> >> >We can fix the issue by using the pci generic remove function >> >> > >> >> >Fixes: ac89d46096d5 ("net/i40e: release port upon close") >> >> > >> >> >Signed-off-by: Di ChenxuX >> >> > >> >> >v2: >> >> >change the code in driver. >> >> >--- >> >> > drivers/net/i40e/i40e_ethdev.c | 12 +----------- >> >> > 1 file changed, 1 insertion(+), 11 deletions(-) >> >> > >> >> >diff --git a/drivers/net/i40e/i40e_ethdev.c >> >> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d 100644 >> >> >--- a/drivers/net/i40e/i40e_ethdev.c >> >> >+++ b/drivers/net/i40e/i40e_ethdev.c >> >> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver >> >> >*pci_drv __rte_unused, >> >> > >> >> > static int eth_i40e_pci_remove(struct rte_pci_device *pci_dev) { >> >> >- struct rte_eth_dev *ethdev; >> >> >- >> >> >- ethdev = rte_eth_dev_allocated(pci_dev->device.name); >> >> >- if (!ethdev) >> >> >- return -ENODEV; >> >> >- >> >> >- >> >> >- if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) >> >> >- return rte_eth_dev_destroy(ethdev, >> >> i40e_vf_representor_uninit); >> >> >- else >> >> >- return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit); >> >> >+ return rte_eth_dev_pci_generic_remove(pci_dev, >> >> >+eth_i40e_dev_uninit); >> >> >> >> What about i40e_vf_representor_uninit, you also need to take it into >> >> consideration. >> >> >> >> And you should also call rte_eth_dev_release_port in remove ops in >> >> case user detach a port directly without closing it first. >> >> >> >> This comment also applies your ixgbe fix. >> >> >> >> >> >> Thanks, >> >> Xiaolong >> >> >> >> >> >> > } >> >> > >> >> > static struct rte_pci_driver rte_i40e_pmd = { >> >> >-- >> >> >2.17.1 >> >> >