DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Christensen <drc@linux.vnet.ibm.com>
To: Takeshi Yoshimura <tyos@jp.ibm.com>, dev@dpdk.org
Cc: drc@ibm.com
Subject: Re: [dpdk-dev] [PATCH] vfio: fix VFIO mapping failures in ppc64le
Date: Wed, 22 Jan 2020 10:34:53 -0800	[thread overview]
Message-ID: <024a05ec-039a-e3ee-fa06-9e029805a32c@linux.vnet.ibm.com> (raw)
In-Reply-To: <20200117042555.22567-1-tyos@jp.ibm.com>

> ppc64le failed when using large physical memory. I found problems in my two
> commits in the past.
> 
> 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")
> 
> Signed-off-by: Takeshi Yoshimura <tyos@jp.ibm.com>
> ---

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

  reply	other threads:[~2020-01-22 18:35 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 [this message]
2020-02-05 21:04 ` David Marchand

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=024a05ec-039a-e3ee-fa06-9e029805a32c@linux.vnet.ibm.com \
    --to=drc@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=drc@ibm.com \
    --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).