aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2014-05-29 11:53:13 -0400
committerChristoph Hellwig <hch@lst.de>2014-06-02 03:54:55 -0400
commit41b3cf08cd5e7915293f3784ab649d48bb142153 (patch)
treee9a3d5966ad331f9524501d81006560097991810
parent072b0518b0f75296443a0df9fe7f25e052e62652 (diff)
hpsa: set irq affinity hints to route MSI-X vectors across CPUs
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Reviewed-by: Mike Miller <michael.miller@canonical.com> Reviewed-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/hpsa.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index b474dbaaa8d0..2b7454f6c50f 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6615,6 +6615,17 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h)
6615 h->ioaccel_cmd_pool, h->ioaccel_cmd_pool_dhandle); 6615 h->ioaccel_cmd_pool, h->ioaccel_cmd_pool_dhandle);
6616} 6616}
6617 6617
6618static void hpsa_irq_affinity_hints(struct ctlr_info *h)
6619{
6620 int i, cpu, rc;
6621
6622 cpu = cpumask_first(cpu_online_mask);
6623 for (i = 0; i < h->msix_vector; i++) {
6624 rc = irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
6625 cpu = cpumask_next(cpu, cpu_online_mask);
6626 }
6627}
6628
6618static int hpsa_request_irq(struct ctlr_info *h, 6629static int hpsa_request_irq(struct ctlr_info *h,
6619 irqreturn_t (*msixhandler)(int, void *), 6630 irqreturn_t (*msixhandler)(int, void *),
6620 irqreturn_t (*intxhandler)(int, void *)) 6631 irqreturn_t (*intxhandler)(int, void *))
@@ -6634,6 +6645,7 @@ static int hpsa_request_irq(struct ctlr_info *h,
6634 rc = request_irq(h->intr[i], msixhandler, 6645 rc = request_irq(h->intr[i], msixhandler,
6635 0, h->devname, 6646 0, h->devname,
6636 &h->q[i]); 6647 &h->q[i]);
6648 hpsa_irq_affinity_hints(h);
6637 } else { 6649 } else {
6638 /* Use single reply pool */ 6650 /* Use single reply pool */
6639 if (h->msix_vector > 0 || h->msi_vector) { 6651 if (h->msix_vector > 0 || h->msi_vector) {
@@ -6685,12 +6697,15 @@ static void free_irqs(struct ctlr_info *h)
6685 if (!h->msix_vector || h->intr_mode != PERF_MODE_INT) { 6697 if (!h->msix_vector || h->intr_mode != PERF_MODE_INT) {
6686 /* Single reply queue, only one irq to free */ 6698 /* Single reply queue, only one irq to free */
6687 i = h->intr_mode; 6699 i = h->intr_mode;
6700 irq_set_affinity_hint(h->intr[i], NULL);
6688 free_irq(h->intr[i], &h->q[i]); 6701 free_irq(h->intr[i], &h->q[i]);
6689 return; 6702 return;
6690 } 6703 }
6691 6704
6692 for (i = 0; i < h->msix_vector; i++) 6705 for (i = 0; i < h->msix_vector; i++) {
6706 irq_set_affinity_hint(h->intr[i], NULL);
6693 free_irq(h->intr[i], &h->q[i]); 6707 free_irq(h->intr[i], &h->q[i]);
6708 }
6694} 6709}
6695 6710
6696static void hpsa_free_irqs_and_disable_msix(struct ctlr_info *h) 6711static void hpsa_free_irqs_and_disable_msix(struct ctlr_info *h)