On Mon, Nov 12, 2018 at 10:59:52PM +0200, Leon Romanovsky wrote: > From: Jason Gunthorpe <jgg@xxxxxxxxxxxx> > > We have many cases where parts of the uapi are not supported in a driver, > needs a certain protocol, or whatever. It is best to reflect this directly > into the struct uverbs_api when it is built so that everything is simply > blocked off, and future introspection can report a proper supported list. > > This is done by adding some additional helpers to the definition list > language that disable objects based on a 'supported' call back, and a > helper that disables based on a NULL struct ib_device function pointer. > > Disablement is global. For instance, if a driver disables an object then > everything connected to that object is removed, including core methods. > > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > + if (!attr_elm->spec.mandatory) > + continue; > + obj_key = uapi_get_obj_id(&attr_elm->spec); > + if (obj_key == UVERBS_API_KEY_ERR) > + continue; > + tmp_obj = uapi_get_object(uapi, obj_key); > + if (IS_ERR(tmp_obj)) { > + if (PTR_ERR(tmp_obj) == -ENOMSG) > + continue; > + } else { > + if (!tmp_obj->disabled) > + continue; > + } This is a rebasing error, in rdma.git for-next uapi_get_object() returns NULL, not ERR_PTR, I fixed it, but you'll need to move this hunk to where it belongs in your queue.. Jason