linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [RFC PATCH 2.6.9-rc2] Add sysfs queue depth override to qla2xxx
@ 2004-09-28 16:52 Andrew Vasquez
  2004-09-28 19:36 ` Jeremy Higdon
  0 siblings, 1 reply; 16+ messages in thread
From: Andrew Vasquez @ 2004-09-28 16:52 UTC (permalink / raw)
  To: Jeremy Higdon, linux-scsi; +Cc: James.Bottomley

On Tuesday, September 28, 2004 12:54 AM, Jeremy Higdon wrote:
> +static ssize_t
> +qla2xxx_store_queue_depth(struct device *dev, const char *buf,
> size_t count) +{
> +	int			 depth;
> +	struct scsi_device	*sdev = to_scsi_device(dev);
> +
> +	if (sdev->tagged_supported) {
> +		depth = simple_strtoul(buf, NULL, 0);
> +		if (depth > ql2xmaxqdepth)
> +			depth = ql2xmaxqdepth;

Any particular reason why the ql2xmaxqdepth module-parameter is
being used as a high-water limit?  The module-param is (was) used 
as a global setting of queue-depth for all luns (quite inflexible).
By overriding:

	/sys/class/scsi_device/22:0:0:0/device/queue_depth

with a writable value, a user should be allowed to update the
value to something higher (max(unsigned short)?) based on the 
back-end storage.

--
Andrew

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: [RFC PATCH 2.6.9-rc2] Add sysfs queue depth override to qla2xxx
@ 2004-09-28 16:54 Andrew Vasquez
  0 siblings, 0 replies; 16+ messages in thread
From: Andrew Vasquez @ 2004-09-28 16:54 UTC (permalink / raw)
  To: James Bottomley, Jeremy Higdon; +Cc: SCSI Mailing List

On Tuesday, September 28, 2004 7:06 AM, James Bottomley wrote:
> On Tue, 2004-09-28 at 03:54, Jeremy Higdon wrote:
> > 
> > Found a bug in the patch.  It returned an incorrect count if
> > tagged_supported was not true.
> 
> I haven't had time to check yet, but I believe I remember queue depth
> being also a parameter that has to be communicated to the card's
> firmware for the sizing of an internal queue.

Not needed for the fibre-channel driver.  The only rate-limiter is the
size of the host request-queue.

--
Andrew

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [RFC PATCH 2.6.9-rc2] Add sysfs queue depth override to qla2xxx
@ 2004-09-27  6:10 Jeremy Higdon
  2004-09-27  6:25 ` Jeremy Higdon
  2004-09-28  7:54 ` Jeremy Higdon
  0 siblings, 2 replies; 16+ messages in thread
From: Jeremy Higdon @ 2004-09-27  6:10 UTC (permalink / raw)
  To: linux-scsi; +Cc: andrew.vasquez, James.Bottomley

This patch is to QLA2xxx version 8.00.00b15-k, and it allows users
to override the default driver queue depth for a target by making
the queue_depth sysfs attribute writeable.

I based this on the code in the 53c700 driver.

Andrew, please apply if it looks correct to you and James.

Let me know if you'd like me to regenerate against a different qla2xxx
version.

thanks

Jeremy


===== drivers/scsi/qla2xxx/qla_os.c 1.41 vs edited =====
--- 1.41/drivers/scsi/qla2xxx/qla_os.c	2004-08-09 16:48:29 -07:00
+++ edited/drivers/scsi/qla2xxx/qla_os.c	2004-09-22 00:12:41 -07:00
@@ -159,6 +159,20 @@
 
 static int qla2x00_proc_info(struct Scsi_Host *, char *, char **,
     off_t, int, int);
+static ssize_t qla2xxx_store_queue_depth(struct device *dev, const char *buf, size_t count);
+
+static struct device_attribute qla2xxx_queue_depth_attr = {
+	.attr = {
+		.name =		"queue_depth",
+		.mode =		S_IWUSR,
+	},
+	.store = qla2xxx_store_queue_depth,
+};
+
+static struct device_attribute *qla2xxx_dev_attrs[] = {
+	&qla2xxx_queue_depth_attr,
+	NULL,
+};
 
 static struct scsi_host_template qla2x00_driver_template = {
 	.module			= THIS_MODULE,
@@ -184,6 +198,8 @@
 	 * which equates to 0x800000 sectors.
 	 */
 	.max_sectors		= 0xFFFF,
+
+	.sdev_attrs		= qla2xxx_dev_attrs,
 };
 
 static struct scsi_transport_template *qla2xxx_transport_template = NULL;
@@ -1797,6 +1813,22 @@
 	}
 
 	return (0);
+}
+
+static ssize_t
+qla2xxx_store_queue_depth(struct device *dev, const char *buf, size_t count)
+{
+	int			 depth;
+	struct scsi_device	*sdev = to_scsi_device(dev);
+
+	if (sdev->tagged_supported) {
+		depth = simple_strtoul(buf, NULL, 0);
+		if (depth > ql2xmaxqdepth)
+			return -EINVAL;
+		scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth);
+		return count;
+	}
+	return 1;
 }
 
 /**

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-09-29 22:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-28 16:52 [RFC PATCH 2.6.9-rc2] Add sysfs queue depth override to qla2xxx Andrew Vasquez
2004-09-28 19:36 ` Jeremy Higdon
2004-09-28 19:53   ` James Bottomley
2004-09-28 20:12     ` Jens Axboe
2004-09-28 20:34       ` Andrew Vasquez
2004-09-29  6:21         ` Jens Axboe
2004-09-29  6:57           ` Jeremy Higdon
2004-09-29  6:56             ` Jens Axboe
2004-09-29  0:36     ` Jeremy Higdon
2004-09-29 16:41       ` Andrew Vasquez
2004-09-29 22:12         ` Jeremy Higdon
  -- strict thread matches above, loose matches on Subject: below --
2004-09-28 16:54 Andrew Vasquez
2004-09-27  6:10 Jeremy Higdon
2004-09-27  6:25 ` Jeremy Higdon
2004-09-28  7:54 ` Jeremy Higdon
2004-09-28 14:05   ` James Bottomley

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).