Thomas Gleixner
2021-Jul-07 09:06 UTC
[PATCH V2 5/6] virtio: add one field into virtio_device for recording if device uses managed irq
On Tue, Jul 06 2021 at 07:42, Christoph Hellwig wrote:> On Fri, Jul 02, 2021 at 11:05:54PM +0800, Ming Lei wrote: >> blk-mq needs to know if the device uses managed irq, so add one field >> to virtio_device for recording if device uses managed irq. >> >> If the driver use managed irq, this flag has to be set so it can be >> passed to blk-mq. > > I don't think all this boilerplate code make a whole lot of sense. > I think we need to record this information deep down in the irq code by > setting a flag in struct device only if pci_alloc_irq_vectors_affinity > atually managed to allocate multiple vectors and the PCI_IRQ_AFFINITY > flag was set. Then blk-mq can look at that flag, and also check that > more than one queue is in used and work based on that.Ack.
Ming Lei
2021-Jul-07 09:42 UTC
[PATCH V2 5/6] virtio: add one field into virtio_device for recording if device uses managed irq
On Wed, Jul 07, 2021 at 11:06:25AM +0200, Thomas Gleixner wrote:> On Tue, Jul 06 2021 at 07:42, Christoph Hellwig wrote: > > On Fri, Jul 02, 2021 at 11:05:54PM +0800, Ming Lei wrote: > >> blk-mq needs to know if the device uses managed irq, so add one field > >> to virtio_device for recording if device uses managed irq. > >> > >> If the driver use managed irq, this flag has to be set so it can be > >> passed to blk-mq. > > > > I don't think all this boilerplate code make a whole lot of sense. > > I think we need to record this information deep down in the irq code by > > setting a flag in struct device only if pci_alloc_irq_vectors_affinity > > atually managed to allocate multiple vectors and the PCI_IRQ_AFFINITY > > flag was set. Then blk-mq can look at that flag, and also check that > > more than one queue is in used and work based on that. > > Ack.The problem is that how blk-mq looks at that flag, since the device representing the controller which allocates irq vectors isn't visible to blk-mq. Usually blk-mq(block layer) provides queue limits abstract for drivers to tell any physical property(dma segment, max sectors, ...) to block layer, that is why this patch takes this very similar usage to check if HBA uses managed irq or not. Thanks, Ming