Browse Source

Add DPDK Initialization

Change-Id: Ieef5f888bf2ccfde64df97d8131d05dd25eefca9
Signed-off-by: Ling Yu <ling.y.yu@intel.com>
Signed-off-by: Ruijing Guo <ruijing.guo@intel.com>
Ruijing Guo 3 years ago
parent
commit
ea851c2249

+ 26
- 31
deployment_scripts/puppet/manifests/ovs-install-compute.pp View File

@@ -1,47 +1,42 @@
1 1
 $fuel_settings = parseyaml(file('/etc/compute.yaml'))
2 2
 if $operatingsystem == 'Ubuntu' {
3 3
         if $fuel_settings['fuel-plugin-ovs']['use_dpdk'] {
4
-                exec { "wget dpdk":
5
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk-install/dpdk-install.sh",
6
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
7
-                }
4
+                $NICS = $fuel_settings['fuel-plugin-ovs']['dpdk-bind-nic']
8 5
                 exec { "install dpdk":
9
-                        command => "bash /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install.sh",
10
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
11
-                }
12
-                package { 'openvswitch-datapath-dkms':
13
-                        ensure => "2.4.91-1",
14
-                }
15
-                package { 'openvswitch-common':
16
-                        ensure => "2.4.91-1",
17
-                }
18
-                package { 'openvswitch-switch':
19
-                        ensure => "2.4.91-1",
20
-                        require => Package['openvswitch-common','openvswitch-datapath-dkms'],
21
-                }
22
-        } else {
23
-                exec { "install openvswitch-datapath-dkms package":
24
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-datapath-dkms_2.4.90-1_all.deb;sudo dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb",
6
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-install.sh; bash ./dpdk-install.sh",
25 7
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
26
-                }
27
-                exec { "install openvswitch-common package":
28
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-common_2.4.90-1_amd64.deb;sudo dpkg -i openvswitch-common_2.4.90-1_amd64.deb",
8
+                } ->
9
+                exec {'dpdk-init':
10
+                command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.init -O /etc/init.d/dpdk;chmod +x /etc/init.d/dpdk",
11
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
12
+                } ->
13
+                exec {'dpdk-conf':
14
+                command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.conf -O /etc/default/dpdk.conf",
15
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
16
+                } ->
17
+                exec {'adapt_conf_file':
18
+                command => "sed 's/DPDK_NIC_MAPPINGS=.*/DPDK_NIC_MAPPINGS=${NICS}/' -i /etc/default/dpdk.conf",
19
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
20
+                } ->
21
+                exec {'dpdk start':
22
+                command => "bash /etc/init.d/dpdk start",
23
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
24
+                } ->
25
+                exec { "install ovs with dpdk":
26
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/ovs-dpdk-install.sh; bash ./ovs-dpdk-install.sh",
29 27
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
30 28
                 }
31
-                exec { "install openvswitch-switch package":
32
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-switch_2.4.90-1_amd64.deb;sudo dpkg -i openvswitch-switch_2.4.90-1_amd64.deb",
29
+        } else {
30
+                exec { "install ovs":
31
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/ovs-install.sh; bash ./ovs-install.sh",
33 32
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
34 33
                 }
35 34
         }
36 35
         if $fuel_settings['fuel-plugin-ovs']['use_dppd'] {
37
-                exec { "wget dppd":
38
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd-install/dppd-install.sh",
39
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
40
-                }
41 36
                 exec { "install dppd":
42
-                        command => "bash /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install.sh",
37
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-install.sh; bash ./dppd-install.sh",
43 38
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
44 39
                 }
45 40
         }
46 41
 } elsif $operatingsystem == 'CentOS' {
47
-}
42
+}

+ 25
- 30
deployment_scripts/puppet/manifests/ovs-install-controller.pp View File

@@ -1,45 +1,40 @@
1 1
 $fuel_settings = parseyaml(file('/etc/controller.yaml'))
