Return-Path: Received: from mail-wi0-f181.google.com ([209.85.212.181]:36322 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbbDHIvg (ORCPT ); Wed, 8 Apr 2015 04:51:36 -0400 Received: by wizk4 with SMTP id k4so46540238wiz.1 for ; Wed, 08 Apr 2015 01:51:35 -0700 (PDT) Message-ID: <5524EC14.9030304@profitbricks.com> Date: Wed, 08 Apr 2015 10:51:32 +0200 From: Michael Wang MIME-Version: 1.0 To: Jason Gunthorpe , Tom Talpey CC: Roland Dreier , Sean Hefty , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, Hal Rosenstock , Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Upinder Malhi , Trond Myklebust , "J. Bruce Fields" , Ira Weiny , PJ Waskiewicz , Tatyana Nikolova , Or Gerlitz , Jack Morgenstein , Haggai Eran , Ilya Nelkenbaum , Yann Droneaud , Bart Van Assche , Shachar Raindel , Sagi Grimberg , Devesh Sharma , Matan Barak , Moni Shoua , Jiri Kosina , Selvin Xavier , Mitesh Ahuja , Li RongQing , Rasmus Villemoes , Alex Estrin , Doug Ledford , Eric Dumazet , Erez Shitrit , Tom Gundersen , Chuck Lever Subject: Re: [PATCH v2 09/17] IB/Verbs: Use helper cap_read_multi_sge() and reform svc_rdma_accept() References: <5523CCD5.6030401@profitbricks.com> <5523CEE4.5060901@profitbricks.com> <5523FBF1.80304@talpey.com> <20150407174223.GB15704@obsidianresearch.com> In-Reply-To: <20150407174223.GB15704@obsidianresearch.com> Content-Type: text/plain; charset=windows-1252 Sender: linux-nfs-owner@vger.kernel.org List-ID: On 04/07/2015 07:42 PM, Jason Gunthorpe wrote: [snip] >>> @@ -992,8 +992,8 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) >>> dma_mr_acc = IB_ACCESS_LOCAL_WRITE; >>> } else >>> need_dma_mr = 0; >>> - break; >>> - case RDMA_TRANSPORT_IB: >>> + } else if (rdma_ib_mgmt(newxprt->sc_cm_id->device, >>> + newxprt->sc_cm_id->port_num)) { >>> if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)) { >>> need_dma_mr = 1; >>> dma_mr_acc = IB_ACCESS_LOCAL_WRITE; >> >> Now I'm even more confused. How is the presence of IB management >> related to needing a privileged lmr? > > Agree, this needs to be someone else. > > I think the test is probably based on this comment: > > * NB: iWARP requires remote write access for the data sink > * of an RDMA_READ. IB does not. > > So the if should be: > > if (cap_rdma_read_needs_write(..) && > !(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)) { > need_dma_mr = 1; > dma_mr_acc = > (IB_ACCESS_LOCAL_WRITE | > IB_ACCESS_REMOTE_WRITE); > > And the identical if blocks merged. > > Plus the > if (rdma_transport_iwarp(newxprt->sc_cm_id->device, > newxprt->sc_cm_id->port_num)) > newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV Sounds good :-) I'll give this part a reform in next version. Regards, Michael Wang > > Jason >