Loading
RDMA/hns: Fix flush cqe error when racing with destroy qp
mainline inclusion from mainline-v6.13-rc2 commit 377a2097705b915325a67e4d44f9f2844e567809 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB7JSL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=377a2097705b915325a67e4d44f9f2844e567809 ---------------------------------------------------------------------- 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: ffd541d4 ("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> Signed-off-by:
huwentao <huwentao19@h-partners.com> Conflicts: drivers/infiniband/hw/hns/hns_roce_device.h drivers/infiniband/hw/hns/hns_roce_hw_v2.c