2 2
 if $operatingsystem == 'Ubuntu' {
3 3
         if $fuel_settings['fuel-plugin-ovs']['use_dpdk'] {
4
-                exec { "wget dpdk":
5
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk-install/dpdk-install.sh",
6
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
7
-                }
4
+                $NICS = $fuel_settings['fuel-plugin-ovs']['dpdk-bind-nic']
8 5
                 exec { "install dpdk":
9
-                        command => "bash /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install.sh",
10
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
11
-                }
12
-                package { 'openvswitch-datapath-dkms':
13
-                        ensure => "2.4.91-1",
14
-                }
15
-                package { 'openvswitch-common':
16
-                        ensure => "2.4.91-1",
17
-                }
18
-                package { 'openvswitch-switch':
19
-                        ensure => "2.4.91-1",
20
-                        require => Package['openvswitch-common','openvswitch-datapath-dkms'],
21
-                }
22
-        } else {
23
-                exec { "install openvswitch-datapath-dkms package":
24
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-datapath-dkms_2.4.90-1_all.deb;sudo dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb",
6
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-install.sh; bash ./dpdk-install.sh",
25 7
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
26
-                }
27
-                exec { "install openvswitch-common package":
28
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-common_2.4.90-1_amd64.deb;sudo dpkg -i openvswitch-common_2.4.90-1_amd64.deb",
8
+                } ->
9
+                exec {'dpdk-init':
10
+                command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.init -O /etc/init.d/dpdk;chmod +x /etc/init.d/dpdk",
11
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
12
+                } ->
13
+                exec {'dpdk-conf':
14
+                command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.conf -O /etc/default/dpdk.conf",
15
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
16
+                } ->
17
+                exec {'adapt_conf_file':
18
+                command => "sed 's/DPDK_NIC_MAPPINGS=.*/DPDK_NIC_MAPPINGS=${NICS}/' -i /etc/default/dpdk.conf",
19
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
20
+                } ->
21
+                exec {'dpdk start':
22
+                command => "bash /etc/init.d/dpdk start",
23
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
24
+                } ->
25
+                exec { "install ovs with dpdk":
26
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/ovs-dpdk-install.sh; bash ./ovs-dpdk-install.sh",
29 27
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
30 28
                 }
31
-                exec { "install openvswitch-switch package":
32
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-switch_2.4.90-1_amd64.deb;sudo dpkg -i openvswitch-switch_2.4.90-1_amd64.deb",
29
+        } else {
30
+                exec { "install ovs":
31
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/ovs-install.sh; bash ./ovs-install.sh",
33 32
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
34 33
                 }
35 34
         }
36 35
         if $fuel_settings['fuel-plugin-ovs']['use_dppd'] {
37
-                exec { "wget dppd":
38
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd-install/dppd-install.sh",
39
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
40
-                }
41 36
                 exec { "install dppd":
42
-                        command => "bash /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install.sh",
37
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-install.sh; bash ./dppd-install.sh",
43 38
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
44 39
                 }
45 40
         }

+ 25
- 30
deployment_scripts/puppet/manifests/ovs-install-primary-controller.pp View File

@@ -1,45 +1,40 @@
1 1
 $fuel_settings = parseyaml(file('/etc/primary-controller.yaml'))
2 2
 if $operatingsystem == 'Ubuntu' {
3 3
         if $fuel_settings['fuel-plugin-ovs']['use_dpdk'] {
4
-                exec { "wget dpdk":
5
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk-install/dpdk-install.sh",
6
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
7
-                }
4
+                $NICS = $fuel_settings['fuel-plugin-ovs']['dpdk-bind-nic']
8 5
                 exec { "install dpdk":
9
-                        command => "bash /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install.sh",
10
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
11
-                }
12
-                package { 'openvswitch-datapath-dkms':
13
-                        ensure => "2.4.91-1",
14
-                }
15
-                package { 'openvswitch-common':
16
-                        ensure => "2.4.91-1",
17
-                }
18
-                package { 'openvswitch-switch':
19
-                        ensure => "2.4.91-1",
20
-                        require => Package['openvswitch-common','openvswitch-datapath-dkms'],
21
-                }
22
-        } else {
23
-                exec { "install openvswitch-datapath-dkms package":
24
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-datapath-dkms_2.4.90-1_all.deb;sudo dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb",
6
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-install.sh; bash ./dpdk-install.sh",
25 7
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
26
-                }
27
-                exec { "install openvswitch-common package":
28
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-common_2.4.90-1_amd64.deb;sudo dpkg -i openvswitch-common_2.4.90-1_amd64.deb",
8
+                } ->
9
+                exec {'dpdk-init':
10
+                command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.init -O /etc/init.d/dpdk;chmod +x /etc/init.d/dpdk",
11
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
12
+                } ->
13
+                exec {'dpdk-conf':
14
+                command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.conf -O /etc/default/dpdk.conf",
15
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
16
+                } ->
17
+                exec {'adapt_conf_file':
18
+                command => "sed 's/DPDK_NIC_MAPPINGS=.*/DPDK_NIC_MAPPINGS=${NICS}/' -i /etc/default/dpdk.conf",
19
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
20
+                } ->
21
+                exec {'dpdk start':
22
+                command => "bash /etc/init.d/dpdk start",
23
+                path   => "/usr/bin:/usr/sbin:/bin:/sbin",
24
+                } ->
25
+                exec { "install ovs with dpdk":
26
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/ovs-dpdk-install.sh; bash ./ovs-dpdk-install.sh",
29 27
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
30 28
                 }
31
-                exec { "install openvswitch-switch package":
32
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/openvswitch-switch_2.4.90-1_amd64.deb;sudo dpkg -i openvswitch-switch_2.4.90-1_amd64.deb",
29
+        } else {
30
+                exec { "install ovs":
31
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/ovs-install.sh; bash ./ovs-install.sh",
33 32
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
34 33
                 }
35 34
         }
36 35
         if $fuel_settings['fuel-plugin-ovs']['use_dppd'] {
37
-                exec { "wget dppd":
38
-                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd-install/dppd-install.sh",
39
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
40
-                }
41 36
                 exec { "install dppd":
42
-                        command => "bash /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install.sh",
37
+                        command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-install.sh; bash ./dppd-install.sh",
43 38
                         path   => "/usr/bin:/usr/sbin:/bin:/sbin",
44 39
                 }
45 40
         }

+ 5
- 0
environment_config.yaml View File

@@ -4,6 +4,11 @@ attributes:
4 4
       weight: 20
5 5
       value: false
6 6
       label: "Use dpdk"
7
+    dpdk-bind-nic:
8
+      value: 'eth2'
9
+      label: 'Network device'
10
+      weight: 40
11
+      type: "text"
7 12
     use_dppd:
8 13
       type: "checkbox"
9 14
       weight: 20

+ 1
- 1
ovs-nsh/build-ovs-nsh-dpdk.sh View File

@@ -32,5 +32,5 @@ export RTE_SDK=/dpdk-${DPDK_VER}
32 32
 export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
33 33
 ./boot.sh
34 34
 ./configure --with-dpdk=$DPDK_BUILD
35
-sed -i "s/2.4.90-1/2.4.91-1/" debian/changelog;sed -i "s?configure --with-linux?configure --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc --with-linux?" debian/dkms.conf.in;sed -i "s?configure --with-linux?configure --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc --with-linux?" debian/rules.modules;sed -i "s?configure --?configure -- --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc?" debian/rules;make dist;tar -xzf openvswitch-2.4.90.tar.gz;
35
+sed -i "s?set ovs-vswitchd unix?set ovs-vswitchd --dpdk -c 0x1 -n 4 -- unix?" utilities/ovs-ctl.in;sed -i "s?configure --with-linux?configure --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc --with-linux?" debian/dkms.conf.in;sed -i "s?configure --with-linux?configure --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc --with-linux?" debian/rules.modules;sed -i "s?configure --?configure -- --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc?" debian/rules;make dist;tar -xzf openvswitch-2.4.90.tar.gz;
36 36
 cd openvswitch-2.4.90;DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary

+ 8
- 9
pre_build_hook View File

@@ -23,15 +23,14 @@ function build_pkg {
23 23
       cd ${DIR}/ovs-nsh
24 24
       sudo docker build -t ovs-nsh .
25 25
       container_id=`sudo docker run -d ovs-nsh`
26
-      sudo docker cp $container_id:/openvswitch/openvswitch-common_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/
27
-      sudo docker cp $container_id:/openvswitch/openvswitch-datapath-dkms_2.4.90-1_all.deb ${DIR}/repositories/ubuntu/
28
-      sudo docker cp $container_id:/openvswitch/openvswitch-switch_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/
29
-      sudo docker cp $container_id:/dpdk-2.1.0.tar.gz ${DIR}/repositories/ubuntu/dpdk-install/
30
-      sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-common_2.4.91-1_amd64.deb ${DIR}/repositories/ubuntu/
31
-      sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-datapath-dkms_2.4.91-1_all.deb ${DIR}/repositories/ubuntu/
32
-      sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-switch_2.4.91-1_amd64.deb ${DIR}/repositories/ubuntu/
33
-      wget https://01.org/sites/default/files/downloads/intel-data-plane-performance-demonstrators/dppd-prox-v021.zip
34
-      mv dppd-prox-v021.zip ${DIR}/repositories/ubuntu/dppd-install/
26
+      sudo docker cp $container_id:/openvswitch/openvswitch-common_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/ovs/
27
+      sudo docker cp $container_id:/openvswitch/openvswitch-datapath-dkms_2.4.90-1_all.deb ${DIR}/repositories/ubuntu/ovs/
28
+      sudo docker cp $container_id:/openvswitch/openvswitch-switch_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/ovs/
29
+      sudo docker cp $container_id:/dpdk-2.1.0.tar.gz ${DIR}/repositories/ubuntu/dpdk/
30
+      sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-common_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/dpdk
31
+      sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-datapath-dkms_2.4.90-1_all.deb ${DIR}/repositories/ubuntu/dpdk
32
+      sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-switch_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/dpdk
33
+      wget https://01.org/sites/default/files/downloads/intel-data-plane-performance-demonstrators/dppd-prox-v021.zip -O ${DIR}/repositories/ubuntu/dppd/dppd-prox-v021.zip
35 34
       ;;
36 35
     *) echo "Not supported system"; exit 1;;
37 36
   esac

+ 0
- 7
repositories/ubuntu/dpdk-install/dpdk-install.sh View File

@@ -1,7 +0,0 @@
1
-#!/bin/bash
2
-
3
-set -eux
4
-rm -rf /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install/
5
-mkdir /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install/
6
-cd /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install/;wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk-install/dpdk-2.1.0.tar.gz;tar -xvzf dpdk-2.1.0.tar.gz
7
-cd /etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install/dpdk-2.1.0; make install T=x86_64-native-linuxapp-gcc

+ 10
- 0
repositories/ubuntu/dpdk/dpdk-install.sh View File

@@ -0,0 +1,10 @@
1
+#!/bin/bash
2
+set -eux
3
+
4
+INSTALL_HOME=/usr/share/dpdk/
5
+sudo rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6
+cd $INSTALL_HOME
7
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-2.1.0.tar.gz;
8
+tar -xvzf dpdk-2.1.0.tar.gz
9
+cd $INSTALL_HOME/dpdk-2.1.0; make install T=x86_64-native-linuxapp-gcc
10
+

+ 6
- 0
repositories/ubuntu/dpdk/dpdk.conf View File

@@ -0,0 +1,6 @@
1
+DPDK_NUM_HUGEPAGES=${DPDK_NUM_HUGEPAGES:-2048}
2
+DPDK_HUGEPAGE_MOUNT=${DPDK_HUGEPAGE_MOUNT:-/dev/hugepages}
3
+DPDK_NIC_MAPPINGS=eth1
4
+DPDK_ALLOCATE_HUGEPAGES=True
5
+DPDK_INTERFACE_DRIVER='igb_uio'
6
+DPDK_HUGEPAGE_MOUNT_PAGESIZE=''

+ 91
- 0
repositories/ubuntu/dpdk/dpdk.init View File

@@ -0,0 +1,91 @@
1
+#! /bin/bash
2
+#
3
+# Copyright (C) 2015 Intel, Inc.
4
+#
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:
8
+#
9
+#     http://www.apache.org/licenses/LICENSE-2.0
10
+#
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.
16
+#
17
+set -eux
18
+echo "sourcing config"
19
+source /etc/default/dpdk.conf
20
+
21
+RTE_SDK=${RTE_SDK:-/usr/share/dpdk/dpdk-2.1.0}
22
+RTE_TARGET=${RTE_TARGET:-x86_64-native-linuxapp-gcc}
23
+DPDK_DIR=$RTE_SDK
24
+
25
+load_igb_uio_module(){
26
+    if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko ];then
27
+        echo "## ERROR: Target does not have the DPDK UIO Kernel Module."
28
+        echo "       To fix, please try to rebuild target."
29
+        return
30
+    fi
31
+    sudo modprobe uio
32
+    echo "Loading DPDK UIO module"
33
+    sudo insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko
34
+}
35
+
36
+bind_nic_2_driver() {
37
+    list=("$@")
38
+    # Bind nics to DPDK_INTERFACE_DRIVER.
39
+    for pair in "${list[@]}"; do
40
+        addr=`echo $pair | cut -f 1 -d "#"`
41
+        nic=`echo $pair | cut -f 2 -d "#"`
42
+        echo sudo RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py -b $DPDK_INTERFACE_DRIVER $addr
43
+        sudo RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py -b $DPDK_INTERFACE_DRIVER $addr
44
+    done
45
+}
46
+
47
+bind_nics(){
48
+    # Extract nic name, bind it with DPDK_INTERFACE_DRIVER driver
49
+    PCI_MAPPINGS=${DPDK_NIC_MAPPINGS//,/ }
50
+    PCI_ARRAY=( $PCI_MAPPINGS )
51
+    bind_nic_2_driver "${PCI_ARRAY[@]}"
52
+}
53
+
54
+alloc_hugepages() {
55
+    HUGEPAGE_SIZE=$(grep Hugepagesize /proc/meminfo | awk '{ print $2 }')
56
+    sudo mkdir -p $DPDK_HUGEPAGE_MOUNT
57
+
58
+
59
+    #allocate hugepages
60
+    if [ $DPDK_ALLOCATE_HUGEPAGES == 'True' ]; then
61
+        for d in /sys/devices/system/node/node? ; do
62
+            echo $DPDK_NUM_HUGEPAGES | sudo tee $d/hugepages/hugepages-${HUGEPAGE_SIZE}kB/nr_hugepages
63
+        done
64
+    fi
65
+
66
+    if [ -n "$DPDK_HUGEPAGE_MOUNT_PAGESIZE" ]; then
67
+        sudo mount -t hugetlbfs  pagesize=$DPDK_HUGEPAGE_MOUNT_PAGESIZE  nodev $DPDK_HUGEPAGE_MOUNT
68
+    else
69
+        sudo mount -t hugetlbfs  nodev $DPDK_HUGEPAGE_MOUNT
70
+    fi
71
+}
72
+
73
+cmd_start(){
74
+    echo "mounting hugepages"
75
+    alloc_hugepages
76
+    echo "loading DPDK_INTERFACE_DRIVER diver"
77
+    load_igb_uio_module
78
+    bind_nics
79
+}
80
+
81
+case "$1" in
82
+    start)
83
+        cmd_start
84
+        ;;
85
+    *)
86
+        echo "Usage: $0 {start}" >&2
87
+        exit 1
88
+        ;;
89
+esac
90
+
91
+exit 0

+ 12
- 0
repositories/ubuntu/dpdk/ovs-dpdk-install.sh View File

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+set -eux
3
+
4
+INSTALL_HOME=/usr/share/ovs-dpdk/
5
+sudo rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6
+cd $INSTALL_HOME
7
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-datapath-dkms_2.4.90-1_all.deb
8
+sudo dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb
9
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-common_2.4.90-1_amd64.deb
10
+sudo dpkg -i openvswitch-common_2.4.90-1_amd64.deb
11
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-switch_2.4.90-1_amd64.deb
12
+sudo dpkg -i openvswitch-switch_2.4.90-1_amd64.deb

+ 0
- 12
repositories/ubuntu/dppd-install/dppd-install.sh View File

@@ -1,12 +0,0 @@
1
-#!/bin/bash
2
-
3
-set -eux
4
-sudo apt-get install -y pkg-config unzip liblua5.2-dev libpcap-dev libedit-dev libncurses5-dev libncursesw5-dev
5
-rm -rf /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install/
6
-mkdir /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install/
7
-cd /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install/;wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd-install/dppd-prox-v021.zip;unzip dppd-prox-v021.zip
8
-export RTE_SDK=/etc/fuel/plugins/fuel-plugin-ovs-0.5/dpdk-install/dpdk-2.1.0
9
-export RTE_TARGET=x86_64-native-linuxapp-gcc
10
-cd /etc/fuel/plugins/fuel-plugin-ovs-0.5/dppd-install/dppd-PROX-v021
11
-export DPPD_DIR=`pwd`
12
-make

+ 12
- 0
repositories/ubuntu/dppd/dppd-install.sh View File

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+set -eux
3
+INSTALL_HOME=/usr/share/dppd/
4
+sudo rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
5
+cd $INSTALL_HOME
6
+sudo apt-get install -y pkg-config unzip liblua5.2-dev libpcap-dev libedit-dev libncurses5-dev libncursesw5-dev
7
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-prox-v021.zip;
8
+unzip dppd-prox-v021.zip
9
+export RTE_SDK=/usr/share/dpdk/dpdk-2.1.0
10
+export RTE_TARGET=x86_64-native-linuxapp-gcc
11
+cd /usr/share/dppd/dppd-PROX-v021
12
+export DPPD_DIR=`pwd`; make

+ 12
- 0
repositories/ubuntu/ovs/ovs-install.sh View File

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+set -eux
3
+
4
+INSTALL_HOME=/usr/share/ovs/
5
+sudo rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6
+cd $INSTALL_HOME
7
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-datapath-dkms_2.4.90-1_all.deb
8
+sudo dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb
9
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-common_2.4.90-1_amd64.deb
10
+sudo dpkg -i openvswitch-common_2.4.90-1_amd64.deb
11
+wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-switch_2.4.90-1_amd64.deb
12
+sudo dpkg -i openvswitch-switch_2.4.90-1_amd64.deb

Loading…
Cancel
Save