Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9cf7db2bca9180f5888eebc23dc607666a9685b
Commit:     c9cf7db2bca9180f5888eebc23dc607666a9685b
Parent:     036be09ca55ee8512c05742f4f6b88911d012a90
Author:     Ralph Campbell <[EMAIL PROTECTED]>
AuthorDate: Sat Aug 25 16:48:29 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 20:50:29 2007 -0700

    IB/ipath: Generate flush CQE when QP is in error state
    
    Follow the IB spec. (C10-96) for post send which states that a flushed
    completion event should be generated for work requests posted when a QP
    is in the error state.
    
    Signed-off-by: Ralph Campbell <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_verbs.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c 
b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 3cc82b6..495194b 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -230,6 +230,18 @@ void ipath_skip_sge(struct ipath_sge_state *ss, u32 length)
        }
 }
 
+static void ipath_flush_wqe(struct ipath_qp *qp, struct ib_send_wr *wr)
+{
+       struct ib_wc wc;
+
+       memset(&wc, 0, sizeof(wc));
+       wc.wr_id = wr->wr_id;
+       wc.status = IB_WC_WR_FLUSH_ERR;
+       wc.opcode = ib_ipath_wc_opcode[wr->opcode];
+       wc.qp = &qp->ibqp;
+       ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
+}
+
 /**
  * ipath_post_one_send - post one RC, UC, or UD send work request
  * @qp: the QP to post on
@@ -248,8 +260,14 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct 
ib_send_wr *wr)
        spin_lock_irqsave(&qp->s_lock, flags);
 
        /* Check that state is OK to post send. */
-       if (!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK))
-               goto bail_inval;
+       if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK))) {
+               if (qp->state != IB_QPS_SQE && qp->state != IB_QPS_ERR)
+                       goto bail_inval;
+               /* C10-96 says generate a flushed completion entry. */
+               ipath_flush_wqe(qp, wr);
+               ret = 0;
+               goto bail;
+       }
 
        /* IB spec says that num_sge == 0 is OK. */
        if (wr->num_sge > qp->s_max_sge)
-
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