OSDN Git Service

IB/hfi1: Clear the IOWAIT pending bits when QP is put into error state
authorKaike Wan <kaike.wan@intel.com>
Mon, 18 Mar 2019 16:55:29 +0000 (09:55 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 27 Mar 2019 17:34:31 +0000 (14:34 -0300)
commit93b289b9aff66eca7575b09f36f5abbeca8e6167
tree2067532f26d0750d355ea8ae0a1e7bc53455fe02
parent662d66466637862ef955f7f6e78a286d8cf0ebef
IB/hfi1: Clear the IOWAIT pending bits when QP is put into error state

When a QP is put into error state, it may be waiting for send engine
resources. In this case, the QP will be removed from the send engine's
waiting list, but its IOWAIT pending bits are not cleared. This will
normally not have any major impact as the QP is being destroyed.  However,
the QP still needs to wind down its operations, such as draining the send
queue by scheduling the send engine. Clearing the pending bits will avoid
any potential complications. In addition, if the QP will eventually hang,
clearing the pending bits can help debugging by presenting a consistent
picture if the user dumps the qp_stats.

This patch clears a QP's IOWAIT_PENDING_IB and IO_PENDING_TID bits in
priv->s_iowait.flags in this case.

Fixes: 5da0fc9dbf89 ("IB/hfi1: Prepare resource waits for dual leg")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/qp.c