[ofa-general] [PATCH] rdma/cm: add locking around QP accesses

Sean Hefty mshefty at ichips.intel.com
Tue Sep 25 09:46:21 PDT 2007


> In iscsi/iser, the approach we took wrt to destruction of a <ID,QP> pair 
> (ID and QP are created/destroyed through and state-managed by the 
> rdma-cm) is:
> 
> A) call rdma_disconnect to make sure the QP was transitioned to error
> 
> B) get the completions/flushes assoc. with all the WR posted to the QP
> C) make sure a disconnected event was received
> 
> call rdma_destroy_qp only when B && C hold.
> 
> What is your take on this approach?

That should work fine and avoid any races.

It was just my intent to support calling rdma_destroy_id() at any time 
in order to cancel any outstanding operation.  I didn't consider that 
this also meant supporting rdma_destroy_qp() being called at any time. 
This patch should protect against QP destruction, as long as the user 
does not call rdma_destroy_qp() while calling another API, such as 
rdma_accept().

- Sean



More information about the general mailing list