* [PATCH 3/4 v3] IB/srp: adjust can_queue
@ 2010-08-03 14:08 Bart Van Assche
[not found] ` <201008031608.42244.bvanassche-HInyCGIudOg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2010-08-03 14:08 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Roland Dreier, David Dillow
The SRP (draft) standard specifies that an SRP initiator must never queue more
than (SRP request limit) - 1 unanswered SRP_CMD information units. 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_SQ_REQ_SIZE (63) by reducing
the number of BUSY responses reported by ib_srp to the SCSI mid-layer.
Signed-off-by: Bart Van Assche <bart.vanassche-Re5JQEeQqe8AvxtiuMwx3w@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 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 1c40ac3..4efda6c 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1436,7 +1436,7 @@ 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 = min(target->req_lim - 1,
target->scsi_host->can_queue);
} else {
shost_printk(KERN_WARNING, target->scsi_host,
--
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] 3+ messages in thread
* Re: [PATCH 3/4 v3] IB/srp: adjust can_queue
[not found] ` <201008031608.42244.bvanassche-HInyCGIudOg@public.gmane.org>
@ 2010-08-03 15:24 ` David Dillow
[not found] ` <1280849064.20446.46.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: David Dillow @ 2010-08-03 15:24 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Roland Dreier
On Tue, 2010-08-03 at 16:08 +0200, Bart Van Assche wrote:
> The SRP (draft) standard specifies that an SRP initiator must never queue more
> than (SRP request limit) - 1 unanswered SRP_CMD information units. 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_SQ_REQ_SIZE (63) by reducing
> the number of BUSY responses reported by ib_srp to the SCSI mid-layer.
Actually, the standard states we can never send more than REQUEST LIMIT
requests. But we reserve 1 request for sending task management requests,
so that's why we need to tell the mid-layer to not send us more than
req_lim - 1 commands.
Dave
--
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] 3+ messages in thread
* Re: [PATCH 3/4 v3] IB/srp: adjust can_queue
[not found] ` <1280849064.20446.46.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
@ 2010-08-04 16:44 ` Bart Van Assche
0 siblings, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2010-08-04 16:44 UTC (permalink / raw)
To: David Dillow; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Roland Dreier
On Tue, Aug 3, 2010 at 5:24 PM, David Dillow <dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org> wrote:
> On Tue, 2010-08-03 at 16:08 +0200, Bart Van Assche wrote:
>> The SRP (draft) standard specifies that an SRP initiator must never queue more
>> than (SRP request limit) - 1 unanswered SRP_CMD information units. 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_SQ_REQ_SIZE (63) by reducing
>> the number of BUSY responses reported by ib_srp to the SCSI mid-layer.
>
> Actually, the standard states we can never send more than REQUEST LIMIT
> requests. But we reserve 1 request for sending task management requests,
> so that's why we need to tell the mid-layer to not send us more than
> req_lim - 1 commands.
The SRP spec says the following about the request limit and management commands:
c) An SRP initiator port may send an SRP request on an RDMA channel
when the value of the RDMA
channel’s Request Limit variable is greater than zero. An SRP
initiator port shall not send an SRP
request on any RDMA channel whose Request Limit variable has a value
less than or equal to zero; the
results of doing so are vendor-specific. To ensure that task
management requests may be sent, an SRP
initiator port may choose to send commands only when the value of the
Request Limit variable is greater
than one;
So reserving one queue element for management commands is not a
requirement but a recommendation. I agree that the patch description
has to be updated.
Bart.
--
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] 3+ messages in thread
end of thread, other threads:[~2010-08-04 16:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 14:08 [PATCH 3/4 v3] IB/srp: adjust can_queue Bart Van Assche
[not found] ` <201008031608.42244.bvanassche-HInyCGIudOg@public.gmane.org>
2010-08-03 15:24 ` David Dillow
[not found] ` <1280849064.20446.46.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2010-08-04 16:44 ` Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox