On Wed, Jan 10, 2018 at 12:32 PM, Bart Van Assche <Bart.VanAssche@xxxxxxx> wrote: > On Wed, 2018-01-10 at 12:17 -0700, Jason Gunthorpe wrote: >> But that has nothing directly to do with the lifetime of, say, struct >> srp_request which contains ib_wc->wr_cqe? >> >> eg freeing struct srp_request before the wrid has passed through the >> CQ poll would produce these sorts of symptoms... > > Hello Jason, > > The SRP initiator driver RDMA channel shutdown sequence is as follows: > * srp_remove_target() calls srp_free_ch_ib(). That last function calls > srp_destroy_qp() which in turn calls ib_drain_qp(). ib_drain_qp() waits until > all CQEs have been dequeued by changing the QP state into IB_QPS_ERR and by > waiting until the completion for a newly posted request has been received. > * srp_remove_target() calls srp_free_req_data(). That last function > calls kfree(ch->req_ring), that is the data structure that contains the > SRP request structures. Thanks Bart, informative.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html