From 863fb09fbf1eb74f56ea02184a62165056aa29cb Mon Sep 17 00:00:00 2001 From: Joachim Fenkes Date: Wed, 23 Apr 2008 11:55:45 -0700 Subject: IB/ehca: Prevent posting of SQ WQEs if QP not in RTS ...as required by IB Spec, C10-29. Signed-off-by: Joachim Fenkes Signed-off-by: Roland Dreier --- drivers/infiniband/hw/ehca/ehca_reqs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/infiniband/hw/ehca/ehca_reqs.c') diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c index a20bbf466188..0b2359e2757a 100644 --- a/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c @@ -421,6 +421,11 @@ int ehca_post_send(struct ib_qp *qp, int ret = 0; unsigned long flags; + if (unlikely(my_qp->state != IB_QPS_RTS)) { + ehca_err(qp->device, "QP not in RTS state qpn=%x", qp->qp_num); + return -EINVAL; + } + /* LOCK the QUEUE */ spin_lock_irqsave(&my_qp->spinlock_s, flags); -- cgit v1.2.2