From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, John McNamara <john.mcnamara@intel.com>,
Marko Kovacevic <marko.kovacevic@intel.com>,
dariusz.stojaczyk@intel.com,
Thomas Monjalon <thomas@monjalon.net>,
Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: Re: [dpdk-dev] [PATCH v4] eal: pick IOVA as PA if IOMMU is not available
Date: Mon, 29 Jul 2019 12:18:00 +0100 [thread overview]
Message-ID: <4b3b8843-1354-6e38-26af-893b3a436e51@intel.com> (raw)
In-Reply-To: <CAJFAV8weSCL=--j=J04hdxiFJiL7P5vF4i2ud8rW0Ep0ecU4YA@mail.gmail.com>
On 29-Jul-19 10:31 AM, David Marchand wrote:
> On Fri, Jul 26, 2019 at 5:37 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.
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
>> Tested-by: Jerin Jacob <jerinj@marvell.com>
>> Reviewed-by: Jerin Jacob <jerinj@marvell.com>
>> ---
>>
>> Notes:
>> v4:
>> - Fix indentation in release notes' known issues
>>
>> v3:
>> - Add documentation changes
>> - Fix a typo pointed out by checkpatch
>>
>> v2:
>> - Decouple IOMMU from VFIO
>> - Add a check for physical addresses availability
>>
>> .../prog_guide/env_abstraction_layer.rst | 27 +++++++++++------
>> doc/guides/rel_notes/known_issues.rst | 26 ++++++++++++++++
>> doc/guides/rel_notes/release_19_08.rst | 16 ++++++++++
>> lib/librte_eal/linux/eal/eal.c | 21 +++++++++++--
>> lib/librte_eal/linux/eal/eal_vfio.c | 30 +++++++++++++++++++
>> lib/librte_eal/linux/eal/eal_vfio.h | 2 ++
>> 6 files changed, 111 insertions(+), 11 deletions(-)
>>
>> diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
>> index 1487ea550..e6e70e5a8 100644
>> --- a/doc/guides/prog_guide/env_abstraction_layer.rst
>> +++ b/doc/guides/prog_guide/env_abstraction_layer.rst
>> @@ -425,6 +425,9 @@ IOVA Mode Detection
>> IOVA Mode is selected by considering what the current usable Devices on the
>> system require and/or support.
>>
>> +On FreeBSD, RTE_IOVA_VA mode is not supported, so RTE_IOVA_PA is always used.
>
> We still allow setting it via --iova-mode=
> Is it really unsupported ? vdev like rings could work.
Oh, right, we don't *really* support IOVA as VA mode, but you can still
run in --no-huge mode (or using only virtual devices) and pretend like
it works ;)
Still, i think FreeBSD should default to PA unless it's not running as root.
>
>
>> +On Linux, the IOVA mode is detected based on a heuristic.
>> +
>> Below is the 2-step heuristic for this choice.
>
> We can combine those two sentences as a single one.
Sure.
>
>
>>
>> For the first step, EAL asks each bus its requirement in terms of IOVA mode
>> @@ -438,20 +441,26 @@ and decides on a preferred IOVA mode.
>> RTE_IOVA_VA), then the preferred IOVA mode is RTE_IOVA_DC (see below with the
>> check on Physical Addresses availability),
>>
>> +If the buses have expressed no preference on which IOVA mode to pick, then a
>> +default is selected using the following logic:
>> +
<snip>
>> @@ -1061,8 +1061,25 @@ 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");
>> + RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode.\n");
>> +
>> + if (!phys_addrs) {
>> + /* if we have no access to physical addresses,
>> + * pick IOVA as VA mode.
>> + */
>> + iova_mode = RTE_IOVA_VA;
>> + RTE_LOG(DEBUG, EAL, "Physical addresses are unavailable, selecting IOVA as VA mode.\n");
>> + } else if (vfio_iommu_enabled()) {
>
> How about:
> s/vfio_iommu_enabled/is_iommu_available/
>
> And the code would move from vfio specific files to eal.c.
Can do.
--
Thanks,
Anatoly
next prev parent reply other threads:[~2019-07-29 11:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 16:46 [dpdk-dev] [PATCH] " Anatoly Burakov
2019-07-25 8:05 ` David Marchand
2019-07-25 9:31 ` Burakov, Anatoly
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 [this message]
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=4b3b8843-1354-6e38-26af-893b3a436e51@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dariusz.stojaczyk@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=john.mcnamara@intel.com \
--cc=marko.kovacevic@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).