Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57f01b53398baebd809e7efd49fc10c10174b46d
Commit:     57f01b53398baebd809e7efd49fc10c10174b46d
Parent:     b2d9308ae43a9cfa56cc9682dc6ed63347a8d2bf
Author:     Jack Morgenstein <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 6 19:35:04 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Thu Jun 7 23:24:38 2007 -0700

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/qp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index dc137de..cd22975 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,
                optpar |= MLX4_QP_OPTPAR_PKEY_INDEX;
        }
 
-       if (attr_mask & IB_QP_RNR_RETRY) {
-               context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
-               optpar |= MLX4_QP_OPTPAR_RNR_RETRY;
-       }
-
        if (attr_mask & IB_QP_AV) {
                if (mlx4_set_path(dev, &attr->ah_attr, &context->pri_path,
                                  attr_mask & IB_QP_PORT ? attr->port_num : 
qp->port)) {
@@ -802,6 +797,12 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
 
        context->pd         = cpu_to_be32(to_mpd(ibqp->pd)->pdn);
        context->params1    = cpu_to_be32(MLX4_IB_ACK_REQ_FREQ << 28);
+
+       if (attr_mask & IB_QP_RNR_RETRY) {
+               context->params1 |= cpu_to_be32(attr->rnr_retry << 13);
+               optpar |= MLX4_QP_OPTPAR_RNR_RETRY;
+       }
+
        if (attr_mask & IB_QP_RETRY_CNT) {
                context->params1 |= cpu_to_be32(attr->retry_cnt << 16);
                optpar |= MLX4_QP_OPTPAR_RETRY_COUNT;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to