summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ehca/ehca_reqs.c
diff options
context:
space:
mode:
authorJoachim Fenkes <fenkes@de.ibm.com>2008-04-23 11:55:45 -0700
committerRoland Dreier <rolandd@cisco.com>2008-04-23 11:55:45 -0700
commit863fb09fbf1eb74f56ea02184a62165056aa29cb (patch)
tree7fb54dd86320f2fba3a6276f5b2fa0e09efed7a3 /drivers/infiniband/hw/ehca/ehca_reqs.c
parentbc7b3a36ba02e4053ca38653e6a753082d9add03 (diff)
downloadop-kernel-dev-863fb09fbf1eb74f56ea02184a62165056aa29cb.zip
op-kernel-dev-863fb09fbf1eb74f56ea02184a62165056aa29cb.tar.gz
IB/ehca: Prevent posting of SQ WQEs if QP not in RTS
...as required by IB Spec, C10-29. Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_reqs.c')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_reqs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index a20bbf4..0b2359e 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);
OpenPOWER on IntegriCloud