IB/{qib, hfi1}: Avoid flow control testing for RDMA write operation
[pandora-kernel.git] / drivers / infiniband / hw / qib / qib_rc.c
index afaf4ac..b338dd0 100644 (file)
@@ -271,13 +271,9 @@ int qib_make_rc_req(struct qib_qp *qp)
                        goto bail;
                }
                wqe = get_swqe_ptr(qp, qp->s_last);
-               while (qp->s_last != qp->s_acked) {
-                       qib_send_complete(qp, wqe, IB_WC_SUCCESS);
-                       if (++qp->s_last >= qp->s_size)
-                               qp->s_last = 0;
-                       wqe = get_swqe_ptr(qp, qp->s_last);
-               }
-               qib_send_complete(qp, wqe, IB_WC_WR_FLUSH_ERR);
+               qib_send_complete(qp, wqe, qp->s_last != qp->s_acked ?
+                       IB_WC_SUCCESS : IB_WC_WR_FLUSH_ERR);
+               /* will get called again */
                goto done;
        }
 
@@ -369,7 +365,7 @@ int qib_make_rc_req(struct qib_qp *qp)
                case IB_WR_RDMA_WRITE:
                        if (newreq && !(qp->s_flags & QIB_S_UNLIMITED_CREDIT))
                                qp->s_lsn++;
-                       /* FALLTHROUGH */
+                       goto no_flow_control;
                case IB_WR_RDMA_WRITE_WITH_IMM:
                        /* If no credit, return. */
                        if (!(qp->s_flags & QIB_S_UNLIMITED_CREDIT) &&
@@ -377,6 +373,7 @@ int qib_make_rc_req(struct qib_qp *qp)
                                qp->s_flags |= QIB_S_WAIT_SSN_CREDIT;
                                goto bail;
                        }
+no_flow_control:
                        ohdr->u.rc.reth.vaddr =
                                cpu_to_be64(wqe->wr.wr.rdma.remote_addr);
                        ohdr->u.rc.reth.rkey =