RDMA/hns: Delayed flush cqe process with workqueue
authorYixian Liu <liuyixian@huawei.com>
Thu, 6 Feb 2020 09:56:45 +0000 (17:56 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 13 Feb 2020 20:44:21 +0000 (16:44 -0400)
commitb53742865e9f09cbba4d9daa161760ec23f36aa4
treedbed4af2085d1b2a74066715da0bd283b66f0cc7
parentffd541d45726341c1830ff595fd7352b6d1cfbcd
RDMA/hns: Delayed flush cqe process with workqueue

HiP08 RoCE hardware lacks ability(a known hardware problem) to flush
outstanding WQEs if QP state gets into errored mode for some reason.  To
overcome this hardware problem and as a workaround, when QP is detected to
be in errored state during various legs like post send, post receive
etc[1], flush needs to be performed from the driver.

The earlier patch[1] sent to solve the hardware limitation explained in
the cover-letter had a bug in the software flushing leg. It acquired mutex
while modifying QP state to errored state and while conveying it to the
hardware using the mailbox. This caused leg to sleep while holding
spin-lock and caused crash.

Suggested Solution: we have proposed to defer the flushing of the QP in
the Errored state using the workqueue to get around with the limitation of
our hardware.

This patch specifically adds the calls to the flush handler from where
parts of the code like post_send/post_recv etc. when the QP state gets
into the errored mode.

[1] https://patchwork.kernel.org/patch/10534271/

Link: https://lore.kernel.org/r/1580983005-13899-3-git-send-email-liuyixian@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Reviewed-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
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