DPDK patches and discussions
 help / color / mirror / Atom feed
From: Paulis Gributs <paulis.gributs@intel.com>
To: xiaoyun.li@intel.com, ferruh.yigit@intel.com
Cc: dev@dpdk.org, thomas@monjalon.net,
	Paulis Gributs <paulis.gributs@intel.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices
Date: Wed, 28 Jul 2021 13:48:48 +0000	[thread overview]
Message-ID: <20210728134848.353258-1-paulis.gributs@intel.com> (raw)

After removing rte_eth_devices from testpmd the vm_hotplug no longer
recovered after removal of a device, this patch fixes this issue.

Fixes: 0a0821bcf312 ("app/testpmd: remove most uses of internal ethdev array")

Signed-off-by: Paulis Gributs <paulis.gributs@intel.com>
---
 app/test-pmd/testpmd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 63da63eb3c..6cbe9ba3c8 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3197,14 +3197,16 @@ rmv_port_callback(void *arg)
 	stop_port(port_id);
 	no_link_check = org_no_link_check;
 
-	close_port(port_id);
 	ret = eth_dev_info_get_print_err(port_id, &dev_info);
 	if (ret != 0)
 		TESTPMD_LOG(ERR,
 			"Failed to get device info for port %d, not detaching\n",
 			port_id);
-	else
-		detach_device(dev_info.device); /* might be already removed or have more ports */
+	else {
+		struct rte_device *device = dev_info.device;
+		close_port(port_id);
+		detach_device(device); /* might be already removed or have more ports */
+	}
 	if (need_to_start)
 		start_packet_forwarding(0);
 }
-- 
2.25.1


             reply	other threads:[~2021-07-28 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 13:48 Paulis Gributs [this message]
2021-07-30  2:17 ` Li, Xiaoyun
2021-07-30 12:30   ` 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=20210728134848.353258-1-paulis.gributs@intel.com \
    --to=paulis.gributs@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    --cc=xiaoyun.li@intel.com \
    /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).