Skip to content

Commit

Permalink
test/common: consolidate test params for running with external DPDK
Browse files Browse the repository at this point in the history
Get rid of WITH_DPDK_DIR and SPDK_RUN_INSTALLED_DPDK,
introduce SPDK_RUN_EXTERNAL_DPDK which can point to
a DPDK dir. It's an empty string by default.

Change-Id: Iff2b3773a4614db07f4196165087a79472e02b9a
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/867
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
  • Loading branch information
darsto authored and tomzawadzki committed Aug 17, 2020
1 parent 52aaee4 commit 49473bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion autorun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ cat "$conf"

# Runs agent scripts
$rootdir/autobuild.sh "$conf"
sudo -E WITH_DPDK_DIR="$WITH_DPDK_DIR" $rootdir/autotest.sh "$conf"
sudo -E $rootdir/autotest.sh "$conf"
$rootdir/autopackage.sh "$conf"
29 changes: 9 additions & 20 deletions test/common/autotest_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export SPDK_TEST_REDUCE
export SPDK_RUN_ASAN
: ${SPDK_RUN_UBSAN=0}
export SPDK_RUN_UBSAN
: ${SPDK_RUN_INSTALLED_DPDK=0}
export SPDK_RUN_INSTALLED_DPDK
: ${SPDK_RUN_EXTERNAL_DPDK=""}
export SPDK_RUN_EXTERNAL_DPDK
: ${SPDK_RUN_NON_ROOT=0}
export SPDK_RUN_NON_ROOT
: ${SPDK_TEST_CRYPTO=0}
Expand Down Expand Up @@ -188,19 +188,11 @@ fi
if [ "$(uname -s)" = "Linux" ]; then
MAKE="make"
MAKEFLAGS=${MAKEFLAGS:--j$(nproc)}
DPDK_LINUX_DIR=/usr/share/dpdk/x86_64-default-linuxapp-gcc
if [ -d $DPDK_LINUX_DIR ] && [ $SPDK_RUN_INSTALLED_DPDK -eq 1 ]; then
WITH_DPDK_DIR=$DPDK_LINUX_DIR
fi
# Override the default HUGEMEM in scripts/setup.sh to allocate 8GB in hugepages.
export HUGEMEM=8192
elif [ "$(uname -s)" = "FreeBSD" ]; then
MAKE="gmake"
MAKEFLAGS=${MAKEFLAGS:--j$(sysctl -a | grep -E -i 'hw.ncpu' | awk '{print $2}')}
DPDK_FREEBSD_DIR=/usr/local/share/dpdk/x86_64-native-bsdapp-clang
if [ -d $DPDK_FREEBSD_DIR ] && [ $SPDK_RUN_INSTALLED_DPDK -eq 1 ]; then
WITH_DPDK_DIR=$DPDK_FREEBSD_DIR
fi
# FreeBSD runs a much more limited set of tests, so keep the default 2GB.
export HUGEMEM=2048
else
Expand Down Expand Up @@ -413,11 +405,8 @@ function get_config_params() {
config_params+=' --with-uring'
fi

# By default, --with-dpdk is not set meaning the SPDK build will use the DPDK submodule.
# If a DPDK installation is found in a well-known location though, WITH_DPDK_DIR will be
# set which will override the default and use that DPDK installation instead.
if [ -n "$WITH_DPDK_DIR" ]; then
config_params+=" --with-dpdk=$WITH_DPDK_DIR"
if [ -n "$SPDK_RUN_EXTERNAL_DPDK" ]; then
config_params+=" --with-dpdk=$SPDK_RUN_EXTERNAL_DPDK"
fi

echo "$config_params"
Expand Down Expand Up @@ -1200,12 +1189,12 @@ function autotest_cleanup() {
function freebsd_update_contigmem_mod() {
if [ $(uname) = FreeBSD ]; then
kldunload contigmem.ko || true
if [ -n "$WITH_DPDK_DIR" ]; then
if [ -n "$SPDK_RUN_EXTERNAL_DPDK" ]; then
echo "Warning: SPDK only works on FreeBSD with patches that only exist in SPDK's dpdk submodule"
cp -f "$WITH_DPDK_DIR/kmod/contigmem.ko" /boot/modules/
cp -f "$WITH_DPDK_DIR/kmod/contigmem.ko" /boot/kernel/
cp -f "$WITH_DPDK_DIR/kmod/nic_uio.ko" /boot/modules/
cp -f "$WITH_DPDK_DIR/kmod/nic_uio.ko" /boot/kernel/
cp -f "$SPDK_RUN_EXTERNAL_DPDK/kmod/contigmem.ko" /boot/modules/
cp -f "$SPDK_RUN_EXTERNAL_DPDK/kmod/contigmem.ko" /boot/kernel/
cp -f "$SPDK_RUN_EXTERNAL_DPDK/kmod/nic_uio.ko" /boot/modules/
cp -f "$SPDK_RUN_EXTERNAL_DPDK/kmod/nic_uio.ko" /boot/kernel/
else
cp -f "$rootdir/dpdk/build/kmod/contigmem.ko" /boot/modules/
cp -f "$rootdir/dpdk/build/kmod/contigmem.ko" /boot/kernel/
Expand Down
2 changes: 0 additions & 2 deletions test/common/config/vm_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ SPDK_TEST_IOAT=0
# requires some extra configuration. see TEST_ENV_SETUP_README
SPDK_TEST_VHOST=0
SPDK_TEST_VHOST_INIT=0
# Not configured here
SPDK_RUN_INSTALLED_DPDK=0
EOF
fi
2 changes: 1 addition & 1 deletion test/external_code/test_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ make -C $SPDK_DIR -j$(nproc)

export SPDK_HEADER_DIR="$SPDK_DIR/include"
export SPDK_LIB_DIR="$SPDK_DIR/build/lib"
export DPDK_LIB_DIR="$SPDK_DIR/dpdk/build/lib"
export DPDK_LIB_DIR="${SPDK_RUN_EXTERNAL_DPDK:-$SPDK_DIR/dpdk/build}/lib"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPDK_LIB_DIR:$DPDK_LIB_DIR:"$test_root/passthru"

# The default target is to make both the app and bdev and link them against the combined SPDK shared library libspdk.so.
Expand Down

0 comments on commit 49473bd

Please sign in to comment.