Re: [RFC v4 6/8] crypto: hisilicon/qm: Add helper to retrieve the PF qm data

From: Jason Gunthorpe
Date: Tue Feb 08 2022 - 09:54:28 EST


On Tue, Feb 08, 2022 at 02:49:48PM +0000, Shameerali Kolothum Thodi wrote:

> > > +EXPORT_SYMBOL_GPL(hisi_qm_get_pf_qm);
> >
> > Why put this in this driver, why not in the vfio driver? And why use
> > symbol_get ?
>
> QM driver provides a generic common interface for all HiSilicon ACC
> drivers. So thought of placing it here. And symbol_get/put is used
> to avoid having dependency of all the ACC drivers being built along
> with the vfio driver. Is there a better way to retrieve the struct pci_driver *
> associated with each ACC PF driver? Please let me know.

No, this is the way, but it seems better to put the function that is
only ever called by vfio in VFIO and avoid the symbol get - what is
the issue with loading some small modules?

Jason