From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: Chuck Lever <chuck.lever@oracle.com>, Sagi Grimberg <sagig@mellanox.com>
Cc: linux-rdma@vger.kernel.org,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v3 12/26] xprtrdma: Port to new memory registration API
Date: Sat, 10 Oct 2015 04:06:29 +0300 [thread overview]
Message-ID: <56186495.6060309@dev.mellanox.co.il> (raw)
In-Reply-To: <87F3CC02-2979-4C6B-990A-C31C52790ABC@oracle.com>
>> out_list_err:
>> - rc = PTR_ERR(f->fr_pgl);
>> + rc = -ENOMEM;
>> dprintk("RPC: %s: ib_alloc_fast_reg_page_list status %i\n”,
>
> Should you update this debugging message?
Yes I will.
>> + n = ib_map_mr_sg(mr, frmr->sg, frmr->sg_nents, PAGE_SIZE);
>> + if (unlikely(n != frmr->sg_nents)) {
>
> The basic logic looks OK. But signed v. unsigned comparison here?
> Is there a guarantee that the maximum value sg_nents can have is
> INT_MAX?
>
> i and n are signed, sg_nents is unsigned. I’d prefer to have
> the variable signage all agree. Since we’re counting stuff,
> maybe unsigned all around is a better choice? (rc should
> remain signed).
OK, I'll make i, n, len unsigned integers.
>
> If ib_map_mr_sg can return a negative value, maybe “rc = ib_map_mr_sg”
> is more clear. Is n used anywhere else?
Nop.
>
> Use %u formatter for displaying unsigned variables.
>
>
>> + pr_err("RPC: %s: failed to map mr %p (%d/%d)\n",
>> + __func__, frmr->fr_mr, n, frmr->sg_nents);
>> + rc = n < 0 ? n : -EINVAL;
>> + goto out_senderr;
>
> Is frmr->sg_nents set correctly here for the ib_dma_unmap_sg()
> call in the error exit? Maybe you want to use the value in
> “n” instead (as long as it’s positive, of course).
Umm, I think that frmr->sg_nents is assigned before the unmap is even
reachable (we assign before mapping because we won't take partial
maapings at least for now).
I'll be waiting for more comments before posting v4.
Cheers,
Sagi.
next prev parent reply other threads:[~2015-10-10 1:06 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 7:50 [PATCH v3 00/26] New fast registration API Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 01/26] IB/core: Introduce new " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 02/26] IB/mlx5: Remove dead fmr code Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 03/26] IB/mlx5: Support the new memory registration API Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 04/26] IB/mlx4: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 05/26] RDMA/ocrdma: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 06/26] RDMA/cxgb3: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 07/26] iw_cxgb4: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 08/26] IB/qib: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 09/26] RDMA/nes: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 10/26] IB/iser: Port to new fast " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 11/26] iser-target: Port to new memory " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 12/26] xprtrdma: " Sagi Grimberg
2015-10-08 15:24 ` Anna Schumaker
2015-10-08 15:56 ` Chuck Lever
2015-10-10 1:06 ` Sagi Grimberg [this message]
2015-10-08 20:26 ` Or Gerlitz
2015-10-08 7:50 ` [PATCH v3 13/26] svcrdma: " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 14/26] RDS/IW: Convert " Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 15/26] IB/srp: Split srp_map_sg Sagi Grimberg
2015-10-08 7:50 ` [PATCH v3 16/26] IB/srp: Convert to new registration API Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 17/26] IB/srp: Remove srp_finish_mapping Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 18/26] IB/srp: Dont allocate a page vector when using fast_reg Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 19/26] IB/mlx5: Remove old FRWR API support Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 20/26] IB/mlx4: " Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 21/26] RDMA/ocrdma: Remove old FRWR API Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 22/26] RDMA/cxgb3: " Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 23/26] iw_cxgb4: " Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 24/26] IB/qib: " Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 25/26] RDMA/nes: " Sagi Grimberg
2015-10-08 7:51 ` [PATCH v3 26/26] IB/core: Remove old fast registration API Sagi Grimberg
2015-10-08 8:01 ` [PATCH v3 00/26] New " Christoph Hellwig
2015-10-08 8:21 ` Sagi Grimberg
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=56186495.6060309@dev.mellanox.co.il \
--to=sagig@dev.mellanox.co.il \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sagig@mellanox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox