From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 39FA3292D for ; Sun, 22 Apr 2018 17:11:54 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4E95A20E8C; Sun, 22 Apr 2018 11:11:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 22 Apr 2018 11:11:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=65a85VyRJDyK4HjSY VEVHJLR1+KerO0tplbm9//tOw0=; b=KLit47gX57QPIyqJBKJVkppnL1GlQbArr o6rzvYT+jhY6VOVGWkU7X8SVXGUdpGocxlz0aYF0/Qe3JtU6+a9iroTiARAYHTKD JvCwHaaz65EdE/S/1PrUwdF4Xjt4xvex8FvQmEb8NqM2xYw/cH4oCVZ+ot4Q9nEx dFsSEkvL2j6YKx2L1zu2ETFEDrF7DZJB1oQc81nD1nd5KsCbIj9YbOgYcWnJfrFh nFnBsQM287hs3hw76SqhsiGkZal1E0lAe3De7aV8+n/ySsJhvDYyHyO+M7EPyRHF sx71/kPj4mCaEejaW18omk3EIiSfyIEjJ/nnXGn/JO+FSoWiEBXDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=65a85VyRJDyK4HjSYVEVHJLR1+KerO0tplbm9//tOw0=; b=ZmmoswkF PQsO7XqE3dvKb8aRLr9o3ruYrRkvwTmEt2d6MHIx/W3EpOQ/kk+ZBHyyjsglZPmI p05s3tRRBeT4v4M7Y51zpEuLSpi+BAPiNVD0q+NdwxliH7iPV0H/wJ0KdkKD9kTa BedKwjJ0ZKk7YnqtJaeQwBuooNWduEa0NcF/psoNiRmurzu3qylbi2VIP4U3ijZS 4Uq46HP7fbJBmkxzEnRdOGHag8MohMDOamAuObYEl+AZKeZNcayEPDG8/HXrlvia vENnwl2fbsR78ZCwca/7uTrJKKTrU8znxI4wsFjd2hDIj5rcuRFwSbORJPBRHeYi qFyxIrA2vaVrOQ== X-ME-Sender: Received: from yuanhanliu-NB0.tencent.com (unknown [223.74.148.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 690551025D; Sun, 22 Apr 2018 11:11:51 -0400 (EDT) From: Yuanhan Liu To: Anatoly Burakov Cc: Santosh Shukla , dpdk stable Date: Sun, 22 Apr 2018 23:09:31 +0800 Message-Id: <20180422150949.17523-41-yliu@fridaylinux.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180422150949.17523-1-yliu@fridaylinux.org> References: <20180422150949.17523-1-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'mem: do not use physical addresses in IOVA as VA mode' has been queued to LTS release 17.11.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: Sun, 22 Apr 2018 15:11:54 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.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 04/29/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 8888d6f0905cac90bd2335d799778a6d12472055 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 16a181c36..17c20d4b3 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -491,6 +491,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; } @@ -1109,7 +1112,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.11.0