[PATCH] IB/ehca: Reject recv WRs if QP is in RESET state

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joachim Fenkes
Date: Monday, June 9, 2008 - 4:24 am

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
On Friday 06 June 2008 22:20, Dotan Barak wrote:


You're right, this is only consistent -- thanks for pointing it out!

Regards,
  Joachim

 drivers/infiniband/hw/ehca/ehca_reqs.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index f093b00..ad197f4 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -544,8 +544,16 @@ int ehca_post_recv(struct ib_qp *qp,
 		   struct ib_recv_wr *recv_wr,
 		   struct ib_recv_wr **bad_recv_wr)
 {
-	return internal_post_recv(container_of(qp, struct ehca_qp, ib_qp),
-				  qp->device, recv_wr, bad_recv_wr);
+	struct ehca_qp *my_qp = container_of(qp, struct ehca_qp, ib_qp);
+
+	/* Reject WR if QP is in RESET state */
+	if (unlikely(my_qp->state == IB_QPS_RESET)) {
+		ehca_err(qp->device, "Invalid QP state  qp_state=%d qpn=%x",
+			 my_qp->state, qp->qp_num);
+		return -EINVAL;
+	}
+
+	return internal_post_recv(my_qp, qp->device, recv_wr, bad_recv_wr);
 }
 
 int ehca_post_srq_recv(struct ib_srq *srq,
-- 
1.5.5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] IB/ehca: Reject recv WRs if QP is in RESET state, Joachim Fenkes, (Mon Jun 9, 4:24 am)
[PATCH] IB/ehca: Make device table externally visible, Joachim Fenkes, (Tue Jul 1, 7:14 am)
Re: [PATCH] IB/ehca: Make device table externally visible, Roland Dreier, (Tue Jul 1, 10:55 am)
[PATCH] IB/ehca: Fix lockdep failures for shca_list_lock, Joachim Fenkes, (Fri Nov 21, 8:37 am)
[PATCH] IB/ehca: Fix locking for shca_list_lock, Joachim Fenkes, (Fri Nov 21, 9:18 am)
Re: [PATCH] IB/ehca: Fix locking for shca_list_lock, Roland Dreier, (Fri Nov 21, 11:28 am)
Re: [PATCH] IB/ehca: Fix lockdep failures for shca_list_lock, Michael Ellerman, (Fri Nov 21, 8:41 pm)
[PATCH] IB/ehca: Change misleading error message, Joachim Fenkes, (Tue Nov 25, 5:58 am)
Re: [PATCH] IB/ehca: Change misleading error message, Roland Dreier, (Tue Nov 25, 4:13 pm)
Re: [PATCH] IB/ehca: Change misleading error message, Joachim Fenkes, (Wed Nov 26, 6:44 am)