aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2007-06-06 12:35:04 -0400
committerRoland Dreier <rolandd@cisco.com>2007-06-08 02:24:38 -0400
commit57f01b53398baebd809e7efd49fc10c10174b46d (patch)
treedc3ab265d42b52f43679cead18d5e35e8a9eba3b /drivers/infiniband
parentb2d9308ae43a9cfa56cc9682dc6ed63347a8d2bf (diff)
IB/mlx4: Fix zeroing of rnr_retry value in ib_modify_qp()
The code in __mlx4_ib_modify_qp() overwrites context->params1 after the RNR retry parameter is ORed in, which results in the RNR retry parameter always being set to 0. Fix this by moving where we OR in the value to later in the function, after the initial assignment of context->params1. Found by the Mellanox firmware group. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index dc137dec2308..cd2297586980 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -762,11 +762,6 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
762 optpar |= MLX4_QP_OPTPAR_PKEY_INDEX; 762 optpar |= MLX4_QP_OPTPAR_PKEY_INDEX;
763 } 763 }
764 764
765 if (attr_mask & IB_QP_RNR_RETRY) {
766 context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
767 optpar |= MLX4_QP_OPTPAR_RNR_RETRY;
768 }
769
770 if (attr_mask & IB_QP_AV) { 765 if (attr_mask & IB_QP_AV) {
771 if (mlx4_set_path(dev, &attr->ah_attr, &context->pri_path, 766 if (mlx4_set_path(dev, &attr->ah_attr, &context->pri_path,
772 attr_mask & IB_QP_PORT ? attr->port_num : qp->port)) { 767 attr_mask & IB_QP_PORT ? attr->port_num : qp->port)) {
@@ -802,6 +797,12 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
802 797
803 context->pd = cpu_to_be32(to_mpd(ibqp->pd)->pdn); 798 context->pd = cpu_to_be32(to_mpd(ibqp->pd)->pdn);
804 context->params1 = cpu_to_be32(MLX4_IB_ACK_REQ_FREQ << 28); 799 context->params1 = cpu_to_be32(MLX4_IB_ACK_REQ_FREQ << 28);
800
801 if (attr_mask & IB_QP_RNR_RETRY) {
802 context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
803 optpar |= MLX4_QP_OPTPAR_RNR_RETRY;
804 }
805
805 if (attr_mask & IB_QP_RETRY_CNT) { 806 if (attr_mask & IB_QP_RETRY_CNT) {
806 context->params1 |= cpu_to_be32(attr->retry_cnt << 16); 807 context->params1 |= cpu_to_be32(attr->retry_cnt << 16);
807 optpar |= MLX4_QP_OPTPAR_RETRY_COUNT; 808 optpar |= MLX4_QP_OPTPAR_RETRY_COUNT;