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 B405CA0C53 for ; Mon, 25 Oct 2021 21:01:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A73884003E; Mon, 25 Oct 2021 21:01:02 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id CEC204003E; Mon, 25 Oct 2021 21:01:00 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 372CD5C02E2; Mon, 25 Oct 2021 15:00:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 25 Oct 2021 15:00:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= VUDm/04wghHCLQ4Rl7jUPF5rEnf/xWr7PtdwNtEez6k=; b=lgToDCftX4EV1az5 dh5DI9zaSuEGGfzwjHDa9Tg/cwWpGL2I7k3E6sFl/2q3LSIkG6EgtY/eBjpG3ZGZ Qr8jo3xZ+34ESC60fGMoB6kCAOzp06a+BNWZNyOiT4ctcmG6o2MEAL2tMecW6U9M /SNjDboZrlIUsCKcNmiZ28oY5QZKzh5e0JlVyQpydY8leJ2J8kgCNg36/Yq7wg5v PScsc+7FQv6EVQKLpth3XwIJEqIJ7FhJwYfPfJ36DQIs7K9L+w1uOsshS86xKNsx y0Ktn36WAhfsx9DZH6wloolF37xCfR9rfnpjzhwvelMeFU3eeVoXAzp+1Y1rwGev CrkV3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=VUDm/04wghHCLQ4Rl7jUPF5rEnf/xWr7PtdwNtEez 6k=; b=IkheFWYAMiM2m84QFCg0J8GmxmBQw8ynhZsC8GAj+i6xGHr1rDy/4cnad eKe9Iky5LDURD8DtXalBKYrtX9Q3CHGGbY7Pcimm1qhdN9zC6SPfpGyWizLshq7N eKfw7qt70MrP4wF4Jfk6D9vTIrPR1cFCYE9FT7sDxcBDj38OeNRRRRqI90uhf4bw gq2LBpgj1QLj29ouR1so0PTP9nvZiRMUcUhKW6Vh8sV29rbT2HgczWRUpWY29q1e mHT+bsGv69VKYFcMFBAwMTRjEG7nIC2ZbUIniHSBxrS9V3npfuNZAcA1lqw+u5eR 8g2GkAuObdUxhtKlcQoujk40yOuWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 15:00:57 -0400 (EDT) From: Thomas Monjalon To: Dmitry Kozlyuk Cc: dev@dpdk.org, stable@dpdk.org, Tal Shnaiderman , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , "Kadam, Pallavi" Date: Mon, 25 Oct 2021 21:00:55 +0200 Message-ID: <2802061.CXJFZ6z2yU@thomas> In-Reply-To: <3ed65ecf-d530-59e9-b18e-6dedddaa5328@intel.com> References: <20211025122053.326790-1-dkozlyuk@nvidia.com> <3ed65ecf-d530-59e9-b18e-6dedddaa5328@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eal/windows: fix IOVA mode detection and handling X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > > Windows EAL did not detect IOVA mode and worked incorrectly > > if physical addresses could not be obtained > > (if virt2phys driver was missing or inaccessible). > > In this case, rte_mem_virt2iova() reported RTE_BAD_IOVA for any address. > > Inability to obtain IOVA, be it PA or VA, should cause a failure > > for the DPDK allocator, but it was hidden by the implementation, > > so allocations did not fail when they should. > > The mode when DPDK cannot obtain PA but can work is IOVA-as-VA mode. > > However, rte_eal_iova_mode() always returned RTE_IOVA_DC > > (while it should only ever return RTE_IOVA_PA or RTE_IOVA_VA), > > because IOVA mode detection was not implemented. > > > > Implement IOVA mode detection: > > 1. Always allow to force --iova-mode=va. > > 2. Allow to force --iova-mode=pa only if virt2phys is available. > > 3. If no mode is forced and virt2phys is available, > > select the mode according to bus requests, default to PA. > > 4. If no mode is forced but virt2phys is unavailable, default to VA. > > Fix rte_mem_virt2iova() by returning VA when using IOVA-as-VA. > > Fix rte_eal_iova_mode() by returning the selected mode. > > > > Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management") > > Cc: stable@dpdk.org > > > > Reported-by: Tal Shnaiderman > > Signed-off-by: Dmitry Kozlyuk > > Tested-by: Pallavi Kadam > Acked-by: Pallavi Kadam Applied, thanks.