public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI/MSI: Only disable affinity settings if pre and post vector count is equal to max_vecs and not min_vecs
@ 2017-02-21 17:34 Himanshu Madhani
  2017-02-23  0:27 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Madhani @ 2017-02-21 17:34 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen; +Cc: himanshu.madhani, linux-scsi

From: Michael Hernandez <michael.hernandez@cavium.com>

min_vecs is the minimum amount of vectors needed to operate in MSI-X mode
which may just include the vectors that don't need affinity.

Disabling affinity settings causes the qla2xxx driver scsi_add_host
to fail when blk_mq is enabled as the blk_mq_pci_map_queues expects
affinity masks on each vector.

Fixes: dfef358 ("PCI/MSI: Don't apply affinity if there aren't enough vectors left")
Signed-off-by: Michael Hernandez <michael.hernandez@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
---
 drivers/pci/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 7f73bac..5823348 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1214,7 +1214,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
 		 * If there aren't any vectors left after applying the pre/post
 		 * vectors don't bother with assigning affinity.
 		 */
-		if (affd->pre_vectors + affd->post_vectors == min_vecs)
+		if (affd->pre_vectors + affd->post_vectors == max_vecs)
 			affd = NULL;
 	} else {
 		if (WARN_ON(affd))
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI/MSI: Only disable affinity settings if pre and post vector count is equal to max_vecs and not min_vecs
  2017-02-21 17:34 [PATCH] PCI/MSI: Only disable affinity settings if pre and post vector count is equal to max_vecs and not min_vecs Himanshu Madhani
@ 2017-02-23  0:27 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-02-23  0:27 UTC (permalink / raw)
  To: Himanshu Madhani; +Cc: James.Bottomley, martin.petersen, linux-scsi

>>>>> "Himanshu" == Himanshu Madhani <himanshu.madhani@cavium.com> writes:

Himanshu,

Himanshu> min_vecs is the minimum amount of vectors needed to operate in
Himanshu> MSI-X mode which may just include the vectors that don't need
Himanshu> affinity.

Himanshu> Disabling affinity settings causes the qla2xxx driver
Himanshu> scsi_add_host to fail when blk_mq is enabled as the
Himanshu> blk_mq_pci_map_queues expects affinity masks on each vector.

Himanshu> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index
[...]

This should go through the PCI tree and not SCSI.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-23  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-21 17:34 [PATCH] PCI/MSI: Only disable affinity settings if pre and post vector count is equal to max_vecs and not min_vecs Himanshu Madhani
2017-02-23  0:27 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox