aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_qp.c
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2005-06-27 17:36:41 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 18:11:45 -0400
commit34a4a753d15f905158d77fb81adc9c19a02a4639 (patch)
tree73c0bacd8b57dcde4320ed4a89c2e22e07586c93 /drivers/infiniband/hw/mthca/mthca_qp.c
parentcd123d7fcfde319bd723d14d975d60319a1b2ad8 (diff)
[PATCH] IB/mthca: Set RDMA/atomic capabilities correctly
mthca apparently had the meanings of the max_rd_atomic and max_dest_rd_atomic QP attributes backwards. max_rd_atomic limits the maximum number of outstanding RDMA/atomic requests as an initiator (on a send queue), and max_dest_rd_atomic specifies the resources allocated to handle RMDA/atomic requests from the remote end of the connection. We were programming our QP context with these values swapped. Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_qp.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 793c216b1299..6bed9a3e3f0f 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -724,9 +724,9 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
724 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RETRY_COUNT); 724 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RETRY_COUNT);
725 } 725 }
726 726
727 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) { 727 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) {
728 qp_context->params1 |= cpu_to_be32(min(attr->max_dest_rd_atomic ? 728 qp_context->params1 |= cpu_to_be32(min(attr->max_rd_atomic ?
729 ffs(attr->max_dest_rd_atomic) - 1 : 0, 729 ffs(attr->max_rd_atomic) - 1 : 0,
730 7) << 21); 730 7) << 21);
731 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_SRA_MAX); 731 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_SRA_MAX);
732 } 732 }
@@ -764,10 +764,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
764 qp->atomic_rd_en = attr->qp_access_flags; 764 qp->atomic_rd_en = attr->qp_access_flags;
765 } 765 }
766 766
767 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) { 767 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) {
768 u8 rra_max; 768 u8 rra_max;
769 769
770 if (qp->resp_depth && !attr->max_rd_atomic) { 770 if (qp->resp_depth && !attr->max_dest_rd_atomic) {
771 /* 771 /*
772 * Lowering our responder resources to zero. 772 * Lowering our responder resources to zero.
773 * Turn off RDMA/atomics as responder. 773 * Turn off RDMA/atomics as responder.
@@ -778,7 +778,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
778 MTHCA_QP_OPTPAR_RAE); 778 MTHCA_QP_OPTPAR_RAE);
779 } 779 }
780 780
781 if (!qp->resp_depth && attr->max_rd_atomic) { 781 if (!qp->resp_depth && attr->max_dest_rd_atomic) {
782 /* 782 /*
783 * Increasing our responder resources from 783 * Increasing our responder resources from
784 * zero. Turn on RDMA/atomics as appropriate. 784 * zero. Turn on RDMA/atomics as appropriate.
@@ -799,7 +799,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
799 } 799 }
800 800
801 for (rra_max = 0; 801 for (rra_max = 0;
802 1 << rra_max < attr->max_rd_atomic && 802 1 << rra_max < attr->max_dest_rd_atomic &&
803 rra_max < dev->qp_table.rdb_shift; 803 rra_max < dev->qp_table.rdb_shift;
804 ++rra_max) 804 ++rra_max)
805 ; /* nothing */ 805 ; /* nothing */
@@ -807,7 +807,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
807 qp_context->params2 |= cpu_to_be32(rra_max << 21); 807 qp_context->params2 |= cpu_to_be32(rra_max << 21);
808 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRA_MAX); 808 qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRA_MAX);
809 809
810 qp->resp_depth = attr->max_rd_atomic; 810 qp->resp_depth = attr->max_dest_rd_atomic;
811 } 811 }
812 812
813 qp_context->params2 |= cpu_to_be32(MTHCA_QP_BIT_RSC); 813 qp_context->params2 |= cpu_to_be32(MTHCA_QP_BIT_RSC);