summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXuan Jia <jason.jiaxuan@gmail.com>2018-01-03 03:53:55 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-03 03:53:55 +0000
commit9993a5778c5558eec7ba35db765c461293d44185 (patch)
tree4c91f57a1955926923a8b9ab1b07b1bcee9a0cee /src
parent56a7275c8c8b1fefb9ed36230a2487cd89cf1bbe (diff)
parent7446e1cc07eb77d6866ec50044c8bf95673b5c9f (diff)
Merge "upgrade to ovsdpdk 2.6.1"
Diffstat (limited to 'src')
-rw-r--r--src/cni/ovsdpdk/kube_ovsdpdk.yml2
-rw-r--r--src/cni/ovsdpdk/start.sh28
2 files changed, 19 insertions, 11 deletions
diff --git a/src/cni/ovsdpdk/kube_ovsdpdk.yml b/src/cni/ovsdpdk/kube_ovsdpdk.yml
index 76ea51f..6954b33 100644
--- a/src/cni/ovsdpdk/kube_ovsdpdk.yml
+++ b/src/cni/ovsdpdk/kube_ovsdpdk.yml
@@ -34,7 +34,7 @@ spec:
command:
- bash
- "-c"
- - "apt-get update && apt-get install -y git && git clone http://github.com/opnfv/container4nfv && cd container4nfv && git fetch https://gerrit.opnfv.org/gerrit/container4nfv refs/changes/43/47743/5 && git checkout FETCH_HEAD && bash ./src/cni/ovsdpdk/start.sh"
+ - "apt-get update && apt-get install -y git && git clone http://github.com/opnfv/container4nfv && cd container4nfv && bash ./src/cni/ovsdpdk/start.sh"
securityContext:
privileged: true
volumeMounts:
diff --git a/src/cni/ovsdpdk/start.sh b/src/cni/ovsdpdk/start.sh
index 53b5fe1..7cf42bf 100644
--- a/src/cni/ovsdpdk/start.sh
+++ b/src/cni/ovsdpdk/start.sh
@@ -6,23 +6,31 @@ for i in {1..10}
do
sysctl -w vm.nr_hugepages=2048; sleep 1
done
+sysctl -w vm.nr_hugepages=1024
+mount -t hugetlbfs -o pagesize=2M none /dev/hugepages
-apt-get update
+apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5EDB1B62EC4926EA
+apt-get update -y
+apt-get install software-properties-common -y
+apt-add-repository cloud-archive:ocata -y
+apt-get update -y
apt-get install -y openvswitch-switch-dpdk pciutils vim
update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk
-modprobe uio_pci_generic
+service openvswitch-switch restart
+cp /usr/bin/ovs-vsctl /usr/local/bin
+
+sed -i "s/[# ]*\(NR_2M_PAGES=\).*/\10/" /etc/dpdk/dpdk.conf
+service dpdk restart
ip=$(ip a s eth2 | grep inet | grep -v inet6 | sed "s/.*inet//" | cut -f2 -d' ')
ip address flush eth2
+modprobe uio_pci_generic
/usr/share/dpdk/tools/dpdk_nic_bind.py --bind=uio_pci_generic eth2
-sysctl -w vm.nr_hugepages=1024
-mount -t hugetlbfs -o pagesize=2M none /dev/hugepages
-cp /usr/bin/ovs-vsctl /usr/local/bin
-memory=$(grep HugePages_Total /proc/meminfo | cut -f2 -d:)
-echo "DPDK_OPTS='--dpdk -c 0x1 -n 2 -m $memory'" | tee -a /etc/default/openvswitch-switch
-service dpdk restart
+
+ovs-vsctl --no-wait set Open_vSwitch . "other_config:dpdk-init=true"
+ovs-vsctl --no-wait set Open_vSwitch . "other_config:dpdk-lcore-mask=1"
+ovs-vsctl --no-wait set Open_vSwitch . "other_config:dpdk-alloc-mem=1024"
service openvswitch-switch restart
-pkill ovs-vswitchd
-ovs-vswitchd --dpdk -c 0x1 -n 2 -m $memory -- unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log --pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor
+
ovs-vsctl add-br br-dpdk -- set bridge br-dpdk datapath_type=netdev
ovs-vsctl add-port br-dpdk dpdk0 -- set Interface dpdk0 type=dpdk
ip a a $ip dev br-dpdk