[v4] pdump: fix vdev cleanup
Checks
Commit Message
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
CC: ferruh.yigit@intel.com
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
v4: fix typo in commit message
v3: fix author
v2: fix typo in commit message
---
---
app/pdump/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
On 1/15/2019 1:45 PM, Reshma Pattan wrote:
> 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
> CC: ferruh.yigit@intel.com
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
15/01/2019 15:57, Ferruh Yigit:
> On 1/15/2019 1:45 PM, Reshma Pattan wrote:
> > 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
> > CC: ferruh.yigit@intel.com
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
>
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied, thanks
@@ -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();
}