[ofa-general] [PATCH 2/3] IB/srp: allow user to control host queue length
David Dillow
dave at thedillows.org
Wed Dec 19 14:08:56 PST 2007
It can be useful for tuning and balancing for the user to restrict the
maximum number of commands that can be queued for a particular SRP
target, similar to the tuning parameter "max_cmds_per_lun" allows per
device on this target.
This patch adds "queue_len" to allow that flexibility.
Signed-off-by: David Dillow <dillowda at ornl.gov>
---
ib_srp.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 17ad144..9cb77e6 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1612,6 +1612,7 @@ enum {
SRP_OPT_MAX_CMD_PER_LUN = 1 << 6,
SRP_OPT_IO_CLASS = 1 << 7,
SRP_OPT_INITIATOR_EXT = 1 << 8,
+ SRP_OPT_QUEUE_LEN = 1 << 9,
SRP_OPT_ALL = (SRP_OPT_ID_EXT |
SRP_OPT_IOC_GUID |
SRP_OPT_DGID |
@@ -1629,6 +1630,7 @@ static match_table_t srp_opt_tokens = {
{ SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" },
{ SRP_OPT_IO_CLASS, "io_class=%x" },
{ SRP_OPT_INITIATOR_EXT, "initiator_ext=%s" },
+ { SRP_OPT_QUEUE_LEN, "queue_len=%d" },
{ SRP_OPT_ERR, NULL }
};
@@ -1756,6 +1758,14 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
kfree(p);
break;
+ case SRP_OPT_QUEUE_LEN:
+ if (match_int(args, &token)) {
+ printk(KERN_WARNING PFX "bad queue_len parameter '%s'\n", p);
+ goto out;
+ }
+ target->scsi_host->can_queue = min(token, SRP_SQ_SIZE);
+ break;
+
default:
printk(KERN_WARNING PFX "unknown parameter or missing value "
"'%s' in target creation request\n", p);
More information about the general
mailing list