From 8247bd40412e047a53e268a226acabdcd5f0b511 Mon Sep 17 00:00:00 2001 From: Marcin Spiewak Date: Fri, 31 Mar 2023 14:55:52 +0000 Subject: [PATCH] configure: added --max-lcores option to ./configure This patch adds support for --max-lcores configuration option to ./configure script. This option can be used to change value of DPDK's RTE_MAX_LCORE (which is by default set to 128 for x86 architecture). If specified, DPDK will be configured to use the value provided by the user instead of the default one. The option can be useful in systems where number of physical CPUs is larger than 128. When RTE_MAX_LCORE is increased, it is possible to specify cores with identifiers larger than 128 in the SPDK's CPU mask. If the option is not specifed, DPDK will use default value of RTE_MAX_LCORE. --max-lcores range is [1..1024] Example usage: ./configure --max-lcores=256 ./configure --max-lcores=16 Change-Id: I47d321ba394c9acf27eaa91619aeaad28db6de34 Signed-off-by: Marcin Spiewak Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17453 Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Community-CI: Mellanox Build Bot --- CONFIG | 3 +++ configure | 16 ++++++++++++++++ dpdkbuild/Makefile | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/CONFIG b/CONFIG index e65dd970b..4c354de65 100644 --- a/CONFIG +++ b/CONFIG @@ -217,3 +217,6 @@ CONFIG_SMA=n # Build with Avahi support CONFIG_AVAHI=n + +# Setup DPDK's RTE_MAX_LCORES +CONFIG_MAX_LCORES= diff --git a/configure b/configure index 1c9c7980c..392f13757 100755 --- a/configure +++ b/configure @@ -28,6 +28,7 @@ function usage() { echo " --cross-prefix=prefix Prefix for cross compilation (default: none)" echo " example: aarch64-linux-gnu" echo " --libdir=path Configure installation path for the libraries (default: \$prefix/lib)" + echo " --max-lcores=VAL DPDK configuration. Maximum number of lcores supported by EAL." echo "" echo " --enable-debug Configure for debug builds" echo " --enable-werror Treat compiler warnings as errors" @@ -651,6 +652,14 @@ for i in "$@"; do --without-avahi) CONFIG[AVAHI]=n ;; + --max-lcores='') + echo "Must specify max number of lcores for --max-lcores" + usage + exit 1 + ;; + --max-lcores=*) + CONFIG[MAX_LCORES]="${i#*=}" + ;; --) break ;; @@ -1250,6 +1259,13 @@ if [[ "${CONFIG[AVAHI]}" = "y" ]]; then fi fi +if [[ -n ${CONFIG[MAX_LCORES]} ]]; then + if [[ ! ${CONFIG[MAX_LCORES]} =~ ^[1-9][0-9]*$ ]] || ((CONFIG[MAX_LCORES] > 1024)); then + echo "ERROR: Max number of lcores must be a decimal number in range [1..1024] (given: ${CONFIG[MAX_LCORES]})" + exit 1 + fi +fi + # For ARM Neoverse-N1 platform, debug build needs gcc version newer than 8.4 if [[ "${CONFIG[DEBUG]}" = "y" && $arch = aarch64* && "$CC_TYPE" = "gcc" ]]; then GCC_VERSION=$($CC -dumpfullversion) diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 663ba062c..62b789119 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -103,6 +103,10 @@ endif DPDK_CFLAGS += -fPIC +ifneq ($(CONFIG_MAX_LCORES),) +DPDK_OPTS += -Dmax_lcores=$(CONFIG_MAX_LCORES) +endif + ifeq ($(CONFIG_WERROR),y) DPDK_CFLAGS += -Werror else