Commit d9174e1e authored by GangCao's avatar GangCao Committed by Daniel Verkamp
Browse files

setup: add the SKIP_PCI parameter in setup.sh



User may only want to configure hugepage and no configure
on the PCI devices. Add the SKIP_PCI parameter to offer
this option.

If user only wants to configure hugepage, can run:
SKIP_PCI=1 ./scripts/setup.sh

The default behavior is that PCI devices will be configured.

Change-Id: I8302efd5a09f2885e00fa8ed00d398219c11dde7
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/389473


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 55ac2263
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -131,7 +131,9 @@ function configure_linux_pci {
}

function configure_linux {
	if [ "$SKIP_PCI" == 0 ]; then
		configure_linux_pci
	fi

	hugetlbfs_mount=$(linux_hugetlbfs_mount)

@@ -241,7 +243,9 @@ function reset_linux_pci {
}

function reset_linux {
	if [ "$SKIP_PCI" == 0 ]; then
		reset_linux_pci
	fi

	hugetlbfs_mount=$(linux_hugetlbfs_mount)
	rm -f "$hugetlbfs_mount"/spdk*map_*
@@ -317,7 +321,9 @@ function configure_freebsd_pci {
}

function configure_freebsd {
	if [ "$SKIP_PCI" == 0 ]; then
		configure_freebsd_pci
	fi

	kldunload contigmem.ko || true
	kenv hw.contigmem.num_buffers=$((HUGEMEM / 256))
@@ -327,7 +333,10 @@ function configure_freebsd {

function reset_freebsd {
	kldunload contigmem.ko || true

	if [ "$SKIP_PCI" == 0 ]; then
		kldunload nic_uio.ko || true
	fi
}

username=$1
@@ -350,6 +359,7 @@ if [ "$username" = "" ]; then
fi

: ${HUGEMEM:=2048}
: ${SKIP_PCI:=0}

if [ `uname` = Linux ]; then
	HUGEPGSZ=$(( `grep Hugepagesize /proc/meminfo | cut -d : -f 2 | tr -dc '0-9'` ))