All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] virtio_vdpa: Support surprise removal of virtio vdpa device
@ 2022-01-11  6:55 dongsheng li
  2022-01-11 12:12   ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: dongsheng li @ 2022-01-11  6:55 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtualization, linux-kernel, wangwei, dongsheng li

When virtio vdpa device removed, the abnormal damage of the device cannot be
perceived normally, which will cause problems similar to:

Commit 43bb40c5b926 ("virtio_pci: Support surprise removal of
virtio pci device")
Hence, add the ability to abort the command on surprise removal

Signed-off-by: dongsheng li <lidongsheng@dayudpu.com>
---
 drivers/virtio/virtio_vdpa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
index f85f860bc10b..a5cebad09320 100644
--- a/drivers/virtio/virtio_vdpa.c
+++ b/drivers/virtio/virtio_vdpa.c
@@ -396,6 +396,7 @@ static void virtio_vdpa_remove(struct vdpa_device *vdpa)
 {
 	struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa);
 
+	virtio_break_device(&vd_dev->vdev);
 	unregister_virtio_device(&vd_dev->vdev);
 }
 
-- 
2.17.1


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

* Re: [PATCH v2] virtio_vdpa: Support surprise removal of virtio vdpa device
  2022-01-11  6:55 [PATCH v2] virtio_vdpa: Support surprise removal of virtio vdpa device dongsheng li
@ 2022-01-11 12:12   ` Michael S. Tsirkin
  0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-01-11 12:12 UTC (permalink / raw)
  To: dongsheng li; +Cc: wangwei, linux-kernel, virtualization

On Tue, Jan 11, 2022 at 02:55:27PM +0800, dongsheng li wrote:
> When virtio vdpa device removed, the abnormal damage of the device cannot be
> perceived normally, which will cause problems similar to:
> 
> Commit 43bb40c5b926 ("virtio_pci: Support surprise removal of
> virtio pci device")
> Hence, add the ability to abort the command on surprise removal
> 
> Signed-off-by: dongsheng li <lidongsheng@dayudpu.com>

If you don't mkae changes you can carry forward acks.

> ---
>  drivers/virtio/virtio_vdpa.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index f85f860bc10b..a5cebad09320 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -396,6 +396,7 @@ static void virtio_vdpa_remove(struct vdpa_device *vdpa)
>  {
>  	struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa);
>  
> +	virtio_break_device(&vd_dev->vdev);

My comment on graceful removal stands. E.g. a storage device
will want to flush out writes if possible not drop them.

>  	unregister_virtio_device(&vd_dev->vdev);
>  }
>  
> -- 
> 2.17.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2] virtio_vdpa: Support surprise removal of virtio vdpa device
@ 2022-01-11 12:12   ` Michael S. Tsirkin
  0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-01-11 12:12 UTC (permalink / raw)
  To: dongsheng li; +Cc: jasowang, virtualization, linux-kernel, wangwei

On Tue, Jan 11, 2022 at 02:55:27PM +0800, dongsheng li wrote:
> When virtio vdpa device removed, the abnormal damage of the device cannot be
> perceived normally, which will cause problems similar to:
> 
> Commit 43bb40c5b926 ("virtio_pci: Support surprise removal of
> virtio pci device")
> Hence, add the ability to abort the command on surprise removal
> 
> Signed-off-by: dongsheng li <lidongsheng@dayudpu.com>

If you don't mkae changes you can carry forward acks.

> ---
>  drivers/virtio/virtio_vdpa.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index f85f860bc10b..a5cebad09320 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -396,6 +396,7 @@ static void virtio_vdpa_remove(struct vdpa_device *vdpa)
>  {
>  	struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa);
>  
> +	virtio_break_device(&vd_dev->vdev);

My comment on graceful removal stands. E.g. a storage device
will want to flush out writes if possible not drop them.

>  	unregister_virtio_device(&vd_dev->vdev);
>  }
>  
> -- 
> 2.17.1


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

end of thread, other threads:[~2022-01-11 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-11  6:55 [PATCH v2] virtio_vdpa: Support surprise removal of virtio vdpa device dongsheng li
2022-01-11 12:12 ` Michael S. Tsirkin
2022-01-11 12:12   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.