add new topology parameter: arch
[csit.git] / tests / dpdk / dpdk_scripts / init_dpdk.sh
1 #!/bin/bash
2
3 set -x
4
5 # Setting variables
6 DPDK_VERSION=dpdk-17.11
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_VERSION}/
22
23 modprobe uio
24 echo "RC = $?"
25
26 lsmod | grep igb_uio
27 if [ $? -ne 1 ];
28 then
29     rmmod igb_uio || \
30         { echo "Failed to remove igb_uio module"; exit 1; }
31 fi
32
33 lsmod | grep uio_pci_generic
34 if [ $? -ne 1 ];
35 then
36     rmmod uio_pci_generic || \
37         { echo "Failed to remove uio_pci_generic module"; exit 1; }
38 fi
39
40 insmod ./${ARCH}-${MACHINE}-linuxapp-gcc/kmod/igb_uio.ko || \
41     { echo "Failed to insert igb_uio module"; exit 1; }
42
43 # Binding
44 ./usertools/dpdk-devbind.py -b igb_uio $1 $2 || \
45     { echo "Failed to bind interface $1 and $2 to igb_uio"; exit 1; }
46
47 cd ${PWDDIR}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.