Refactor DPDK testcases to new structure
[csit.git] / tests / dpdk / dpdk_scripts / patch_l3fwd.sh
1 #!/bin/bash
2
3 set -x
4
5 # Setting variables
6 # set arch, default to x86_64 if none given
7 ARCH=${1:-"x86_64"}
8 PATCH=$2
9
10 # dpdk prefers "arm64" to "aarch64" and does not allow arm64 native target
11 if [ $ARCH == "aarch64" ]; then
12     ARCH="arm64"
13     MACHINE="armv8a"
14 else
15     MACHINE="native"
16 fi
17
18 DPDK_DIR=dpdk
19 ROOTDIR=/tmp/openvpp-testing
20 PWDDIR=$(pwd)
21
22 # Compile the l3fwd
23 export RTE_SDK=${ROOTDIR}/${DPDK_DIR}/
24 export RTE_TARGET=${ARCH}-${MACHINE}-linuxapp-gcc
25 cd ${RTE_SDK}/examples/l3fwd
26 sudo sed -i 's/^#define RTE_TEST_RX_DESC_DEFAULT 128/#define RTE_TEST_RX_DESC_DEFAULT 2048/g' ./main.c
27 sudo sed -i 's/^#define RTE_TEST_TX_DESC_DEFAULT 512/#define RTE_TEST_TX_DESC_DEFAULT 2048/g' ./main.c
28
29 chmod +x ${PATCH} && source ${PATCH}
30
31 make clean
32 make -j || \
33     { echo "Failed to compile l3fwd"; exit 1; }
34 cd ${PWDDIR}
35