From 3e5fe6f602d0583c94d3cc07add246a4816797bf Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 8 Oct 2015 11:05:17 -0700 Subject: [PATCH] autobuild: unbind NVMe devices on FreeBSD Change-Id: I5e6a6ca6751d77aed48bedc2e59f97139dd8ef00 Signed-off-by: Daniel Verkamp --- autotest.sh | 2 +- scripts/cleanup.sh | 1 + scripts/unbind_nvme.sh | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/autotest.sh b/autotest.sh index 3f1671535..846ac85fb 100755 --- a/autotest.sh +++ b/autotest.sh @@ -23,7 +23,7 @@ timing_enter afterboot ./scripts/configure_hugepages.sh 3072 timing_exit afterboot -lsmod | grep -q ^nvme && rmmod nvme || true +./scripts/unbind_nvme.sh ##################### # Unit Tests diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index 7f189429c..c522253de 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -18,6 +18,7 @@ function cleanup_linux() { function cleanup_freebsd { kldunload contigmem.ko || true + kldunload nic_uio.ko || true } if [ `uname` = Linux ]; then diff --git a/scripts/unbind_nvme.sh b/scripts/unbind_nvme.sh index 67af2547d..be35b0af6 100755 --- a/scripts/unbind_nvme.sh +++ b/scripts/unbind_nvme.sh @@ -3,7 +3,7 @@ set -e function configure_linux { - lsmod | grep nvme && rmmod nvme + rmmod nvme || true } function configure_freebsd { @@ -12,8 +12,9 @@ function configure_freebsd { echo $AWK_PROG > $TMP NVME_PCICONF=`pciconf -l | grep class=0x010802` BDFS=`echo $NVME_PCICONF | awk -F: -f $TMP` + kldunload nic_uio.ko || true kenv hw.nic_uio.bdfs=$BDFS - kldload `find . -name nic_uio.ko | head -1` + kldload nic_uio.ko rm $TMP }