* [ofa-general][PATCH 1/4] SRP fail-over faster
@ 2009-10-12 22:56 Vu Pham
[not found] ` <4AD3B433.7040803-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Vu Pham @ 2009-10-12 22:56 UTC (permalink / raw)
To: Linux RDMA list
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: [ofa-general][PATCH 1/4] SRP fail-over faster,.eml --]
[-- Type: message/rfc822, Size: 2522 bytes --]
[-- Attachment #2.1.1: Type: text/plain, Size: 195 bytes --]
Recreating qp, cq at reconnect instead of re-use them. We need this so
that we don't have to wait on disconnect connection
Signed-off-by: Vu Pham <vu-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[-- Attachment #2.1.2: srp_1_recreate_at_reconnect.patch --]
[-- Type: text/plain, Size: 1368 bytes --]
---
drivers/infiniband/ulp/srp/ib_srp.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: ofed_kernel/drivers/infiniband/ulp/srp/ib_srp.c
===================================================================
--- ofed_kernel.orig/drivers/infiniband/ulp/srp/ib_srp.c
+++ ofed_kernel/drivers/infiniband/ulp/srp/ib_srp.c
@@ -537,10 +537,10 @@ static void srp_reset_req(struct srp_tar
static int srp_reconnect_target(struct srp_target_port *target)
{
- struct ib_qp_attr qp_attr;
struct srp_request *req, *tmp;
- struct ib_wc wc;
int ret;
+ struct ib_cq *old_cq;
+ struct ib_qp *old_qp;
spin_lock_irq(target->scsi_host->host_lock);
if (target->state != SRP_TARGET_LIVE) {
@@ -559,17 +559,17 @@ static int srp_reconnect_target(struct s
if (ret)
goto err;
- qp_attr.qp_state = IB_QPS_RESET;
- ret = ib_modify_qp(target->qp, &qp_attr, IB_QP_STATE);
- if (ret)
- goto err;
-
- ret = srp_init_qp(target, target->qp);
- if (ret)
+ old_qp = target->qp;
+ old_cq = target->cq;
+ ret = srp_create_target_ib(target);
+ if (ret) {
+ target->qp = old_qp;
+ target->cq = old_cq;
goto err;
+ }
- while (ib_poll_cq(target->cq, 1, &wc) > 0)
- ; /* nothing */
+ ib_destroy_qp(old_qp);
+ ib_destroy_cq(old_cq);
spin_lock_irq(target->scsi_host->host_lock);
list_for_each_entry_safe(req, tmp, &target->req_queue, list)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ofa-general][PATCH 1/4] SRP fail-over faster
[not found] ` <4AD3B433.7040803-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2009-10-14 18:04 ` Roland Dreier
[not found] ` <adaaaztam3r.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Roland Dreier @ 2009-10-14 18:04 UTC (permalink / raw)
To: Vu Pham; +Cc: Linux RDMA list
One meta comment: when sending a series of 4 patches, please choose a
descriptive subject for each one. We don't want the same headline in
the kernel log for all 4 patches.
> - qp_attr.qp_state = IB_QPS_RESET;
> - ret = ib_modify_qp(target->qp, &qp_attr, IB_QP_STATE);
> - if (ret)
> - goto err;
> -
> - ret = srp_init_qp(target, target->qp);
> - if (ret)
> + old_qp = target->qp;
> + old_cq = target->cq;
> + ret = srp_create_target_ib(target);
I don't understand why this is any faster? Is creating a new QP really
any different from modifying an old QP to reset state?
--
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: [ofa-general][PATCH 1/4] SRP fail-over faster
[not found] ` <adaaaztam3r.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2009-10-14 19:52 ` Vu Pham
0 siblings, 0 replies; 3+ messages in thread
From: Vu Pham @ 2009-10-14 19:52 UTC (permalink / raw)
To: Roland Dreier; +Cc: Linux RDMA list
Roland Dreier wrote:
> One meta comment: when sending a series of 4 patches, please choose a
> descriptive subject for each one. We don't want the same headline in
> the kernel log for all 4 patches.
>
>
I'll remember next time
> > - qp_attr.qp_state = IB_QPS_RESET;
> > - ret = ib_modify_qp(target->qp, &qp_attr, IB_QP_STATE);
> > - if (ret)
> > - goto err;
> > -
> > - ret = srp_init_qp(target, target->qp);
> > - if (ret)
> > + old_qp = target->qp;
> > + old_cq = target->cq;
> > + ret = srp_create_target_ib(target);
>
> I don't understand why this is any faster? Is creating a new QP really
> any different from modifying an old QP to reset state?
>
It is not; it is needed for patch 2/4 disconnect without wait and it is
faster that way
--
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:[~2009-10-14 19:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 22:56 [ofa-general][PATCH 1/4] SRP fail-over faster Vu Pham
[not found] ` <4AD3B433.7040803-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-14 18:04 ` Roland Dreier
[not found] ` <adaaaztam3r.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-14 19:52 ` Vu Pham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox