diff options
author | Bart Van Assche <bvanassche@acm.org> | 2010-08-30 15:27:36 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-10-25 01:14:14 -0400 |
commit | 7ade400aba9a675b610074d6609658661db07eeb (patch) | |
tree | 609a1370a1a8d416c789905c17607bd8d31c6242 /drivers/infiniband | |
parent | 05a1d7504f836ee67e27f2488cb5b8126b51dbd4 (diff) |
IB/srp: Reduce number of BUSY conditions
As proposed by the SRP (draft) standard, ib_srp reserves one ring
element for SRP_TSK_MGMT requests. This patch makes sure that the SCSI
mid-layer never tries to queue more than (SRP request limit) - 1 SCSI
commands to ib_srp. This improves performance for targets whose request
limit is less than or equal to SRP_NORMAL_REQ_SQ_SIZE by reducing the
number of BUSY responses reported by ib_srp to the SCSI mid-layer.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index d4c08d648137..4df827591cad 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1339,8 +1339,13 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) | |||
1339 | target->max_ti_iu_len = be32_to_cpu(rsp->max_ti_iu_len); | 1339 | target->max_ti_iu_len = be32_to_cpu(rsp->max_ti_iu_len); |
1340 | target->req_lim = be32_to_cpu(rsp->req_lim_delta); | 1340 | target->req_lim = be32_to_cpu(rsp->req_lim_delta); |
1341 | 1341 | ||
1342 | target->scsi_host->can_queue = min(target->req_lim, | 1342 | /* |
1343 | target->scsi_host->can_queue); | 1343 | * Reserve credits for task management so we don't |
1344 | * bounce requests back to the SCSI mid-layer. | ||
1345 | */ | ||
1346 | target->scsi_host->can_queue | ||
1347 | = min(target->req_lim - SRP_TSK_MGMT_SQ_SIZE, | ||
1348 | target->scsi_host->can_queue); | ||
1344 | } else { | 1349 | } else { |
1345 | shost_printk(KERN_WARNING, target->scsi_host, | 1350 | shost_printk(KERN_WARNING, target->scsi_host, |
1346 | PFX "Unhandled RSP opcode %#x\n", opcode); | 1351 | PFX "Unhandled RSP opcode %#x\n", opcode); |