Re: Kernel v4.16 / v4.17 SRP and SRPT patches

Bart Van Assche
2018-01-10T19:32:14Z

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.