From d9174e1e42a9516e716c73bbf7cceaa34aec1c56 Mon Sep 17 00:00:00 2001 From: GangCao Date: Tue, 28 Nov 2017 19:09:57 -0500 Subject: [PATCH] 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: GangCao Reviewed-on: https://review.gerrithub.io/389473 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Daniel Verkamp --- scripts/setup.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 8f82e5ea2..9597aa681 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -131,7 +131,9 @@ function configure_linux_pci { } function configure_linux { - configure_linux_pci + 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 { - reset_linux_pci + 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 { - configure_freebsd_pci + 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 - kldunload nic_uio.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'` ))