From: Chuck Lever <chuck.lever@oracle.com>
To: Andre Tomt <andre@tomt.net>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
iommu@lists.linux-foundation.org
Subject: Re: [PATCH v2] xprtrdma: Fix DMA scatter-gather list mapping imbalance
Date: Wed, 12 Feb 2020 11:05:31 -0500 [thread overview]
Message-ID: <E4C9BADB-72EA-4F39-9837-675C7E7E2CCF@oracle.com> (raw)
In-Reply-To: <1d2693b1-b37f-c611-91c3-55b567be5274@tomt.net>
> On Feb 12, 2020, at 11:03 AM, Andre Tomt <andre@tomt.net> wrote:
>
> On 12.02.2020 14:48, Chuck Lever wrote:
>>> On Feb 12, 2020, at 8:43 AM, Chuck Lever <chuck.lever@oracle.com> wrote:
>>>
>>> The @nents value that was passed to ib_dma_map_sg() has to be passed
>>> to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses to
>>> concatenate sg entries, it will return a different nents value than
>>> it was passed.
>>>
>>> The bug was exposed by recent changes to the AMD IOMMU driver, which
>>> enabled sg entry concatenation.
>>>
>>> Looking all the way back to 4143f34e01e9 ("xprtrdma: Port to new
>>> memory registration API") and reviewing other kernel ULPs, it's not
>>> clear that the frwr_map() logic was ever correct for this case.
>>>
>>> Reported-by: Andre Tomt <andre@tomt.net>
>>> Suggested-by: Robin Murphy <robin.murphy@arm.com>
>>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>>> ---
>>> include/trace/events/rpcrdma.h | 6 ++++--
>>> net/sunrpc/xprtrdma/frwr_ops.c | 13 +++++++------
>>> 2 files changed, 11 insertions(+), 8 deletions(-)
>>>
>>> Hi Andre, here's take 2, based on the trace data you sent me.
>>> Please let me know if this one fares any better.
>>>
>>> Changes since v1:
>>> - Ensure the correct nents value is passed to ib_map_mr_sg
>>> - Record the mr_nents value in the MR trace points
> Verified working (with the patch correction) in my environment, with some quick testing (mount + some random and bulk I/O)
>
> client, 5.5.3 + patch + amd iommu on = OK
> client, 5.5.3 + patch + amd iommu off = OK
> client, 5.6-rc1 + patch + amd iommu on = OK
>
> server, 5.5.3 + patch + intel iommu on = OK
Very good! I'll submit the fix through the NFS tree ASAP, and request backport to v5.5 stable.
--
Chuck Lever
prev parent reply other threads:[~2020-02-12 16:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 13:43 [PATCH v2] xprtrdma: Fix DMA scatter-gather list mapping imbalance Chuck Lever
2020-02-12 13:48 ` Chuck Lever
2020-02-12 16:03 ` Andre Tomt
2020-02-12 16:05 ` Chuck Lever [this message]
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=E4C9BADB-72EA-4F39-9837-675C7E7E2CCF@oracle.com \
--to=chuck.lever@oracle.com \
--cc=andre@tomt.net \
--cc=iommu@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).