Re: [PATCH 12/13] vfio/nvidia-vgpu: add the NVIDIA vGPU VFIO variant driver
From: Jason Gunthorpe
Date: Thu Sep 17 2026 - 09:24:24 EST
On Thu, Sep 17, 2026 at 11:49:29AM +1000, Dave Airlie wrote:
> +static pci_ers_result_t hisi_acc_vfio_pci_aer_err_detected(
> + struct pci_dev *pdev, pci_channel_state_t state)
> +{
> + struct hisi_acc_vf_core_device *hisi_acc_vdev = hisi_acc_drvdata(pdev);
> +
> + return vfio_pci_core_aer_err_detected(&hisi_acc_vdev->core_device,
> state);
> +}
> +
> +static int hisi_acc_vfio_pci_runtime_suspend(struct device *dev)
> +{
> + struct hisi_acc_vf_core_device *hisi_acc_vdev = dev_get_drvdata(dev);
> +
> + return vfio_pci_core_runtime_suspend(&hisi_acc_vdev->core_device);
> +}
> +
> +static int hisi_acc_vfio_pci_runtime_resume(struct device *dev)
> +{
> + struct hisi_acc_vf_core_device *hisi_acc_vdev = dev_get_drvdata(dev);
> +
> + return vfio_pci_core_runtime_resume(&hisi_acc_vdev->core_device);
> +}
> +
> +static const struct dev_pm_ops hisi_acc_vfio_pci_pm_ops = {
> + SET_RUNTIME_PM_OPS(hisi_acc_vfio_pci_runtime_suspend,
> + hisi_acc_vfio_pci_runtime_resume, NULL)
> +};
>
> is how much code it adds to current drivers, this doesn't seem
> excessive for 10 drivers,
Well, I think it is alot, and there it sucks if new ones are added.
> like you could obfuscate it a bit with some macros, but I really don't
> see a lot of value in hiding
> what is effectively just standard driver boilerplate.
This is exactly the kind of boilerplate people have been removing with
macros. I would macro it..
Jason