From patchwork Mon Jun 12 17:14:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 128512 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B0D642C50; Mon, 12 Jun 2023 19:15:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61DAE410DD; Mon, 12 Jun 2023 19:15:06 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3E9C940698 for ; Mon, 12 Jun 2023 19:15:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686590104; x=1718126104; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GHpc5EDfdbwYljNEe1JpWyD7xZ2Y/LRx4ZlLrlH2fWU=; b=Z7Q352XPzZ4jPJYGFikAnYDPVhrFN4RzwsMaL1yYGtPIBCPQ7WSR5jfB rNm6gbU3S/2etScMDmUh1LzTFOrnqx6pClav3wKCHGA0NbzKHrLcRWYmG wbdQPF5WHiHKuaZW6IE633VCYJmv7VQdDGjKPzHg/UK9uEsg8SCtnYPJs Z5H5U9pZs9n9CuTf1+QMTx9NiVjq4GMgi1Yc5lYsbAw7DheaA5YHMB7S8 oDw9/SgCbJrMK4zdHcGJY+SdNzxMV97eamgeUs24V+Kg3rn1XRn/A1XkX 9VJmH2EwY8fVKXXnLHb/SmKgowGhUBGSlyGfukgc2a7xe/ZSC7kUHxdmh w==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="347760954" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="347760954" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 10:15:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="744392357" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="744392357" Received: from silpixa00401385.ir.intel.com ([10.237.214.11]) by orsmga001.jf.intel.com with ESMTP; 12 Jun 2023 10:15:02 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 1/2] build: change flag variable type to boolean Date: Mon, 12 Jun 2023 18:14:55 +0100 Message-Id: <20230612171456.173378-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612162104.170749-1-bruce.richardson@intel.com> References: <20230612162104.170749-1-bruce.richardson@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The has_libnuma flag was using 0 and 1 integer values, instead of the more appropriate boolean type. Change to use true/false instead. Signed-off-by: Bruce Richardson Reviewed-by: David Marchand --- config/arm/meson.build | 2 +- config/meson.build | 4 ++-- lib/eal/linux/meson.build | 2 +- lib/vhost/meson.build | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 43f6a551a2..faba5e38cf 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -592,7 +592,7 @@ if update_flags part_number = soc_config['part_number'] soc_flags = soc_config.get('flags', []) if not soc_config.get('numa', true) - has_libnuma = 0 + has_libnuma = false endif disable_drivers += ',' + soc_config.get('disable_drivers', '') diff --git a/config/meson.build b/config/meson.build index 65087ce090..8aebccbbdc 100644 --- a/config/meson.build +++ b/config/meson.build @@ -174,7 +174,7 @@ if link_lib != '' endif # check for libraries used in multiple places in DPDK -has_libnuma = 0 +has_libnuma = false find_libnuma = true if meson.is_cross_build() and not meson.get_cross_property('numa', true) # don't look for libnuma if explicitly disabled in cross build @@ -184,7 +184,7 @@ if find_libnuma numa_dep = cc.find_library('numa', required: false) if numa_dep.found() and cc.has_header('numaif.h') dpdk_conf.set10('RTE_HAS_LIBNUMA', true) - has_libnuma = 1 + has_libnuma = true add_project_link_arguments('-lnuma', language: 'c') dpdk_extra_ldflags += '-lnuma' endif diff --git a/lib/eal/linux/meson.build b/lib/eal/linux/meson.build index 1b913acc06..e99ebed256 100644 --- a/lib/eal/linux/meson.build +++ b/lib/eal/linux/meson.build @@ -20,6 +20,6 @@ sources += files( ) deps += ['kvargs', 'telemetry'] -if has_libnuma == 1 +if has_libnuma dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true) endif diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build index 0d1abf6283..9e39d221a1 100644 --- a/lib/vhost/meson.build +++ b/lib/vhost/meson.build @@ -5,7 +5,7 @@ if not is_linux build = false reason = 'only supported on Linux' endif -if has_libnuma == 1 +if has_libnuma dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true) endif if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0')) From patchwork Mon Jun 12 17:14:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 128513 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8BA1B42C50; Mon, 12 Jun 2023 19:15:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3ACD41138; Mon, 12 Jun 2023 19:15:09 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3ECBC410FC for ; Mon, 12 Jun 2023 19:15:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686590107; x=1718126107; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/VNnxFS7dbjThQrOzuXykQhWnt2GbS1HokebkIfxCtc=; b=LL3ac52//JsakdlQaYdZ6GV97cBnnzm7LceJWbRT7l7+fMTE30UXmuJf 5+XlwWJqR3ZXLgQdGIjsxrGcgZQsqTNeSAvEzooBgoQjos7l9it+y4pSD 8y9w/kHFMiQ+aoKis4lt4XlSywEFOgkxb8vrEovEaMC7Y6s6krTyzKLEt tAsYlAYtFKGG44WHhOlnJSXLfDUhN7c7sZbSInOXhxcGG8Qgxky/cgxc0 UF8GHga5pPNAGGIrOzvtMiHR231Zv4X3Ibfmh1bmMILgUznlgiKJhFnLt 3mW957qJL+3mmy6atq2zOExLrRAzquLVgj7UvFYQEVbMDk6ZR8kCuYuyw g==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="347760967" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="347760967" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 10:15:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="744392370" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="744392370" Received: from silpixa00401385.ir.intel.com ([10.237.214.11]) by orsmga001.jf.intel.com with ESMTP; 12 Jun 2023 10:15:06 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 2/2] build: prevent accidentally building without NUMA support Date: Mon, 12 Jun 2023 18:14:56 +0100 Message-Id: <20230612171456.173378-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612171456.173378-1-bruce.richardson@intel.com> References: <20230612162104.170749-1-bruce.richardson@intel.com> <20230612171456.173378-1-bruce.richardson@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When libnuma development package is missing on a system, DPDK can still be built but will be missing much-needed support for NUMA memory management. This may later cause issues at runtime if the resulting binary is run on a NUMA system. We can reduce the incidence of such runtime error by ensuring that, for native builds*, libnuma is present - unless the user actually specifies via "max_numa_nodes" that they don't require NUMA support. Having this as an error condition is also in keeping with what is documented in the Linux GSG doc, where libnuma is listed as a requirement for building DPDK [1]. * NOTE: cross-compilation builds have a different logic set, with a separate "numa" value indicating if numa support is necessary. [1] https://doc.dpdk.org/guides-23.03/linux_gsg/sys_reqs.html Signed-off-by: Bruce Richardson --- V2: Limit check to linux only --- config/meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/meson.build b/config/meson.build index 8aebccbbdc..00812976ba 100644 --- a/config/meson.build +++ b/config/meson.build @@ -381,6 +381,15 @@ endif if not dpdk_conf.has('RTE_MAX_NUMA_NODES') error('Number of NUMA nodes not specified.') endif +if (is_linux and + dpdk_conf.get('RTE_MAX_NUMA_NODES') > 1 and + not meson.is_cross_build() and + not has_libnuma) + error(''' +No NUMA library (development package) found, yet DPDK configured for multiple NUMA nodes. +Please install libnuma, or set 'max_numa_nodes' option to '1' to build without NUMA support. +''') +endif # set the install path for the drivers dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)