All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
@ 2011-10-13  8:21 Kumar Sanghvi
       [not found] ` <1318494090-9996-1-git-send-email-kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Kumar Sanghvi @ 2011-10-13  8:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: roland-BHEL68pLQRGGvPXPguhicg,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	divy-ut6Up61K2wZBDgjK7y7TUQ, Kumar Sanghvi

At the time when peer closes connection, iw_cxgb4 will not
send a cq event if ibqp.uobject exists. In that case, its possible
for user application to get blocked in ibv_get_cq_event.

To resolve this, call the cq's comp_handler to unblock any read
from ibv_get_cq_event.

Signed-off-by: Kumar Sanghvi <kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/qp.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index ec3ce67..b59b56c 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -970,8 +970,12 @@ static void flush_qp(struct c4iw_qp *qhp)
 	if (qhp->ibqp.uobject) {
 		t4_set_wq_in_error(&qhp->wq);
 		t4_set_cq_in_error(&rchp->cq);
-		if (schp != rchp)
+		(*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
+		if (schp != rchp) {
 			t4_set_cq_in_error(&schp->cq);
+			(*schp->ibcq.comp_handler)(&schp->ibcq,
+					schp->ibcq.cq_context);
+		}
 		return;
 	}
 	__flush_qp(qhp, rchp, schp);
-- 
1.7.1

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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found] ` <1318494090-9996-1-git-send-email-kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2011-10-13 15:54   ` Steve Wise
  2011-10-13 16:01   ` Roland Dreier
  1 sibling, 0 replies; 12+ messages in thread
From: Steve Wise @ 2011-10-13 15:54 UTC (permalink / raw)
  To: Kumar Sanghvi
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, roland-BHEL68pLQRGGvPXPguhicg,
	divy-ut6Up61K2wZBDgjK7y7TUQ

Acked-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found] ` <1318494090-9996-1-git-send-email-kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
  2011-10-13 15:54   ` Steve Wise
@ 2011-10-13 16:01   ` Roland Dreier
       [not found]     ` <CAL1RGDU9Ka7-sGVnCnobgQjoh7p2bsXbSLp-Fnn6aA1Q9of36w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Roland Dreier @ 2011-10-13 16:01 UTC (permalink / raw)
  To: Kumar Sanghvi
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	divy-ut6Up61K2wZBDgjK7y7TUQ

Would this generate a completion event even if no completion entries are queued?

Maybe I'm misunderstanding, but this sounds like a bandaid for broken
applications,
and a bandaid that other hardware drivers won't implement.

On Thu, Oct 13, 2011 at 1:21 AM, Kumar Sanghvi <kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org> wrote:
> At the time when peer closes connection, iw_cxgb4 will not
> send a cq event if ibqp.uobject exists. In that case, its possible
> for user application to get blocked in ibv_get_cq_event.
>
> To resolve this, call the cq's comp_handler to unblock any read
> from ibv_get_cq_event.
>
> Signed-off-by: Kumar Sanghvi <kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/infiniband/hw/cxgb4/qp.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index ec3ce67..b59b56c 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -970,8 +970,12 @@ static void flush_qp(struct c4iw_qp *qhp)
>        if (qhp->ibqp.uobject) {
>                t4_set_wq_in_error(&qhp->wq);
>                t4_set_cq_in_error(&rchp->cq);
> -               if (schp != rchp)
> +               (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
> +               if (schp != rchp) {
>                        t4_set_cq_in_error(&schp->cq);
> +                       (*schp->ibcq.comp_handler)(&schp->ibcq,
> +                                       schp->ibcq.cq_context);
> +               }
>                return;
>        }
>        __flush_qp(qhp, rchp, schp);
> --
> 1.7.1
>
>
--
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] 12+ messages in thread

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]     ` <CAL1RGDU9Ka7-sGVnCnobgQjoh7p2bsXbSLp-Fnn6aA1Q9of36w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-10-13 16:12       ` Steve Wise
       [not found]         ` <4E970E02.2090207-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Steve Wise @ 2011-10-13 16:12 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Kumar Sanghvi, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	divy-ut6Up61K2wZBDgjK7y7TUQ

On 10/13/2011 11:01 AM, Roland Dreier wrote:
> Would this generate a completion event even if no completion entries are queued?
>

I guess it can if the QP has no WRs posted at all.

> Maybe I'm misunderstanding, but this sounds like a bandaid for broken
> applications,
> and a bandaid that other hardware drivers won't implement.
>

I'm not sure other drivers have this issue.  For example, when a mlx or mthca QP moves out of RTS, does the HW flush the 
pending recv WRs?  For Chelsio devices, the provider driver/library must handle this.

This logic is needed to adhere to the iwarp verbs spec which states that when the QP moves out of RTS, all WRs that are 
pending get completed with FLUSH status.  For T3/T4 devices, this is all done in software.  For user mode, the provider 
library has to flush the QP (IE the kernel doesn't own the queue state).

The idea is that if an application is expecting a CQ event notification when the QP moves out of RTS, and there are only 
recv wrs posted, then the T4 (and T3 does this too) driver must post this CQ notification, in addition to marking the CQ 
as "in error" which means some QP bound to this CQ needs flushing.  Then when the app wakes up and polls the CQ, the 
libcxgb4 code will flush the QPs in error and thus CQEs will be inserted into the CQ.  We have seen certain applications 
that rely on this event to discover that a QP has moved out of RTS.  IE they don't look at async QP events nor RDMACM 
events.



Steve.



> On Thu, Oct 13, 2011 at 1:21 AM, Kumar Sanghvi<kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>  wrote:
>> At the time when peer closes connection, iw_cxgb4 will not
>> send a cq event if ibqp.uobject exists. In that case, its possible
>> for user application to get blocked in ibv_get_cq_event.
>>
>> To resolve this, call the cq's comp_handler to unblock any read
>> from ibv_get_cq_event.
>>
>> Signed-off-by: Kumar Sanghvi<kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
>> ---
>>   drivers/infiniband/hw/cxgb4/qp.c |    6 +++++-
>>   1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
>> index ec3ce67..b59b56c 100644
>> --- a/drivers/infiniband/hw/cxgb4/qp.c
>> +++ b/drivers/infiniband/hw/cxgb4/qp.c
>> @@ -970,8 +970,12 @@ static void flush_qp(struct c4iw_qp *qhp)
>>         if (qhp->ibqp.uobject) {
>>                 t4_set_wq_in_error(&qhp->wq);
>>                 t4_set_cq_in_error(&rchp->cq);
>> -               if (schp != rchp)
>> +               (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
>> +               if (schp != rchp) {
>>                         t4_set_cq_in_error(&schp->cq);
>> +                       (*schp->ibcq.comp_handler)(&schp->ibcq,
>> +                                       schp->ibcq.cq_context);
>> +               }
>>                 return;
>>         }
>>         __flush_qp(qhp, rchp, schp);
>> --
>> 1.7.1
>>
>>

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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]         ` <4E970E02.2090207-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2011-10-14 20:22           ` Roland Dreier
  2011-10-20  9:11           ` Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
  1 sibling, 0 replies; 12+ messages in thread
From: Roland Dreier @ 2011-10-14 20:22 UTC (permalink / raw)
  To: Steve Wise
  Cc: Kumar Sanghvi, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	divy-ut6Up61K2wZBDgjK7y7TUQ

On Thu, Oct 13, 2011 at 9:12 AM, Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+v7I7tHvgBF7@public.gmane.orgm> wrote:
> I'm not sure other drivers have this issue.  For example, when a mlx or
> mthca QP moves out of RTS, does the HW flush the pending recv WRs?  For
> Chelsio devices, the provider driver/library must handle this.

Yeah, mthca will generate the flush events in hardware IIRC.

So OK, this change makes sense to me... only risk is a spurious
event for empty queues.

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

* RE: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]         ` <4E970E02.2090207-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  2011-10-14 20:22           ` Roland Dreier
@ 2011-10-20  9:11           ` Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
       [not found]             ` <88B766C272F2C64B944B21AD078333151BEE2E947E-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA @ 2011-10-20  9:11 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW, roland-BHEL68pLQRGGvPXPguhicg
  Cc: kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ

http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt

Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
Is this ensured?

compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.

Parav


-----Original Message-----
From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Steve Wise
Sent: Thursday, October 13, 2011 9:43 PM
To: Roland Dreier
Cc: Kumar Sanghvi; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel

On 10/13/2011 11:01 AM, Roland Dreier wrote:
> Would this generate a completion event even if no completion entries are queued?
>

I guess it can if the QP has no WRs posted at all.

> Maybe I'm misunderstanding, but this sounds like a bandaid for broken
> applications,
> and a bandaid that other hardware drivers won't implement.
>

I'm not sure other drivers have this issue.  For example, when a mlx or mthca QP moves out of RTS, does the HW flush the 
pending recv WRs?  For Chelsio devices, the provider driver/library must handle this.

This logic is needed to adhere to the iwarp verbs spec which states that when the QP moves out of RTS, all WRs that are 
pending get completed with FLUSH status.  For T3/T4 devices, this is all done in software.  For user mode, the provider 
library has to flush the QP (IE the kernel doesn't own the queue state).

The idea is that if an application is expecting a CQ event notification when the QP moves out of RTS, and there are only 
recv wrs posted, then the T4 (and T3 does this too) driver must post this CQ notification, in addition to marking the CQ 
as "in error" which means some QP bound to this CQ needs flushing.  Then when the app wakes up and polls the CQ, the 
libcxgb4 code will flush the QPs in error and thus CQEs will be inserted into the CQ.  We have seen certain applications 
that rely on this event to discover that a QP has moved out of RTS.  IE they don't look at async QP events nor RDMACM 
events.



Steve.



> On Thu, Oct 13, 2011 at 1:21 AM, Kumar Sanghvi<kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>  wrote:
>> At the time when peer closes connection, iw_cxgb4 will not
>> send a cq event if ibqp.uobject exists. In that case, its possible
>> for user application to get blocked in ibv_get_cq_event.
>>
>> To resolve this, call the cq's comp_handler to unblock any read
>> from ibv_get_cq_event.
>>
>> Signed-off-by: Kumar Sanghvi<kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
>> ---
>>   drivers/infiniband/hw/cxgb4/qp.c |    6 +++++-
>>   1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
>> index ec3ce67..b59b56c 100644
>> --- a/drivers/infiniband/hw/cxgb4/qp.c
>> +++ b/drivers/infiniband/hw/cxgb4/qp.c
>> @@ -970,8 +970,12 @@ static void flush_qp(struct c4iw_qp *qhp)
>>         if (qhp->ibqp.uobject) {
>>                 t4_set_wq_in_error(&qhp->wq);
>>                 t4_set_cq_in_error(&rchp->cq);
>> -               if (schp != rchp)
>> +               (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
>> +               if (schp != rchp) {
>>                         t4_set_cq_in_error(&schp->cq);
>> +                       (*schp->ibcq.comp_handler)(&schp->ibcq,
>> +                                       schp->ibcq.cq_context);
>> +               }
>>                 return;
>>         }
>>         __flush_qp(qhp, rchp, schp);
>> --
>> 1.7.1
>>
>>

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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]             ` <88B766C272F2C64B944B21AD078333151BEE2E947E-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
@ 2011-10-20 14:56               ` Steve Wise
  2011-10-20 16:06               ` Roland Dreier
  1 sibling, 0 replies; 12+ messages in thread
From: Steve Wise @ 2011-10-20 14:56 UTC (permalink / raw)
  To: Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
  Cc: roland-BHEL68pLQRGGvPXPguhicg, kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ

On 10/20/2011 04:11 AM, Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA@public.gmane.org wrote:
> http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt
>
> Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
> Is this ensured?
>
> compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.
>

I think you're correct.  post_qp_event() can be called indirectly on the ingress side of things concurrently with the 
application moving the QP to a state that causes a flush.  My first thought is to serialize the call to the 
compl_handler with the CQ spinlock, but I'm pretty certain that we can't hold that around an upcall because the app most 
likely turns around and calls ib_poll_cq() which would attempt to acquire this same lock.



> Parav
>
>
> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Steve Wise
> Sent: Thursday, October 13, 2011 9:43 PM
> To: Roland Dreier
> Cc: Kumar Sanghvi; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
> Subject: Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
>
> On 10/13/2011 11:01 AM, Roland Dreier wrote:
>> Would this generate a completion event even if no completion entries are queued?
>>
> I guess it can if the QP has no WRs posted at all.
>
>> Maybe I'm misunderstanding, but this sounds like a bandaid for broken
>> applications,
>> and a bandaid that other hardware drivers won't implement.
>>
> I'm not sure other drivers have this issue.  For example, when a mlx or mthca QP moves out of RTS, does the HW flush the
> pending recv WRs?  For Chelsio devices, the provider driver/library must handle this.
>
> This logic is needed to adhere to the iwarp verbs spec which states that when the QP moves out of RTS, all WRs that are
> pending get completed with FLUSH status.  For T3/T4 devices, this is all done in software.  For user mode, the provider
> library has to flush the QP (IE the kernel doesn't own the queue state).
>
> The idea is that if an application is expecting a CQ event notification when the QP moves out of RTS, and there are only
> recv wrs posted, then the T4 (and T3 does this too) driver must post this CQ notification, in addition to marking the CQ
> as "in error" which means some QP bound to this CQ needs flushing.  Then when the app wakes up and polls the CQ, the
> libcxgb4 code will flush the QPs in error and thus CQEs will be inserted into the CQ.  We have seen certain applications
> that rely on this event to discover that a QP has moved out of RTS.  IE they don't look at async QP events nor RDMACM
> events.
>
>
>
> Steve.
>
>
>
>> On Thu, Oct 13, 2011 at 1:21 AM, Kumar Sanghvi<kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>   wrote:
>>> At the time when peer closes connection, iw_cxgb4 will not
>>> send a cq event if ibqp.uobject exists. In that case, its possible
>>> for user application to get blocked in ibv_get_cq_event.
>>>
>>> To resolve this, call the cq's comp_handler to unblock any read
>>> from ibv_get_cq_event.
>>>
>>> Signed-off-by: Kumar Sanghvi<kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
>>> ---
>>>    drivers/infiniband/hw/cxgb4/qp.c |    6 +++++-
>>>    1 files changed, 5 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
>>> index ec3ce67..b59b56c 100644
>>> --- a/drivers/infiniband/hw/cxgb4/qp.c
>>> +++ b/drivers/infiniband/hw/cxgb4/qp.c
>>> @@ -970,8 +970,12 @@ static void flush_qp(struct c4iw_qp *qhp)
>>>          if (qhp->ibqp.uobject) {
>>>                  t4_set_wq_in_error(&qhp->wq);
>>>                  t4_set_cq_in_error(&rchp->cq);
>>> -               if (schp != rchp)
>>> +               (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
>>> +               if (schp != rchp) {
>>>                          t4_set_cq_in_error(&schp->cq);
>>> +                       (*schp->ibcq.comp_handler)(&schp->ibcq,
>>> +                                       schp->ibcq.cq_context);
>>> +               }
>>>                  return;
>>>          }
>>>          __flush_qp(qhp, rchp, schp);
>>> --
>>> 1.7.1
>>>
>>>
> --
> 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
> --
> 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

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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]             ` <88B766C272F2C64B944B21AD078333151BEE2E947E-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
  2011-10-20 14:56               ` Steve Wise
@ 2011-10-20 16:06               ` Roland Dreier
       [not found]                 ` <CAL1RGDXw9kkxAM8_pJ=jRhFTgRRt52QygDpQ+89RfEN=7QU=HQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Roland Dreier @ 2011-10-20 16:06 UTC (permalink / raw)
  To: Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA
  Cc: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ

On Thu, Oct 20, 2011 at 2:11 AM,  <Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org> wrote:
> http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt
>
> Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
> Is this ensured?
>
> compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.

Yes, does look like an issue with this patch :(

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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]                 ` <CAL1RGDXw9kkxAM8_pJ=jRhFTgRRt52QygDpQ+89RfEN=7QU=HQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-10-20 16:21                   ` Steve Wise
       [not found]                     ` <4EA04A95.9010908-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Steve Wise @ 2011-10-20 16:21 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA,
	kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ

On 10/20/2011 11:06 AM, Roland Dreier wrote:
> On Thu, Oct 20, 2011 at 2:11 AM,<Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>  wrote:
>> http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt
>>
>> Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
>> Is this ensured?
>>
>> compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.
> Yes, does look like an issue with this patch :(
>

And I think this bug exists in the T3 driver too.


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

* RE: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]                     ` <4EA04A95.9010908-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2011-10-20 17:25                       ` Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
       [not found]                         ` <88B766C272F2C64B944B21AD078333151BEE2E9521-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA @ 2011-10-20 17:25 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW, roland-BHEL68pLQRGGvPXPguhicg
  Cc: kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ

You are right, cq_lock will result into dead lock.
Should there be a additional compl_handler spin_lock?
I was measuring performance impact for adding it, and, irq_save() and irq_restore() variant showed additional 200 cycles, which I believe should be o.k.?

Parav

-----Original Message-----
From: Steve Wise [mailto:swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org] 
Sent: Thursday, October 20, 2011 9:52 PM
To: Roland Dreier
Cc: Pandit, Parav; kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel

On 10/20/2011 11:06 AM, Roland Dreier wrote:
> On Thu, Oct 20, 2011 at 2:11 AM,<Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>  wrote:
>> http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt
>>
>> Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
>> Is this ensured?
>>
>> compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.
> Yes, does look like an issue with this patch :(
>

And I think this bug exists in the T3 driver too.


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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]                         ` <88B766C272F2C64B944B21AD078333151BEE2E9521-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
@ 2011-10-20 17:30                           ` Steve Wise
       [not found]                             ` <4EA05AA0.4030201-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Steve Wise @ 2011-10-20 17:30 UTC (permalink / raw)
  To: Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
  Cc: roland-BHEL68pLQRGGvPXPguhicg, kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ

On 10/20/2011 12:25 PM, Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA@public.gmane.org wrote:
> You are right, cq_lock will result into dead lock.
> Should there be a additional compl_handler spin_lock?
> I was measuring performance impact for adding it, and, irq_save() and irq_restore() variant showed additional 200 cycles, which I believe should be o.k.?
>
> Parav
>

Yea, I think adding a comp_handler spin lock would do the trick.  I'll let Kumar come up with this change.



> -----Original Message-----
> From: Steve Wise [mailto:swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org]
> Sent: Thursday, October 20, 2011 9:52 PM
> To: Roland Dreier
> Cc: Pandit, Parav; kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
> Subject: Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
>
> On 10/20/2011 11:06 AM, Roland Dreier wrote:
>> On Thu, Oct 20, 2011 at 2:11 AM,<Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>   wrote:
>>> http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt
>>>
>>> Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
>>> Is this ensured?
>>>
>>> compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.
>> Yes, does look like an issue with this patch :(
>>
> And I think this bug exists in the T3 driver too.
>

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

* Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
       [not found]                             ` <4EA05AA0.4030201-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2011-10-21  7:32                               ` Kumar Sanghvi
  0 siblings, 0 replies; 12+ messages in thread
From: Kumar Sanghvi @ 2011-10-21  7:32 UTC (permalink / raw)
  To: Steve Wise
  Cc: Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA,
	roland-BHEL68pLQRGGvPXPguhicg, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	divy-ut6Up61K2wZBDgjK7y7TUQ

On Thu, Oct 20, 2011 at 12:30:08 -0500, Steve Wise wrote:
> On 10/20/2011 12:25 PM, Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA@public.gmane.org wrote:
> >You are right, cq_lock will result into dead lock.
> >Should there be a additional compl_handler spin_lock?
> >I was measuring performance impact for adding it, and, irq_save() and irq_restore() variant showed additional 200 cycles, which I believe should be o.k.?
> >
> >Parav
> >
> 
> Yea, I think adding a comp_handler spin lock would do the trick.  I'll let Kumar come up with this change.

I will cook up a patch and post soon.

Thanks,
Kumar.
> 
> 
> 
> >-----Original Message-----
> >From: Steve Wise [mailto:swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org]
> >Sent: Thursday, October 20, 2011 9:52 PM
> >To: Roland Dreier
> >Cc: Pandit, Parav; kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
> >Subject: Re: [PATCH] RDMA/cxgb4: Unblock reads on comp_channel
> >
> >On 10/20/2011 11:06 AM, Roland Dreier wrote:
> >>On Thu, Oct 20, 2011 at 2:11 AM,<Parav.Pandit-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>   wrote:
> >>>http://lxr.linux.no/#linux+v3.0.4/Documentation/infiniband/core_locking.txt
> >>>
> >>>Line no 66 to 97 states that - at a given point of time, there should be only one callback per CQ should be active.
> >>>Is this ensured?
> >>>
> >>>compl_handler() is invoked from multiple places flush_qp() and post_qp_event() to my mind.
> >>Yes, does look like an issue with this patch :(
> >>
> >And I think this bug exists in the T3 driver too.
> >
> 
--
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] 12+ messages in thread

end of thread, other threads:[~2011-10-21  7:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-13  8:21 [PATCH] RDMA/cxgb4: Unblock reads on comp_channel Kumar Sanghvi
     [not found] ` <1318494090-9996-1-git-send-email-kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2011-10-13 15:54   ` Steve Wise
2011-10-13 16:01   ` Roland Dreier
     [not found]     ` <CAL1RGDU9Ka7-sGVnCnobgQjoh7p2bsXbSLp-Fnn6aA1Q9of36w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-13 16:12       ` Steve Wise
     [not found]         ` <4E970E02.2090207-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2011-10-14 20:22           ` Roland Dreier
2011-10-20  9:11           ` Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
     [not found]             ` <88B766C272F2C64B944B21AD078333151BEE2E947E-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
2011-10-20 14:56               ` Steve Wise
2011-10-20 16:06               ` Roland Dreier
     [not found]                 ` <CAL1RGDXw9kkxAM8_pJ=jRhFTgRRt52QygDpQ+89RfEN=7QU=HQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-20 16:21                   ` Steve Wise
     [not found]                     ` <4EA04A95.9010908-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2011-10-20 17:25                       ` Parav.Pandit-iH1Dq9VlAzfQT0dZR+AlfA
     [not found]                         ` <88B766C272F2C64B944B21AD078333151BEE2E9521-/SwythR3zqxVRK6PHKByhFaTQe2KTcn/@public.gmane.org>
2011-10-20 17:30                           ` Steve Wise
     [not found]                             ` <4EA05AA0.4030201-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2011-10-21  7:32                               ` Kumar Sanghvi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.