* [PATCH] scsi: storvsc: Add ability to change scsi queue depth
@ 2019-06-14 23:48 Branden Bonaby
2019-06-15 18:19 ` Michael Kelley
2019-06-19 1:08 ` Martin K. Petersen
0 siblings, 2 replies; 5+ messages in thread
From: Branden Bonaby @ 2019-06-14 23:48 UTC (permalink / raw)
To: kys, haiyangz, sthemmin, sashal, jejb, martin.petersen
Cc: Branden Bonaby, linux-hyperv, linux-scsi, linux-kernel
Adding functionality to allow the SCSI queue depth to be changed,
by utilizing the "scsi_change_queue_depth" function.
Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
---
drivers/scsi/storvsc_drv.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 8472de1007ff..719ca9906fc2 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -387,6 +387,7 @@ enum storvsc_request_type {
static int storvsc_ringbuffer_size = (128 * 1024);
static u32 max_outstanding_req_per_channel;
+static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth);
static int storvsc_vcpus_per_sub_channel = 4;
@@ -1711,6 +1712,7 @@ static struct scsi_host_template scsi_driver = {
.dma_boundary = PAGE_SIZE-1,
.no_write_same = 1,
.track_queue_depth = 1,
+ .change_queue_depth = storvsc_change_queue_depth,
};
enum {
@@ -1917,6 +1919,15 @@ static int storvsc_probe(struct hv_device *device,
return ret;
}
+/* Change a scsi target's queue depth */
+static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth)
+{
+ if (queue_depth > scsi_driver.can_queue){
+ queue_depth = scsi_driver.can_queue;
+ }
+ return scsi_change_queue_depth(sdev, queue_depth);
+}
+
static int storvsc_remove(struct hv_device *dev)
{
struct storvsc_device *stor_device = hv_get_drvdata(dev);
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] scsi: storvsc: Add ability to change scsi queue depth
2019-06-14 23:48 [PATCH] scsi: storvsc: Add ability to change scsi queue depth Branden Bonaby
@ 2019-06-15 18:19 ` Michael Kelley
2019-06-17 17:08 ` KY Srinivasan
2019-06-19 1:08 ` Martin K. Petersen
1 sibling, 1 reply; 5+ messages in thread
From: Michael Kelley @ 2019-06-15 18:19 UTC (permalink / raw)
To: brandonbonaby94, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal, jejb, martin.petersen
Cc: brandonbonaby94, linux-hyperv, linux-scsi, linux-kernel
From: Branden Bonaby <brandonbonaby94@gmail.com> Sent: Friday, June 14, 2019 4:48 PM
>
> Adding functionality to allow the SCSI queue depth to be changed,
> by utilizing the "scsi_change_queue_depth" function.
>
> Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
> ---
> drivers/scsi/storvsc_drv.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 8472de1007ff..719ca9906fc2 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -387,6 +387,7 @@ enum storvsc_request_type {
>
> static int storvsc_ringbuffer_size = (128 * 1024);
> static u32 max_outstanding_req_per_channel;
> +static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth);
>
> static int storvsc_vcpus_per_sub_channel = 4;
>
> @@ -1711,6 +1712,7 @@ static struct scsi_host_template scsi_driver = {
> .dma_boundary = PAGE_SIZE-1,
> .no_write_same = 1,
> .track_queue_depth = 1,
> + .change_queue_depth = storvsc_change_queue_depth,
> };
>
> enum {
> @@ -1917,6 +1919,15 @@ static int storvsc_probe(struct hv_device *device,
> return ret;
> }
>
> +/* Change a scsi target's queue depth */
> +static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth)
> +{
> + if (queue_depth > scsi_driver.can_queue){
> + queue_depth = scsi_driver.can_queue;
> + }
> + return scsi_change_queue_depth(sdev, queue_depth);
> +}
> +
> static int storvsc_remove(struct hv_device *dev)
> {
> struct storvsc_device *stor_device = hv_get_drvdata(dev);
> --
> 2.17.1
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] scsi: storvsc: Add ability to change scsi queue depth
2019-06-15 18:19 ` Michael Kelley
@ 2019-06-17 17:08 ` KY Srinivasan
0 siblings, 0 replies; 5+ messages in thread
From: KY Srinivasan @ 2019-06-17 17:08 UTC (permalink / raw)
To: Michael Kelley, brandonbonaby94, Haiyang Zhang,
Stephen Hemminger, sashal, jejb, martin.petersen
Cc: brandonbonaby94, linux-hyperv, linux-scsi, linux-kernel
> -----Original Message-----
> From: Michael Kelley <mikelley@microsoft.com>
> Sent: Saturday, June 15, 2019 11:19 AM
> To: brandonbonaby94 <brandonbonaby94@gmail.com>; KY Srinivasan
> <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Stephen
> Hemminger <sthemmin@microsoft.com>; sashal@kernel.org;
> jejb@linux.ibm.com; martin.petersen@oracle.com
> Cc: brandonbonaby94 <brandonbonaby94@gmail.com>; linux-
> hyperv@vger.kernel.org; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: RE: [PATCH] scsi: storvsc: Add ability to change scsi queue depth
>
> From: Branden Bonaby <brandonbonaby94@gmail.com> Sent: Friday, June
> 14, 2019 4:48 PM
> >
> > Adding functionality to allow the SCSI queue depth to be changed,
> > by utilizing the "scsi_change_queue_depth" function.
> >
> > Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
> > ---
> > drivers/scsi/storvsc_drv.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> > index 8472de1007ff..719ca9906fc2 100644
> > --- a/drivers/scsi/storvsc_drv.c
> > +++ b/drivers/scsi/storvsc_drv.c
> > @@ -387,6 +387,7 @@ enum storvsc_request_type {
> >
> > static int storvsc_ringbuffer_size = (128 * 1024);
> > static u32 max_outstanding_req_per_channel;
> > +static int storvsc_change_queue_depth(struct scsi_device *sdev, int
> queue_depth);
> >
> > static int storvsc_vcpus_per_sub_channel = 4;
> >
> > @@ -1711,6 +1712,7 @@ static struct scsi_host_template scsi_driver = {
> > .dma_boundary = PAGE_SIZE-1,
> > .no_write_same = 1,
> > .track_queue_depth = 1,
> > + .change_queue_depth = storvsc_change_queue_depth,
> > };
> >
> > enum {
> > @@ -1917,6 +1919,15 @@ static int storvsc_probe(struct hv_device
> *device,
> > return ret;
> > }
> >
> > +/* Change a scsi target's queue depth */
> > +static int storvsc_change_queue_depth(struct scsi_device *sdev, int
> queue_depth)
> > +{
> > + if (queue_depth > scsi_driver.can_queue){
> > + queue_depth = scsi_driver.can_queue;
> > + }
> > + return scsi_change_queue_depth(sdev, queue_depth);
> > +}
> > +
> > static int storvsc_remove(struct hv_device *dev)
> > {
> > struct storvsc_device *stor_device = hv_get_drvdata(dev);
> > --
> > 2.17.1
>
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: storvsc: Add ability to change scsi queue depth
2019-06-14 23:48 [PATCH] scsi: storvsc: Add ability to change scsi queue depth Branden Bonaby
2019-06-15 18:19 ` Michael Kelley
@ 2019-06-19 1:08 ` Martin K. Petersen
2019-06-19 1:56 ` Branden Bonaby
1 sibling, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2019-06-19 1:08 UTC (permalink / raw)
To: Branden Bonaby
Cc: kys, haiyangz, sthemmin, sashal, jejb, martin.petersen,
linux-hyperv, linux-scsi, linux-kernel
Branden,
> Adding functionality to allow the SCSI queue depth to be changed, by
> utilizing the "scsi_change_queue_depth" function.
Applied to 5.3/scsi-queue. Please run checkpatch before submission. I
fixed it up this time.
Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: storvsc: Add ability to change scsi queue depth
2019-06-19 1:08 ` Martin K. Petersen
@ 2019-06-19 1:56 ` Branden Bonaby
0 siblings, 0 replies; 5+ messages in thread
From: Branden Bonaby @ 2019-06-19 1:56 UTC (permalink / raw)
To: Martin K. Petersen
Cc: kys, haiyangz, sthemmin, sashal, jejb, linux-hyperv, linux-scsi,
linux-kernel
On Tue, Jun 18, 2019 at 09:08:59PM -0400, Martin K. Petersen wrote:
>
> Branden,
>
> > Adding functionality to allow the SCSI queue depth to be changed, by
> > utilizing the "scsi_change_queue_depth" function.
>
> Applied to 5.3/scsi-queue. Please run checkpatch before submission. I
> fixed it up this time.
>
> Thanks!
Oh I see what you mean about the brackets, thanks will do next time.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-06-19 1:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 23:48 [PATCH] scsi: storvsc: Add ability to change scsi queue depth Branden Bonaby
2019-06-15 18:19 ` Michael Kelley
2019-06-17 17:08 ` KY Srinivasan
2019-06-19 1:08 ` Martin K. Petersen
2019-06-19 1:56 ` Branden Bonaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).