| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2016 Christoph Hellwig. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 6 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 9 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 10 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 11 | | - * more details. |
|---|
| 12 | 4 | */ |
|---|
| 13 | 5 | #include <linux/kobject.h> |
|---|
| 14 | 6 | #include <linux/blkdev.h> |
|---|
| .. | .. |
|---|
| 21 | 13 | |
|---|
| 22 | 14 | /** |
|---|
| 23 | 15 | * blk_mq_pci_map_queues - provide a default queue mapping for PCI device |
|---|
| 24 | | - * @set: tagset to provide the mapping for |
|---|
| 16 | + * @qmap: CPU to hardware queue map. |
|---|
| 25 | 17 | * @pdev: PCI device associated with @set. |
|---|
| 26 | 18 | * @offset: Offset to use for the pci irq vector |
|---|
| 27 | 19 | * |
|---|
| .. | .. |
|---|
| 31 | 23 | * that maps a queue to the CPUs that have irq affinity for the corresponding |
|---|
| 32 | 24 | * vector. |
|---|
| 33 | 25 | */ |
|---|
| 34 | | -int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev, |
|---|
| 26 | +int blk_mq_pci_map_queues(struct blk_mq_queue_map *qmap, struct pci_dev *pdev, |
|---|
| 35 | 27 | int offset) |
|---|
| 36 | 28 | { |
|---|
| 37 | 29 | const struct cpumask *mask; |
|---|
| 38 | 30 | unsigned int queue, cpu; |
|---|
| 39 | 31 | |
|---|
| 40 | | - for (queue = 0; queue < set->nr_hw_queues; queue++) { |
|---|
| 32 | + for (queue = 0; queue < qmap->nr_queues; queue++) { |
|---|
| 41 | 33 | mask = pci_irq_get_affinity(pdev, queue + offset); |
|---|
| 42 | 34 | if (!mask) |
|---|
| 43 | 35 | goto fallback; |
|---|
| 44 | 36 | |
|---|
| 45 | 37 | for_each_cpu(cpu, mask) |
|---|
| 46 | | - set->mq_map[cpu] = queue; |
|---|
| 38 | + qmap->mq_map[cpu] = qmap->queue_offset + queue; |
|---|
| 47 | 39 | } |
|---|
| 48 | 40 | |
|---|
| 49 | 41 | return 0; |
|---|
| 50 | 42 | |
|---|
| 51 | 43 | fallback: |
|---|
| 52 | | - WARN_ON_ONCE(set->nr_hw_queues > 1); |
|---|
| 53 | | - blk_mq_clear_mq_map(set); |
|---|
| 44 | + WARN_ON_ONCE(qmap->nr_queues > 1); |
|---|
| 45 | + blk_mq_clear_mq_map(qmap); |
|---|
| 54 | 46 | return 0; |
|---|
| 55 | 47 | } |
|---|
| 56 | 48 | EXPORT_SYMBOL_GPL(blk_mq_pci_map_queues); |
|---|