From: "Melanie Plageman (Microsoft)" <melanieplageman@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: andres@anarazel.de, haiyangz@microsoft.com, jejb@linux.ibm.com,
kys@microsoft.com, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, martin.petersen@oracle.com,
mikelley@microsoft.com, sthemmin@microsoft.com,
wei.liu@kernel.org,
"Melanie Plageman (Microsoft)" <melanieplageman@gmail.com>
Subject: [PATCH v1] scsi: storvsc: Cap cmd_per_lun at can_queue
Date: Fri, 5 Mar 2021 23:21:51 +0000 [thread overview]
Message-ID: <20210305232151.1531-1-melanieplageman@gmail.com> (raw)
The scsi_device->queue_depth is set to Scsi_Host->cmd_per_lun during
allocation.
Cap cmd_per_lun at can_queue to avoid dispatch errors.
Signed-off-by: Melanie Plageman (Microsoft) <melanieplageman@gmail.com>
---
drivers/scsi/storvsc_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 6bc5453cea8a..d7953a6e00e6 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1946,6 +1946,8 @@ static int storvsc_probe(struct hv_device *device,
(max_sub_channels + 1) *
(100 - ring_avail_percent_lowater) / 100;
+ scsi_driver.cmd_per_lun = min_t(u32, scsi_driver.cmd_per_lun, scsi_driver.can_queue);
+
host = scsi_host_alloc(&scsi_driver,
sizeof(struct hv_host_device));
if (!host)
--
2.20.1
next reply other threads:[~2021-03-05 23:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 23:21 Melanie Plageman (Microsoft) [this message]
2021-03-08 14:37 ` [PATCH v1] scsi: storvsc: Cap cmd_per_lun at can_queue Michael Kelley
2021-03-08 17:56 ` Melanie Plageman
2021-03-09 10:09 ` John Garry
2021-03-09 15:57 ` Michael Kelley
2021-03-09 16:35 ` John Garry
2021-03-09 17:09 ` Michael Kelley
2021-03-09 15:45 ` Michael Kelley
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=20210305232151.1531-1-melanieplageman@gmail.com \
--to=melanieplageman@gmail.com \
--cc=andres@anarazel.de \
--cc=haiyangz@microsoft.com \
--cc=jejb@linux.ibm.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mikelley@microsoft.com \
--cc=sthemmin@microsoft.com \
--cc=wei.liu@kernel.org \
/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.