From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 29E3E187 for ; Mon, 30 Apr 2018 16:42:46 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id i3so14588414wmf.3 for ; Mon, 30 Apr 2018 07:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KQER3MdfzEnyHO77U87WEpyk18y//D6XD7x04cFeO7w=; b=O2tUTm1mndTniJYJSLxzfIXb+QzbLpE07fnjz79Wr35gOd94lNNPQj51dyzdyRTNTy lx99WDcGd3tvegXlgcAM0q5K5nlR+ndhVOIcHmnVnd1+pinvsaipPcFRoffv7dUEGsFz v3+RnLO5SXowPjgAG8stSv32bIFzoMYAvx7fAOQvGoeSVWbHVb7ZuE3CtcZsPXtCZm88 ZkNEnPRmhVRmaFa+DovqR8SueJAStElhGQ5IU/qff9ilNnPU/huXNKXYd+IfQbUTqsLv 3jzRVmMZuZYTNM/kmSsdEMVlp3QTwxugSutTLkZdCOtQ+m/DNGB+G0qvQQkya+v64cMJ TBzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KQER3MdfzEnyHO77U87WEpyk18y//D6XD7x04cFeO7w=; b=gMnDQujZc+h9O/zwjb5Prp8qPvlhXW009l3Gks1zVxkRwfXbDVN1b83BXXml9WxMLO /v8GmyO9RIw188rfzlyIfSschznEjD+bqCUn6D9THNWMSeMBU7Pjv+kl0Ph+YTtkmF+4 nJxIHf8ar/ZezlXgQ7cA6QcZzgVu8hF4h4e7MTx5Tfu5cRJSR2EVA9udKUZmdho2kOE0 tAwEsJWY2gNqnZPs5V6kU65dT4WXFVE0qfLMTEoLUu0H4StETrSVbV8UaUwKvoa3r/Hu OYM1WgmLBwHq4LgHQBb5OmIp8O4nejQ1/vXSUzb4fsyyxnaAGNiMjtn+fBeCRc5aHtwR GM3Q== X-Gm-Message-State: ALQs6tAjmJ6uL+XiFENROVAApCpFoOyVA7LE80eu/U4HPGlN37NefXh8 dDj9eDGgVCgqPzvK79XSVXw= X-Google-Smtp-Source: AB8JxZq/GteqgGFqPqBQFUHGbMpYshxTf0x8ir8Ip9/1sqQEkfDlpQJ0cWlN48+eg3Ht29XcWJiMvg== X-Received: by 10.28.249.14 with SMTP id x14mr7739908wmh.63.1525099366151; Mon, 30 Apr 2018 07:42:46 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id c21-v6sm7253057wre.43.2018.04.30.07.42.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:42:45 -0700 (PDT) From: luca.boccassi@gmail.com To: Anatoly Burakov Cc: Santosh Shukla , dpdk stable Date: Mon, 30 Apr 2018 15:40:28 +0100 Message-Id: <20180430144223.18657-13-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'mem: do not use physical addresses in IOVA as VA mode' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:42:47 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From fe29a30cda0df4a22d022ffad812e87557c9fe88 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Wed, 4 Apr 2018 15:40:45 +0100 Subject: [PATCH] mem: do not use physical addresses in IOVA as VA mode [ upstream commit 048303b6f3fdfb5ce863e293f6b3dfabc0a0a2db ] We already use VA addresses for IOVA purposes everywhere if we're in RTE_IOVA_VA mode: 1) rte_malloc_virt2phy()/rte_malloc_virt2iova() always return VA addresses 2) Because of 1), memzone's IOVA is set to VA address on reserve 3) Because of 2), mempool's IOVA addresses are set to VA addresses The only place where actual physical addresses are stored is in memsegs at init time, but we're not using them anywhere, and there is no external API to get those addresses (aside from manually iterating through memsegs), nor should anyone care about them in RTE_IOVA_VA mode. So, fix EAL initialization to allocate VA-contiguous segments at the start without regard for physical addresses (as if they weren't available), and use VA to set final IOVA addresses for all pages. Fixes: 62196f4e0941 ("mem: rename address mapping function to IOVA") Signed-off-by: Anatoly Burakov Acked-by: Santosh Shukla --- lib/librte_eal/linuxapp/eal/eal_memory.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 38853b753..ecf375b22 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -473,6 +473,9 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi, hugepg_tbl[i].orig_va = virtaddr; } else { + /* rewrite physical addresses in IOVA as VA mode */ + if (rte_eal_iova_mode() == RTE_IOVA_VA) + hugepg_tbl[i].physaddr = (uintptr_t)virtaddr; hugepg_tbl[i].final_va = virtaddr; } @@ -1091,7 +1094,8 @@ rte_eal_hugepage_init(void) continue; } - if (phys_addrs_available) { + if (phys_addrs_available && + rte_eal_iova_mode() != RTE_IOVA_VA) { /* find physical addresses for each hugepage */ if (find_physaddrs(&tmp_hp[hp_offset], hpi) < 0) { RTE_LOG(DEBUG, EAL, "Failed to find phys addr " -- 2.14.2