diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cni/ovsdpdk/kube_ovsdpdk.yml | 2 | ||||
-rw-r--r-- | src/cni/ovsdpdk/start.sh | 28 |
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 |