blk-mq-rdma: pass in queue map to blk_mq_rdma_map_queues
authorSagi Grimberg <sagi@grimberg.me>
Wed, 12 Dec 2018 07:38:54 +0000 (23:38 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 13 Dec 2018 08:59:08 +0000 (09:59 +0100)
Will be used by nvme-rdma for queue map separation support.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk-mq-rdma.c
drivers/nvme/host/rdma.c
include/linux/blk-mq-rdma.h

index a71576aff3a59337b69ddd42c317ed6b6dcd07a7..45030a81a1ed901260feb1bb197b91f2d38c12c4 100644 (file)
  * @set->nr_hw_queues, or @dev does not provide an affinity mask for a
  * vector, we fallback to the naive mapping.
  */
-int blk_mq_rdma_map_queues(struct blk_mq_tag_set *set,
+int blk_mq_rdma_map_queues(struct blk_mq_queue_map *map,
                struct ib_device *dev, int first_vec)
 {
        const struct cpumask *mask;
        unsigned int queue, cpu;
 
-       for (queue = 0; queue < set->nr_hw_queues; queue++) {
+       for (queue = 0; queue < map->nr_queues; queue++) {
                mask = ib_get_vector_affinity(dev, first_vec + queue);
                if (!mask)
                        goto fallback;
 
                for_each_cpu(cpu, mask)
-                       set->map[0].mq_map[cpu] = queue;
+                       map->mq_map[cpu] = map->queue_offset + queue;
        }
 
        return 0;
 
 fallback:
-       return blk_mq_map_queues(&set->map[0]);
+       return blk_mq_map_queues(map);
 }
 EXPORT_SYMBOL_GPL(blk_mq_rdma_map_queues);
index f2db848f6985421e26320d1f5da079b089aebe2f..5057d5ab5aaae58c3ca4c6369b0ec26f52ce0a6f 100644 (file)
@@ -1751,7 +1751,7 @@ static int nvme_rdma_map_queues(struct blk_mq_tag_set *set)
 {
        struct nvme_rdma_ctrl *ctrl = set->driver_data;
 
-       return blk_mq_rdma_map_queues(set, ctrl->device->dev, 0);
+       return blk_mq_rdma_map_queues(&set->map[0], ctrl->device->dev, 0);
 }
 
 static const struct blk_mq_ops nvme_rdma_mq_ops = {
index b4ade198007db59713b989cf180fb69041be0999..7b6ecf9ac4c3ce21a21e78c38a04856a46169e7d 100644 (file)
@@ -4,7 +4,7 @@
 struct blk_mq_tag_set;
 struct ib_device;
 
-int blk_mq_rdma_map_queues(struct blk_mq_tag_set *set,
+int blk_mq_rdma_map_queues(struct blk_mq_queue_map *map,
                struct ib_device *dev, int first_vec);
 
 #endif /* _LINUX_BLK_MQ_RDMA_H */