]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: cq: cleanup cqe once a kernel qp is destroyed/reset
authorWei Lin Guay <wei.lin.guay@oracle.com>
Mon, 31 Oct 2016 18:06:28 +0000 (19:06 +0100)
committerKnut Omang <knut.omang@oracle.com>
Fri, 11 Nov 2016 16:36:59 +0000 (17:36 +0100)
To ease the sqflush/rqflush workaround, sifdrv removes
all the associated cqes once a kernel qp is destroy/reset.

Even though IB specification 10.2.4.4 mentioned that
"Destroying a QP does not guarantee that CQEs of that
QP are deallocated from the CQ upon destruction.",
it also stated that "Even if the CQEs are already on
the CQ, it might not be possible to retrieve them"

Thus, IB spec is indicating that it is vendor specific
implementation and the ULP should not assume that the
cqes are in the cq once a qp is destroyed/reset.

Orabug: 25070316

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/version.c
drivers/infiniband/hw/sif/versioninfo.h

index 545a7fe702fcf2bd00d82f5f9ff8405e865486da..ee462f355182517437de308aa1403e00a0b0e48d 100644 (file)
@@ -420,9 +420,9 @@ static int handle_send_wc(struct sif_dev *sdev, struct sif_cq *cq,
 
        if (qp_is_destroyed) {
                wc->wr_id = cqe->wc_id.rq_id;
-
-               /* No more work, when QP is gone */
-               return cqe->status == PSIF_WC_STATUS_GEN_TRANSL_COMPL_ERR ? -EFAULT : 0;
+               sif_log(sdev, SIF_INFO,
+                       "remove cqe (0x%llx) from cq %d", wc->wr_id, cq->index);
+               return -EFAULT;
        }
 
        ret = translate_wr_id(&wc->wr_id, sdev, cq, sq, cqe, sq_seq_num, cqe->qp);
@@ -468,8 +468,11 @@ static int handle_recv_wc(struct sif_dev *sdev, struct sif_cq *cq, struct ib_wc
        wc->wr_id = cqe->wc_id.rq_id;
 
        /* If no QP, no further work */
-       if (qp_is_destroyed)
-               return 0;
+       if (qp_is_destroyed) {
+               sif_log(sdev, SIF_INFO,
+                       "remove cqe (0x%llx) from cq %d", wc->wr_id, cq->index);
+               return -EFAULT;
+       }
 
        rq_len = atomic_dec_return(&rq_sw->length);
 
index e919c3ca07ec4a10271248df1a94e2296a45c863..a4efee8c51d743df39189c124bed501a856e6453 100644 (file)
@@ -4,12 +4,12 @@
 
 struct sif_version sif_version = {
 .git_repo = "sifdrv [origin/master]",
-.last_commit = "titan_1.0.6.0 cq: transfer headroom attribute to user mode",
+.last_commit = "titan_1.0.8.0 cq: cleanup cqe once a kernel qp is destroyed/reset",
 .git_status = "",
-.build_git_time = "Mon, 24 Oct 2016 11:51:44 +0000",
+.build_git_time = "Fri, 11 Nov 2016 15:18:55 +0000",
 .build_user = "komang",
 
 .git_psifapi_repo = "psifapi [origin/master]",
-.last_psifapi_commit = "titan_1.0.6.0 preparations for venus",
+.last_psifapi_commit = "titan_1.0.8.0 preparations for venus",
 .git_psifapi_status = "",
 };
index 711cce6ec97272b6d04b2a3e75cbe5b781b5d8c7..799daa5e36b5b45644a29076be5da4ce721f19c1 100644 (file)
@@ -1,6 +1,6 @@
 /* Misc driver release info */
 
-#define BUILD_DATE "2016-10-24"
-#define BUILD_TIME "11:51:44"
-#define BUILD_EPOCH 1477309904
-#define TITAN_RELEASE "1.0.6.0"
+#define BUILD_DATE "2016-11-11"
+#define BUILD_TIME "15:18:55"
+#define BUILD_EPOCH 1478877535
+#define TITAN_RELEASE "1.0.8.0"