public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [ofa-general][PATCH 2/4] SRP fail-over faster
@ 2009-10-12 22:57 Vu Pham
       [not found] ` <4AD3B443.7040107-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Vu Pham @ 2009-10-12 22:57 UTC (permalink / raw)
  To: Linux RDMA list

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: [ofa-general][PATCH 2/4] SRP fail-over faster,.eml --]
[-- Type: message/rfc822, Size: 1800 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 110 bytes --]

Disconnect connection without waiting.

Signed-off-by: Vu Pham <vu-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>



[-- Attachment #2.1.2: srp_2_disconnect_without_wait.patch --]
[-- Type: text/plain, Size: 727 bytes --]

---
 drivers/infiniband/ulp/srp/ib_srp.c |    2 --
 1 file changed, 2 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
@@ -421,7 +421,6 @@ static void srp_disconnect_target(struct
 			     PFX "Sending CM DREQ failed\n");
 		return;
 	}
-	wait_for_completion(&target->done);
 }
 
 static void srp_remove_work(struct work_struct *work)
@@ -1301,7 +1300,6 @@ static int srp_cm_handler(struct ib_cm_i
 		shost_printk(KERN_ERR, target->scsi_host,
 			     PFX "connection closed\n");
 
-		comp = 1;
 		target->status = 0;
 		break;
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ofa-general][PATCH 2/4] SRP fail-over faster
       [not found] ` <4AD3B443.7040107-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2009-10-14 18:04   ` Roland Dreier
       [not found]     ` <ada63aham2r.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Dreier @ 2009-10-14 18:04 UTC (permalink / raw)
  To: Vu Pham; +Cc: Linux RDMA list


 > -	wait_for_completion(&target->done);

How do you avoid leaking connection on module unload etc?  Don't we have
to wait for the disconnect to finish somewhere?

 - R.
--
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] 6+ messages in thread

* Re: [ofa-general][PATCH 2/4] SRP fail-over faster
       [not found]     ` <ada63aham2r.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2009-10-14 19:59       ` Vu Pham
       [not found]         ` <4AD62D9D.1020900-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Vu Pham @ 2009-10-14 19:59 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Linux RDMA list

Roland Dreier wrote:
>  > -	wait_for_completion(&target->done);
>
> How do you avoid leaking connection on module unload etc?  Don't we have
> to wait for the disconnect to finish somewhere?
>
>  - R.
>   
Are you talking about cm_id?
I think that we wait because we want to reuse cq/qp associate with the 
connection.
On module unload, we destroy cm_id, cq, qp altogether.

-vu
--
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] 6+ messages in thread

* Re: [ofa-general][PATCH 2/4] SRP fail-over faster
       [not found]         ` <4AD62D9D.1020900-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2009-10-14 20:29           ` Roland Dreier
       [not found]             ` <adatyy190ti.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Dreier @ 2009-10-14 20:29 UTC (permalink / raw)
  To: Vu Pham; +Cc: Linux RDMA list


 > >  > -	wait_for_completion(&target->done);
 > >
 > > How do you avoid leaking connection on module unload etc?  Don't we have
 > > to wait for the disconnect to finish somewhere?
 > >
 > >  - R.
 > >   
 > Are you talking about cm_id?
 > I think that we wait because we want to reuse cq/qp associate with the
 > connection.
 > On module unload, we destroy cm_id, cq, qp altogether.

OK, I think I understand this piece locally (although if you delete the
wait_for_completion() it would probably make more sense to delete the
init_completion() just before it as well).

However is it really a correct to reuse a cm_id that is in state
timewait to initiate a new connection?  That seems pretty fragile to me.
--
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] 6+ messages in thread

* Re: [ofa-general][PATCH 2/4] SRP fail-over faster
       [not found]             ` <adatyy190ti.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2009-10-14 21:00               ` Vu Pham
  2009-10-22 23:08               ` Vu Pham
  1 sibling, 0 replies; 6+ messages in thread
From: Vu Pham @ 2009-10-14 21:00 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Linux RDMA list

Roland Dreier wrote:
>  > >  > -	wait_for_completion(&target->done);
>  > >
>  > > How do you avoid leaking connection on module unload etc?  Don't we have
>  > > to wait for the disconnect to finish somewhere?
>  > >
>  > >  - R.
>  > >   
>  > Are you talking about cm_id?
>  > I think that we wait because we want to reuse cq/qp associate with the
>  > connection.
>  > On module unload, we destroy cm_id, cq, qp altogether.
>
> OK, I think I understand this piece locally (although if you delete the
> wait_for_completion() it would probably make more sense to delete the
> init_completion() just before it as well).
>
> However is it really a correct to reuse a cm_id that is in state
> timewait to initiate a new connection?  That seems pretty fragile to me.
>   
Understood. However, we have to wait (1 << max(timeout - 8, 0)) ms; 
therefore, we need to disconnect without wait
--
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] 6+ messages in thread

* Re: [ofa-general][PATCH 2/4] SRP fail-over faster
       [not found]             ` <adatyy190ti.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  2009-10-14 21:00               ` Vu Pham
@ 2009-10-22 23:08               ` Vu Pham
  1 sibling, 0 replies; 6+ messages in thread
From: Vu Pham @ 2009-10-22 23:08 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Linux RDMA list

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

Roland Dreier wrote:
>  > >  > -	wait_for_completion(&target->done);
>  > >
>  > > How do you avoid leaking connection on module unload etc?  Don't we have
>  > > to wait for the disconnect to finish somewhere?
>  > >
>  > >  - R.
>  > >   
>  > Are you talking about cm_id?
>  > I think that we wait because we want to reuse cq/qp associate with the
>  > connection.
>  > On module unload, we destroy cm_id, cq, qp altogether.
>
> OK, I think I understand this piece locally (although if you delete the
> wait_for_completion() it would probably make more sense to delete the
> init_completion() just before it as well).
>
> However is it really a correct to reuse a cm_id that is in state
> timewait to initiate a new connection?  That seems pretty fragile to me.
>   
Here is the updated patch to remove both init_completion() and 
wait_for_completion()


[-- Attachment #2: srp_2_disconnect_without_wait.patch --]
[-- Type: text/plain, Size: 1094 bytes --]

Disconnect the connection without waiting (1 << max(timeout -8),0) ms

Signed-off-by: Vu Pham <vu-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

 drivers/infiniband/ulp/srp/ib_srp.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 54c8fe2..dfa14de 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -415,13 +415,11 @@ static void srp_disconnect_target(struct srp_target_port *target)
 {
 	/* XXX should send SRP_I_LOGOUT request */
 
-	init_completion(&target->done);
 	if (ib_send_cm_dreq(target->cm_id, NULL, 0)) {
 		shost_printk(KERN_DEBUG, target->scsi_host,
 			     PFX "Sending CM DREQ failed\n");
 		return;
 	}
-	wait_for_completion(&target->done);
 }
 
 static void srp_remove_work(struct work_struct *work)
@@ -1301,7 +1299,6 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
 		shost_printk(KERN_ERR, target->scsi_host,
 			     PFX "connection closed\n");
 
-		comp = 1;
 		target->status = 0;
 		break;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-22 23:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 22:57 [ofa-general][PATCH 2/4] SRP fail-over faster Vu Pham
     [not found] ` <4AD3B443.7040107-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-14 18:04   ` Roland Dreier
     [not found]     ` <ada63aham2r.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-14 19:59       ` Vu Pham
     [not found]         ` <4AD62D9D.1020900-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-14 20:29           ` Roland Dreier
     [not found]             ` <adatyy190ti.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-14 21:00               ` Vu Pham
2009-10-22 23:08               ` Vu Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox