Re: [PATCH v5] vfio error recovery: kernel support

From: Cao jin
Date: Wed Mar 22 2017 - 22:11:37 EST




On 03/22/2017 09:10 PM, Michael S. Tsirkin wrote:
> Minor comments on commit log below.
>
> On Wed, Mar 22, 2017 at 06:34:23PM +0800, Cao jin wrote:
>> From: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
>>

>
>> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
>> Signed-off-by: Cao jin <caoj.fnst@xxxxxxxxxxxxxx>
>> ---
>>
>> v5 changelog:
>> 1. Add another new eventfd passive_reset_trigger & the boilerplate code,
>> used in slot_reset. Add comment for slot_reset().
>> 2. Rewrite the commit log.
>>
>> drivers/vfio/pci/vfio_pci.c | 49 +++++++++++++++++++++++++++++++++++--
>> drivers/vfio/pci/vfio_pci_intrs.c | 38 ++++++++++++++++++++++++++++
>> drivers/vfio/pci/vfio_pci_private.h | 2 ++
>> include/uapi/linux/vfio.h | 2 ++
>> 4 files changed, 89 insertions(+), 2 deletions(-)
>>

>
>
>> +static pci_ers_result_t vfio_pci_aer_slot_reset(struct pci_dev *pdev)
>> +{
>> + struct vfio_pci_device *vdev;
>> + struct vfio_device *device;
>> + static pci_ers_result_t err = PCI_ERS_RESULT_NONE;
>> +
>> + device = vfio_device_get_from_dev(&pdev->dev);
>> + if (!device)
>> + goto err_dev;
>> +
>> + vdev = vfio_device_data(device);
>> + if (!vdev)
>> + goto err_data;
>> +
>> + mutex_lock(&vdev->igate);
>> +
>> + if (vdev->passive_reset_trigger)
>> + eventfd_signal(vdev->passive_reset_trigger, 1);
>> + else if (vdev->err_trigger)
>> + eventfd_signal(vdev->err_trigger, 1);
>
> why is this chunk here? why not just do
>
> if (vdev->passive_reset_trigger)
> eventfd_signal(vdev->passive_reset_trigger, 1);
>
> without a fallback?
>
>

I thought it is one way of "passing maximum info to userspace and let it
decide."

--
Sincerely,
Cao jin