RE: [RFC] Revert "virtio_pci: Support surprise removal of virtio pci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> From: Li,Rongqing <lirongqing@xxxxxxxxx>
> Sent: Friday, January 12, 2024 7:59 AM
> 
> 
> > > diff --git a/drivers/virtio/virtio_pci_common.c
> > > b/drivers/virtio/virtio_pci_common.c
> > > index 7a55939..d60fe99 100644
> > > --- a/drivers/virtio/virtio_pci_common.c
> > > +++ b/drivers/virtio/virtio_pci_common.c
> > > @@ -584,13 +584,6 @@ static void virtio_pci_remove(struct pci_dev
> > *pci_dev)
> > >         struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
> > >         struct device *dev = get_device(&vp_dev->vdev.dev);
> > >
> > > -       /*
> > > -        * Device is marked broken on surprise removal so that virtio upper
> > > -        * layers can abort any ongoing operation.
> > > -        */
> > > -       if (!pci_device_is_present(pci_dev))
> > > -               virtio_break_device(&vp_dev->vdev);
> > > -
> > >         pci_disable_sriov(pci_dev);
> >
> >
> > Maybe break device is not the right thing to do. Indeed, request
> > buffers which have been already used are not completed by driver.
>
We can possibly have a virtio_device level flag to indicate device dead/not responsive.
 
> True, break device makes virtio-blk no longer work for surprise removal
> 
> And seems no simple method can work for all devices.

When the VQ is broken or when virtio_device is marked dead, virtblk_remove() should 
a. flush all the outstanding requests
b. inform the upper layer to not issue more requests
c. for transient requests arriving on MQ, fail them in the request queue callback.







[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux