[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rdma
Subject:    Re: [PATCH for-next v1 4/4] IB/{core,hw}: ib_pd should not have ib_uobject pointer
From:       Shamir Rabinovitch <shamir.rabinovitch () oracle ! com>
Date:       2019-04-30 18:04:11
Message-ID: 20190430180410.GA30695 () srabinov-laptop
[Download RAW message or body]

On Tue, Apr 30, 2019 at 08:13:02PM +0300, Leon Romanovsky wrote:
> 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@oracle.com>
> > ---
> >  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

Hi Leon,

Why we drag the context into objects that do not need it? We already have
issue with objects that do need the context but at least we can drop this 
dependency from objects that do not need the context. 

What is the impact of removing this piece of the code and avoiding
such assumptions in the netlink for other ib_x objects?

Thanks
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic