@@ -253,13 +253,6 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
++wq->tail;
}
- if (is_error) {
- mlx4_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc);
- return CQ_OK;
- }
-
- wc->status = IBV_WC_SUCCESS;
-
if (is_send) {
wc->wc_flags = 0;
switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) {
@@ -311,6 +304,10 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
wc->wc_flags = IBV_WC_WITH_IMM;
wc->imm_data = cqe->immed_rss_invalid;
break;
+ default:
+ /* assume it's a recv completion */
+ wc->opcode = IBV_WC_RECV;
+ break;
}
wc->slid = ntohs(cqe->rlid);
@@ -322,6 +319,11 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
wc->pkey_index = ntohl(cqe->immed_rss_invalid) & 0x7f;
}
+ if (is_error)
+ mlx4_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc);
+ else
+ wc->status = IBV_WC_SUCCESS;
+
return CQ_OK;
}