diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2008-07-15 02:48:47 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-07-15 02:48:47 -0400 |
commit | 3e255eac561672cbc92844b9f16cae9304c2a783 (patch) | |
tree | 2e3181032185920f569b3dcaa0b1ad881674545e /drivers | |
parent | 7c27f358209a8ce7c57b584346d7b611e823f1b1 (diff) |
IB/ehca: Reject receive work requests if QP is in RESET state
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 b799b2710210..dd9bc68f1c7b 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, | |||
544 | struct ib_recv_wr *recv_wr, | 544 | struct ib_recv_wr *recv_wr, |
545 | struct ib_recv_wr **bad_recv_wr) | 545 | struct ib_recv_wr **bad_recv_wr) |
546 | { | 546 | { |
547 | return internal_post_recv(container_of(qp, struct ehca_qp, ib_qp), | 547 | struct ehca_qp *my_qp = container_of(qp, struct ehca_qp, ib_qp); |
548 | qp->device, recv_wr, bad_recv_wr); | 548 | |
549 | /* Reject WR if QP is in RESET state */ | ||
550 | if (unlikely(my_qp->state == IB_QPS_RESET)) { | ||
551 | ehca_err(qp->device, "Invalid QP state qp_state=%d qpn=%x", | ||
552 | my_qp->state, qp->qp_num); | ||
553 | return -EINVAL; | ||
554 | } | ||
555 | |||
556 | return internal_post_recv(my_qp, qp->device, recv_wr, bad_recv_wr); | ||
549 | } | 557 | } |
550 | 558 | ||
551 | int ehca_post_srq_recv(struct ib_srq *srq, | 559 | int ehca_post_srq_recv(struct ib_srq *srq, |