Skip to contentSkip to conversation

libcxgb4: set *bad_wr in post_send/recv error paths

PATCH Applied Steve Wise 3 participants 5 messages Dec 6, 2016 – Dec 10, 2016 1 message not in the archive InfiniBand

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/1 libcxgb4: set *bad_wr in post_send/recv error paths

---
 providers/cxgb4/qp.c | 4 ++++
 1 file changed, 4 insertions(+)
providers/cxgb4/qp.c +4 -0
index 376a00a..3b448dd 100644
@@ -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) {
Signature · 6 lines
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20161206210403.71E59E08C5-/[email protected]

#2 lore raw

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

Yuval

Quoted 45 lines · Steve Wise
---
 providers/cxgb4/qp.c | 4 ++++
 1 file changed, 4 insertions(+)
providers/cxgb4/qp.c +4 -0
index 376a00a..3b448dd 100644
@@ -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) {
Signature · 6 lines
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by
#4 lore raw

I see,
so FWIW:

Quoted 9 lines · Steve Wise
Quoted 4 lines

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

Yuval

Hey Yuval,

Yes, I sent out that fix earlier:

Quoted 8 lines

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 [email protected] 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html