]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: sqflush: set the duplicated CQ entry status as DUPL_COMPL_ERR
authorWei Lin Guay <wei.lin.guay@oracle.com>
Tue, 13 Sep 2016 19:17:58 +0000 (21:17 +0200)
committerKnut Omang <knut.omang@oracle.com>
Mon, 3 Oct 2016 12:02:20 +0000 (14:02 +0200)
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>
drivers/infiniband/hw/sif/sif_cq.c
drivers/infiniband/hw/sif/sif_r3.c

index 04bb791f742130e505a129e4329c60dd0d1e8dbc..d6d6ceca2de86170e28c8284e37fb8d6c00039cc 100644 (file)
@@ -49,7 +49,7 @@ static inline int translate_wr_id(
                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,
index 2d373502eee1a6225cd51f69dee278e5dedaf898..c3c0009fdea08141c23afc22bdba34855122542a 100644 (file)
@@ -810,8 +810,13 @@ static u16 walk_and_update_cqes(struct sif_dev *sdev, struct sif_qp *qp, u16 hea
                        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));