RE: [PATCH v3 rdma-next 08/10] RDMA/nldev: provide detailed MR information

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

 



> 
> On Tue, Feb 27, 2018 at 04:21:36PM -0600, Steve Wise wrote:
> > >
> > > On Mon, Feb 26, 2018 at 03:22:42PM -0800, Steve Wise wrote:
> > >
> > > > +static int fill_res_mr_entry(struct sk_buff *msg, struct
> > netlink_callback
> > > *cb,
> > > > +			     struct rdma_restrack_entry *res,
uint32_t port)
> > > > +{
> > > > +	struct ib_mr *mr = container_of(res, struct ib_mr, res);
> > > > +	struct nlattr *entry_attr;
> > > > +
> > > > +	entry_attr = nla_nest_start(msg,
> > > RDMA_NLDEV_ATTR_RES_MR_ENTRY);
> > > > +	if (!entry_attr)
> > > > +		goto out;
> > > > +
> > > > +	if (netlink_capable(cb->skb, CAP_NET_ADMIN)) {
> > > > +		if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_RKEY, mr-
> > > >rkey))
> > > > +			goto err;
> > > > +		if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_LKEY, mr-
> > > >lkey))
> > > > +			goto err;
> > > > +		if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_RES_IOVA,
> > > > +				      mr->iova, 0))
> > >
> > > ?? is '0' right here? Expecting a defined attribute constant for
padding.
> >
> >
> > What does the pad do exactly?  I replicated other code I saw that use 0
for
> > the pad.  But I can add a NLDEV_ATTR_RES_PAD if that is the correct way
to
> > go.
> 
> Sometimes netlink will try to align the u64s to 8 bytes in the skb. If
> it needs to make an alignment adjustment then it stuffs a dummy
> attribute with the given ID. The ID should never be used for any other
> attribute and must be ignored by userspace.
> 
> Safest to put it in the general enum to ensure it isn't re-used.
> 
> > > > +	if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_PGSIZE, mr-
> > > >page_size))
> > > > +		goto err;
> > >
> > > Still not really sure what pgsize is supposed to be, I think we should
> > > drop it??
> > >
> >
> > Let us say we register a MR that has a backing memory scattergather list
of
> > 10 64KB entries, each 64KB entry, though, is physically contiguous.
The
> > page-size for that registration, then can be 64KB even though the host
page
> > size is 4KB.  So the page list for the registration with the rdma device
can
> > be 10 64K entries, each of size 64KB...
> 
> So what is the value?
> 
> 'max contiguous page size' of any page in the registration or 'min
> contiguous page size' of any page in the registration?
> 
> Seems like it needs a better name at least..
> 
> Jason

All "pages" in the REG_MR page list are of the same size.  So pgsize is the
size of each entry...



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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