From: Christoph Hellwig <hch@lst.de>
To: tglx@linutronix.de
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] blk-mq: add a first_vec argument to blk_mq_pci_map_queues
Date: Tue, 8 Nov 2016 17:15:07 -0800 [thread overview]
Message-ID: <1478654107-7384-8-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1478654107-7384-1-git-send-email-hch@lst.de>
This allows skipping the first N IRQ vectors in case they are used for
control or admin interrupts.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
---
block/blk-mq-pci.c | 6 ++++--
drivers/nvme/host/pci.c | 2 +-
include/linux/blk-mq-pci.h | 3 ++-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c
index 966c216..03ff7c4 100644
--- a/block/blk-mq-pci.c
+++ b/block/blk-mq-pci.c
@@ -21,6 +21,7 @@
* blk_mq_pci_map_queues - provide a default queue mapping for PCI device
* @set: tagset to provide the mapping for
* @pdev: PCI device associated with @set.
+ * @first_vec: first interrupt vectors to use for queues (usually 0)
*
* This function assumes the PCI device @pdev has at least as many available
* interrupt vetors as @set has queues. It will then queuery the vector
@@ -28,12 +29,13 @@
* that maps a queue to the CPUs that have irq affinity for the corresponding
* vector.
*/
-int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev)
+int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev,
+ int first_vec)
{
const struct cpumask *mask;
unsigned int queue, cpu;
- for (queue = 0; queue < set->nr_hw_queues; queue++) {
+ for (queue = first_vec; queue < set->nr_hw_queues; queue++) {
mask = pci_irq_get_affinity(pdev, queue);
if (!mask)
return -EINVAL;
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 0248d0e..6e6b917 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -273,7 +273,7 @@ static int nvme_pci_map_queues(struct blk_mq_tag_set *set)
{
struct nvme_dev *dev = set->driver_data;
- return blk_mq_pci_map_queues(set, to_pci_dev(dev->dev));
+ return blk_mq_pci_map_queues(set, to_pci_dev(dev->dev), 0);
}
/**
diff --git a/include/linux/blk-mq-pci.h b/include/linux/blk-mq-pci.h
index 6ab5952..fde26d2 100644
--- a/include/linux/blk-mq-pci.h
+++ b/include/linux/blk-mq-pci.h
@@ -4,6 +4,7 @@
struct blk_mq_tag_set;
struct pci_dev;
-int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev);
+int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev,
+ int first_vec);
#endif /* _LINUX_BLK_MQ_PCI_H */
--
2.1.4
next prev parent reply other threads:[~2016-11-09 1:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 1:15 support for partial irq affinity assignment V3 Christoph Hellwig
2016-11-09 1:15 ` [PATCH 1/7] genirq/affinity: Introduce struct irq_affinity Christoph Hellwig
2016-11-09 7:48 ` [tip:irq/core] " tip-bot for Christoph Hellwig
2016-11-09 1:15 ` [PATCH 2/7] genirq/affinity: Handle pre/post vectors in irq_calc_affinity_vectors() Christoph Hellwig
2016-11-09 7:04 ` Hannes Reinecke
2016-11-09 7:49 ` [tip:irq/core] " tip-bot for Christoph Hellwig
2016-11-09 1:15 ` [PATCH 3/7] genirq/affinity: Handle pre/post vectors in irq_create_affinity_masks() Christoph Hellwig
2016-11-09 7:05 ` Hannes Reinecke
2016-11-09 7:49 ` [tip:irq/core] " tip-bot for Christoph Hellwig
2016-11-09 1:15 ` [PATCH 4/7] PCI/MSI: Propagate IRQ affinity description through the MSI code Christoph Hellwig
2016-11-09 7:50 ` [tip:irq/core] " tip-bot for Christoph Hellwig
2016-11-09 1:15 ` [PATCH 5/7] pci/msi: Provide pci_alloc_irq_vectors_affinity() Christoph Hellwig
2016-11-09 1:38 ` Christoph Hellwig
2016-11-09 7:50 ` [tip:irq/core] PCI/MSI: " tip-bot for Christoph Hellwig
2016-11-09 1:15 ` [PATCH 6/7] PCI: Remove the irq_affinity mask from struct pci_dev Christoph Hellwig
2016-11-09 7:51 ` [tip:irq/core] " tip-bot for Christoph Hellwig
2016-11-09 1:15 ` Christoph Hellwig [this message]
2016-11-09 4:38 ` support for partial irq affinity assignment V3 Jens Axboe
2016-11-09 7:51 ` Thomas Gleixner
2016-11-09 15:10 ` Christoph Hellwig
2016-11-09 15:09 ` Thomas Gleixner
-- strict thread matches above, loose matches on Subject: below --
2016-11-07 18:47 support for partial irq affinity assignment Christoph Hellwig
2016-11-07 18:47 ` [PATCH 7/7] blk-mq: add a first_vec argument to blk_mq_pci_map_queues Christoph Hellwig
2016-11-08 8:27 ` Johannes Thumshirn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478654107-7384-8-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®