genirq/msi: Make use of affinity aware allocations
authorThomas Gleixner <tglx@linutronix.de>
Mon, 4 Jul 2016 08:39:26 +0000 (17:39 +0900)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 4 Jul 2016 10:25:14 +0000 (12:25 +0200)
Allow the MSI code to provide affinity hints per MSI descriptor.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: linux-block@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
Cc: axboe@fb.com
Cc: agordeev@redhat.com
Link: http://lkml.kernel.org/r/1467621574-8277-6-git-send-email-hch@lst.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/msi.h
kernel/irq/msi.c

index c33abfa0f5a760c3e973cf472246cb5f884f4cee..4f0bfe5912b2f1eb9be7a5c25f4e1ec64c2fafbe 100644 (file)
@@ -47,6 +47,7 @@ struct fsl_mc_msi_desc {
  * @nvec_used: The number of vectors used
  * @dev:       Pointer to the device which uses this descriptor
  * @msg:       The last set MSI message cached for reuse
+ * @affinity:  Optional pointer to a cpu affinity mask for this descriptor
  *
  * @masked:    [PCI MSI/X] Mask bits
  * @is_msix:   [PCI MSI/X] True if MSI-X
@@ -67,6 +68,7 @@ struct msi_desc {
        unsigned int                    nvec_used;
        struct device                   *dev;
        struct msi_msg                  msg;
+       const struct cpumask            *affinity;
 
        union {
                /* PCI MSI/X specific data */
index 58dbbacc6fbbe57cd91d202165e155eb828d06e3..0e2a736b14a7f03048be7b6343b46c32fa8d62ee 100644 (file)
@@ -335,7 +335,7 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
 
                virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used,
                                               dev_to_node(dev), &arg, false,
-                                              NULL);
+                                              desc->affinity);
                if (virq < 0) {
                        ret = -ENOSPC;
                        if (ops->handle_error)