DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Takeshi Yoshimura <tyos@jp.ibm.com>
Cc: dev <dev@dpdk.org>, drc@ibm.com, dpdk stable <stable@dpdk.org>,
	 David Christensen <drc@linux.vnet.ibm.com>
Subject: Re: [dpdk-dev] [PATCH] vfio: fix VFIO mapping failures in ppc64le
Date: Wed, 5 Feb 2020 22:04:07 +0100	[thread overview]
Message-ID: <CAJFAV8wBi2OT-GXXyQFgduSLxHFRyyGne6vs0mung9KSJ5-obg@mail.gmail.com> (raw)
In-Reply-To: <20200117042555.22567-1-tyos@jp.ibm.com>

On Fri, Jan 17, 2020 at 5:26 AM Takeshi Yoshimura <tyos@jp.ibm.com> wrote:
>
> ppc64le failed when using large physical memory. I found problems in my two
> commits in the past.

Let's hope this is not a "Jamais deux sans trois" ;-).
Since this problem is linked to your usage in SPDK, please test
against -rc2 and confirm this is ok.


>
> In commit e072d16f8920 ("vfio: fix expanding DMA area in ppc64le"), I added
> a sanity check using a mapped address to resolve an issue around expanding
> IOMMU window, but this was not enough, since memory allocation can return
> memory anywhere dependent on memory fragmentation. DPDK may still skip DMA
> mapping and attempts to unmap non-mapped DMA during expanding IOMMU window.
> As a result, SPDK apps using large physical memory frequently failed to
> proceed the communication with NVMe and/or went into an infinite loop.
>
> The root cause of the bug was in a gap between memory segments managed by
> DPDK and firmware-level DMA mapping. DPDK's memory segments don't contain
> the state of DMA mapping, and so, the memesg_walk cannot determine if an
> iterated memory segment is mapped or not. This resulted in incorrect DMA
> maps and unmaps.
>
> At this time, I added the code to avoid iterating non-mapped memory
> segments during DMA mapping. The memseg_walk iterates over memory segments
> marked as "used", and so, the code sets memory segments that will be
> mapped or unmapped as "free" transiently.
>
> The commit db90b4969e2e ("vfio: retry creating sPAPR DMA window") allows
> retring different page levels and sizes to create DMA window. However, this
> allows page sizes different from hugepage sizes. This inconsistency caused
> failures at the time of DMA mapping after the window creation. This patch
> fixes to retry only different page levels.
>
> Fixes: e072d16f8920 ("vfio: fix expanding DMA area in ppc64le")
> Fixes: db90b4969e2e ("vfio: retry creating sPAPR DMA window")

Cc: stable@dpdk.org

>
> Signed-off-by: Takeshi Yoshimura <tyos@jp.ibm.com>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>

Applied, thanks.



--
David Marchand


      parent reply	other threads:[~2020-02-05 21:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  4:25 Takeshi Yoshimura
2020-01-22 18:34 ` David Christensen
2020-02-05 21:04 ` David Marchand [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=CAJFAV8wBi2OT-GXXyQFgduSLxHFRyyGne6vs0mung9KSJ5-obg@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=drc@ibm.com \
    --cc=drc@linux.vnet.ibm.com \
    --cc=stable@dpdk.org \
    --cc=tyos@jp.ibm.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;
as well as URLs for NNTP newsgroup(s).