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

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