Hi Jason,

> -----Original Message-----
> From: Jason Gunthorpe <j...@mellanox.com>
> Sent: Wednesday, July 22, 2020 10:35 AM
> To: Dey, Megha <megha....@intel.com>
> Cc: Jiang, Dave <dave.ji...@intel.com>; vk...@kernel.org; m...@kernel.org;
> bhelg...@google.com; raf...@kernel.org; gre...@linuxfoundation.org;
> t...@linutronix.de; h...@zytor.com; alex.william...@redhat.com; Pan, Jacob
> jun <jacob.jun....@intel.com>; Raj, Ashok <ashok....@intel.com>; Liu, Yi L
> <yi.l....@intel.com>; Lu, Baolu <baolu...@intel.com>; Tian, Kevin
> <kevin.t...@intel.com>; Kumar, Sanjay K <sanjay.k.ku...@intel.com>; Luck,
> Tony <tony.l...@intel.com>; Lin, Jing <jing....@intel.com>; Williams, Dan J
> <dan.j.willi...@intel.com>; kwankh...@nvidia.com; eric.au...@redhat.com;
> pa...@mellanox.com; Hansen, Dave <dave.han...@intel.com>;
> netan...@mellanox.com; shah...@mellanox.com; yan.y.z...@linux.intel.com;
> pbonz...@redhat.com; Ortiz, Samuel <samuel.or...@intel.com>; Hossain, Mona
> <mona.hoss...@intel.com>; dmaeng...@vger.kernel.org; linux-
> ker...@vger.kernel.org; x...@kernel.org; linux-...@vger.kernel.org;
> k...@vger.kernel.org
> Subject: Re: [PATCH RFC v2 04/18] irq/dev-msi: Introduce APIs to allocate/free
> dev-msi interrupts
> 
> On Wed, Jul 22, 2020 at 10:05:52AM -0700, Dey, Megha wrote:
> >
> >
> > On 7/21/2020 9:25 AM, Jason Gunthorpe wrote:
> > > On Tue, Jul 21, 2020 at 09:02:41AM -0700, Dave Jiang wrote:
> > > > From: Megha Dey <megha....@intel.com>
> > > >
> > > > The dev-msi interrupts are to be allocated/freed only for custom
> > > > devices, not standard PCI-MSIX devices.
> > > >
> > > > These interrupts are device-defined and they are distinct from the
> > > > already existing msi interrupts:
> > > > pci-msi: Standard PCI MSI/MSI-X setup format
> > > > platform-msi: Platform custom, but device-driver opaque MSI
> > > > setup/control
> > > > arch-msi: fallback for devices not assigned to the generic PCI
> > > > domain
> > > > dev-msi: device defined IRQ domain for ancillary devices. For e.g.
> > > > DSA portal devices use device specific IMS(Interrupt message store)
> interrupts.
> > > >
> > > > dev-msi interrupts are represented by their own device-type. That
> > > > means
> > > > dev->msi_list is never contended for different interrupt types. It
> > > > will either be all PCI-MSI or all device-defined.
> > >
> > > Not sure I follow this, where is the enforcement that only dev-msi
> > > or normal MSI is being used at one time on a single struct device?
> > >
> >
> > So, in the dev_msi_alloc_irqs, I first check if the dev_is_pci..
> > If it is a pci device, it is forbidden to use dev-msi and must use the
> > pci subsystem calls. dev-msi is to be used for all other custom
> > devices, mdev or otherwise.
> 
> What prevents creating a dev-msi directly on the struct pci_device ?

In the next patchset, I have explicitly added code which denies PCI devices 
from using the dev_msi alloc/free APIS
> 
> Jason

Reply via email to