IB/ipath: Fix problem with next WQE after a UC completion
authorRalph Campbell <ralph.campbell@qlogic.com>
Mon, 18 Jun 2007 21:24:37 +0000 (14:24 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 10 Jul 2007 03:12:26 +0000 (20:12 -0700)
This patch fixes a bug introduced when moving some code around for
readability.

Setting the wqe pointer at the end of the function is a NOP since it
isn't used.  Move it back to where it is used.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_uc.c

index 1c2b03c2ef5e9dd31366f36477132b7b4a8aeada..49d650cabccf659076fd660113848200e654228c 100644 (file)
@@ -58,7 +58,6 @@ static void complete_last_send(struct ipath_qp *qp, struct ipath_swqe *wqe,
                wc->port_num = 0;
                ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 0);
        }
-       wqe = get_swqe_ptr(qp, qp->s_last);
 }
 
 /**
@@ -97,8 +96,10 @@ int ipath_make_uc_req(struct ipath_qp *qp,
                 * Signal the completion of the last send
                 * (if there is one).
                 */
-               if (qp->s_last != qp->s_tail)
+               if (qp->s_last != qp->s_tail) {
                        complete_last_send(qp, wqe, &wc);
+                       wqe = get_swqe_ptr(qp, qp->s_last);
+               }
 
                /* Check if send work queue is empty. */
                if (qp->s_tail == qp->s_head)