diff options
author | Keith Busch <keith.busch@intel.com> | 2018-03-27 11:39:06 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-03-27 23:25:36 -0400 |
commit | f23f5bece686a76598335141a091934f7eb0998c (patch) | |
tree | d523d0195bb2955637e5d607332029e7476b3e02 /block/blk-mq-pci.c | |
parent | 3148ffbdb9162baa28545809d675d3bf9339d6a1 (diff) |
blk-mq: Allow PCI vector offset for mapping queues
The PCI interrupt vectors intended to be associated with a queue may
not start at 0; a driver may allocate pre_vectors for special use. This
patch adds an offset parameter so blk-mq may find the intended affinity
mask and updates all drivers using this API accordingly.
Cc: Don Brace <don.brace@microsemi.com>
Cc: <qla2xxx-upstream@qlogic.com>
Cc: <linux-scsi@vger.kernel.org>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-pci.c')
-rw-r--r-- | block/blk-mq-pci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c index 76944e3271bf..e233996bb76f 100644 --- a/block/blk-mq-pci.c +++ b/block/blk-mq-pci.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * blk_mq_pci_map_queues - provide a default queue mapping for PCI device | 21 | * blk_mq_pci_map_queues - provide a default queue mapping for PCI device |
22 | * @set: tagset to provide the mapping for | 22 | * @set: tagset to provide the mapping for |
23 | * @pdev: PCI device associated with @set. | 23 | * @pdev: PCI device associated with @set. |
24 | * @offset: Offset to use for the pci irq vector | ||
24 | * | 25 | * |
25 | * This function assumes the PCI device @pdev has at least as many available | 26 | * This function assumes the PCI device @pdev has at least as many available |
26 | * interrupt vectors as @set has queues. It will then query the vector | 27 | * interrupt vectors as @set has queues. It will then query the vector |
@@ -28,13 +29,14 @@ | |||
28 | * that maps a queue to the CPUs that have irq affinity for the corresponding | 29 | * that maps a queue to the CPUs that have irq affinity for the corresponding |
29 | * vector. | 30 | * vector. |
30 | */ | 31 | */ |
31 | int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev) | 32 | int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev, |
33 | int offset) | ||
32 | { | 34 | { |
33 | const struct cpumask *mask; | 35 | const struct cpumask *mask; |
34 | unsigned int queue, cpu; | 36 | unsigned int queue, cpu; |
35 | 37 | ||
36 | for (queue = 0; queue < set->nr_hw_queues; queue++) { | 38 | for (queue = 0; queue < set->nr_hw_queues; queue++) { |
37 | mask = pci_irq_get_affinity(pdev, queue); | 39 | mask = pci_irq_get_affinity(pdev, queue + offset); |
38 | if (!mask) | 40 | if (!mask) |
39 | goto fallback; | 41 | goto fallback; |
40 | 42 | ||