Orabug:
24652927
Mark the duplicate completion status as PSIF_WC_STATUS_DUPL_COMPL_ERR if
the additional/duplicate completions are detected by walk_and_update_cqes.
Then, the translate_wr_id can identify the duplicate completion during
sif_poll_cq.
Signed-off-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
return -EFAULT;
}
if (!unlikely(wh->used)) {
- if (sq_seq_num == wh->sq_seq) {
+ if ((sq_seq_num == wh->sq_seq) || (cqe->status == PSIF_WC_STATUS_DUPL_COMPL_ERR)) {
sif_log(sdev, SIF_WCE,
"dupl cqe 0x%x for cq %d: got sq_seq 0x%x, last exp.0x%x, sts %d opc 0x%x",
cqe->seq_num, cq->index, sq_seq_num, wh->sq_seq,
if (last_seq != updated_seq)
lcqe.wc_id.sq_id.sq_seq_num = updated_seq;
- if (GREATER_16(updated_seq, end))
+ if (GREATER_16(updated_seq, end)) {
+ /* Explicitly mark the CQE as duplicated completion
+ * when there are more CQE in the CQ.
+ */
lcqe.wc_id.sq_id.sq_seq_num = end;
+ lcqe.status = PSIF_WC_STATUS_DUPL_COMPL_ERR;
+ }
copy_conv_to_hw(cqe, &lcqe, sizeof(lcqe));