On Tue, Nov 10, 2015 at 11:25:46AM -0700, Jason Gunthorpe wrote: > I like this, my only comment is we should have a rdma_cap for this > behavior, rdma_cap_needs_rdma_read_mr(pd) or something?
Yes, that's better than checking the protocol. > > + if (!(dev->device_cap_flags & > > IB_DEVICE_MEM_MGT_EXTENSIONS)) { > > Lets enforce this in the core, if rdma_cap_needs_rdma_read_mr is set > the the device must also set IB_DEVICE_MEM_MGT_EXTENSIONS, check at > device creation time. The iWarp verbs spec requires them to be supported, so that should not be an issue. > > + } else if (rdma_ib_or_roce(dev, newxprt->sc_cm_id->port_num)) { > > + /* > > + * For IB or RoCE life is easy, no unsafe write access is > > + * required and multiple SGEs are supported, so we don't need > > + * to use MRs. > > + */ > > + newxprt->sc_reader = rdma_read_chunk_lcl; > > + } else { > > + /* > > + * Neither iWarp nor IB-ish, we're out of luck. > > + */ > > goto errout; > > No need for the else, !rdma_cap_needs_rdma_read_mr means pd->local_dma_lkey > is okay > to use. What would happen if someone tried to use NFS on usnic without this? -- 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