DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices
@ 2021-07-28 13:48 Paulis Gributs
  2021-07-30  2:17 ` Li, Xiaoyun
  0 siblings, 1 reply; 3+ messages in thread
From: Paulis Gributs @ 2021-07-28 13:48 UTC (permalink / raw)
  To: xiaoyun.li, ferruh.yigit; +Cc: dev, thomas, Paulis Gributs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices
  2021-07-28 13:48 [dpdk-dev] [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices Paulis Gributs
@ 2021-07-30  2:17 ` Li, Xiaoyun
  2021-07-30 12:30   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Li, Xiaoyun @ 2021-07-30  2:17 UTC (permalink / raw)
  To: Gributs, Paulis, Yigit, Ferruh; +Cc: dev, thomas

> -----Original Message-----
> From: Gributs, Paulis <paulis.gributs@intel.com>
> Sent: Wednesday, July 28, 2021 21:49
> To: Li, Xiaoyun <xiaoyun.li@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; Gributs, Paulis
> <paulis.gributs@intel.com>
> Subject: [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices
> 
> 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(-)

Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices
  2021-07-30  2:17 ` Li, Xiaoyun
@ 2021-07-30 12:30   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2021-07-30 12:30 UTC (permalink / raw)
  To: Gributs, Paulis; +Cc: Yigit, Ferruh, dev, Li, Xiaoyun

> > 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(-)
> 
> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>

Adding a bit of explanation:
"because the port was closed before querying it."
About the title, vm_hotplug is nothing in testpmd,
and the problem is not limited to VMs.

Applied with rewording.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-30 12:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 13:48 [dpdk-dev] [PATCH] app/testpmd: fix vm_hotplug after removal of rte_eth_devices Paulis Gributs
2021-07-30  2:17 ` Li, Xiaoyun
2021-07-30 12:30   ` Thomas Monjalon

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).