summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGage Eads <gage.eads@intel.com>2019-02-26 10:04:37 -0600
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-01 18:17:36 +0100
commit499ca6161007d95d6727c4236b53fe8036efda00 (patch)
treebe14570112059c14be1c9e7bcc3a984232fd568f /app
parentc19429844c0257aceb29fdc845dbd16115966986 (diff)
downloaddpdk-next-eventdev-499ca6161007d95d6727c4236b53fe8036efda00.zip
dpdk-next-eventdev-499ca6161007d95d6727c4236b53fe8036efda00.tar.gz
dpdk-next-eventdev-499ca6161007d95d6727c4236b53fe8036efda00.tar.xz
app/pdump: remove only created vdevs
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 <gage.eads@intel.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Diffstat (limited to 'app')
-rw-r--r--app/pdump/main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/app/pdump/main.c b/app/pdump/main.c
index 5e183ea..ccf2a1d 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();