From: Tom Tucker <tom@opengridcomputing.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 05/10] svcrdma: Modify post recv path to use local dma key
Date: Thu, 25 Sep 2008 08:36:29 -0500 [thread overview]
Message-ID: <48DB93DD.6040005@opengridcomputing.com> (raw)
In-Reply-To: <20080924203111.GC10841@fieldses.org>
J. Bruce Fields wrote:
> On Tue, Sep 16, 2008 at 06:34:34AM -0500, Tom Tucker wrote:
>> Update the svc_rdma_post_recv routine to use the adapter's global LKEY
>> instead of sc_phys_mr which is only valid when using a DMA MR.
>>
>> Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
>>
>> ---
>> net/sunrpc/xprtrdma/svc_rdma_transport.c | 10 +++++++---
>> 1 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> index b8c642d..a61caa7 100644
>> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> @@ -476,7 +476,7 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt)
>> struct ib_recv_wr recv_wr, *bad_recv_wr;
>> struct svc_rdma_op_ctxt *ctxt;
>> struct page *page;
>> - unsigned long pa;
>> + dma_addr_t pa;
>> int sge_no;
>> int buflen;
>> int ret;
>> @@ -488,13 +488,17 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt)
>> BUG_ON(sge_no >= xprt->sc_max_sge);
>> page = svc_rdma_get_page();
>> ctxt->pages[sge_no] = page;
>> - atomic_inc(&xprt->sc_dma_used);
>> pa = ib_dma_map_page(xprt->sc_cm_id->device,
>> page, 0, PAGE_SIZE,
>> DMA_FROM_DEVICE);
>> + if (ib_dma_mapping_error(xprt->sc_cm_id->device, pa)) {
>> + svc_rdma_put_context(ctxt, 1);
>> + return -ENOMEM;
>> + }
>
> Might be a tad nicer to do a "goto out_put_ctx" here and consolidate the
> cleanup with the similar cleanup done after the later ib_post_recv
> failure.
>
Yes it would.
> --b.
>
>> + atomic_inc(&xprt->sc_dma_used);
>> ctxt->sge[sge_no].addr = pa;
>> ctxt->sge[sge_no].length = PAGE_SIZE;
>> - ctxt->sge[sge_no].lkey = xprt->sc_phys_mr->lkey;
>> + ctxt->sge[sge_no].lkey = xprt->sc_dma_lkey;
>> buflen += PAGE_SIZE;
>> }
>> ctxt->count = sge_no;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-09-25 13:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1221564879-85046-1-git-send-email-tom@opengridcomputing.com>
[not found] ` <1221564879-85046-2-git-send-email-tom@opengridcomputing.com>
2008-09-24 19:11 ` [PATCH 01/10] svcrdma: Add Fast Reg MR Data Types J. Bruce Fields
2008-09-25 14:27 ` Tom Tucker
[not found] ` <1221564879-85046-3-git-send-email-tom@opengridcomputing.com>
2008-09-24 19:45 ` [PATCH 02/10] svcrdma: Add FRMR get/put services J. Bruce Fields
2008-09-25 14:25 ` Tom Tucker
2008-09-25 14:44 ` J. Bruce Fields
2008-09-25 20:31 ` Tom Tucker
[not found] ` <1221564879-85046-4-git-send-email-tom@opengridcomputing.com>
2008-09-24 20:10 ` [PATCH 03/10] svcrdma: Query device for Fast Reg support during connection setup J. Bruce Fields
2008-09-25 14:08 ` Tom Tucker
[not found] ` <1221564879-85046-5-git-send-email-tom@opengridcomputing.com>
2008-09-24 20:25 ` [PATCH 04/10] svcrdma: Add a service to register a Fast Reg MR with the device J. Bruce Fields
2008-09-25 13:31 ` Tom Tucker
[not found] ` <1221564879-85046-6-git-send-email-tom@opengridcomputing.com>
2008-09-24 20:31 ` [PATCH 05/10] svcrdma: Modify post recv path to use local dma key J. Bruce Fields
2008-09-25 13:36 ` Tom Tucker [this message]
[not found] ` <1221564879-85046-7-git-send-email-tom@opengridcomputing.com>
[not found] ` <1221564879-85046-8-git-send-email-tom@opengridcomputing.com>
[not found] ` <1221564879-85046-9-git-send-email-tom@opengridcomputing.com>
[not found] ` <1221564879-85046-10-git-send-email-tom@opengridcomputing.com>
[not found] ` <1221564879-85046-11-git-send-email-tom@opengridcomputing.com>
2008-09-24 21:21 ` [PATCH 10/10] svcrdma: Documentation update for the FastReg memory model J. Bruce Fields
2008-09-25 13:35 ` Tom Tucker
2008-09-26 16:01 ` Talpey, Thomas
[not found] ` <RTPCLUEXC2-PRDGryWt0000003c-rtwIt2gI0FxT+ZUat5FNkAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2008-09-30 2:59 ` Tom Tucker
2008-09-26 23:40 ` J. Bruce Fields
2008-09-30 3:07 ` Tom Tucker
2008-09-30 18:44 ` J. Bruce Fields
2008-09-30 18:55 ` Tom Tucker
2008-09-30 18:57 ` J. Bruce Fields
2008-09-30 20:17 ` Tom Tucker
2008-10-01 16:17 ` J. Bruce Fields
2008-10-02 0:38 ` Tom Tucker
2008-09-30 19:04 ` Talpey, Thomas
[not found] ` <RTPCLUEXC2-PRDgFrYI00000094-rtwIt2gI0FxT+ZUat5FNkAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2008-10-01 18:26 ` J. Bruce Fields
2008-10-01 19:18 ` Talpey, Thomas
[not found] ` <RTPCLUEXC2-PRDVjCRG000000bb-rtwIt2gI0FxT+ZUat5FNkAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2008-10-01 19:23 ` Talpey, Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DB93DD.6040005@opengridcomputing.com \
--to=tom@opengridcomputing.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.