IB/ipath: Fix CQ flushing when QP is modified to error state
authorBryan O'Sullivan <bos@pathscale.com>
Thu, 15 Mar 2007 21:44:57 +0000 (14:44 -0700)
committerRoland Dreier <rolandd@cisco.com>
Thu, 19 Apr 2007 03:20:56 +0000 (20:20 -0700)
If a receive work request has been removed from the queue but has not
had a CQ entry generated for it and the QP is modified to the error
state, the completion entry generated is incorrect.  This patch fixes
the problem.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_qp.c
drivers/infiniband/hw/ipath/ipath_ud.c

index 64ea807703c954e63e0581ec025c166711672670..f671fd07325302977e83d08040bb31d08877ec30 100644 (file)
@@ -519,7 +519,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
                break;
 
        case IB_QPS_ERR:
-               ipath_error_qp(qp, IB_WC_GENERAL_ERR);
+               ipath_error_qp(qp, IB_WC_WR_FLUSH_ERR);
                break;
 
        default:
index a20261c0b4f8c19022234a2301d3d4e256489e28..57625b8c1b97affd8f67dfe9f44e8e712cd4a7bd 100644 (file)
@@ -647,6 +647,7 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                ipath_skip_sge(&qp->r_sge, sizeof(struct ib_grh));
        ipath_copy_sge(&qp->r_sge, data,
                       wc.byte_len - sizeof(struct ib_grh));
+       qp->r_wrid_valid = 0;
        wc.wr_id = qp->r_wr_id;
        wc.status = IB_WC_SUCCESS;
        wc.opcode = IB_WC_RECV;