RE: [PATCH V3 1/5] RDMA/core: Transport-independent access flags

Steve Wise
2015-07-07T14:17:01Z

> -----Original Message-----
> From: linux-nfs-owner@vger.kernel.org [mailto:linux-nfs-owner@vger.kernel.org] On Behalf Of Haggai Eran
> Sent: Monday, July 06, 2015 2:09 AM
> To: Steve Wise; dledford@redhat.com
> Cc: sagig@mellanox.com; ogerlitz@mellanox.com; roid@mellanox.com; linux-rdma@vger.kernel.org; eli@mellanox.com; target-
> devel@vger.kernel.org; linux-nfs@vger.kernel.org; trond.myklebust@primarydata.com; bfields@fieldses.org
> Subject: Re: [PATCH V3 1/5] RDMA/core: Transport-independent access flags
>
> On 06/07/2015 02:22, Steve Wise wrote:
> > +int rdma_device_access_flags(struct ib_pd *pd, int roles, int attrs)
> > +{
> > + int access_flags = attrs;
> > +
> > + if (roles & RDMA_MRR_RECV)
> > + access_flags |= IB_ACCESS_LOCAL_WRITE;
> > +
> > + if (roles & RDMA_MRR_WRITE_DEST)
> > + access_flags |= IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_WRITE;
> > +
> > + if (roles & RDMA_MRR_READ_DEST) {
> > + access_flags |= IB_ACCESS_LOCAL_WRITE;
> > + if (rdma_protocol_iwarp(pd->device,
> > + rdma_start_port(pd->device)))
> > + access_flags |= IB_ACCESS_REMOTE_WRITE;
> > + }
> > +
> > + if (roles & RDMA_MRR_READ_SOURCE)
> > + access_flags |= IB_ACCESS_REMOTE_READ;
> > +
> > + if (roles & RDMA_MRR_ATOMIC_DEST)
> > + access_flags |= IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_ATOMIC;
>
> I think you need LOCAL_WRITE for ATOMIC_SOURCE in order to receive the
> results of the atomic operation.
>

Where/how are the results returned? In a recv completion? If so, then that MR would need RDMA_MRR_RECV, not RDMA_MRR_ATOMIC_SOURCE.