summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2016-06-07 00:20:52 +0000
committerGuo Ruijing <ruijing.guo@intel.com>2016-06-07 17:50:27 +0000
commit537bee446fd9fdac7347c476588c97b19391bf3d (patch)
tree77ad90f798ff252d8d0ecb2481bdf4c8ece316f1
parent133eadeac3e24bba349fe3e5adde4bc3b08a9cb9 (diff)
Update to DPDK 16.04 + OVS 2.5.90
Change-Id: I6efd1fd3efb6f0c80313a7a1d9d8ac87486802f9 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Notes
Notes (review): Code-Review+2: Ruijing <ruijing.guo@intel.com> Workflow+1: Ruijing <ruijing.guo@intel.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 08 Jun 2016 02:00:20 +0000 Reviewed-on: https://review.openstack.org/323683 Project: openstack/fuel-plugin-ovs Branch: refs/heads/master
-rw-r--r--deployment_scripts/install.sh32
-rwxr-xr-xovs_build/build-ovs-dpdk.sh26
-rwxr-xr-xovs_build/build-ovs-nsh-dpdk.sh16
-rwxr-xr-xovs_build/rules150
-rw-r--r--vagrant/Vagrantfile2
5 files changed, 193 insertions, 33 deletions
diff --git a/deployment_scripts/install.sh b/deployment_scripts/install.sh
index e4b9489..87868d8 100644
--- a/deployment_scripts/install.sh
+++ b/deployment_scripts/install.sh
@@ -13,28 +13,28 @@ dpdk=$3
13if [ $nsh = 'true' ] 13if [ $nsh = 'true' ]
14then 14then
15 wget -r -np -nH --cut-dirs=3 http://$host:8080/plugins/fuel-plugin-ovs-0.9/ovs-nsh/ 15 wget -r -np -nH --cut-dirs=3 http://$host:8080/plugins/fuel-plugin-ovs-0.9/ovs-nsh/
16 dpkg -i openvswitch-datapath-dkms_2.5.90-1_all.deb 16 dpkg -i openvswitch-datapath-dkms_2.5.90-1.nsh_all.deb
17 dpkg -i openvswitch-common_2.5.90-1_amd64.deb 17 dpkg -i openvswitch-common_2.5.90-1.nsh_amd64.deb
18 dpkg -i openvswitch-switch_2.5.90-1_amd64.deb 18 dpkg -i openvswitch-switch_2.5.90-1.nsh_amd64.deb
19 dpkg -i python-openvswitch_2.5.90-1_all.deb 19 dpkg -i python-openvswitch_2.5.90-1.nsh_all.deb
20 if [ $dpdk = 'true' ] 20 if [ $dpdk = 'true' ]
21 then 21 then
22 dpkg -i libxenstore3.0_4.4.2-0ubuntu0.14.04.5_amd64.deb 22 dpkg -i libxenstore3.0*.deb
23 dpkg -i libdpdk0_2.2.0-1_amd64.deb 23 dpkg -i libdpdk0_16.04-1_amd64.deb
24 dpkg -i dpdk_2.2.0-1_amd64.deb 24 dpkg -i dpdk_16.04-1_amd64.deb
25 dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb 25 dpkg -i openvswitch-switch-dpdk_2.5.90-1.nsh_amd64.deb
26 fi 26 fi
27else 27else
28 wget -r -np -nH --cut-dirs=3 http://$host:8080/plugins/fuel-plugin-ovs-0.9/ovs-dpdk/ 28 wget -r -np -nH --cut-dirs=3 http://$host:8080/plugins/fuel-plugin-ovs-0.9/ovs-dpdk/
29 dpkg -i openvswitch-datapath-dkms_2.5.1-1_all.deb 29 dpkg -i openvswitch-datapath-dkms_2.5.90-1_all.deb
30 dpkg -i openvswitch-common_2.5.1-1_amd64.deb 30 dpkg -i openvswitch-common_2.5.90-1_amd64.deb
31 dpkg -i openvswitch-switch_2.5.1-1_amd64.deb 31 dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
32 dpkg -i python-openvswitch_2.5.1-1_all.deb 32 dpkg -i python-openvswitch_2.5.90-1_all.deb
33 if [ $dpdk = 'true' ] 33 if [ $dpdk = 'true' ]
34 then 34 then
35 dpkg -i libxenstore3.0_4.4.2-0ubuntu0.14.04.5_amd64.deb 35 dpkg -i libxenstore3.0*.deb
36 dpkg -i libdpdk0_2.2.0-1_amd64.deb 36 dpkg -i libdpdk0_16.04-1_amd64.deb
37 dpkg -i dpdk_2.2.0-1_amd64.deb 37 dpkg -i dpdk_16.04-1_amd64.deb
38 dpkg -i openvswitch-switch-dpdk_2.5.1-1_amd64.deb 38 dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb
39 fi 39 fi
40fi 40fi
diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
index 8b2ac2e..66334f2 100755
--- a/ovs_build/build-ovs-dpdk.sh
+++ b/ovs_build/build-ovs-dpdk.sh
@@ -1,8 +1,10 @@
1#!/bin/bash 1#!/bin/bash
2 2
3OVS_COMMIT=cd4764fdd8ce0aa0063525dad0e67f20b3bcf6e9 3set -eux
4
5OVS_COMMIT=7d8eadce4df70f563a0c0123c612f6117c8ff864
4URL_OVS=https://github.com/openvswitch/ovs.git 6URL_OVS=https://github.com/openvswitch/ovs.git
5OVS_VER=${OVS_VER:-2.5.1} 7OVS_VER=${OVS_VER:-2.5.90}
6BUILD_HOME=$HOME/dpdk 8BUILD_HOME=$HOME/dpdk
7BUILD_DEST=${BUILD_DEST:-/deb} 9BUILD_DEST=${BUILD_DEST:-/deb}
8 10
@@ -12,12 +14,14 @@ sudo apt-get build-dep openvswitch -y
12sudo apt-get -y install devscripts dpkg-dev git wget 14sudo apt-get -y install devscripts dpkg-dev git wget
13 15
14rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME} 16rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
17cp `dirname $0`/rules ${BUILD_HOME}
15 18
16cd ${BUILD_HOME} 19cd ${BUILD_HOME}
17wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc 20wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
18wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz 21wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
19wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz 22wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
20dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc 23dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
24wget -c http://fast.dpdk.org/rel/dpdk-16.04.tar.xz
21 25
22# copy from debian/control 26# copy from debian/control
23sudo apt-get install -y debhelper \ 27sudo apt-get install -y debhelper \
@@ -35,12 +39,15 @@ sudo apt-get install -y debhelper \
35 texlive-fonts-recommended \ 39 texlive-fonts-recommended \
36 texlive-latex-extra 40 texlive-latex-extra
37 41
38cd dpdk-2.2.0; rm -rf debian/patches/; 42cd dpdk-2.2.0; rm -rf debian/patches/; uupdate -v 16.04 ../dpdk-16.04.tar.xz
43cd ${BUILD_HOME}/dpdk-16.04
39cat << EOF > debian/changelog 44cat << EOF > debian/changelog
40dpdk (2.2.0-1) unstable; urgency=low 45dpdk (16.04-1) unstable; urgency=low
41 [ DPDK team] 46 * DPDK 16.04
42 * New upstream version 47 -- DPDK team <dev@dpdk.org>
43EOF 48EOF
49mv debian/rules debian/rules.orig
50cp ${BUILD_HOME}/rules debian/rules
44debian/rules build; fakeroot debian/rules binary 51debian/rules build; fakeroot debian/rules binary
45cd ${BUILD_HOME}; sudo dpkg -i *.deb 52cd ${BUILD_HOME}; sudo dpkg -i *.deb
46apt-get download libxenstore3.0 53apt-get download libxenstore3.0
@@ -77,14 +84,13 @@ cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
77rm -rf openvswitch-dpdk-${OVS_VER}* 84rm -rf openvswitch-dpdk-${OVS_VER}*
78cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz 85cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
79cd ../openvswitch-dpdk-${OVS_VER} 86cd ../openvswitch-dpdk-${OVS_VER}
80sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4 87#sed -i 's~DPDK_LIB_DIR=.*~DPDK_LIB_DIR="$with_dpdk/x86_64-linux-gnu/lib"~' acinclude.m4
81sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
82autoreconf --install 88autoreconf --install
83rm -rf debian/patches/ .git; 89rm -rf debian/patches/ .git;
84cat << EOF > debian/changelog 90cat << EOF > debian/changelog
85openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low 91openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
86 [ Open vSwitch team ] 92 * New upstream version
87 * Open vSwitch Upstream 93 -- Open vSwitch team <dev@openvswitch.org>
88EOF 94EOF
89debian/rules build; fakeroot debian/rules binary 95debian/rules build; fakeroot debian/rules binary
90 96
diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
index 53bb617..c7bdeba 100755
--- a/ovs_build/build-ovs-nsh-dpdk.sh
+++ b/ovs_build/build-ovs-nsh-dpdk.sh
@@ -38,8 +38,8 @@ sudo apt-get install -y debhelper \
38cd dpdk-2.2.0; rm -rf debian/patches/; 38cd dpdk-2.2.0; rm -rf debian/patches/;
39cat << EOF > debian/changelog 39cat << EOF > debian/changelog
40dpdk (2.2.0-1) unstable; urgency=low 40dpdk (2.2.0-1) unstable; urgency=low
41 [ DPDK team] 41 * DPDK 2.2.0
42 * New upstream version 42 -- DPDK team <dev@dpdk.org>
43EOF 43EOF
44debian/rules build; fakeroot debian/rules binary 44debian/rules build; fakeroot debian/rules binary
45cd ${BUILD_HOME}; sudo dpkg -i *.deb 45cd ${BUILD_HOME}; sudo dpkg -i *.deb
@@ -88,13 +88,17 @@ sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
88autoreconf --install 88autoreconf --install
89rm -rf debian/patches/ .git; 89rm -rf debian/patches/ .git;
90cat << EOF > debian/changelog 90cat << EOF > debian/changelog
91openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low 91openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
92 [ Open vSwitch team ] 92 * Support NSH
93 * Support NSH 93 -- Open vSwitch team <dev@openvswitch.org>
94EOF 94EOF
95debian/rules build; fakeroot debian/rules binary 95debian/rules build; fakeroot debian/rules binary
96 96
97cd ${BUILD_HOME}/ovs 97cd ${BUILD_HOME}/ovs
98cat << EOF > debian/changelog
99openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
100 * Support NSH
101 -- Open vSwitch team <dev@openvswitch.org>
102EOF
98debian/rules build; fakeroot debian/rules binary 103debian/rules build; fakeroot debian/rules binary
99
100cp ${BUILD_HOME}/*.deb ${BUILD_DEST} 104cp ${BUILD_HOME}/*.deb ${BUILD_DEST}
diff --git a/ovs_build/rules b/ovs_build/rules
new file mode 100755
index 0000000..f2f5a17
--- /dev/null
+++ b/ovs_build/rules
@@ -0,0 +1,150 @@
1#!/usr/bin/make -f
2# See debhelper(7) (uncomment to enable)
3# output every command that modifies files on the build system.
4#export DH_VERBOSE = 1
5
6# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
7DPKG_EXPORT_BUILDFLAGS = 1
8include /usr/share/dpkg/default.mk
9
10DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
11
12# see FEATURE AREAS in dpkg-buildflags(1)
13export DEB_BUILD_MAINT_OPTIONS = hardening=+all
14
15# build with debug symbols, dh_strip will create -dgbsyms packages by that
16export EXTRA_CFLAGS = -g
17
18# see ENVIRONMENT in dpkg-buildflags(1)
19# package maintainers to append CFLAGS
20#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
21# package maintainers to append LDFLAGS
22#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
23
24DPDK_CONFIG = "$(DEB_HOST_GNU_CPU)-native-linuxapp-gcc"
25DPDK_STATIC_DIR = "debian/build/static-root"
26DPDK_SHARED_DIR = "debian/build/shared-root"
27
28clean:
29 dh_testdir
30 rm -rf debian/build debian/tmp
31 dh_clean
32
33build-config:
34 dh_testdir
35 $(MAKE) O=$(DPDK_STATIC_DIR) T=$(DPDK_CONFIG) config
36
37build-indep: build-config
38 dh_testdir
39 $(MAKE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html
40
41build-arch: build-config
42 dh_testdir
43 $(MAKE) O=$(DPDK_STATIC_DIR) build
44 # Unfortunately the decision about having static or shared libraries is
45 # made for the whole build, which then produces only .a or .so files
46 # (but not both).
47 # And the target layout for target selection has no field for the
48 # type of library.
49 # Right now I hack this by doing a second build which only differs in
50 # the selection of shared libs.
51 # Shared libs should be default, so the previous static build is only
52 # used to get static libraries.
53 cp -a $(DPDK_STATIC_DIR) $(DPDK_SHARED_DIR)
54 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \
55 $(DPDK_SHARED_DIR)/.config
56 $(MAKE) O=$(DPDK_SHARED_DIR) build
57
58build: build-arch build-indep
59
60binary-indep: PACKAGE_NAME=dpdk-doc
61binary-indep: DOCDIR=usr/share/doc/dpdk
62binary-indep: export DH_OPTIONS=--indep
63binary-indep:
64 dh_testroot
65 dh_prep
66 dh_testdir
67 dh_installdirs
68 dh_install
69 dh_installdocs
70 dh_installchangelogs
71 dh_lintian
72 # Package: dpdk-doc
73 # All files based on the install-doc rule (includes examples)
74 $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
75 DESTDIR=debian/dpdk-doc install-doc
76 dh_link
77 dh_compress
78 dh_fixperms
79 dh_installdeb
80 dh_gencontrol
81 dh_md5sums
82 dh_builddeb
83
84binary-arch: LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
85binary-arch: export DH_OPTIONS=--arch
86binary-arch:
87 dh_testroot
88 dh_prep
89 dh_testdir
90 dh_installdirs
91 dh_install
92 dh_installdocs
93 dh_installchangelogs
94 dh_lintian
95 dh_systemd_enable
96 dh_installinit --no-start --no-restart-on-upgrade
97 dh_systemd_start --no-start --no-restart-on-upgrade
98 # Package: dpdk (runtime)
99 $(MAKE) O=$(DPDK_STATIC_DIR) prefix=/usr \
100 DESTDIR=debian/dpdk install-runtime
101 $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
102 DESTDIR=debian/dpdk install-runtime
103 cp debian/dpdk.interfaces debian/dpdk/etc/dpdk/interfaces
104 rm debian/dpdk/usr/sbin/dpdk_nic_bind
105 ln -s /usr/share/dpdk/tools/dpdk_nic_bind.py \
106 debian/dpdk/sbin/dpdk_nic_bind
107 # Package: libdpdk0 (bare runtime libs)
108 mkdir -p debian/libdpdk0/$(LIBDIR)
109 # NOTE so far upstream dpdk has not settled on really versioning the
110 # combined lib. There are discussions ongoing and various alternative
111 # approaches.
112 # We have to wait until that is clarified upstream (in a follow on dpdk
113 # version).
114 # One likely solution will make us ship the non combined .so and a
115 # linker script which replaces the combined lib.
116 # To easen package management a few notes how this will change if that
117 # happens:
118 # NOTE: linker script - this becomes a nop (linker skript has no sover
119 # on its own)
120 rm debian/dpdk/usr/lib/libdpdk.so
121 cp -a $(DPDK_SHARED_DIR)/lib/* debian/libdpdk0/$(LIBDIR)/
122 # NOTE: linker script - insert basenames loop for all .so's
123 # NOTE: linker script - we also will need multiple symbol files then
124 # Package: dpdk-dev (build environment)
125 $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
126 DESTDIR=debian/dpdk-dev install-sdk
127 cp $(DPDK_SHARED_DIR)/.config debian/dpdk-dev/usr/share/dpdk/config
128 # Package: libdpdk-dev (bare headers and static devel libs)
129 mkdir -p debian/libdpdk-dev/usr/lib/
130 # NOTE: linker script - insert basenames loop for all .a's
131 #ln -s /$(LIBDIR)/libdpdk.so \
132 # debian/libdpdk-dev/$(LIBDIR)/libdpdk.so.0
133 cp -a $(DPDK_STATIC_DIR)/lib/* debian/libdpdk-dev/usr/lib/
134 mv debian/dpdk-dev/usr/include/dpdk debian/libdpdk-dev/usr/include/
135 # NOTE: linker script - package instead of removing all sublibs
136 rm -rf debian/dpdk/usr/lib*
137 dh_python2
138 dh_perl
139 dh_link
140 dh_compress
141 dh_fixperms
142 dh_strip
143 dh_makeshlibs
144 dh_shlibdeps
145 dh_installdeb
146 dh_gencontrol
147 dh_md5sums
148 dh_builddeb
149
150binary: binary-arch binary-indep
diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile
index bd4ed6b..06bbc95 100644
--- a/vagrant/Vagrantfile
+++ b/vagrant/Vagrantfile
@@ -11,7 +11,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
11 11
12 config.vm.define "fuel" do | h | 12 config.vm.define "fuel" do | h |
13 h.vm.host_name = "fuel" 13 h.vm.host_name = "fuel"
14 h.vm.provision :shell, :inline => "/vagrant/build_fuel_plugin.sh" 14 h.vm.provision :shell, :inline => "/vagrant/build_fuel_plugin.sh", privileged: false
15 h.vm.synced_folder "..", "/fuel-plugin" 15 h.vm.synced_folder "..", "/fuel-plugin"
16 h.vm.provider :virtualbox do |v| 16 h.vm.provider :virtualbox do |v|
17 v.customize ["modifyvm", :id, "--memory", 4096] 17 v.customize ["modifyvm", :id, "--memory", 4096]