From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B70B6235; Tue, 26 Feb 2019 17:04:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2019 08:04:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,416,1544515200"; d="scan'208";a="141789297" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga001.jf.intel.com with ESMTP; 26 Feb 2019 08:04:35 -0800 From: Gage Eads To: dev@dpdk.org Cc: ferruh.yigit@intel.com, reshma.pattan@intel.com, stable@dpdk.org Date: Tue, 26 Feb 2019 10:04:37 -0600 Message-Id: <20190226160437.10666-1-gage.eads@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190225171418.10306-1-gage.eads@intel.com> References: <20190225171418.10306-1-gage.eads@intel.com> Subject: [dpdk-dev] [PATCH v2] app/pdump: only remove created vdevs 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, 26 Feb 2019 16:04:37 -0000 This commit fixes a bug in which a unidirectional pdump could attempt to remove devices it didn't create. Fixes: 35cb223ab7be ("app/pdump: fix vdev cleanup") Cc: stable@dpdk.org Signed-off-by: Gage Eads Acked-by: Reshma Pattan --- v2: Tweak commit message app/pdump/main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 5e183ea90..ccf2a1d2f 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -512,12 +512,19 @@ cleanup_pdump_resources(void) if (pt->dir & RTE_PDUMP_FLAG_TX) free_ring_data(pt->tx_ring, pt->tx_vdev_id, &pt->stats); - /* Remove the vdev created */ - rte_eth_dev_get_name_by_port(pt->rx_vdev_id, name); - rte_eal_hotplug_remove("vdev", name); + /* Remove the vdev(s) created */ + if (pt->dir & RTE_PDUMP_FLAG_RX) { + rte_eth_dev_get_name_by_port(pt->rx_vdev_id, name); + rte_eal_hotplug_remove("vdev", name); + } + + if (pt->single_pdump_dev) + continue; - rte_eth_dev_get_name_by_port(pt->tx_vdev_id, name); - rte_eal_hotplug_remove("vdev", name); + if (pt->dir & RTE_PDUMP_FLAG_TX) { + rte_eth_dev_get_name_by_port(pt->tx_vdev_id, name); + rte_eal_hotplug_remove("vdev", name); + } } cleanup_rings(); -- 2.13.6