Skip to contentSkip to conversation

pdump: only remove created vdevs

PATCH Superseded Gage Eads 3 participants 5 messages Feb 25, 2019 – Feb 27, 2019

lore
Share & tools
lore

Gage Eads

author
#0 lore raw

PATCH 1/1 pdump: only remove created vdevs

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")
---
 app/pdump/main.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
app/pdump/main.c +12 -5
index 5e183ea90..ccf2a1d2f 100644
@@ -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();
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Eads, Gage
Sent: Monday, February 25, 2019 5:14 PM
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>; Pattan, Reshma <[email protected]>; [email protected]
Subject: [PATCH] pdump: only remove created vdevs

Quoted 3 lines

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

Small nit, You can remove "--" in commit message . Other than that

author
#2 lore raw
Quoted 19 lines

-----Original Message-----
From: Pattan, Reshma
Sent: Tuesday, February 26, 2019 8:15 AM
To: Eads, Gage <[email protected]>; [email protected]
Cc: Yigit, Ferruh <[email protected]>; [email protected]
Subject: RE: [PATCH] pdump: only remove created vdevs

Quoted 8 lines

-----Original Message-----
From: Eads, Gage
Sent: Monday, February 25, 2019 5:14 PM
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>; Pattan, Reshma <[email protected]>; [email protected]
Subject: [PATCH] pdump: only remove created vdevs

Quoted 8 lines
Quoted 3 lines

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

Small nit, You can remove "--" in commit message . Other than that

Sure thing. I'll fix the title and the Fixes commit name as well (both should be "app/pdump", not "pdump").

Thanks,
Gage

author
#3 lore raw

PATCH v2 1/1 app/pdump: only remove created vdevs

In reply to Gage Eads

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")

---
v2: Tweak commit message

 app/pdump/main.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
app/pdump/main.c +12 -5
index 5e183ea90..ccf2a1d2f 100644
@@ -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();
Signature · 1 line
2.13.6