From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 86A6BA0527; Mon, 9 Nov 2020 16:47:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DC906004; Mon, 9 Nov 2020 16:47:53 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id B2D795F13 for ; Mon, 9 Nov 2020 16:47:49 +0100 (CET) IronPort-SDR: WQodUa5GTsnjMuNRkP2ORQZ7wAAQrWFBYtJVGQsE5EhnQsL3t3rw+JXIlJBWPxVI1mkZ5hi+vb 57L5GCc9GlUQ== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="149103238" X-IronPort-AV: E=Sophos;i="5.77,463,1596524400"; d="scan'208";a="149103238" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 07:47:44 -0800 IronPort-SDR: YNEV7ucMjMMG9kOgHN86KspBdI1r46UQE/tuseBNRrPslktKCP7a3CtoDNNLMQPGgNfFpyz/Vw KMyU0giifWIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,463,1596524400"; d="scan'208";a="540896909" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.222.52]) by orsmga005.jf.intel.com with ESMTP; 09 Nov 2020 07:47:43 -0800 From: Anatoly Burakov To: dev@dpdk.org Cc: Damjan Marion Date: Mon, 9 Nov 2020 15:47:48 +0000 Message-Id: <8f49e252a7be2d8561f4b32193e5800f98c40b0e.1604936860.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <0ae7d9b2c1ee0e12f8ae7faa2d154c03ae7e0c92.1604935662.git.anatoly.burakov@intel.com> References: <0ae7d9b2c1ee0e12f8ae7faa2d154c03ae7e0c92.1604935662.git.anatoly.burakov@intel.com> Subject: [dpdk-dev] [PATCH 21.02 v2] mem: don't warn about base addr if not requested X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Any EAL memory allocation often goes through eal_get_virtual_area() function, which will print a warning whenever the resulting allocation didn't match the specified address requirements. This is useful for when we have requested a specific base virtual address, to let the user know that the mapping has deviated from that address. However, on Linux, we also have a default base address that's there to ensure better chances of successful secondary process initialization, as well as higher likelihood of the virtual areas to fit inside the IOMMU address width. Because of this default base address, there are warnings printed even when no base address was explicitly requested, which can be confusing to the user. Emit this warning with debug level unless base address was explicitly requested by the user. Cc: Damjan Marion Signed-off-by: Anatoly Burakov --- Notes: v2: - Fix the condition to not update the address incorrectly - Instead of removing the warning, let it have debug level unless base address was explicitly specified by the user I'm not entirely sure the trade off between user confusion and helpful debug information is worth it, but in my experience, i've stopped getting any emails about secondary processes a long time ago and this isn't a widely used feature, so i believe this is worth it. lib/librte_eal/common/eal_common_memory.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 33917fa835..1b50c2099d 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -140,9 +140,19 @@ eal_get_virtual_area(void *requested_addr, size_t *size, return NULL; } else if (requested_addr != NULL && addr_is_hint && aligned_addr != requested_addr) { - RTE_LOG(WARNING, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", - requested_addr, aligned_addr); - RTE_LOG(WARNING, EAL, " This may cause issues with mapping memory into secondary processes\n"); + /* + * demote this warning to debug if we did not explicitly request + * a base virtual address. + */ + if (internal_conf->base_virtaddr != 0) { + RTE_LOG(WARNING, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", + requested_addr, aligned_addr); + RTE_LOG(WARNING, EAL, " This may cause issues with mapping memory into secondary processes\n"); + } else { + RTE_LOG(DEBUG, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", + requested_addr, aligned_addr); + RTE_LOG(DEBUG, EAL, " This may cause issues with mapping memory into secondary processes\n"); + } } else if (next_baseaddr != NULL) { next_baseaddr = RTE_PTR_ADD(aligned_addr, *size); } -- 2.17.1