RE: [RFC] XRC upstream merge reboot

Hefty, Sean
2011-08-22T15:46:39Z

> I am a bit concerned here. In the current usage model, target QPs are destroyed when their reference
> count goes to zero
> (ib_reg_xrc_recv_qp and ibv_xrc_create_qp increment the reference count, while ib_unreg_xrc_recv_qp
> decrements it).
> In this model, the TGT QP user/consumer does not need to know if it is the last user of the QP (and
> therefore should
> destroy it). The QP simply gets destroyed when no one is left using it.
>
> In your proposed model, it looks like the last TGT QP user needs to know that it is the last user and
> must therefore destroy
> the TGT QP (rather than the QP being destroyed automatically as the result of the ref count going to
> zero).
>
> Am I correct?
>
> (Or does every user -- both the creator and the caller of ib_open_qp do an ib_destroy_qp() -- and the
> destroy actually
> occurs when no users who did open/create remain?).

The latter is correct. The caller of ib_create_qp() and ib_open_qp() all call ib_destroy_qp() if they wish to destroy the QP once the reference count hits zero.