From: michaelc@cs.wisc.edu
To: linux-scsi@vger.kernel.org
Cc: Mike Christie <michaelc@cs.wisc.edu>
Subject: [RFC PATCH 1/4] scsi-ml: modify change_queue_depth to take in reason why it is being called
Date: Tue, 19 May 2009 00:52:44 -0500 [thread overview]
Message-ID: <1242712369913-git-send-email-michaelc@cs.wisc.edu> (raw)
In-Reply-To: <12427123683166-git-send-email-michaelc@cs.wisc.edu>
From: Mike Christie <michaelc@cs.wisc.edu>
This patch modifies scsi_host_tematepl->change_queue_depth so that
it takes an argument indicating why it is being called. This will be
used so that if a LLD needs to do some extra processing when
handling queue fulls or later ramp ups, it can do so.
To simplify the review, this patch only modifies scsi-ml. The next
patches will convert each driver.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/scsi_sysfs.c | 3 ++-
include/scsi/scsi_host.h | 9 ++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index fa4711d..2453948 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -783,7 +783,8 @@ sdev_store_queue_depth_rw(struct device *dev, struct device_attribute *attr,
if (depth < 1)
return -EINVAL;
- retval = sht->change_queue_depth(sdev, depth);
+ retval = sht->change_queue_depth(sdev, depth,
+ SCSI_QDEPTH_SYSFS_REQ);
if (retval < 0)
return retval;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index d123ca8..60495f5 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -43,6 +43,13 @@ struct blk_queue_tags;
#define DISABLE_CLUSTERING 0
#define ENABLE_CLUSTERING 1
+enum {
+ SCSI_QDEPTH_SYSFS_REQ, /* user requested change through sysfs */
+ SCSI_QDEPTH_QFULL, /* scsi-ml requested due to queue full */
+ SCSI_QDEPTH_RAMP_UP, /* scsi-ml requested due to threshhold event */
+ SCSI_QDEPTH_RAMP_DOWN, /* LLD/class requested due to lld/class event */
+};
+
struct scsi_host_template {
struct module *module;
const char *name;
@@ -294,7 +301,7 @@ struct scsi_host_template {
*
* Status: OPTIONAL
*/
- int (* change_queue_depth)(struct scsi_device *, int);
+ int (* change_queue_depth)(struct scsi_device *, int, int);
/*
* Fill in this function to allow the changing of tag types
--
1.6.0.6
next prev parent reply other threads:[~2009-05-19 5:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 5:52 RFC: handle queue_depth adjustments because of QUEUE_FULLs in scsi_error.c michaelc
2009-05-19 5:52 ` michaelc
2009-05-19 5:52 ` michaelc [this message]
2009-05-19 5:52 ` [RFC PATCH 2/4] scsi error: have scsi-ml call change_queue_depth to handle QUEUE_FULL michaelc
2009-05-19 5:52 ` [RFC PATCH 3/4] drivers: convert drivers setting the change_queue_depth callback michaelc
2009-05-19 5:52 ` [RFC PATCH 4/4] drivers: convert fc drivers calling scsi_track_queue_full michaelc
2009-06-12 12:57 ` Christof Schmitt
2009-06-12 12:48 ` [RFC PATCH 2/4] scsi error: have scsi-ml call change_queue_depth to handle QUEUE_FULL Christof Schmitt
2009-06-15 17:34 ` Mike Christie
2009-06-16 13:16 ` James Smart
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=1242712369913-git-send-email-michaelc@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=linux-scsi@vger.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 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).