<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 24, 2023 at 11:29 AM Dmitry Kozlyuk <<a href="mailto:dmitry.kozliuk@gmail.com">dmitry.kozliuk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2023-11-24 11:09 (UTC+0100), <a href="mailto:christian.ehrhardt@canonical.com" target="_blank">christian.ehrhardt@canonical.com</a>:<br>
[...]<br>
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c<br>
> index 57da058cec..2f1fce3c54 100644<br>
> --- a/lib/eal/linux/eal.c<br>
> +++ b/lib/eal/linux/eal.c<br>
> @@ -1067,6 +1067,16 @@ rte_eal_init(int argc, char **argv)<br>
>  <br>
>       phys_addrs = rte_eal_using_phys_addrs() != 0;<br>
>  <br>
> +     if (!phys_addrs) {<br>
> +             /* if we have no access to physical addresses, pick IOVA as VA mode. */<br>
> +             if (internal_conf->iova_mode == RTE_IOVA_PA)<br>
> +                     RTE_LOG(WARNING, EAL, "WARNING: --iova-mode=pa, but Physical addresses are unavailable, selecting IOVA as VA mode.\n");<br>
<br>
If an impossible combination of options is requested,<br>
initialization should fail instead.<br></blockquote><div><br></div><div>You are absolutely right Dmitry.</div><div>In fact I was only trying to rebase an old patch that we used to carry.</div><div>But the more I look at and think about it the less I like the approach.</div><div><br></div><div>A production setup has an admin that should do this consciously.</div><div>What we actually should change is not the behavior of EAL, but just the test automation to work on no-huge ppc64.</div><div>That is simpler and has much less impact and therefore probably is the right solution.</div><div><br></div><div>Consider this patch here withdrawn.</div><div>I'll submit the fix to the tests in a few seconds.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> +             else<br>
> +                     RTE_LOG(DEBUG, EAL, "Physical addresses are unavailable, selecting IOVA as VA mode.\n");<br>
> +             internal_conf->iova_mode = RTE_IOVA_VA;<br>
> +             rte_eal_get_configuration()->iova_mode = internal_conf->iova_mode;<br>
> +     }<br>
> +<br>
>       /* if no EAL option "--iova-mode=<pa|va>", use bus IOVA scheme */<br>
>       if (internal_conf->iova_mode == RTE_IOVA_DC) {<br>
>               /* autodetect the IOVA mapping mode */<br>
<br>
What do you think about keeping the existing code structure:<br>
<br>
if (--iova-mode not specified) {<br>
        iova_mode = VA if !phys_addrs or !RTE_IOVA_IN_MBUF (with logs)<br>
        if (iova_mode == DC) {<br>
                // autodetect from bus requirements and IOMMU (with logs)<br>
        }<br>
        rte_eal_get_configuration()->iova_mode = iova_mode;<br>
} else {<br>
        rte_eal_get_configuration()->iova_mode =<br>
                internal_conf->iova_mode;<br>
}<br>
// verify rte_eal_get_configuration()->iova_mode<br>
<br>
Note: the logic should be consistent across OS when possible.<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Christian Ehrhardt<br><span style="color:rgb(34,34,34)">Director of Engineering</span>, Ubuntu Server<br>Canonical Ltd</div></div></div>