RE: [PATCH V4 for-next 05/10] IB/core: Introduce Receive Work Queue indirection table

Steve Wise
2016-05-24T14:02:37Z

> > Hey Yishai,
> >
> > Why do you need usecnt on the individual tables allocated by the device? I
see
> > them inc'd here and dec'd in destroy. But I don't see them used anywhere
else?
> >
> > Steve.
>
> Look at ib_destroy_wq for this reference count usage.
>
> WQ and indirection table are IB objects that are managed by the IB layer
> for both update/cleanup. Specifically, a WQ can't be cleaned up if there
> is an indirection table that points to. From application point of view
> when it has an handle to an indirection table it assumes that all its
> underlying WQ(s) are valid so the IB layer should prevent any
> destruction of any WQ before releasing the indirection table, this is
> done by the ref count mechanism as done for other related IB objects.
> You can look also at ib_uverbs_cleanup_ucontext where upon process
> termination the order of cleanup is first destroying the indirection
> table(s) then going over all WQ(s) and destroy them.

I see. Thanks for the clarification.

Steve.