xprtrdma: Wait before destroying transport's queue pair
[ Proposed for upstream v4.4 ]
Ensure that resources needed to handle completions remain in place
until all pending completions have been processed.
This solution is based on commit
7dad6b2e440d ("IB/srp: Fix a race
condition triggered by destroying a queue pair").
Note that when shutting down a transport, destroying the receive
buffers must be done _after_ the receive buffers are flushed.
Also note that during a transport reconnect, any waiting RPC can
exit (eg soft timeout). With FRWR, that can result in a posted send
WR after the sentinel. That will be addressed eventually. Right now
there are no dependencies on this (mis)behavior.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>