[ofa-general] CQ destory

Roland Dreier rdreier at cisco.com
Wed Nov 14 08:28:04 PST 2007


 >    Is there any way to figure out that a cq does not have any pending
 > completion entries and thus
 >    is safe to call ibv_destroy_cq. Or is it ok to call destroy
 > regardless of whether there are completion
 >    entries? I am seeing a seg fault in ibv_poll_cq if I adopt the
 > latter approach.

The only way to know that a CQ has no entries is to poll the CQ and
not see any entries.  However, it is fine to destroy a CQ if there are
entries present.  I don't understand how destroying a CQ could be
connected to a seg fault in ibv_poll_cq, unless you are polling the CQ
after calling ibv_destroy_cq() for that same CQ, which is a
use-after-free bug in your code.

 - R.



More information about the general mailing list