]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDMA/hns: Fix flush cqe error when racing with destroy qp
authorwenglianfa <wenglianfa@huawei.com>
Thu, 24 Oct 2024 12:39:57 +0000 (20:39 +0800)
committerLeon Romanovsky <leon@kernel.org>
Wed, 30 Oct 2024 12:13:54 +0000 (14:13 +0200)
commit377a2097705b915325a67e4d44f9f2844e567809
tree329451a642f53bbef7014f2e617e23e21434bd0a
parent571e4ab8a45e530623ab129803f090a844dd3fe9
RDMA/hns: Fix flush cqe error when racing with destroy qp

QP needs to be modified to IB_QPS_ERROR to trigger HW flush cqe. But
when this process races with destroy qp, the destroy-qp process may
modify the QP to IB_QPS_RESET first. In this case flush cqe will fail
since it is invalid to modify qp from IB_QPS_RESET to IB_QPS_ERROR.

Add lock and bit flag to make sure pending flush cqe work is completed
first and no more new works will be added.

Fixes: ffd541d45726 ("RDMA/hns: Add the workqueue framework for flush cqe handler")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20241024124000.2931869-3-huangjunxian6@hisilicon.com
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_qp.c