From: Wei Lin Guay Date: Mon, 31 Oct 2016 18:06:28 +0000 (+0100) Subject: sif: cq: cleanup cqe once a kernel qp is destroyed/reset X-Git-Tag: v4.1.12-92~36^2~7 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=05606e033f4e2bf474bc914d0d87204b530c35b9;p=users%2Fjedix%2Flinux-maple.git sif: cq: cleanup cqe once a kernel qp is destroyed/reset 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 Reviewed-by: Knut Omang --- diff --git a/drivers/infiniband/hw/sif/sif_cq.c b/drivers/infiniband/hw/sif/sif_cq.c index 545a7fe702fcf..ee462f3551825 100644 --- a/drivers/infiniband/hw/sif/sif_cq.c +++ b/drivers/infiniband/hw/sif/sif_cq.c @@ -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); diff --git a/drivers/infiniband/hw/sif/version.c b/drivers/infiniband/hw/sif/version.c index e919c3ca07ec4..a4efee8c51d74 100644 --- a/drivers/infiniband/hw/sif/version.c +++ b/drivers/infiniband/hw/sif/version.c @@ -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 = "", }; diff --git a/drivers/infiniband/hw/sif/versioninfo.h b/drivers/infiniband/hw/sif/versioninfo.h index 711cce6ec9727..799daa5e36b5b 100644 --- a/drivers/infiniband/hw/sif/versioninfo.h +++ b/drivers/infiniband/hw/sif/versioninfo.h @@ -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"