|
5 | 5 | #include <linux/hdreg.h>
|
6 | 6 | #include <linux/module.h>
|
7 | 7 | #include <linux/mutex.h>
|
| 8 | +#include <linux/interrupt.h> |
8 | 9 | #include <linux/virtio.h>
|
9 | 10 | #include <linux/virtio_blk.h>
|
10 | 11 | #include <linux/scatterlist.h>
|
11 | 12 | #include <linux/string_helpers.h>
|
12 | 13 | #include <scsi/scsi_cmnd.h>
|
13 | 14 | #include <linux/idr.h>
|
14 | 15 | #include <linux/blk-mq.h>
|
| 16 | +#include <linux/blk-mq-virtio.h> |
15 | 17 | #include <linux/numa.h>
|
16 | 18 |
|
17 | 19 | #define PART_BITS 4
|
@@ -385,6 +387,7 @@ static int init_vq(struct virtio_blk *vblk)
|
385 | 387 | struct virtqueue **vqs;
|
386 | 388 | unsigned short num_vqs;
|
387 | 389 | struct virtio_device *vdev = vblk->vdev;
|
| 390 | + struct irq_affinity desc = { 0, }; |
388 | 391 |
|
389 | 392 | err = virtio_cread_feature(vdev, VIRTIO_BLK_F_MQ,
|
390 | 393 | struct virtio_blk_config, num_queues,
|
@@ -412,7 +415,7 @@ static int init_vq(struct virtio_blk *vblk)
|
412 | 415 |
|
413 | 416 | /* Discover virtqueues and write information to configuration. */
|
414 | 417 | err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names,
|
415 |
| - NULL); |
| 418 | + &desc); |
416 | 419 | if (err)
|
417 | 420 | goto out;
|
418 | 421 |
|
@@ -543,10 +546,18 @@ static int virtblk_init_request(void *data, struct request *rq,
|
543 | 546 | return 0;
|
544 | 547 | }
|
545 | 548 |
|
| 549 | +static int virtblk_map_queues(struct blk_mq_tag_set *set) |
| 550 | +{ |
| 551 | + struct virtio_blk *vblk = set->driver_data; |
| 552 | + |
| 553 | + return blk_mq_virtio_map_queues(set, vblk->vdev, 0); |
| 554 | +} |
| 555 | + |
546 | 556 | static struct blk_mq_ops virtio_mq_ops = {
|
547 | 557 | .queue_rq = virtio_queue_rq,
|
548 | 558 | .complete = virtblk_request_done,
|
549 | 559 | .init_request = virtblk_init_request,
|
| 560 | + .map_queues = virtblk_map_queues, |
550 | 561 | };
|
551 | 562 |
|
552 | 563 | static unsigned int virtblk_queue_depth;
|
|
0 commit comments