upgrade to ovsdpdk 2.6.1 37/49837/7
authorGuo Ruijing <ruijing.guo@intel.com>
Tue, 2 Jan 2018 10:13:19 +0000 (05:13 -0500)
committerGuo Ruijing <ruijing.guo@intel.com>
Wed, 3 Jan 2018 11:42:52 +0000 (06:42 -0500)
Change-Id: I6c5092a639f8306dd48b58dcd55d2ca6e5452e4d
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
src/cni/ovsdpdk/kube_ovsdpdk.yml
src/cni/ovsdpdk/start.sh

index 76ea51f..6954b33 100644 (file)
@@ -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:
index 53b5fe1..7cf42bf 100644 (file)
@@ -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