From 24f7c6a4d22b8d26f0aa86669fc7aadad2108f2f Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Fri, 13 Jul 2018 11:44:29 +0000 Subject: Refactor DPDK testcases to new structure + RXQ refactor Change-Id: Ic03a2e208b9fe5d324a5ed75a603af4cff1854a9 Signed-off-by: Peter Mikus --- tests/dpdk/dpdk_scripts/patch_l3fwd.sh | 35 +++++++++++++++++++++++++ tests/dpdk/dpdk_scripts/patch_l3fwd_flip_routes | 10 +++++++ 2 files changed, 45 insertions(+) create mode 100755 tests/dpdk/dpdk_scripts/patch_l3fwd.sh create mode 100755 tests/dpdk/dpdk_scripts/patch_l3fwd_flip_routes (limited to 'tests/dpdk/dpdk_scripts') diff --git a/tests/dpdk/dpdk_scripts/patch_l3fwd.sh b/tests/dpdk/dpdk_scripts/patch_l3fwd.sh new file mode 100755 index 0000000000..54ae7eaffc --- /dev/null +++ b/tests/dpdk/dpdk_scripts/patch_l3fwd.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -x + +# Setting variables +# set arch, default to x86_64 if none given +ARCH=${1:-"x86_64"} +PATCH=$2 + +# dpdk prefers "arm64" to "aarch64" and does not allow arm64 native target +if [ $ARCH == "aarch64" ]; then + ARCH="arm64" + MACHINE="armv8a" +else + MACHINE="native" +fi + +DPDK_DIR=dpdk +ROOTDIR=/tmp/openvpp-testing +PWDDIR=$(pwd) + +# Compile the l3fwd +export RTE_SDK=${ROOTDIR}/${DPDK_DIR}/ +export RTE_TARGET=${ARCH}-${MACHINE}-linuxapp-gcc +cd ${RTE_SDK}/examples/l3fwd +sudo sed -i 's/^#define RTE_TEST_RX_DESC_DEFAULT 128/#define RTE_TEST_RX_DESC_DEFAULT 2048/g' ./main.c +sudo sed -i 's/^#define RTE_TEST_TX_DESC_DEFAULT 512/#define RTE_TEST_TX_DESC_DEFAULT 2048/g' ./main.c + +chmod +x ${PATCH} && source ${PATCH} + +make clean +make -j || \ + { echo "Failed to compile l3fwd"; exit 1; } +cd ${PWDDIR} + diff --git a/tests/dpdk/dpdk_scripts/patch_l3fwd_flip_routes b/tests/dpdk/dpdk_scripts/patch_l3fwd_flip_routes new file mode 100755 index 0000000000..e0b204eb9c --- /dev/null +++ b/tests/dpdk/dpdk_scripts/patch_l3fwd_flip_routes @@ -0,0 +1,10 @@ +#!/bin/sh + +patch --ignore-whitespace l3fwd_lpm.c <<"_EOF" +44,45c44,45 +< {IPv4(1, 1, 1, 0), 24, 0}, +< {IPv4(2, 1, 1, 0), 24, 1}, +--- +> {IPv4(1, 1, 1, 0), 24, 1}, +> {IPv4(2, 1, 1, 0), 24, 0}, +_EOF -- cgit 1.2.3-korg