DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jianfeng Tan <jianfeng.tan@intel.com>, dev@dpdk.org
Cc: santosh.shukla@caviumnetworks.com,
	sergio.gonzalez.monroy@intel.com, thomas@monjalon.net
Subject: Re: [dpdk-dev] [PATCH 1/2] eal: honor IOVA mode for no-huge case
Date: Tue, 31 Oct 2017 18:10:24 -0700	[thread overview]
Message-ID: <0210f78e-1a3a-aac0-0e85-aecd91d40a9c@intel.com> (raw)
In-Reply-To: <bbfb968e-e2df-8731-1d09-a69195118aba@intel.com>

On 10/31/2017 3:37 PM, Ferruh Yigit wrote:
> On 10/31/2017 2:49 PM, Ferruh Yigit wrote:
>> On 10/11/2017 3:33 AM, Jianfeng Tan wrote:
>>> With the introduction of IOVA mode, the only blocker to run
>>> with 4KB pages for NICs binding to vfio-pci, is that
>>> RTE_BAD_PHYS_ADDR is not a valid IOVA address.
>>>
>>> We can refine this by using VA as IOVA if it's IOVA mode.
>>>
>>> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
>>> ---
>>>  lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
>>> index 28bca49..187d338 100644
>>> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
>>> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
>>> @@ -1030,7 +1030,10 @@ rte_eal_hugepage_init(void)
>>>  					strerror(errno));
>>>  			return -1;
>>>  		}
>>> -		mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
>>> +		if (rte_eal_iova_mode() == RTE_IOVA_VA)
>>> +			mcfg->memseg[0].phys_addr = (uintptr_t)addr;
>>> +		else
>>> +			mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
>>
>> This breaks KNI which requires physical address.
> 
> My bad, this patch is for no_hugetlbfs case.
> 
> Issue seen starting from next patch in the set [1], which enables IOVA mode for
> Intel PMDs.
> 
> With IOVA mode enabled, KNI fails.
> 
> Does it make sense to add an API to set iova mode explicitly by application?
> Application can set iova to PA and allocate memzones it requires.

Added config option to disable IOVA mode detection:
http://dpdk.org/dev/patchwork/patch/31071/

Still concerned if this may hit someone, since the result for KNI is a kernel
crash it would be nice to have more solid protection here.

And suggestion welcome.

Thanks,
ferruh

> 
> [1]
> http://dpdk.org/commit/f37dfab2
> 
>>
>> Any idea how to disable RTE_IOVA_VA when KNI used?
>>
>>>  		mcfg->memseg[0].addr = addr;
>>>  		mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
>>>  		mcfg->memseg[0].len = internal_config.memory;
>>>
>>
> 

  reply	other threads:[~2017-11-01  1:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 10:33 [dpdk-dev] [PATCH 0/2] enable 4KB + VFIO-PCI Jianfeng Tan
2017-10-11 10:33 ` [dpdk-dev] [PATCH 1/2] eal: honor IOVA mode for no-huge case Jianfeng Tan
2017-10-11 11:27   ` Burakov, Anatoly
2017-10-11 11:30   ` santosh
2017-10-31 21:49   ` Ferruh Yigit
2017-10-31 22:37     ` Ferruh Yigit
2017-11-01  1:10       ` Ferruh Yigit [this message]
2017-10-11 10:33 ` [dpdk-dev] [PATCH 2/2] net: enable IOVA mode for PMDs Jianfeng Tan
2017-10-11 10:43   ` Burakov, Anatoly
2017-10-11 10:56     ` Tan, Jianfeng
2017-10-11 11:30   ` Burakov, Anatoly
2017-10-11 11:33   ` santosh
2018-01-05 10:32   ` Maxime Coquelin
2018-01-05 12:04     ` Maxime Coquelin
2018-01-05 12:10     ` santosh
2018-01-05 12:57       ` Maxime Coquelin
2017-10-11 10:47 ` [dpdk-dev] [PATCH 0/2] enable 4KB + VFIO-PCI Burakov, Anatoly
2017-10-11 10:50   ` Thomas Monjalon
2017-10-12 19:57 ` Ferruh Yigit

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=0210f78e-1a3a-aac0-0e85-aecd91d40a9c@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=santosh.shukla@caviumnetworks.com \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=thomas@monjalon.net \
    /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).