Re: [RFC 18/29] nvkm/vgpu: introduce pci_driver.sriov_configure() in nvkm

Jason Gunthorpe
2024-09-26T22:56:14Z

On Sun, Sep 22, 2024 at 05:49:40AM -0700, Zhi Wang wrote:

> diff --git a/include/drm/nvkm_vgpu_mgr_vfio.h b/include/drm/nvkm_vgpu_mgr_vfio.h
> index d9ed2cd202ff..5c2c650c2df9 100644
> --- a/include/drm/nvkm_vgpu_mgr_vfio.h
> +++ b/include/drm/nvkm_vgpu_mgr_vfio.h
> @@ -6,8 +6,13 @@
> #ifndef __NVKM_VGPU_MGR_VFIO_H__
> #define __NVKM_VGPU_MGR_VFIO_H__
>
> +enum {
> + NVIDIA_VGPU_EVENT_PCI_SRIOV_CONFIGURE = 0,
> +};
> +
> struct nvidia_vgpu_vfio_handle_data {
> void *priv;
> + struct notifier_block notifier;
> };

Nothing references this? Why would you need it?

It looks approx correct to me to just directly put your function in
the sriov_configure callback.

This is the callback that indicates the admin has decided to turn on
the SRIOV feature.

Jason