DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vdpa/mlx5: fix device unplug
@ 2021-05-13 18:31 Matan Azrad
  2021-05-13 18:40 ` [dpdk-dev] [PATCH v2] " Matan Azrad
  0 siblings, 1 reply; 4+ messages in thread
From: Matan Azrad @ 2021-05-13 18:31 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, stable, Xueming Li

The vDPA PCI device unplug proccess should release all the private
device resources and also to unregister the device.

The device unregistration was missed what remained the device data
invalid in the rte_vhost library.

Unregister the device in unplug proccess via the remove operation.

Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver")
Cc: stable@dpdk.org

Reported-by: Eli Britstein elibr@nvidia.com
Signed-off-by: Matan Azrad matan@nvidia.com
Tested-by: Eli Britstein elibr@nvidia.com
Acked-by: Xueming Li <xuemingl@nvidia.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 40db28b6db..e5e03e6582 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -787,6 +787,8 @@ mlx5_vdpa_pci_remove(struct rte_pci_device *pci_dev)
 			mlx5_glue->dv_free_var(priv->var);
 			priv->var = NULL;
 		}
+		if (priv->vdev)
+			rte_vdpa_unregister_device(priv->vdev);
 		mlx5_glue->close_device(priv->ctx);
 		pthread_mutex_destroy(&priv->vq_config_lock);
 		rte_free(priv);
-- 
2.25.1


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

end of thread, other threads:[~2021-05-18  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 18:31 [dpdk-dev] [PATCH] vdpa/mlx5: fix device unplug Matan Azrad
2021-05-13 18:40 ` [dpdk-dev] [PATCH v2] " Matan Azrad
2021-05-18  8:24   ` [dpdk-dev] [dpdk-stable] " Xia, Chenbo
2021-05-18  8:27   ` Xia, Chenbo

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