From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: dev <dev@dpdk.org>, Luca Boccassi <bluca@debian.org>,
David Wilder <dwilder@us.ibm.com>
Subject: Re: [PATCH v2] eal/linux: force iova-mode va without pa available
Date: Tue, 28 Nov 2023 15:39:28 +0100 [thread overview]
Message-ID: <CAATJJ0+NNbar_5_10q1Zf-RwHZ2swJj1dKbnb6dkF80XamT-SQ@mail.gmail.com> (raw)
In-Reply-To: <20231124132941.4fe0f846@sovereign>
[-- Attachment #1: Type: text/plain, Size: 2640 bytes --]
On Fri, Nov 24, 2023 at 11:29 AM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
wrote:
> 2023-11-24 11:09 (UTC+0100), christian.ehrhardt@canonical.com:
> [...]
> > diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> > index 57da058cec..2f1fce3c54 100644
> > --- a/lib/eal/linux/eal.c
> > +++ b/lib/eal/linux/eal.c
> > @@ -1067,6 +1067,16 @@ rte_eal_init(int argc, char **argv)
> >
> > phys_addrs = rte_eal_using_phys_addrs() != 0;
> >
> > + if (!phys_addrs) {
> > + /* if we have no access to physical addresses, pick IOVA
> as VA mode. */
> > + if (internal_conf->iova_mode == RTE_IOVA_PA)
> > + RTE_LOG(WARNING, EAL, "WARNING: --iova-mode=pa,
> but Physical addresses are unavailable, selecting IOVA as VA mode.\n");
>
> If an impossible combination of options is requested,
> initialization should fail instead.
>
You are absolutely right Dmitry.
In fact I was only trying to rebase an old patch that we used to carry.
But the more I look at and think about it the less I like the approach.
A production setup has an admin that should do this consciously.
What we actually should change is not the behavior of EAL, but just the
test automation to work on no-huge ppc64.
That is simpler and has much less impact and therefore probably is the
right solution.
Consider this patch here withdrawn.
I'll submit the fix to the tests in a few seconds.
> > + else
> > + RTE_LOG(DEBUG, EAL, "Physical addresses are
> unavailable, selecting IOVA as VA mode.\n");
> > + internal_conf->iova_mode = RTE_IOVA_VA;
> > + rte_eal_get_configuration()->iova_mode =
> internal_conf->iova_mode;
> > + }
> > +
> > /* if no EAL option "--iova-mode=<pa|va>", use bus IOVA scheme */
> > if (internal_conf->iova_mode == RTE_IOVA_DC) {
> > /* autodetect the IOVA mapping mode */
>
> What do you think about keeping the existing code structure:
>
> if (--iova-mode not specified) {
> iova_mode = VA if !phys_addrs or !RTE_IOVA_IN_MBUF (with logs)
> if (iova_mode == DC) {
> // autodetect from bus requirements and IOMMU (with logs)
> }
> rte_eal_get_configuration()->iova_mode = iova_mode;
> } else {
> rte_eal_get_configuration()->iova_mode =
> internal_conf->iova_mode;
> }
> // verify rte_eal_get_configuration()->iova_mode
>
> Note: the logic should be consistent across OS when possible.
>
>
--
Christian Ehrhardt
Director of Engineering, Ubuntu Server
Canonical Ltd
[-- Attachment #2: Type: text/html, Size: 3781 bytes --]
next prev parent reply other threads:[~2023-11-28 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 10:09 christian.ehrhardt
2023-11-24 10:29 ` Dmitry Kozlyuk
2023-11-28 14:39 ` Christian Ehrhardt [this message]
2023-11-29 21:50 ` David Christensen
2023-11-30 13:48 ` Christian Ehrhardt
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=CAATJJ0+NNbar_5_10q1Zf-RwHZ2swJj1dKbnb6dkF80XamT-SQ@mail.gmail.com \
--to=christian.ehrhardt@canonical.com \
--cc=bluca@debian.org \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=dwilder@us.ibm.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
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).