diff mbox

libcxgb4: set *bad_wr in post_send/recv error paths

Message ID 20161206210403.71E59E08C5@smtp.ogc.us (mailing list archive)
State Accepted
Headers show

Commit Message

Steve Wise Dec. 6, 2016, 7:49 p.m. UTC
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 providers/cxgb4/qp.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Yuval Shaia Dec. 7, 2016, 6:15 p.m. UTC | #1
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@opengridcomputing.com>
> ---
>  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@vger.kernel.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise Dec. 7, 2016, 6:21 p.m. UTC | #2
> 
> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yuval Shaia Dec. 7, 2016, 6:23 p.m. UTC | #3
I see,
so FWIW:
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

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@vger.kernel.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Dec. 10, 2016, 2:20 p.m. UTC | #4
On Tue, Dec 06, 2016 at 11:49:32AM -0800, Steve Wise wrote:
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  providers/cxgb4/qp.c | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks, applied.
diff mbox

Patch

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) {