[MTHCA] Report completion error after filling WC
[mirror/winof/.git] / hw / mthca / user / mlnx_uvp_cq.c
index dfc587f..9a3d7f2 100644 (file)
@@ -356,13 +356,6 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
                wq->last_comp = wqe_index;
        }
 
-       if (is_error) {
-               err = handle_error_cqe(cq, *cur_qp, wqe_index, is_send,
-                                      (struct mthca_err_cqe *) cqe,
-                                      entry, &free_cqe);
-               goto out;
-       }
-
        if (is_send) {
                entry->recv.ud.recv_opt = 0;
                switch (cqe->opcode) {
@@ -429,7 +422,14 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
                        IB_RECV_OPT_GRH_VALID : 0;
        }
 
-       entry->status = IB_WCS_SUCCESS;
+
+       if (is_error) {
+               err = handle_error_cqe(cq, *cur_qp, wqe_index, is_send,
+                                      (struct mthca_err_cqe *) cqe,
+                                      entry, &free_cqe);
+       }
+       else
+               entry->status = IB_WCS_SUCCESS;
 
 out:
        if (likely(free_cqe)) {