public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Joachim Fenkes <fenkes@de•ibm.com>
To: Dotan Barak <dotanba@gmail•com>,
	LinuxPPC-Dev <linuxppc-dev@ozlabs•org>,
	LKML <linux-kernel@vger•kernel.org>,
	OF-General <general@lists•openfabrics.org>,
	Roland Dreier <rolandd@cisco•com>,
	OF-EWG <ewg@lists•openfabrics.org>
Cc: Christoph Raisch <raisch@de•ibm.com>,
	Stefan Roscher <stefan.roscher@de•ibm.com>
Subject: [PATCH] IB/ehca: Reject recv WRs if QP is in RESET state
Date: Mon, 9 Jun 2008 13:24:20 +0200	[thread overview]
Message-ID: <200806091324.20869.fenkes@de.ibm.com> (raw)
In-Reply-To: <48499C11.7030504@gmail.com>

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

> I checked the code in the ehca driver and noticed that
> post RR to a QP is being accepted in any state (including the RESET state).

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

  reply	other threads:[~2008-06-09 11:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 16:35 IB/ehca: Reject send WRs only for RESET, INIT and RTR state Joachim Fenkes
2008-06-06 18:22 ` Roland Dreier
2008-06-06 20:20 ` [ofa-general] " Dotan Barak
2008-06-09 11:24   ` Joachim Fenkes [this message]
2008-06-20 17:26     ` [PATCH] IB/ehca: Reject recv WRs if QP is in RESET state Roland Dreier
2008-07-01 14:14   ` [PATCH] IB/ehca: Make device table externally visible Joachim Fenkes
2008-07-01 17:55     ` Roland Dreier
2008-11-07 16:42   ` [PATCH] IB/ehca: Fix suppression of port activation events Joachim Fenkes
2008-11-10 20:36     ` Roland Dreier
2008-11-11  9:04       ` Joachim Fenkes
2008-11-21 15:37   ` [PATCH] IB/ehca: Fix lockdep failures for shca_list_lock Joachim Fenkes
2008-11-21 16:02     ` Johannes Berg
2008-11-21 16:18       ` [PATCH] IB/ehca: Fix locking " Joachim Fenkes
2008-11-21 18:28         ` Roland Dreier
2008-11-22  3:41       ` [PATCH] IB/ehca: Fix lockdep failures " Michael Ellerman
2008-11-25 12:58   ` [PATCH] IB/ehca: Change misleading error message Joachim Fenkes
2008-11-25 23:13     ` Roland Dreier
2008-11-26 13:44       ` Joachim Fenkes
2009-06-03 14:28   ` [PATCH] IB/ehca: Remove superfluous bitmasks from QP control block Joachim Fenkes
2009-06-03 20:26     ` Roland Dreier
2009-09-01 11:55   ` [PATCH] IB/ehca: Fix CQE flags reporting Joachim Fenkes
2009-09-01 19:55     ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200806091324.20869.fenkes@de.ibm.com \
    --to=fenkes@de$(echo .)ibm.com \
    --cc=dotanba@gmail$(echo .)com \
    --cc=ewg@lists$(echo .)openfabrics.org \
    --cc=general@lists$(echo .)openfabrics.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=raisch@de$(echo .)ibm.com \
    --cc=rolandd@cisco$(echo .)com \
    --cc=stefan.roscher@de$(echo .)ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox