On Sun, Feb 17, 2019 at 09:58:27AM +0200, Shamir Rabinovitch wrote: > After this patch set I would like to send RFC for a way to add the > 'clone' function pointer for each ib_xx core object. I think it can be > done by adding wrapper struct to each ib_xx core object via macro as you > did for the type destroy in uverbs. I'm not sure what you want to do here. Why do we need a callback? The HW object should not need to be touched. What you need is a new ioctl entry point that clones nearly any uobject between ufile's. This should just be some general core code routine using the ANY object stuff. The trick here will be to refcount the HW object and figure out what destroy means. > 'clone' purpose is to copy the driver specific information to user from > existing ib_x object. The driver involvement should be in a general 'query_udata' entry point that returns the driver specific data for the HW object. If the driver can't do that then rdma-core can fail the operation. Clone is the wrong entry point as I really don't want to comtemplate cloning the HW object. Jason