Re: [PATCH for-next v2 3/4] RDMA/nldev: ib_pd can be pointed by multiple ib_ucontext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 20, 2019 at 06:37:39PM +0300, Shamir Rabinovitch wrote:
> On Mon, May 20, 2019 at 03:05:29PM +0300, Leon Romanovsky wrote:
> > On Mon, May 20, 2019 at 02:50:10PM +0300, Shamir Rabinovitch wrote:
> > > On Mon, May 20, 2019 at 12:18:40PM +0300, Leon Romanovsky wrote:
> > > > On Mon, May 20, 2019 at 10:53:20AM +0300, Shamir Rabinovitch wrote:
> >
> > >
> > > > > +	if (!rdma_is_kernel_res(res)) {
> > > > > +		pd_context(pd, &pd_context_ids);
> > > > > +		list_for_each_entry(ctx_id, &pd_context_ids, list) {
> > > > > +			if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CTXN,
> > > > > +				ctx_id->id))
> > > >
> > > > Did it work? You are overwriting RDMA_NLDEV_ATTR_RES_CTXN entry in the
> > > > loop. You need to add RDMA_NLDEV_ATTR_RES_CTX and
> > > > RDMA_NLDEV_ATTR_RES_CTX_ENTRY to include/uapi/rdma_netlink.h and
> > > > open nested table here (inside of PD) with list of contexts.
> > >
> > > I tested with only 1 context per pd (what we have today). Thanks for
> > > comment. I'll try to follow what you wrote here.
> > >
>
> Leon, what is your expectation here? I see 2 options:
>
> 1. Code will build same NL message in case of single context id and
> nested table in case of multiple context ids
>
> 2. Code always build nested table with context id(s)
>
> If taking option (1) we can postpone the iproute2 matching commits to
> some extent but if we take option (2) I guess I have to add iproute2
> commits as well - right?

Yes, I imagined option 1 back then. The nested table inside of PD will
clearly mark that it is "shared PD" and rdmatool already handles
situation where no CTX is provided.

So you will have three options:
1. CTX is provided, no nested - user space PD - rdmatool supports it.
2. CTX is not provided, no nested - kernel space PD - rdmatool supports it by simply not printing cntx number.
3. CTX is not provided, nested table exists - shared PD - legacy rdmatool will think that we are in #2 and new
rdmatool will print list. This nested table should exist once PD in shared mode. I don't know if shared PD can
be with one context ID, but anyway it needs to be in nested table.

>
> Also, what's the best way to add the changes in both given what you
> choose above?

Patch plan?

>
> Thanks



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux