On 7/16/2015 9:08 PM, Jason Gunthorpe wrote:
On Thu, Jul 16, 2015 at 03:21:04PM +0300, Sagi Grimberg wrote:
I gotta say,
these suggestions of bool/write or supported_ops with a convert helper
seem (to me at least) to make things more complicated.
Why not just set the the access_flags as they are?
I want local use?
set IB_ACCESS_LOCAL_WRITE
I want a peer to read from me?
set IB_ACCESS_REMOTE_READ
I want a peer to write to me?
IB_ACCESS_REMOTE_WRITE
...
isn't it much simpler?
I don't have a really strong preference, but I like the idea of using
the OP names because it means the API cannot be used wrong.
Ie this, is absolutely wrong:
rdma_map_sg_lkey(..,IB_ACCESS_REMOTE_READ);
But this:
rdma_map_sg_lkey(..,IB_ACCESS_REMOTE_WRITE);
Is only wrong on IB.
While,
rdma_map_sg_lkey(..,RDMA_OP_RDMA_READ)
Is always right, and can never be used wrong, and thus is less
complicated (for the ULP).
I was thinking that the user won't explicitly say which key it registers
and it will be decided from the registration itself.
Meaning, the registration code will do:
if (access | (IB_ACCESS_REMOTE_READ | IB_ACCESS_REMOTE_WRITE)
register rkey...
else
register lkey...
Will that work with iWARP? or will this break because
iWARP needs REMOTE_WRITE for lkeys?
--
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