Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c27cb71aa7d86df0271caadfcc196a0518f5e33
Commit:     1c27cb71aa7d86df0271caadfcc196a0518f5e33
Parent:     586bb586ae59c473393c09291e86042d263c3ddd
Author:     Jack Morgenstein <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 17 18:37:38 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Jul 17 18:37:38 2007 -0700

    IB/mlx4: Fix port returned from query QP for QPs in INIT state
    
    When a QP is in the INIT state, the sched_queue field hasn't been given
    to the firmware yet, so the firmware cannot return the value when the QP
    is queried.  To handle this, use the port number that is saved in the
    driver's QP data structure.
    
    Found by Dotan Barak and Yaron Gepstein of Mellanox.
    
    Signed-off-by: Jack Morgenstein <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/qp.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 2d00b4e..d10bd88 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1560,7 +1560,10 @@ int mlx4_ib_query_qp(struct ib_qp *ibqp, struct 
ib_qp_attr *qp_attr, int qp_attr
        }
 
        qp_attr->pkey_index = context.pri_path.pkey_index & 0x7f;
-       qp_attr->port_num   = context.pri_path.sched_queue & 0x40 ? 2 : 1;
+       if (qp_attr->qp_state == IB_QPS_INIT)
+               qp_attr->port_num = qp->port;
+       else
+               qp_attr->port_num = context.pri_path.sched_queue & 0x40 ? 2 : 1;
 
        /* qp_attr->en_sqd_async_notify is only applicable in modify qp */
        qp_attr->sq_draining = mlx4_state == MLX4_QP_STATE_SQ_DRAINING;
-
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