DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH] eal: pick IOVA as PA if IOMMU is not available
Date: Thu, 25 Jul 2019 10:31:33 +0100	[thread overview]
Message-ID: <61fe76fd-beb8-6074-32e1-16b47170a6ef@intel.com> (raw)
In-Reply-To: <CAJFAV8xAvrY3AJX1eueYyxAZAkC4aE4p7UOfC9QrOLOx6HK8HA@mail.gmail.com>

On 25-Jul-19 9:05 AM, David Marchand wrote:
> On Wed, Jul 24, 2019 at 6:46 PM Anatoly Burakov
> <anatoly.burakov@intel.com> wrote:
>>
>> When IOMMU is not available, /sys/kernel/iommu_groups will not be
>> populated. This is happening since at least 3.6 when VFIO support
>> was added. If the directory is empty, EAL should not pick IOVA as
>> VA as the default IOVA mode.
>>
>> We also assume that VFIO equals IOMMU, so if VFIO support is not
>> compiled, we always assume IOMMU support is not available.
> 
> Not sure I agree with this statement.
> What about unknown (from eal pov) kernel drivers?

Are there any cases where we can use IOVA as VA mode without having VFIO 
compiled?

> 
> 
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>>   lib/librte_eal/linux/eal/eal.c      | 11 ++++++--
>>   lib/librte_eal/linux/eal/eal_vfio.c | 39 +++++++++++++++++++++++++++++
>>   lib/librte_eal/linux/eal/eal_vfio.h |  2 ++
>>   3 files changed, 50 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
>> index 34db78753..584f97a96 100644
>> --- a/lib/librte_eal/linux/eal/eal.c
>> +++ b/lib/librte_eal/linux/eal/eal.c
>> @@ -1061,8 +1061,15 @@ rte_eal_init(int argc, char **argv)
>>                  enum rte_iova_mode iova_mode = rte_bus_get_iommu_class();
>>
>>                  if (iova_mode == RTE_IOVA_DC) {
>> -                       iova_mode = RTE_IOVA_VA;
>> -                       RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode, select IOVA as VA mode.\n");
>> +                       /* if we have an IOMMU, pick IOVA as VA mode */
>> +                       if (vfio_iommu_enabled()) {
>> +                               iova_mode = RTE_IOVA_VA;
>> +                               RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode, selecting IOVA as VA mode.\n");
>> +                       } else {
>> +                               iova_mode = RTE_IOVA_PA;
>> +                               RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode, but IOMMU is not available.\n");
>> +                               RTE_LOG(DEBUG, EAL, "Selecting IOVA as PA mode.\n");
>> +                       }
> 
> Here, since the buses don't care, we can check for physical address
> availability.
> 

Good point, if PA are not available, we can't use IOVA as PA mode.

-- 
Thanks,
Anatoly

  reply	other threads:[~2019-07-25  9:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 16:46 Anatoly Burakov
2019-07-25  8:05 ` David Marchand
2019-07-25  9:31   ` Burakov, Anatoly [this message]
2019-07-25  9:35     ` David Marchand
2019-07-25  9:38       ` Burakov, Anatoly
2019-07-25  9:40         ` Burakov, Anatoly
2019-07-25 18:58   ` Thomas Monjalon
2019-07-25  9:52 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
2019-07-25  9:56   ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-07-25 11:05   ` [dpdk-dev] [PATCH v3] " Anatoly Burakov
2019-07-26  5:08     ` Stojaczyk, Dariusz
2019-07-26 15:37     ` [dpdk-dev] [PATCH v4] " Anatoly Burakov
2019-07-29  9:31       ` David Marchand
2019-07-29 11:18         ` Burakov, Anatoly
2019-07-29 13:52       ` [dpdk-dev] [PATCH v5] " Anatoly Burakov
2019-07-30  7:21         ` David Marchand
2019-07-30  8:10           ` Thomas Monjalon

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=61fe76fd-beb8-6074-32e1-16b47170a6ef@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.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).