Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0be5fb5f835110652911ea8b88ad78f841e5b45
Commit:     c0be5fb5f835110652911ea8b88ad78f841e5b45
Parent:     02d89b87081f516ad3993637f9b75db0d9786554
Author:     Eli Cohen <[EMAIL PROTECTED]>
AuthorDate: Thu May 24 16:05:01 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Thu May 24 14:02:38 2007 -0700

    IB/mlx4: Initialize send queue entry ownership bits
    
    We need to initialize the owner bit of send queue WQEs to hardware
    ownership whenever the QP is modified from reset to init, not just
    when the QP is first allocated.  This avoids having the hardware
    process stale WQEs when the QP is moved to reset but not destroyed and
    then modified to init again.
    
    Signed-off-by: Eli Cohen <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/qp.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 88a994d..dc137de 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -270,9 +270,7 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct 
ib_pd *pd,
                            struct ib_qp_init_attr *init_attr,
                            struct ib_udata *udata, int sqpn, struct mlx4_ib_qp 
*qp)
 {
-       struct mlx4_wqe_ctrl_seg *ctrl;
        int err;
-       int i;
 
        mutex_init(&qp->mutex);
        spin_lock_init(&qp->sq.lock);
@@ -352,11 +350,6 @@ static int create_qp_common(struct mlx4_ib_dev *dev, 
struct ib_pd *pd,
                if (err)
                        goto err_mtt;
 
-               for (i = 0; i < qp->sq.max; ++i) {
-                       ctrl = get_send_wqe(qp, i);
-                       ctrl->owner_opcode = cpu_to_be32(1 << 31);
-               }
-
                qp->sq.wrid  = kmalloc(qp->sq.max * sizeof (u64), GFP_KERNEL);
                qp->rq.wrid  = kmalloc(qp->rq.max * sizeof (u64), GFP_KERNEL);
 
@@ -878,6 +871,21 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
        else
                sqd_event = 0;
 
+       /*
+        * Before passing a kernel QP to the HW, make sure that the
+        * ownership bits of the send queue are set so that the
+        * hardware doesn't start processing stale work requests.
+        */
+       if (!ibqp->uobject && cur_state == IB_QPS_RESET && new_state == 
IB_QPS_INIT) {
+               struct mlx4_wqe_ctrl_seg *ctrl;
+               int i;
+
+               for (i = 0; i < qp->sq.max; ++i) {
+                       ctrl = get_send_wqe(qp, i);
+                       ctrl->owner_opcode = cpu_to_be32(1 << 31);
+               }
+       }
+
        err = mlx4_qp_modify(dev->dev, &qp->mtt, to_mlx4_state(cur_state),
                             to_mlx4_state(new_state), context, optpar,
                             sqd_event, &qp->mqp);
-
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