diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2012-11-19 10:01:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-01-24 11:25:12 -0500 |
commit | 51906e779f2b13b38f8153774c4c7163d412ffd9 (patch) | |
tree | 970633752f6a5cea156226cd31457289ba16f1c5 /kernel/irq | |
parent | 4cca6ea04d31c22a7d0436949c072b27bde41f86 (diff) |
x86/MSI: Support multiple MSIs in presense of IRQ remapping
The MSI specification has several constraints in comparison with
MSI-X, most notable of them is the inability to configure MSIs
independently. As a result, it is impossible to dispatch
interrupts from different queues to different CPUs. This is
largely devalues the support of multiple MSIs in SMP systems.
Also, a necessity to allocate a contiguous block of vector
numbers for devices capable of multiple MSIs might cause a
considerable pressure on x86 interrupt vector allocator and
could lead to fragmentation of the interrupt vectors space.
This patch overcomes both drawbacks in presense of IRQ remapping
and lets devices take advantage of multiple queues and per-IRQ
affinity assignments.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/c8bd86ff56b5fc118257436768aaa04489ac0a4c.1353324359.git.agordeev@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/chip.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 3aca9f29d30e..cbd97ce0b000 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -90,27 +90,41 @@ int irq_set_handler_data(unsigned int irq, void *data) | |||
90 | EXPORT_SYMBOL(irq_set_handler_data); | 90 | EXPORT_SYMBOL(irq_set_handler_data); |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * irq_set_msi_desc - set MSI descriptor data for an irq | 93 | * irq_set_msi_desc_off - set MSI descriptor data for an irq at offset |
94 | * @irq: Interrupt number | 94 | * @irq_base: Interrupt number base |
95 | * @entry: Pointer to MSI descriptor data | 95 | * @irq_offset: Interrupt number offset |
96 | * @entry: Pointer to MSI descriptor data | ||
96 | * | 97 | * |
97 | * Set the MSI descriptor entry for an irq | 98 | * Set the MSI descriptor entry for an irq at offset |
98 | */ | 99 | */ |
99 | int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry) | 100 | int irq_set_msi_desc_off(unsigned int irq_base, unsigned int irq_offset, |
101 | struct msi_desc *entry) | ||
100 | { | 102 | { |
101 | unsigned long flags; | 103 | unsigned long flags; |
102 | struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); | 104 | struct irq_desc *desc = irq_get_desc_lock(irq_base + irq_offset, &flags, IRQ_GET_DESC_CHECK_GLOBAL); |
103 | 105 | ||
104 | if (!desc) | 106 | if (!desc) |
105 | return -EINVAL; | 107 | return -EINVAL; |
106 | desc->irq_data.msi_desc = entry; | 108 | desc->irq_data.msi_desc = entry; |
107 | if (entry) | 109 | if (entry && !irq_offset) |
108 | entry->irq = irq; | 110 | entry->irq = irq_base; |
109 | irq_put_desc_unlock(desc, flags); | 111 | irq_put_desc_unlock(desc, flags); |
110 | return 0; | 112 | return 0; |
111 | } | 113 | } |
112 | 114 | ||
113 | /** | 115 | /** |
116 | * irq_set_msi_desc - set MSI descriptor data for an irq | ||
117 | * @irq: Interrupt number | ||
118 | * @entry: Pointer to MSI descriptor data | ||
119 | * | ||
120 | * Set the MSI descriptor entry for an irq | ||
121 | */ | ||
122 | int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry) | ||
123 | { | ||
124 | return irq_set_msi_desc_off(irq, 0, entry); | ||
125 | } | ||
126 | |||
127 | /** | ||
114 | * irq_set_chip_data - set irq chip data for an irq | 128 | * irq_set_chip_data - set irq chip data for an irq |
115 | * @irq: Interrupt number | 129 | * @irq: Interrupt number |
116 | * @data: Pointer to chip specific data | 130 | * @data: Pointer to chip specific data |