]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: cq: tear-down sequence in cleaning up the SendCQ
authorWei Lin Guay <wei.lin.guay@oracle.com>
Mon, 30 May 2016 07:54:34 +0000 (09:54 +0200)
committerKnut Omang <knut.omang@oracle.com>
Sun, 3 Jul 2016 14:01:37 +0000 (16:01 +0200)
This commit ensures that the sif_fixup_cqes for a sendCQ
can only be executed after post_process_wa4074. As the CQE
in a sendCQ cannot be trusted,  walk_and_update CQ must
be performed first.

In a scenario where the post_process_wa4074 and sif_fixup_cqes
are performed concurrently, the post_process_wa4074 is given
priority where no polling of the SendCQ is allowed in
sif_fixup_cqes. Then, post_process_wa4074 will generate
the remaining FLUSH-IN ERR for a Send queue.

Signed-off-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
drivers/infiniband/hw/sif/sif_cq.c
drivers/infiniband/hw/sif/sif_qp.c

index 26502cef382367f1b37266c68bddcf260ea0cef8..f3409f54c3421a4379061201746d638be851ae42 100644 (file)
@@ -750,6 +750,10 @@ int sif_fixup_cqes(struct sif_cq *cq, struct sif_sq *sq, struct sif_qp *qp)
                struct psif_cq_entry lcqe;
                uint64_t wr_id_host_order = 0;
 
+               /* TBD - maybe should hide this as a function in sif_r3.c */
+               if ((test_bit(CQ_POLLING_NOT_ALLOWED, &cq_sw->flags)))
+                       break;
+
                cqe = get_cq_entry(cq, seqno);
                polled_value = get_psif_cq_entry__seq_num(cqe);
 
index 7c293d426ee877f372a8b708a29e16be4e1e8154..8b5a59a69344969b3a370f6a83c27bb747954d83 100644 (file)
@@ -2153,6 +2153,14 @@ int destroy_qp(struct sif_dev *sdev, struct sif_qp *qp)
                struct sif_cq *recv_cq = rq ? get_sif_cq(sdev, cq_idx) : NULL;
 
                if (send_cq) {
+                       ret = post_process_wa4074(sdev, qp);
+                       if (ret) {
+                               sif_log(sdev, SIF_INFO,
+                                       "post_process_wa4074 failed for qp %d send cq %d with error %d",
+                                       qp->qp_idx, sq->cq_idx, ret);
+                               goto fixup_failed;
+                       }
+
                        nfixup = sif_fixup_cqes(send_cq, sq, qp);
                        if (nfixup < 0) {
                                sif_log(sdev, SIF_INFO,