diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 7450550db736..c5c3d0edbbf5 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -591,6 +591,20 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
591 | return -EINVAL; | 591 | return -EINVAL; |
592 | } | 592 | } |
593 | 593 | ||
594 | if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && | ||
595 | attr->max_rd_atomic > dev->limits.max_qp_init_rdma) { | ||
596 | mthca_dbg(dev, "Max rdma_atomic as initiator %u too large (max is %d)\n", | ||
597 | attr->max_rd_atomic, dev->limits.max_qp_init_rdma); | ||
598 | return -EINVAL; | ||
599 | } | ||
600 | |||
601 | if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && | ||
602 | attr->max_dest_rd_atomic > 1 << dev->qp_table.rdb_shift) { | ||
603 | mthca_dbg(dev, "Max rdma_atomic as responder %u too large (max %d)\n", | ||
604 | attr->max_dest_rd_atomic, 1 << dev->qp_table.rdb_shift); | ||
605 | return -EINVAL; | ||
606 | } | ||
607 | |||
594 | mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); | 608 | mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); |
595 | if (IS_ERR(mailbox)) | 609 | if (IS_ERR(mailbox)) |
596 | return PTR_ERR(mailbox); | 610 | return PTR_ERR(mailbox); |