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