DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Tan, Jianfeng" <jianfeng.tan@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Santosh Shukla <santosh.shukla@caviumnetworks.com>
Subject: Re: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default
Date: Wed, 1 Nov 2017 00:29:07 -0700	[thread overview]
Message-ID: <0cc520ff-46c0-e291-755d-acbdacf7bdc0@intel.com> (raw)
In-Reply-To: <ED26CBA2FAD1BF48A8719AEF02201E3651338AD1@SHSMSX103.ccr.corp.intel.com>

On 10/31/2017 11:37 PM, Tan, Jianfeng wrote:
> 
> 
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, November 1, 2017 2:33 PM
>> To: Tan, Jianfeng; Thomas Monjalon; Richardson, Bruce; Gonzalez Monroy,
>> Sergio
>> Cc: dev@dpdk.org; Santosh Shukla
>> Subject: Re: [PATCH] eal: disable IOVA mode detection by default
>>
>> On 10/31/2017 7:17 PM, Tan, Jianfeng wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Yigit, Ferruh
>>>> Sent: Wednesday, November 1, 2017 9:07 AM
>>>> To: Thomas Monjalon; Richardson, Bruce; Gonzalez Monroy, Sergio
>>>> Cc: dev@dpdk.org; Yigit, Ferruh; Tan, Jianfeng; Santosh Shukla
>>>> Subject: [PATCH] eal: disable IOVA mode detection by default
>>>>
>>>> Fix kernel crash with KNI because KNI requires physical addresses.
>>>>
>>>> A config option introduced to disable IOVA mode detection and to set it
>>>> to physical address by default. Disabling config option will enable IOVA
>>>> mode detection.
>>>>
>>>> When there is no intension to use KNI, it is safe to enable detection.
>>>>
>>>> Config option disable IOVA mode detection by default to be sure only
>> who
>>>> is aware of result enable it.
>>>>
>>>> Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy")
>>>>
>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> ---
>>>> Cc: Jianfeng Tan <jianfeng.tan@intel.com>
>>>> Cc: Santosh Shukla <santosh.shukla@caviumnetworks.com>
>>>> Cc: Thomas Monjalon <thomas@monjalon.net>
>>>
>>> Refer to how vhost-kernel works, we may leverage a memory region table
>> to do the translation. The bad side is it's less efficient than current
>> phys_to_virt.
>>
>> Hi Jianfeng,
>>
>> Can you please elaborate?
> 
> It is very similar to what Jacob proposed (KNI IOMMU).
> 1. Share memsegs (memory regions) with KNI, some pairs of (userspace_addr, length).
> 2. KNI maintains an address translation table, (userspace_addr, length, kernel_addr).
> 3. Every time we need a kernel va, we search the table to obtain the addr.

I see, this looks like can work.
But I concern about cost of this lookup, which needs to be done per packet.
Current address translations are basic arithmetic operations.

What do you think doing va -> pa translation in userspace via eal APIs, and keep
KNI kernel code intact?
Overall translation cost should be same, but the code complexity kept in eal
layer which already knows about memsegs.

> 
> Thanks,
> Jianfeng
> 
> 
>>
>> Thanks,
>> ferruh
>>
>>> Another side, we did not check the result of phys_to_virt, that's why
>> kernel crashes.
>>>
>>> Thanks,
>>> Jianfeng
>>>
> 

  reply	other threads:[~2017-11-01  7:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01  1:07 Ferruh Yigit
2017-11-01  2:17 ` Tan, Jianfeng
2017-11-01  6:32   ` Ferruh Yigit
2017-11-01  6:37     ` Tan, Jianfeng
2017-11-01  7:29       ` Ferruh Yigit [this message]
2017-11-01  7:55         ` Tan, Jianfeng
2017-11-01  3:54 ` santosh
2017-11-01  4:02 ` Jerin Jacob
2017-11-01  6:21   ` Ferruh Yigit
2017-11-01  6:54     ` Jerin Jacob
2017-11-01  7:39       ` Tan, Jianfeng
2017-11-01  8:26         ` Jerin Jacob
2017-11-01  8:53           ` Tan, Jianfeng
2017-11-01 18:31             ` Ferruh Yigit
2017-11-01  8:12       ` Ferruh Yigit
2017-11-01 10:31 ` Thomas Monjalon
2017-11-01 11:06   ` santosh
2017-11-01 18:22     ` Ferruh Yigit
2017-11-01 18:11   ` 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=0cc520ff-46c0-e291-755d-acbdacf7bdc0@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bruce.richardson@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).