diff options
Diffstat (limited to 'src/vagrant/k8s_kubeadm/ovsdpdk/start.sh')
-rw-r--r-- | src/vagrant/k8s_kubeadm/ovsdpdk/start.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/vagrant/k8s_kubeadm/ovsdpdk/start.sh b/src/vagrant/k8s_kubeadm/ovsdpdk/start.sh index 08d8143..d31a242 100644 --- a/src/vagrant/k8s_kubeadm/ovsdpdk/start.sh +++ b/src/vagrant/k8s_kubeadm/ovsdpdk/start.sh @@ -1,15 +1,25 @@ #!/bin/bash set -ex -sudo sysctl -w vm.nr_hugepages=2048 + +for i in {1..10} +do + sudo sysctl -w vm.nr_hugepages=2048; sleep 1 +done +sudo modprobe uio_pci_generic +sudo ip address flush enp0s9 +sudo /usr/share/dpdk/tools/dpdk_nic_bind.py --bind=uio_pci_generic enp0s9 +sudo sysctl -w vm.nr_hugepages=1024 sudo mount -t hugetlbfs -o pagesize=2M none /dev/hugepages -cp /usr/bin/ovs-vsctl /usr/local/bin +sudo 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'" | sudo tee -a /etc/default/openvswitch-switch sudo service dpdk restart sudo service openvswitch-switch restart +sudo pkill ovs-vswitchd +sudo 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 sudo ovs-vsctl add-br br-dpdk -- set bridge br-dpdk datapath_type=netdev -sudo modprobe uio_pci_generic -#sudo ip address flush enp0s9 -#sudo /usr/share/dpdk/tools/dpdk_nic_bind.py --bind=uio_pci_generic enp0s9 -#sudo ovs-vsctl add-port br-dpdk dpdk0 -- set Interface dpdk0 type=dpdk +sudo ovs-vsctl add-port br-dpdk dpdk0 -- set Interface dpdk0 type=dpdk while true; do sleep 3600; done -echo sudo docker run -ti --privileged -v /dev:/dev -v /usr/local/bin:/usr/local/bin -v /var/run/openvswitch/:/var/run/openvswitch/ dpdk /ovsdpdk/start.sh +echo sudo docker build -t openretriever/ubuntu1604-ovsdpdk . +echo sudo docker run -ti --privileged --net=host -v /dev:/dev -v /usr/local/bin:/usr/local/bin -v /var/run/openvswitch/:/var/run/openvswitch/ -v /lib/modules/:/lib/modules openretriever/ubuntu1604-ovsdpdk bash |