7d3df0a67c26d9a5f47cc9c995451359d3f423e8
[csit.git] / tests / dpdk / dpdk_scripts / init_dpdk.sh
1 #!/bin/bash
2
3 set -x
4
5 # Setting variables
6 DPDK_DIR=dpdk
7 ROOTDIR=/tmp/openvpp-testing
8 PWDDIR=$(pwd)
9
10 # set arch, default to x86_64 if none given
11 ARCH=${3:-"x86_64"}
12
13 # dpdk prefers "arm64" to "aarch64" and does not allow arm64 native target
14 if [ $ARCH == "aarch64" ]; then
15     ARCH="arm64"
16     MACHINE="armv8a"
17 else
18     MACHINE="native"
19 fi
20
21 cd ${ROOTDIR}/${DPDK_DIR}/
22
23 # Binding
24 ./usertools/dpdk-devbind.py -b vfio-pci $1 $2 || \
25     { echo "Failed to bind interface $1 and $2 to vfio-pci"; exit 1; }
26
27 cd ${PWDDIR}