aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorVu Pham <vu@mellanox.com>2006-06-17 23:37:31 -0400
committerRoland Dreier <rolandd@cisco.com>2006-06-17 23:37:31 -0400
commit52fb2b50c4baa1430064c1e6c1c7df473d469df1 (patch)
tree7d538c270d6b9064b5674a8fd6f7cf81d8b8580f /drivers/infiniband
parent0c5b395239cdea4db3d9c23a5738fdaf3b9ada4c (diff)
IB/srp: Allow cmd_per_lun to be set per target port
Allow userspace to throttle traffic on a given connection to a target port by adding "max_cmd_per_lun=xyz" to lower the cmd_per_lun value set for that scsi_host. Signed-off-by: Vu Pham <vu@mellanox.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 46292561c44c..8e6b10369717 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1491,6 +1491,7 @@ enum {
1491 SRP_OPT_PKEY = 1 << 3, 1491 SRP_OPT_PKEY = 1 << 3,
1492 SRP_OPT_SERVICE_ID = 1 << 4, 1492 SRP_OPT_SERVICE_ID = 1 << 4,
1493 SRP_OPT_MAX_SECT = 1 << 5, 1493 SRP_OPT_MAX_SECT = 1 << 5,
1494 SRP_OPT_MAX_CMD_PER_LUN = 1 << 6,
1494 SRP_OPT_ALL = (SRP_OPT_ID_EXT | 1495 SRP_OPT_ALL = (SRP_OPT_ID_EXT |
1495 SRP_OPT_IOC_GUID | 1496 SRP_OPT_IOC_GUID |
1496 SRP_OPT_DGID | 1497 SRP_OPT_DGID |
@@ -1499,13 +1500,14 @@ enum {
1499}; 1500};
1500 1501
1501static match_table_t srp_opt_tokens = { 1502static match_table_t srp_opt_tokens = {
1502 { SRP_OPT_ID_EXT, "id_ext=%s" }, 1503 { SRP_OPT_ID_EXT, "id_ext=%s" },
1503 { SRP_OPT_IOC_GUID, "ioc_guid=%s" }, 1504 { SRP_OPT_IOC_GUID, "ioc_guid=%s" },
1504 { SRP_OPT_DGID, "dgid=%s" }, 1505 { SRP_OPT_DGID, "dgid=%s" },
1505 { SRP_OPT_PKEY, "pkey=%x" }, 1506 { SRP_OPT_PKEY, "pkey=%x" },
1506 { SRP_OPT_SERVICE_ID, "service_id=%s" }, 1507 { SRP_OPT_SERVICE_ID, "service_id=%s" },
1507 { SRP_OPT_MAX_SECT, "max_sect=%d" }, 1508 { SRP_OPT_MAX_SECT, "max_sect=%d" },
1508 { SRP_OPT_ERR, NULL } 1509 { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" },
1510 { SRP_OPT_ERR, NULL }
1509}; 1511};
1510 1512
1511static int srp_parse_options(const char *buf, struct srp_target_port *target) 1513static int srp_parse_options(const char *buf, struct srp_target_port *target)
@@ -1581,6 +1583,14 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
1581 target->scsi_host->max_sectors = token; 1583 target->scsi_host->max_sectors = token;
1582 break; 1584 break;
1583 1585
1586 case SRP_OPT_MAX_CMD_PER_LUN:
1587 if (match_int(args, &token)) {
1588 printk(KERN_WARNING PFX "bad max cmd_per_lun parameter '%s'\n", p);
1589 goto out;
1590 }
1591 target->scsi_host->cmd_per_lun = min(token, SRP_SQ_SIZE);
1592 break;
1593
1584 default: 1594 default:
1585 printk(KERN_WARNING PFX "unknown parameter or missing value " 1595 printk(KERN_WARNING PFX "unknown parameter or missing value "
1586 "'%s' in target creation request\n", p); 1596 "'%s' in target creation request\n", p);