Commit e2d2ca7c authored by Jim Harris's avatar Jim Harris Committed by Konrad Sztyber
Browse files

test: teach get_config_params() how to handle non-x86 processors



'vendor' field doesn't exist in at least some ARM /proc/cpuinfo files.
Michal recommended rewriting this whole section to make it a lot
more simple while also handling this non-x86 case.

Suggested-by: default avatarMichal Berger <michal.berger@intel.com>
Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I62eaa0f404cbe8b59c16a365ecb3c85e241fd21d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24821


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 54f9ed4c
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -416,18 +416,11 @@ function get_config_params() {
		config_params+=" --with-usdt"
	fi

	if [ $(uname -s) == "FreeBSD" ]; then
		intel="hw.model: Intel"
		cpu_vendor=$(sysctl -a | grep hw.model | cut -c 1-15)
	else
		intel="GenuineIntel"
		cpu_vendor=$(grep -i 'vendor' /proc/cpuinfo --max-count=1)
	fi
	if [[ "$cpu_vendor" != *"$intel"* ]]; then
		config_params+=" --without-idxd"
	else
		config_params+=" --with-idxd"
	fi
	case "$(uname -s)" in
		FreeBSD) [[ $(sysctl -n hw.model) == Intel* ]] ;;
		Linux) [[ $(< /proc/cpuinfo) == *GenuineIntel* ]] ;;
		*) false ;;
	esac && config_params+=" --with-idxd" || config_params+=" --without-idxd"

	if [[ -d $CONFIG_FIO_SOURCE_DIR ]]; then
		config_params+=" --with-fio=$CONFIG_FIO_SOURCE_DIR"