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. Bart.��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f