On Tue, Nov 10, 2015 at 05:41:47AM -0800, Christoph Hellwig wrote: > FYI, this is the API I'd aim for (only SRP and no HW driver converted > yet):
> n = ib_map_mr_sg(desc->mr, state->sg, state->sg_nents, > - dev->mr_page_size); > + dev->mr_page_size, > + /* > + * XXX: add a bool write argument to this function, > + * so that we only need to open up the required > + * permissions. > + */ > + IB_MR_REMOTE | IB_MR_RDMA_READ | > IB_MR_RDMA_WRITE); I would call it IB_RDMA_LKEY and IB_RDMA_RKEY. We have other places in the API where lkey/rkey is used and it makes a lot more sense to think about a MR as being either a lkey or rkey usable MR - since this is effectively what we are doing here with these ops. IB_MR_RKEY | IB_MR_RDMA_READ == The resulting key can be used in a wr.rdma.rkey field IB_MR_LKEY | IB_MR_SEND == The key can be used in wr.sg_list[].lkey etc It is an error to use a IB_MR_LKEY in a rkey field, etc.. > +enum ib_mr_flags { > + /* scope: either remote or local */ > + IB_MR_REMOTE, > + IB_MR_LOCAL, > + > + /* direction: one or both can be ORed into the scope above */ > + IB_MR_RDMA_READ = (1 << 10), > + IB_MR_RDMA_WRITE = (1 << 11) Don't forget SEND too. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html