DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pdump: only remove created vdevs
@ 2019-02-25 17:14 Gage Eads
  2019-02-26 14:14 ` Pattan, Reshma
  2019-02-26 16:04 ` [dpdk-dev] [PATCH v2] app/pdump: " Gage Eads
  0 siblings, 2 replies; 5+ messages in thread
From: Gage Eads @ 2019-02-25 17:14 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, reshma.pattan, stable

This commit fixes a bug in which pdump -- particularly when used in a
unidirectional manner -- could attempt to remove devices it didn't create.

Fixes: 35cb223ab7be ("pdump: fix vdev cleanup")
Cc: stable@dpdk.org

Signed-off-by: Gage Eads <gage.eads@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-27 11:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 17:14 [dpdk-dev] [PATCH] pdump: only remove created vdevs Gage Eads
2019-02-26 14:14 ` Pattan, Reshma
2019-02-26 15:12   ` Eads, Gage
2019-02-26 16:04 ` [dpdk-dev] [PATCH v2] app/pdump: " Gage Eads
2019-02-27 11:53   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).