From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 17DA24292A; Wed, 12 Apr 2023 21:12:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DED02410F3; Wed, 12 Apr 2023 21:12:07 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 9C496406A2 for ; Wed, 12 Apr 2023 21:12:06 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] eal: choose IOVA mode according to compilation flags Date: Wed, 12 Apr 2023 21:12:04 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87869@smartserver.smartshare.dk> In-Reply-To: <20230412171949.27665-1-viacheslavo@nvidia.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] eal: choose IOVA mode according to compilation flags Thread-Index: AdltYxE0SxA1St3bRg2BP5BNADvWhQADd7hg References: <20230412171949.27665-1-viacheslavo@nvidia.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Viacheslav Ovsiienko" , Cc: , X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Viacheslav Ovsiienko [mailto:viacheslavo@nvidia.com] > Sent: Wednesday, 12 April 2023 19.20 >=20 > The DPDK can be compiled to be run in IOVA VA mode with > 'enable_iova_as_pa=3Dfalse' meson option. If there is no > explicit EAL --iova-mode parameter specified in the command > line the rte_eal_init() tried to deduce VA or PA mode without > taking into account the above mentioned compile time option, > resulting into initialization failure. >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > lib/eal/linux/eal.c | 5 ++++- This patch is close to being a bugfix. Good catch! You could also consider another patch, logging warnings in = rte_bus_get_iommu_class() [1] for the busses that want IOVA as PA when = !RTE_IOVA_IN_MBUF. [1]: = https://elixir.bootlin.com/dpdk/v23.03/source/lib/eal/common/eal_common_b= us.c#L224 > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c > index c37868b7f0..4481bc4ad8 100644 > --- a/lib/eal/linux/eal.c > +++ b/lib/eal/linux/eal.c > @@ -1080,7 +1080,10 @@ rte_eal_init(int argc, char **argv) > if (iova_mode =3D=3D RTE_IOVA_DC) { > RTE_LOG(DEBUG, EAL, "Buses did not request a specific > IOVA mode.\n"); >=20 > - if (!phys_addrs) { > + if (!RTE_IOVA_IN_MBUF) { > + iova_mode =3D RTE_IOVA_VA; > + RTE_LOG(DEBUG, EAL, "IOVA VA mode is forced by > build option.\n"); Minor detail regarding conventions: "IOVA VA " -> "IOVA as VA" > + } else if (!phys_addrs) { > /* if we have no access to physical addresses, > * pick IOVA as VA mode. > */ > -- > 2.18.1 Reviewed-by: Morten Br=F8rup