* [PATCH 3/3 v5] IB/srp: Reduce number of BUSY conditions
@ 2010-08-16 18:55 Bart Van Assche
[not found] ` <201008162055.47174.bvanassche-HInyCGIudOg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2010-08-16 18:55 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Roland Dreier, David Dillow
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 (62) by reducing the number of BUSY responses reported
by ib_srp to the SCSI mid-layer.
Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Cc: Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: David Dillow <dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org>
---
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 da62b57..fba39f0 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1376,8 +1376,13 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
target->max_ti_iu_len = be32_to_cpu(rsp->max_ti_iu_len);
target->req_lim = be32_to_cpu(rsp->req_lim_delta);
- target->scsi_host->can_queue = min(target->req_lim,
- target->scsi_host->can_queue);
+ /*
+ * Set can_queue such that the SCSI mid-layer
+ * never causes __srp_get_tx_iu() to fail.
+ */
+ target->scsi_host->can_queue
+ = min(target->req_lim - SRP_TASK_MGMT_SQ_SIZE,
+ target->scsi_host->can_queue);
} else {
shost_printk(KERN_WARNING, target->scsi_host,
PFX "Unhandled RSP opcode %#x\n", opcode);
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3 v5] IB/srp: Reduce number of BUSY conditions
[not found] ` <201008162055.47174.bvanassche-HInyCGIudOg@public.gmane.org>
@ 2010-08-18 23:52 ` David Dillow
0 siblings, 0 replies; 2+ messages in thread
From: David Dillow @ 2010-08-18 23:52 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Roland Dreier
On Mon, 2010-08-16 at 20:55 +0200, Bart Van Assche wrote:
> - target->scsi_host->can_queue = min(target->req_lim,
> - target->scsi_host->can_queue);
> + /*
> + * Set can_queue such that the SCSI mid-layer
> + * never causes __srp_get_tx_iu() to fail.
> + */
> + target->scsi_host->can_queue
> + = min(target->req_lim - SRP_TASK_MGMT_SQ_SIZE,
> + target->scsi_host->can_queue);
/*
* Reserve credits for task management so we don't
* needlessly bounce requests back to the SCSI mid-layer
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-18 23:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 18:55 [PATCH 3/3 v5] IB/srp: Reduce number of BUSY conditions Bart Van Assche
[not found] ` <201008162055.47174.bvanassche-HInyCGIudOg@public.gmane.org>
2010-08-18 23:52 ` David Dillow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox