public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libcxgb4: set *bad_wr in post_send/recv error paths
@ 2016-12-06 19:49 Steve Wise
       [not found] ` <20161206210403.71E59E08C5-/5N3P9jjx0xzbRFIqnYvSA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Wise @ 2016-12-06 19:49 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 providers/cxgb4/qp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/providers/cxgb4/qp.c b/providers/cxgb4/qp.c
index 376a00a..3b448dd 100644
--- a/providers/cxgb4/qp.c
+++ b/providers/cxgb4/qp.c
@@ -303,11 +303,13 @@ int c4iw_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 	pthread_spin_lock(&qhp->lock);
 	if (t4_wq_in_error(&qhp->wq)) {
 		pthread_spin_unlock(&qhp->lock);
+		*bad_wr = wr;
 		return -EINVAL;
 	}
 	num_wrs = t4_sq_avail(&qhp->wq);
 	if (num_wrs == 0) {
 		pthread_spin_unlock(&qhp->lock);
+		*bad_wr = wr;
 		return -ENOMEM;
 	}
 	while (wr) {
@@ -403,12 +405,14 @@ int c4iw_post_receive(struct ibv_qp *ibqp, struct ibv_recv_wr *wr,
 	pthread_spin_lock(&qhp->lock);
 	if (t4_wq_in_error(&qhp->wq)) {
 		pthread_spin_unlock(&qhp->lock);
+		*bad_wr = wr;
 		return -EINVAL;
 	}
 	INC_STAT(recv);
 	num_wrs = t4_rq_avail(&qhp->wq);
 	if (num_wrs == 0) {
 		pthread_spin_unlock(&qhp->lock);
+		*bad_wr = wr;
 		return -ENOMEM;
 	}
 	while (wr) {
-- 
1.8.3.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] 5+ messages in thread

* Re: [PATCH] libcxgb4: set *bad_wr in post_send/recv error paths
       [not found] ` <20161206210403.71E59E08C5-/5N3P9jjx0xzbRFIqnYvSA@public.gmane.org>
@ 2016-12-07 18:15   ` Yuval Shaia
  2016-12-07 18:21     ` Steve Wise
  2016-12-10 14:20   ` Leon Romanovsky
  1 sibling, 1 reply; 5+ messages in thread
From: Yuval Shaia @ 2016-12-07 18:15 UTC (permalink / raw)
  To: Steve Wise
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

Looks like same fix should be applied to cxgb4 driver, right?

Yuval

On Tue, Dec 06, 2016 at 11:49:32AM -0800, Steve Wise wrote:
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> ---
>  providers/cxgb4/qp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/providers/cxgb4/qp.c b/providers/cxgb4/qp.c
> index 376a00a..3b448dd 100644
> --- a/providers/cxgb4/qp.c
> +++ b/providers/cxgb4/qp.c
> @@ -303,11 +303,13 @@ int c4iw_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
>  	pthread_spin_lock(&qhp->lock);
>  	if (t4_wq_in_error(&qhp->wq)) {
>  		pthread_spin_unlock(&qhp->lock);
> +		*bad_wr = wr;
>  		return -EINVAL;
>  	}
>  	num_wrs = t4_sq_avail(&qhp->wq);
>  	if (num_wrs == 0) {
>  		pthread_spin_unlock(&qhp->lock);
> +		*bad_wr = wr;
>  		return -ENOMEM;
>  	}
>  	while (wr) {
> @@ -403,12 +405,14 @@ int c4iw_post_receive(struct ibv_qp *ibqp, struct ibv_recv_wr *wr,
>  	pthread_spin_lock(&qhp->lock);
>  	if (t4_wq_in_error(&qhp->wq)) {
>  		pthread_spin_unlock(&qhp->lock);
> +		*bad_wr = wr;
>  		return -EINVAL;
>  	}
>  	INC_STAT(recv);
>  	num_wrs = t4_rq_avail(&qhp->wq);
>  	if (num_wrs == 0) {
>  		pthread_spin_unlock(&qhp->lock);
> +		*bad_wr = wr;
>  		return -ENOMEM;
>  	}
>  	while (wr) {
> -- 
> 1.8.3.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] 5+ messages in thread

* RE: [PATCH] libcxgb4: set *bad_wr in post_send/recv error paths
  2016-12-07 18:15   ` Yuval Shaia
@ 2016-12-07 18:21     ` Steve Wise
  2016-12-07 18:23       ` Yuval Shaia
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Wise @ 2016-12-07 18:21 UTC (permalink / raw)
  To: 'Yuval Shaia'
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

> 
> Looks like same fix should be applied to cxgb4 driver, right?
> 
> Yuval

Hey Yuval,

Yes, I sent out that fix earlier:
 
https://www.spinics.net/lists/linux-rdma/msg42000.html

Steve.

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

* Re: [PATCH] libcxgb4: set *bad_wr in post_send/recv error paths
  2016-12-07 18:21     ` Steve Wise
@ 2016-12-07 18:23       ` Yuval Shaia
  0 siblings, 0 replies; 5+ messages in thread
From: Yuval Shaia @ 2016-12-07 18:23 UTC (permalink / raw)
  To: Steve Wise
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

I see,
so FWIW:
Reviewed-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

On Wed, Dec 07, 2016 at 12:21:19PM -0600, Steve Wise wrote:
> > 
> > Looks like same fix should be applied to cxgb4 driver, right?
> > 
> > Yuval
> 
> Hey Yuval,
> 
> Yes, I sent out that fix earlier:
>  
> https://www.spinics.net/lists/linux-rdma/msg42000.html
> 
> Steve.
> 
> --
> 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] 5+ messages in thread

* Re: [PATCH] libcxgb4: set *bad_wr in post_send/recv error paths
       [not found] ` <20161206210403.71E59E08C5-/5N3P9jjx0xzbRFIqnYvSA@public.gmane.org>
  2016-12-07 18:15   ` Yuval Shaia
@ 2016-12-10 14:20   ` Leon Romanovsky
  1 sibling, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2016-12-10 14:20 UTC (permalink / raw)
  To: Steve Wise
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

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

On Tue, Dec 06, 2016 at 11:49:32AM -0800, Steve Wise wrote:
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> ---
>  providers/cxgb4/qp.c | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks, applied.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2016-12-10 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 19:49 [PATCH] libcxgb4: set *bad_wr in post_send/recv error paths Steve Wise
     [not found] ` <20161206210403.71E59E08C5-/5N3P9jjx0xzbRFIqnYvSA@public.gmane.org>
2016-12-07 18:15   ` Yuval Shaia
2016-12-07 18:21     ` Steve Wise
2016-12-07 18:23       ` Yuval Shaia
2016-12-10 14:20   ` Leon Romanovsky

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