RE: [PATCH RFC 2/2] RDMA/isert: Support iWARP transport

Steve Wise
2015-06-25T19:44:59Z

> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Jason Gunthorpe
> Sent: Thursday, June 25, 2015 2:30 PM
> To: Steve Wise
> Cc: 'Hefty, Sean'; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org; orgerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org; 'Roi Dayan'
> Subject: Re: [PATCH RFC 2/2] RDMA/isert: Support iWARP transport
>
> On Thu, Jun 25, 2015 at 02:25:49PM -0500, Steve Wise wrote:
>
> > To stage the changes we could introduce a new function that returns
> > the needed ib_access_flags value given the desired opcodes. Then
> > have a series that changes all the existing ULPs to make use of this
> > new function.
>
> I wouldn't be afraid to add a new create_mr entry point that does the
> right thing, we can unexport/delete the old one when all kernel users
> are gone. Trivially the core can just have a default that translates
> based on iwarp/!iwarp for now.
>

Ignoring user MRs at this point, I think we would need a new entry point for creating dma mrs ala ib_get_dma_mr().

How defining MR "roles":

/**
* ib_mr_role - possible roles a MR will be used for
*
* This allows a transport independent RDMA application to
* create MRs that are usable for all the desired roles w/o
* having to understand which access rights are needed.
*/
enum ib_mr_role {
IB_MRR_RECV = 1,
IB_MRR_SEND = (1<<1),
IB_MRR_READ_SOURCE = (1<<2),
IB_MRR_READ_SINK = (1<<3),
IB_MRR_WRITE_SOURCE = (1<<4),
IB_MRR_WRITE_SINK = (1<<5),
/* probably more roles */
};

Then new entry point that will call ib_get_dma_mr() with the ib_access_flags required to handle the roles for the given device
protocol.

ib_get_dma_role_mr(struct ib_pd *pd, int mr_role_flags)