summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorReshma Pattan <reshma.pattan@intel.com>2019-01-15 13:45:04 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-17 21:27:37 +0100
commit35cb223ab7be6791fa68698c05b94b843b8a5fda (patch)
tree0b603ca7ea156418b9704da79a8fc19acbac81d3 /app
parent7c06d9258ab8a33b4d5a6604726ebeae90d8537e (diff)
downloaddpdk-next-eventdev-35cb223ab7be6791fa68698c05b94b843b8a5fda.zip
dpdk-next-eventdev-35cb223ab7be6791fa68698c05b94b843b8a5fda.tar.gz
dpdk-next-eventdev-35cb223ab7be6791fa68698c05b94b843b8a5fda.tar.xz
app/pdump: fix vdev cleanup
Virtual devices added in pdump application using rte_eal_hotplug_add should be removed explicitly while exiting the pdump application, otherwise the subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary. Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach") Cc: stable@dpdk.org Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'app')
-rw-r--r--app/pdump/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/pdump/main.c b/app/pdump/main.c
index 9e86bf6..5e183ea 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -494,6 +494,7 @@ cleanup_pdump_resources(void)
{
int i;
struct pdump_tuples *pt;
+ char name[RTE_ETH_NAME_MAX_LEN];
/* disable pdump and free the pdump_tuple resources */
for (i = 0; i < num_tuples; i++) {
@@ -510,6 +511,14 @@ cleanup_pdump_resources(void)
free_ring_data(pt->rx_ring, pt->rx_vdev_id, &pt->stats);
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);
+
+ rte_eth_dev_get_name_by_port(pt->tx_vdev_id, name);
+ rte_eal_hotplug_remove("vdev", name);
+
}
cleanup_rings();
}