linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: santil@linux.vnet.ibm.com, rcjenn@linux.vnet.ibm.com,
	linux-scsi@vger.kernel.org
Subject: [PATCH 1/1] ibmvscsi: Changeable queue depth
Date: Tue, 29 May 2007 15:46:14 -0500	[thread overview]
Message-ID: <465C9116.6050600@linux.vnet.ibm.com> (raw)
In-Reply-To: <1180462468.3700.65.camel@mulgrave.il.steeleye.com>

Adds support for a changeable queue depth to ibmvscsi.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

James Bottomley wrote:
> Don't you want to check this against some system limit ... or will the
> driver cope just fine when the user sets it to machine infinity and we
> diligently try blasting away at it through the queuecommand() routine?
> 
> The usual limit, if you have variable queues ... is the maximum the
> device could ever accept ... although some people adjust that downwards
> because of device starvation fears.

There isn't anything coming back from the VIO server to indicate what this
max value is for the LUN, so we have to use an arbitrary value. I chose 64
since its generally the max queue depth supported by a single disk supported
on pSeries. Here is an updated patch.

-Brian

---

 linux-2.6-bjking1/drivers/scsi/ibmvscsi/ibmvscsi.c |   18 ++++++++++++++++++
 linux-2.6-bjking1/drivers/scsi/ibmvscsi/ibmvscsi.h |    1 +
 2 files changed, 19 insertions(+)

diff -puN drivers/scsi/ibmvscsi/ibmvscsi.c~ibmvscsi_change_q_depth drivers/scsi/ibmvscsi/ibmvscsi.c
--- linux-2.6/drivers/scsi/ibmvscsi/ibmvscsi.c~ibmvscsi_change_q_depth	2007-05-29 12:57:20.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/ibmvscsi/ibmvscsi.c	2007-05-29 15:27:23.000000000 -0500
@@ -1375,6 +1375,23 @@ static int ibmvscsi_slave_configure(stru
 	return 0;
 }
 
+/**
+ * ibmvscsi_change_queue_depth - Change the device's queue depth
+ * @sdev:	scsi device struct
+ * @qdepth:	depth to set
+ *
+ * Return value:
+ * 	actual depth set
+ **/
+static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth)
+{
+	if (qdepth > IBMVSCSI_MAX_CMDS_PER_LUN)
+		qdepth = IBMVSCSI_MAX_CMDS_PER_LUN;
+
+	scsi_adjust_queue_depth(sdev, 0, qdepth);
+	return sdev->queue_depth;
+}
+
 /* ------------------------------------------------------------
  * sysfs attributes
  */
@@ -1521,6 +1538,7 @@ static struct scsi_host_template driver_
 	.eh_abort_handler = ibmvscsi_eh_abort_handler,
 	.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
 	.slave_configure = ibmvscsi_slave_configure,
+	.change_queue_depth = ibmvscsi_change_queue_depth,
 	.cmd_per_lun = 16,
 	.can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT,
 	.this_id = -1,
diff -puN drivers/scsi/ibmvscsi/ibmvscsi.h~ibmvscsi_change_q_depth drivers/scsi/ibmvscsi/ibmvscsi.h
--- linux-2.6/drivers/scsi/ibmvscsi/ibmvscsi.h~ibmvscsi_change_q_depth	2007-05-29 15:25:24.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/ibmvscsi/ibmvscsi.h	2007-05-29 15:29:11.000000000 -0500
@@ -45,6 +45,7 @@ struct Scsi_Host;
 #define MAX_INDIRECT_BUFS 10
 
 #define IBMVSCSI_MAX_REQUESTS_DEFAULT 100
+#define IBMVSCSI_MAX_CMDS_PER_LUN 64
 
 /* ------------------------------------------------------------
  * Data Structures
_

  reply	other threads:[~2007-05-29 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11804616242477-patch-mail.ibm.com>
2007-05-29 18:14 ` [PATCH 1/1] ibmvscsi: Changeable queue depth James Bottomley
2007-05-29 20:46   ` Brian King [this message]
2007-05-29 18:00 Brian King

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=465C9116.6050600@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rcjenn@linux.vnet.ibm.com \
    --cc=santil@linux.vnet.ibm.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 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).