]> git.baikalelectronics.ru Git - kernel.git/commit
iw_cxgb4: only insert drain cqes if wq is flushed
authorSteve Wise <swise@opengridcomputing.com>
Mon, 27 Nov 2017 21:16:32 +0000 (13:16 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 11 Dec 2017 22:33:51 +0000 (15:33 -0700)
commitde93aad8ed65f917489ae614c747eed85854653c
treee73b6bbb3ac8926c1ad93fb8f2c32525906a7778
parente2f4be3d114bc03e7353e64f120e6606d7e50f27
iw_cxgb4: only insert drain cqes if wq is flushed

Only insert our special drain CQEs to support ib_drain_sq/rq() after
the wq is flushed. Otherwise, existing but not yet polled CQEs can be
returned out of order to the user application.  This can happen when the
QP has exited RTS but not yet flushed the QP, which can happen during
a normal close (vs abortive close).

In addition never count the drain CQEs when determining how many CQEs
need to be synthesized during the flush operation.  This latter issue
should never happen if the QP is properly flushed before inserting the
drain CQE, but I wanted to avoid corrupting the CQ state.  So we handle
it and log a warning once.

Fixes: 1a380c09dfe2 ("iw_cxgb4: refactor sq/rq drain logic")
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/cxgb4/cq.c
drivers/infiniband/hw/cxgb4/qp.c