source: test/do-test-build-dpdk.sh @ 0af3a4e

cachetimestampsdevelopetsiliverc-4.0.4ringdecrementfixringperformance
Last change on this file since 0af3a4e was 6d17620, checked in by Richard Sanger <rsanger@…>, 3 years ago

Updates to DPDK to build with 18.02.1

  • Updates to improve backwards compatibility
  • Update to use a new portid_t as the size has changed between releases
  • Fix bug with variable order in tx, both values were zero so this didn't matter
  • Update build script to test newer dpdk versions, remove older versions no longer supported by new kernels
  • Property mode set to 100755
File size: 3.7 KB
Line 
1#!/bin/bash
2# Checks that versions of the DPDK library compile successfully
3# Ensure that all DPDK requirements are installed on the system
4
5TEST_DIR=$(pwd)
6LIBTRACE_DIR="$TEST_DIR"/../
7DPDK_DOWNLOAD_PATH=http://wand.nz/~rjs51/dpdk/
8DOWNLOAD_DIR="$TEST_DIR"/DPDK_source
9BUILD_DIR="$TEST_DIR"/DPDK_builds
10BUILD_THREADS=9
11
12
13OK=0
14FAIL=""
15
16do_test() {
17        if "$@"; then
18                OK=$[ $OK + 1]
19        else
20                FAIL="$FAIL
21$@"
22        fi
23}
24
25# Old kernel version jessie 3.16
26declare -a dpdk_versions=(
27        "dpdk-1.7.1.tar.gz"
28        "dpdk-1.8.0.tar.gz"
29        "dpdk-2.0.0.tar.gz"
30        "dpdk-2.1.0.tar.gz"
31        "dpdk-2.2.0.tar.gz"
32        "dpdk-16.04.tar.gz"
33        "dpdk-16.07.2.tar.gz"
34        "dpdk-16.11.6.tar.gz"
35        )
36# Versions to check stretch linux 4.9
37declare -a dpdk_versions=(
38        "dpdk-2.2.0.tar.gz"
39        "dpdk-16.04.tar.gz"
40        "dpdk-16.07.2.tar.gz"
41        "dpdk-16.11.6.tar.gz"
42        "dpdk-17.02.1.tar.gz"
43        "dpdk-17.05.2.tar.gz"
44        "dpdk-17.08.2.tar.gz"
45        "dpdk-17.11.2.tar.gz"
46        "dpdk-18.02.1.tar.gz"
47        )
48
49
50mkdir "$DOWNLOAD_DIR" > /dev/null 2>&1
51if [ ! -d "$DOWNLOAD_DIR" ]; then
52        echo "ERROR: Could not create download directory"
53        return 1
54fi
55cd "$DOWNLOAD_DIR"
56
57# Download versions of DPDK
58for dpdk_version in "${dpdk_versions[@]}"
59do
60        if [ ! -e "$dpdk_version" ]; then
61                wget "$DPDK_DOWNLOAD_PATH"/"$dpdk_version" > /dev/null
62                if [ $? -ne 0 ]; then
63                        echo "ERROR: Failed to download" "$dpdk_version"
64                else
65                        tar xf "$dpdk_version"
66                        if [ $? -ne 0 ]; then
67                                echo "ERROR: Failed to extract" "$dpdk_version"
68                        fi
69                fi
70        fi
71done
72
73# Build the DPDK libraries
74# We try to not overwrite these, so that a rebuild is faster
75# We build DPDK without KNI, as most kernel dependent code is there
76#   - also excluding makes the build faster
77# We also disable error on warning, to improve forwards compiler compatibility
78cd "$DOWNLOAD_DIR"
79for dpdk_build in $(ls -d */)
80do
81        cd "$dpdk_build"
82        echo "Building $dpdk_build - this might take some time"
83        do_test make install T=x86_64-native-linuxapp-gcc \
84                             CONFIG_RTE_BUILD_COMBINE_LIBS=y \
85                             CONFIG_RTE_LIBRTE_KNI=n \
86                             CONFIG_RTE_KNI_KMOD=n \
87                             EXTRA_CFLAGS="-fPIC -w" -j $BUILD_THREADS \
88                             > build_stdout.txt 2> build_stderr.txt
89        cd ..
90done
91
92rm -r "$BUILD_DIR" > /dev/null 2>&1
93mkdir "$BUILD_DIR"
94if [ ! -d "$BUILD_DIR" ]; then
95        echo "ERROR: Could not create build directory"
96        return 1
97fi
98
99# Build libtrace against each version
100cd "$DOWNLOAD_DIR"
101for dpdk_build in $(ls -d */)
102do
103        cd "$LIBTRACE_DIR"
104        echo "Building libtrace with $dpdk_build - this may take some time"
105        export RTE_SDK="$DOWNLOAD_DIR"/"$dpdk_build"
106        export RTE_TARGET=x86_64-native-linuxapp-gcc
107
108        make clean > /dev/null 2> /dev/null
109        OUTPUT_PREFIX="$BUILD_DIR"/"$dpdk_build" 
110        rm -r "$OUTPUT_PREFIX" > /dev/null 2> /dev/null
111        mkdir "$OUTPUT_PREFIX"
112        if [ ! -d "$OUTPUT_PREFIX" ]; then
113                echo "ERROR: Could not create libtrace build directory $dpdk_build"
114                continue
115        fi
116        ./bootstrap.sh > /dev/null 2> /dev/null
117        do_test ./configure --with-dpdk --prefix="$OUTPUT_PREFIX" \
118                > "$OUTPUT_PREFIX"/conf_out.txt 2> "$OUTPUT_PREFIX"/conf_err.txt
119        do_test grep "configure: Compiled with DPDK live capture support: Yes" \
120                     "$OUTPUT_PREFIX"/conf_out.txt 
121        do_test make -j $BUILD_THREADS \
122                > "$OUTPUT_PREFIX"/make_out.txt 2> "$OUTPUT_PREFIX"/make_err.txt
123        do_test make install \
124                > "$OUTPUT_PREFIX"/install_out.txt 2> "$OUTPUT_PREFIX"/install_err.txt
125done
126
127# Check we actually included dpdk
128cd "$BUILD_DIR"
129for dpdk_build in $(ls -d */)
130do
131        cd "$BUILD_DIR"/"$dpdk_build"/bin
132        ./tracepktdump -H | grep "dpdk format module"
133        if [ $? -ne 0 ]; then
134                FAIL="$FAIL
135Failed to build $dpdk_build libtrace"
136        fi
137done
138
139echo
140echo "Tests passed: $OK"
141echo "Tests failed: $FAIL"
142if [ "$FAIL" != "" ]; then
143        echo "Some tests failed check the output logs"\
144             "conf/make/install[_err/_out].txt" \
145             "in the build directory"
146fi
Note: See TracBrowser for help on using the repository browser.