DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vikas Gupta <vikas.gupta@broadcom.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>, dev@dpdk.org
Cc: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>,
	 Vikram Prakash <vikram.prakash@broadcom.com>
Subject: Re: [dpdk-dev] Issue with VFIO/IOMMU
Date: Mon, 7 Sep 2020 19:01:10 +0530
Message-ID: <4774f1c16093c58e7f93f339f65f42cd@mail.gmail.com> (raw)
In-Reply-To: <828830f7-8f39-72e4-2f64-c20f6b56d8a9@intel.com>

 RE: [dpdk-dev] Issue with VFIO/IOMMU

Hi Burakov,

-----Original Message-----
From: Burakov, Anatoly [mailto:anatoly.burakov@intel.com
<anatoly.burakov@intel.com>]
Sent: Friday, September 04, 2020 7:20 PM
To: Vikas Gupta <vikas.gupta@broadcom.com>; dev@dpdk.org
Cc: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>; Vikram Prakash <
vikram.prakash@broadcom.com>
Subject: Re: [dpdk-dev] Issue with VFIO/IOMMU

On 03-Sep-20 12:09 PM, Vikas Gupta wrote:

> Hi,

>

>    I observe an issue with IOVA address returned by api

> rte_memzone_reserve_aligned (flags= RTE_MEMZONE_IOVA_CONTIG) used for

> queue memory allocation. With high level debugging, I notice that IOVA

> address returned in mz->iova is not mapped by VFIO_IOMMU_MAP_DMA so in

> turn SMMU exception is seen.

I'm not sure i follow.

How did you determine that to be the case, given that, by your own
admission below, `vfio_type1_dma_mem_map` function is executed several
times?

[Vikas]:

I`ll mention map and unmap as below in explaining through one of the example

map = function vfio_type1_dma_mem_map called with argument do_map = 1

unamp = function  type1_dma_mem_map  called with argument do_map = 0

What I notice that for some particular address received in mz->iova, after
rte_memzone_reserve_aligned is successfully returned, the map function
(vfio_type1_dma_mem_map do_map =1) was not called prior to return of
function rte_memzone_reserve_aligned.

Below is one of the sequence to understand.

Let’s say there is an address ‘*iova_fail’*, for which exception is raised
by SMMU while dpdk-test runs with Crypto PMD.

When dpdk-test is run with Crypto test suit I see that for an address*
iova_fail* several times vfio_type1_dma_mem_map is called with (do_map =
0/1 with length = 2MB). I believe this happens due to call for memory
allocation/free for buffers/queues. The test runs fine as long as the map
is called before rte_memzone_reserve_aligned returns and similarly for
unmap when same memory is freed. But after several times with map/unmap for*
iova_fail*, map is NOT called before rte_memzone_reserve_aligned is retuned
though iova_fail was previously unmapped. Since it’s not mapped, SMMU
raises an exception.

Please note issue is not frequently visible and might reproduce after
pmd_crypto_autotest is run multiple times over dpdk-test.

If you are not able to follow I`ll try to send the debug printfs for test.

Thanks,

Vikas

>

>

>

> *Details for the setup*

>

> Platform: Armv8 (Broadcom Stingray)

>

> DPDK release: DPDK 20.08 <http://fast.dpdk.org/rel/dpdk-20.08.tar.xz>

>

> PMD patch:

>

> https://patches.dpdk.org/project/dpdk/list/?series=&submitter=1907&sta

> te=&q=&archive=&delegate=

>

> dpdk-test is launched using below command

>

> *dpdk-test --vdev <cryptopmd_name> -w 0000:00:00.0 --iova-mode pa *

>

>

>

> The test suite is launched over dpdk-test application command prompt

> using command ‘cryptodev_<cryptopmd_name>_autotest’

>

> The issue is seen when several iterations of above test_suite is

> executed which in turn do multiple calls to

> rte_memzone_reserve_aligned, rte_mempool_create and rte_memzone_free,
rte_mempool_free.

>

>   Function *vfio_type1_dma_mem_map* with map/unmap event is executed

> several times during test_suite run.

>

>

>

> Any inputs would be helpful.

>

>

>

> Thanks,

>

> Vikas

>

--

Thanks,

Anatoly

  reply	other threads:[~2020-09-07 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 11:09 Vikas Gupta
2020-09-04 13:50 ` Burakov, Anatoly
2020-09-07 13:31   ` Vikas Gupta [this message]
2020-09-07 15:43     ` Burakov, Anatoly

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=4774f1c16093c58e7f93f339f65f42cd@mail.gmail.com \
    --to=vikas.gupta@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=vikram.prakash@broadcom.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git