aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index c5c3d0edbbf5..84056a8b794e 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -728,9 +728,9 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
728 } 728 }
729 729
730 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) { 730 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) {
731 qp_context->params1 |= cpu_to_be32(min(attr->max_rd_atomic ? 731 if (attr->max_rd_atomic)
732 ffs(attr->max_rd_atomic) - 1 : 0, 732 qp_context->params1 |=
733 7) << 21); 733 cpu_to_be32(fls(attr->max_rd_atomic - 1) << 21);
734 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_SRA_MAX); 734 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_SRA_MAX);
735 } 735 }
736 736
@@ -769,8 +769,6 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
769 } 769 }
770 770
771 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) { 771 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) {
772 u8 rra_max;
773
774 if (qp->resp_depth && !attr->max_dest_rd_atomic) { 772 if (qp->resp_depth && !attr->max_dest_rd_atomic) {
775 /* 773 /*
776 * Lowering our responder resources to zero. 774 * Lowering our responder resources to zero.
@@ -798,13 +796,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
798 MTHCA_QP_OPTPAR_RAE); 796 MTHCA_QP_OPTPAR_RAE);
799 } 797 }
800 798
801 for (rra_max = 0; 799 if (attr->max_dest_rd_atomic)
802 1 << rra_max < attr->max_dest_rd_atomic && 800 qp_context->params2 |=
803 rra_max < dev->qp_table.rdb_shift; 801 cpu_to_be32(fls(attr->max_dest_rd_atomic - 1) << 21);
804 ++rra_max)
805 ; /* nothing */
806 802
807 qp_context->params2 |= cpu_to_be32(rra_max << 21);
808 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRA_MAX); 803 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRA_MAX);
809 804
810 qp->resp_depth = attr->max_dest_rd_atomic; 805 qp->resp_depth = attr->max_dest_rd_atomic;