DPDK patches and discussions
 help / color / mirror / Atom feed
From: Reshma Pattan <reshma.pattan@intel.com>
To: dev@dpdk.org
Cc: Reshma Pattan <reshma.pattan@intel.com>,
	stable@dpdk.org, ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
Date: Fri, 11 Jan 2019 17:51:34 +0000	[thread overview]
Message-ID: <20190111175134.40273-1-reshma.pattan@intel.com> (raw)
In-Reply-To: <20190111174134.39772-1-reshma.pattan@intel.com>

Virtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly
while existing 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>
---
v3: fix author
v2: fix typo in commit message
---
---
 app/pdump/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 9e86bf623..5e183ea90 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();
 }
-- 
2.17.1

  reply	other threads:[~2019-01-11 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 17:41 [dpdk-dev] [PATCH v2] " Reshma Pattan
2019-01-11 17:51 ` Reshma Pattan [this message]
2019-01-15  0:59   ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
2019-01-15 10:09     ` Pattan, Reshma
2019-01-15 10:10       ` Thomas Monjalon
2019-01-15 10:25         ` Pattan, Reshma
2019-01-17 20:23           ` Thomas Monjalon
2019-01-15 13:45   ` [dpdk-dev] [PATCH v4] " Reshma Pattan
2019-01-15 14:57     ` Ferruh Yigit
2019-01-17 20:28       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190111175134.40273-1-reshma.pattan@intel.com \
    --to=reshma.pattan@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).