IB/hns: Fix the bug when free cq
authorShaobo Xu <xushaobo2@huawei.com>
Tue, 29 Nov 2016 23:10:29 +0000 (23:10 +0000)
committerDoug Ledford <dledford@redhat.com>
Sat, 3 Dec 2016 19:20:42 +0000 (14:20 -0500)
commitafb6b092d6507b17c75df394b1d1b2a6e1674627
tree06c7c9341d14ee59b350d0cc9b66bc3e0c02008a
parent19a408efa099e6ebe5458d4fc1ba4630d9daf9d4
IB/hns: Fix the bug when free cq

If the resources of cq are freed while executing the user case, hardware
can not been notified in hip06 SoC. Then hardware will hold on when it
writes the cq buffer which has been released.

In order to slove this problem, RoCE driver checks the CQE counter, and
ensure that the outstanding CQE have been written. Then the cq buffer
can be released.

Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_common.h
drivers/infiniband/hw/hns/hns_roce_cq.c
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v1.c