wqe->status is already set before the code that you mentioned has been reached.
can you be more specific? for instance I didn't find similar behavior for the example below (also in check_ack())
case IB_OPCODE_RC_ATOMIC_ACKNOWLEDGE: syn = aeth_syn(pkt);
if ((syn & AETH_TYPE_MASK) != AETH_ACK) return COMPST_ERROR;
if (wqe->wr.opcode != IB_WR_ATOMIC_CMP_AND_SWP && wqe->wr.opcode != IB_WR_ATOMIC_FETCH_AND_ADD) return COMPST_ERROR; <<<<<<<<<<<<<<<<<<<<<<<<<< reset_retry_counters(qp); return COMPST_ATOMIC;