On Tue, Apr 30, 2019 at 05:23:24PM +0300, Shamir Rabinovitch wrote: > future patches will add the ability to share ib_pd across multiple > ib_ucontext. given that, ib_pd will be pointed by 1 or more ib_uobject. > thus, having ib_uobject pointer in ib_pd is incorrect. > > Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx> > --- > drivers/infiniband/core/nldev.c | 5 ----- > drivers/infiniband/core/uverbs_cmd.c | 1 - > drivers/infiniband/core/verbs.c | 1 - > drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 - > drivers/infiniband/hw/mlx5/main.c | 1 - > drivers/infiniband/hw/mthca/mthca_qp.c | 3 ++- > include/rdma/ib_verbs.h | 1 - > 7 files changed, 2 insertions(+), 11 deletions(-) > > diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c > index bced945a456d..f8a325d8082c 100644 > --- a/drivers/infiniband/core/nldev.c > +++ b/drivers/infiniband/core/nldev.c > @@ -606,11 +606,6 @@ static int fill_res_pd_entry(struct sk_buff *msg, bool has_cap_net_admin, > if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_PDN, res->id)) > goto err; > > - if (!rdma_is_kernel_res(res) && > - nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CTXN, > - pd->uobject->context->res.id)) > - goto err; > - Definitely not, in current code, PD is not shared and connected to ucontext, users need to continue to see it. There are multiple ways to return multiple contextes for shared PD: 1. Return multiple fill_res_pd_entry() for every shared PD, but with different context ID. 2. Create nested context ID and return list here. Thanks