All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Jens Axboe <axboe@fb.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	Meelis Roos <mroos@linux.ee>, Don Brace <don.brace@microsemi.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Laurence Oberman <loberman@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ming Lei <ming.lei@redhat.com>, Omar Sandoval <osandov@fb.com>,
	James Bottomley <james.bottomley@hansenpartnership.com>
Subject: [PATCH V5 3/5] scsi: introduce force_blk_mq
Date: Tue, 13 Mar 2018 17:42:41 +0800	[thread overview]
Message-ID: <20180313094243.8710-4-ming.lei@redhat.com> (raw)
In-Reply-To: <20180313094243.8710-1-ming.lei@redhat.com>

>From scsi driver view, it is a bit troublesome to support both blk-mq
and non-blk-mq at the same time, especially when drivers need to support
multi hw-queue.

This patch introduces 'force_blk_mq' to scsi_host_template so that drivers
can provide blk-mq only support, so driver code can avoid the trouble
for supporting both.

Cc: Omar Sandoval <osandov@fb.com>,
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Cc: James Bottomley <james.bottomley@hansenpartnership.com>,
Cc: Christoph Hellwig <hch@lst.de>,
Cc: Don Brace <don.brace@microsemi.com>
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/scsi/hosts.c     | 1 +
 include/scsi/scsi_host.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 57bf43e34863..cbbc32df7595 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -477,6 +477,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
 		shost->dma_boundary = 0xffffffff;
 
 	shost->use_blk_mq = scsi_use_blk_mq;
+	shost->use_blk_mq = scsi_use_blk_mq || shost->hostt->force_blk_mq;
 
 	device_initialize(&shost->shost_gendev);
 	dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 1a1df0d21ee3..6c6366f0bd15 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -452,6 +452,9 @@ struct scsi_host_template {
 	/* True if the controller does not support WRITE SAME */
 	unsigned no_write_same:1;
 
+	/* True if the low-level driver supports blk-mq only */
+	unsigned force_blk_mq:1;
+
 	/*
 	 * Countdown for host blocking with no commands outstanding.
 	 */
-- 
2.9.5

  parent reply	other threads:[~2018-03-13  9:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13  9:42 [PATCH V5 0/5] SCSI: fix selection of reply(hw) queue Ming Lei
2018-03-13  9:42 ` [PATCH V5 1/5] scsi: hpsa: fix selection of reply queue Ming Lei
2018-03-14  8:57   ` Christoph Hellwig
2018-03-14 15:07   ` Bityutskiy, Artem
2018-03-19 11:48   ` Bityutskiy, Artem
2018-03-19 14:31     ` Jens Axboe
2018-03-19 14:42       ` Artem Bityutskiy
2018-03-19 14:55         ` Kashyap Desai
2018-03-19 15:26         ` Ming Lei
2018-03-20  3:16     ` Martin K. Petersen
2018-03-13  9:42 ` [PATCH V5 2/5] scsi: megaraid_sas: " Ming Lei
2018-03-13 17:13   ` Kashyap Desai
2018-03-14  8:57   ` Christoph Hellwig
2018-03-14 15:07   ` Artem Bityutskiy
2018-03-13  9:42 ` Ming Lei [this message]
2018-03-13  9:42 ` [PATCH V5 4/5] scsi: virtio_scsi: fix IO hang caused by irq vector automatic affinity Ming Lei
2018-03-14  8:58   ` Christoph Hellwig
2018-03-13  9:42 ` [PATCH V5 5/5] scsi: virtio_scsi: unify scsi_host_template Ming Lei
2018-03-14  8:58   ` Christoph Hellwig
2018-03-15  3:35 ` [PATCH V5 0/5] SCSI: fix selection of reply(hw) queue Martin K. Petersen

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=20180313094243.8710-4-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=axboe@fb.com \
    --cc=don.brace@microsemi.com \
    --cc=hch@lst.de \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=mroos@linux.ee \
    --cc=osandov@fb.com \
    --cc=pbonzini@redhat.com \
    --cc=snitzer@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.