From patchwork Thu Nov 7 06:28:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenxu Di X-Patchwork-Id: 62630 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F7C9A034E; Thu, 7 Nov 2019 08:23:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DA3571E905; Thu, 7 Nov 2019 08:23:05 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 51B661E8D5 for ; Thu, 7 Nov 2019 08:23:04 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 23:23:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,277,1569308400"; d="scan'208";a="233166120" Received: from intel.sh.intel.com ([10.239.255.149]) by fmsmga002.fm.intel.com with ESMTP; 06 Nov 2019 23:23:01 -0800 From: Di ChenxuX To: dev@dpdk.org Cc: Yang Qiming , Di ChenxuX Date: Thu, 7 Nov 2019 06:28:21 +0000 Message-Id: <20191107062821.32948-1-chenxux.di@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106050930.82723-1-chenxux.di@intel.com> References: <20191106050930.82723-1-chenxux.di@intel.com> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: 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" testpmd will occur infinite loops when device hotplug remove. We can fix the issue by using the pci generic remove function Fixes: f2f4990eff94 ("net/ixgbe: release port upon close") Signed-off-by: Di ChenxuX v2: reverted the code about ixgbe_vf_representor_uninit. --- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index dbce7a80e..7ec55a4de 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev) ethdev = rte_eth_dev_allocated(pci_dev->device.name); if (!ethdev) - return -ENODEV; + return 0; if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) return rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit); else - return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit); + return rte_eth_dev_pci_generic_remove(pci_dev, + eth_ixgbe_dev_uninit); } static struct rte_pci_driver rte_ixgbe_pmd = {