3 # Copyright (c) 2016-2017 Intel Corporation
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 INSTALL_OVS_BIN="/usr/src"
22 if [[ $EUID -ne 0 ]]; then
23 echo "Must be root to run $0"
31 if [ -n "${download_type}" ]; then
32 echo "Download ${download_type} zip"
34 # rm goes into calling code
36 if [ ! -e "${url##*/}" ]; then
44 echo "Build DPDK libraries"
46 if [[ $DPDK_VERSION != "" ]]; then
47 export DPDK_DIR=$INSTALL_OVS_BIN/dpdk-stable-$DPDK_VERSION
48 export RTE_TARGET=x86_64-native-linuxapp-gcc
49 export DPDK_BUILD=$DPDK_DIR/$RTE_TARGET
51 DPDK_DOWNLOAD="http://fast.dpdk.org/rel/dpdk-$DPDK_VERSION.tar.xz"
52 download_zip "${DPDK_DOWNLOAD}" "DPDK"
53 cd dpdk-stable-"$DPDK_VERSION"
54 make config T=$RTE_TARGET
55 make install -j $(nproc) T=$RTE_TARGET
62 echo "Build and install OVS with DPDK"
64 if [[ $OVS_VERSION != "" ]]; then
65 rm -rf openswitch-"$OVS_VERSION"
66 OVS_DOWNLOAD="http://openvswitch.org/releases/openvswitch-$OVS_VERSION.tar.gz"
67 download_zip "${OVS_DOWNLOAD}" "OVS"
68 cd openvswitch-"$OVS_VERSION"
69 export OVS_DIR=/usr/src/openvswitch-$OVS_VERSION
71 if [[ $DPDK_VERSION != "" ]]; then
72 ./configure --with-dpdk="$DPDK_BUILD"
76 make install -j $(nproc)
94 DPDK_VERSION="${i#*=}"
97 export http_proxy="${i#*=}"
98 export https_proxy="${i#*=}"
101 echo "CommandLine options:"
102 echo "===================="
103 echo "1. ovs_dpdk install mode:"
104 echo "./ovs_install.sh --ovs=<2.7.0> --dpdk=<supported dpdk versoin for given ovs> -p=<proxy>"