On Fri, Jul 10, 2015 at 12:09:37PM +0300, Sagi Grimberg wrote:
> And then provide helpers to populate the MR with generic kernel
> structures such as struct scatterlist (for scsi and other ULPs),
> struct page (for NFS) or struct bio_vec (for block ULPs later on).

Please stick to struct scatterlist for now.  Future block ULPs
will use that as well as the only way you can do a multi-page
DMA mapping is the scatterlist.  A page is just a subset of
an SGL, and we can map a page using a one element SGL trivial,
as we do in lots of places.

>          union {
>                  ...
>                  struct {
>                          struct ib_mr    *mr;
>                          u64             iova;
>                          u32             length;
>                          int             access_flags;
>                  } fast_reg;
>                  ...
>          } wr;
>          ...
> };
> 
> We can consider moving the iova and length to the population helpers.
> Wasn't sure what is better...

Move it to the population helpers.  The walk done in them is used to
generate those values anyway, so there is no need to expose them in
any sort of public API.  I'd also move the access_flags initialization
to the helpers, leaving post to do just that:  post an alredy
initialized mr structure.
--
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

Reply via email to