From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 32B605B1E for ; Mon, 30 Jul 2018 18:18:34 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkArT-00009D-J9; Mon, 30 Jul 2018 16:17:31 +0000 From: Christian Ehrhardt To: Dariusz Stojaczyk Cc: Anatoly Burakov , dpdk stable Date: Mon, 30 Jul 2018 18:12:34 +0200 Message-Id: <20180730161342.16566-109-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'mem: do not use --base-virtaddr in secondary processes' has been queued to stable release 18.05.1 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 Jul 2018 16:18:34 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From 2ab94a2efa3bb0d5f92a630ee86e29a1b2badb1c Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Mon, 18 Jun 2018 21:53:09 +0200 Subject: [PATCH] mem: do not use --base-virtaddr in secondary processes [ upstream commit 6c0fb7547b32ac29336ed21f21be5a306248af99 ] Since secondary process' address space is highly dictated by the primary process' mappings, it doesn't make much sense to use base-virtaddr for secondary processes. This patch is intended to fix PCI resource mapping in secondary processes using the same base-virtaddr as their primary processes. PCI uses the end of the hugepage memory area to map all resources. [pci_find_max_end_va()] It works for primary processes, but can't be mapped 1:1 by secondary ones, as the same addresses are currently always occupied by shadow memseg lists, which were created with eal_get_virtual_area(NULL, ...). ``` PRIMARY PROCESS 0x6e00e00000 388K rw-s- fbarray_memseg-2048k-1-3 0x6e01000000 16777216K r---- [ anon ] 0x7201000000 16K rw-s- resource0 SECONDARY PROCESS 0x6e00e00000 388K rw-s- fbarray_memseg-2048k-1-3 0x6e01000000 16777216K r---- [ anon ] 0x7201000000 4K rw-s- fbarray_memseg-1048576k-0-0_203213 ``` Fixes: 524e43c2ad9a ("mem: prepare memseg lists for multiprocess sync") Signed-off-by: Dariusz Stojaczyk Acked-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 87ed05eab..fee4b80b1 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -56,7 +56,8 @@ eal_get_virtual_area(void *requested_addr, size_t *size, allow_shrink = (flags & EAL_VIRTUAL_AREA_ALLOW_SHRINK) > 0; unmap = (flags & EAL_VIRTUAL_AREA_UNMAP) > 0; - if (next_baseaddr == NULL && internal_config.base_virtaddr != 0) + if (next_baseaddr == NULL && internal_config.base_virtaddr != 0 && + rte_eal_process_type() == RTE_PROC_PRIMARY) next_baseaddr = (void *) internal_config.base_virtaddr; if (requested_addr == NULL && next_baseaddr != NULL) { -- 2.17.1