On Wed, Jul 22, 2015 at 09:50:12AM -0700, Christoph Hellwig wrote:
> > +/**
> > + * ib_map_mr_sg() - Populates MR with a dma mapped SG list
> > + * @mr: memory region
> > + * @sg: dma mapped scatterlist
> > + * @sg_nents: number of entries in sg
> > + * @access: access permissions
>
> I know moving the access flags here was my idea originally, but I seem
> convinced by your argument that it might fit in better with the posting
> helper. Or did someone else come up with a better argument that mine
> for moving it here?
I was hoping we'd move the DMA flush and translate into here and make
it mandatory. Is there any reason not to do that?
> > +int ib_map_mr_sg(struct ib_mr *mr,
> > + struct scatterlist *sg,
> > + unsigned short sg_nents,
> > + unsigned int access)
> > +{
> > + int rc;
> > +
> > + if (!mr->device->map_mr_sg)
> > + return -ENOSYS;
> > +
> > + rc = mr->device->map_mr_sg(mr, sg, sg_nents);
>
> Do we really need a driver callout here? It seems like we should
The call out makes sense to me..
The driver will convert the scatter list directly into whatever HW
representation it needs and prepare everything for posting. Every
driver has a different HW format, so it must be a callout.
> Also it seems like this returns 0/-error. How do callers like SRP
> see that it only did a partial mapping and it needs another MR?
I would think it is an error to pass in more sg_nents than the MR was
created with, so SRP should never get a partial mapping as it should
never ask for more than max_entries.
(? Sagi, did I get the intent of this right?)
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html