Browse Source

Update to DPDK 16.04 + OVS 2.5.90

Change-Id: I6efd1fd3efb6f0c80313a7a1d9d8ac87486802f9
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Guo Ruijing 2 years ago
parent
commit
537bee446f
5 changed files with 193 additions and 33 deletions
  1. 16
    16
      deployment_scripts/install.sh
  2. 16
    10
      ovs_build/build-ovs-dpdk.sh
  3. 10
    6
      ovs_build/build-ovs-nsh-dpdk.sh
  4. 150
    0
      ovs_build/rules
  5. 1
    1
      vagrant/Vagrantfile

+ 16
- 16
deployment_scripts/install.sh View File

@@ -13,28 +13,28 @@ dpdk=$3
13 13
 if [ $nsh = 'true' ]
14 14
 then
15 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
17
-    dpkg -i openvswitch-common_2.5.90-1_amd64.deb
18
-    dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
19
-    dpkg -i python-openvswitch_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.nsh_amd64.deb
18
+    dpkg -i openvswitch-switch_2.5.90-1.nsh_amd64.deb
19
+    dpkg -i python-openvswitch_2.5.90-1.nsh_all.deb
20 20
     if [ $dpdk = 'true' ]
21 21
     then
22
-        dpkg -i libxenstore3.0_4.4.2-0ubuntu0.14.04.5_amd64.deb
23
-        dpkg -i libdpdk0_2.2.0-1_amd64.deb
24
-        dpkg -i dpdk_2.2.0-1_amd64.deb
25
-        dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb
22
+        dpkg -i libxenstore3.0*.deb
23
+        dpkg -i libdpdk0_16.04-1_amd64.deb
24
+        dpkg -i dpdk_16.04-1_amd64.deb
25
+        dpkg -i openvswitch-switch-dpdk_2.5.90-1.nsh_amd64.deb
26 26
     fi
27 27
 else
28 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
30
-    dpkg -i openvswitch-common_2.5.1-1_amd64.deb
31
-    dpkg -i openvswitch-switch_2.5.1-1_amd64.deb
32
-    dpkg -i python-openvswitch_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.90-1_amd64.deb
31
+    dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
32
+    dpkg -i python-openvswitch_2.5.90-1_all.deb
33 33
     if [ $dpdk = 'true' ]
34 34
     then
35
-        dpkg -i libxenstore3.0_4.4.2-0ubuntu0.14.04.5_amd64.deb
36
-        dpkg -i libdpdk0_2.2.0-1_amd64.deb
37
-        dpkg -i dpdk_2.2.0-1_amd64.deb
38
-        dpkg -i openvswitch-switch-dpdk_2.5.1-1_amd64.deb
35
+        dpkg -i libxenstore3.0*.deb
36
+        dpkg -i libdpdk0_16.04-1_amd64.deb
37
+        dpkg -i dpdk_16.04-1_amd64.deb
38
+        dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb
39 39
     fi
40 40
 fi

+ 16
- 10
ovs_build/build-ovs-dpdk.sh View File

@@ -1,8 +1,10 @@
1 1
 #!/bin/bash
2 2
 
3
-OVS_COMMIT=cd4764fdd8ce0aa0063525dad0e67f20b3bcf6e9
3
+set -eux
4
+
5
+OVS_COMMIT=7d8eadce4df70f563a0c0123c612f6117c8ff864
4 6
 URL_OVS=https://github.com/openvswitch/ovs.git
5
-OVS_VER=${OVS_VER:-2.5.1}
7
+OVS_VER=${OVS_VER:-2.5.90}
6 8
 BUILD_HOME=$HOME/dpdk
7 9
 BUILD_DEST=${BUILD_DEST:-/deb}
8 10
 
@@ -12,12 +14,14 @@ sudo apt-get build-dep openvswitch -y
12 14
 sudo apt-get -y install devscripts dpkg-dev git wget
13 15
 
14 16
 rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
17
+cp `dirname $0`/rules ${BUILD_HOME}
15 18
 
16 19
 cd ${BUILD_HOME}
17 20
 wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
18 21
 wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
19 22
 wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
20 23
 dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
24
+wget -c http://fast.dpdk.org/rel/dpdk-16.04.tar.xz
21 25
 
22 26
 # copy from debian/control
23 27
 sudo apt-get install -y debhelper \
@@ -35,12 +39,15 @@ sudo apt-get install -y debhelper \
35 39
                texlive-fonts-recommended  \
36 40
                texlive-latex-extra
37 41
 
38
-cd dpdk-2.2.0; rm -rf debian/patches/;
42
+cd dpdk-2.2.0; rm -rf debian/patches/; uupdate -v 16.04 ../dpdk-16.04.tar.xz
43
+cd ${BUILD_HOME}/dpdk-16.04
39 44
 cat << EOF > debian/changelog
40
-dpdk (2.2.0-1) unstable; urgency=low
41
-   [ DPDK team]
42
-   * New upstream version
45
+dpdk (16.04-1) unstable; urgency=low
46
+  * DPDK 16.04
47
+ -- DPDK team <dev@dpdk.org>
43 48
 EOF
49
+mv debian/rules debian/rules.orig
50
+cp ${BUILD_HOME}/rules debian/rules
44 51
 debian/rules build; fakeroot debian/rules binary
45 52
 cd ${BUILD_HOME}; sudo dpkg -i *.deb
46 53
 apt-get download libxenstore3.0
@@ -77,14 +84,13 @@ cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
77 84
 rm -rf openvswitch-dpdk-${OVS_VER}*
78 85
 cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
79 86
 cd ../openvswitch-dpdk-${OVS_VER}
80
-sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
81
-sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/'  acinclude.m4
87
+#sed -i 's~DPDK_LIB_DIR=.*~DPDK_LIB_DIR="$with_dpdk/x86_64-linux-gnu/lib"~'  acinclude.m4
82 88
 autoreconf --install
83 89
 rm -rf debian/patches/ .git;
84 90
 cat << EOF > debian/changelog
85 91
 openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
86
-   [ Open vSwitch team ]
87
-   * Open vSwitch Upstream
92
+  * New upstream version
93
+ -- Open vSwitch team <dev@openvswitch.org>
88 94
 EOF
89 95
 debian/rules build; fakeroot debian/rules binary
90 96
 

+ 10
- 6
ovs_build/build-ovs-nsh-dpdk.sh View File

@@ -38,8 +38,8 @@ sudo apt-get install -y debhelper \
38 38
 cd dpdk-2.2.0; rm -rf debian/patches/;
39 39
 cat << EOF > debian/changelog
40 40
 dpdk (2.2.0-1) unstable; urgency=low
41
-   [ DPDK team]
42
-   * New upstream version
41
+  * DPDK 2.2.0
42
+ -- DPDK team <dev@dpdk.org>
43 43
 EOF
44 44
 debian/rules build; fakeroot debian/rules binary
45 45
 cd ${BUILD_HOME}; sudo dpkg -i *.deb
@@ -88,13 +88,17 @@ sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/'  acinclude.m4
88 88
 autoreconf --install
89 89
 rm -rf debian/patches/ .git;
90 90
 cat << EOF > debian/changelog
91
-openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
92
-   [ Open vSwitch team ]
93
-   * Support NSH
91
+openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
92
+  * Support NSH
93
+ -- Open vSwitch team <dev@openvswitch.org>
94 94
 EOF
95 95
 debian/rules build; fakeroot debian/rules binary
96 96
 
97 97
 cd ${BUILD_HOME}/ovs
98
+cat << EOF > debian/changelog
99
+openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
100
+  * Support NSH
101
+ -- Open vSwitch team <dev@openvswitch.org>
102
+EOF
98 103
 debian/rules build; fakeroot debian/rules binary
99
-
100 104
 cp ${BUILD_HOME}/*.deb ${BUILD_DEST}

+ 150
- 0
ovs_build/rules View File

@@ -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/*
7
+DPKG_EXPORT_BUILDFLAGS = 1
8
+include /usr/share/dpkg/default.mk
9
+
10
+DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
11
+
12
+# see FEATURE AREAS in dpkg-buildflags(1)
13
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
14
+
15
+# build with debug symbols, dh_strip will create -dgbsyms packages by that
16
+export 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
+
24
+DPDK_CONFIG  = "$(DEB_HOST_GNU_CPU)-native-linuxapp-gcc"
25
+DPDK_STATIC_DIR = "debian/build/static-root"
26
+DPDK_SHARED_DIR = "debian/build/shared-root"
27
+
28
+clean:
29
+	dh_testdir
30
+	rm -rf debian/build debian/tmp
31
+	dh_clean
32
+
33
+build-config:
34
+	dh_testdir
35
+	$(MAKE) O=$(DPDK_STATIC_DIR) T=$(DPDK_CONFIG) config
36
+
37
+build-indep: build-config
38
+	dh_testdir
39
+	$(MAKE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html
40
+
41
+build-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
+
58
+build: build-arch build-indep
59
+
60
+binary-indep: PACKAGE_NAME=dpdk-doc
61
+binary-indep: DOCDIR=usr/share/doc/dpdk
62
+binary-indep: export DH_OPTIONS=--indep
63
+binary-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
+
84
+binary-arch: LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
85
+binary-arch: export DH_OPTIONS=--arch
86
+binary-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
+
150
+binary: binary-arch binary-indep

+ 1
- 1
vagrant/Vagrantfile View File

@@ -11,7 +11,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
11 11
 
12 12
   config.vm.define "fuel" do | h |
13 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 15
     h.vm.synced_folder "..", "/fuel-plugin"
16 16
     h.vm.provider :virtualbox do |v|
17 17
       v.customize ["modifyvm", :id, "--memory", 4096]

Loading…
Cancel
Save