Skip to content

Commit

Permalink
vdpa/mlx5: fix device unplug
Browse files Browse the repository at this point in the history
[ upstream commit 2838aa7 ]

The vDPA PCI device unplug process 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 process via the remove operation.

Fixes: 95276ab ("vdpa/mlx5: introduce Mellanox vDPA driver")

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>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
  • Loading branch information
matan1559 authored and steevenlee committed Jun 8, 2021
1 parent 4079bce commit a6967ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/vdpa/mlx5/mlx5_vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,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);
Expand Down

0 comments on commit a6967ee

Please sign in to comment.