summaryrefslogtreecommitdiffstats
path: root/src/cni/ovsdpdk/setup_ovsdpdk.sh
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-11-23 12:58:05 -0500
committerGuo Ruijing <ruijing.guo@intel.com>2017-11-23 16:33:53 -0500
commita8388222d5d1f11be506e9e79f5e2476c447177e (patch)
tree59aebeb523399bd3c3132391ad85c3153b779448 /src/cni/ovsdpdk/setup_ovsdpdk.sh
parentec94abf0ea9154af2f0dbce13e12df775b72bbac (diff)
build ovsdpdk cni during deployment
Change-Id: I1c3d4b44bab0d75fae93f7fabce7bcfdcc3b9f35 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'src/cni/ovsdpdk/setup_ovsdpdk.sh')
-rwxr-xr-xsrc/cni/ovsdpdk/setup_ovsdpdk.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cni/ovsdpdk/setup_ovsdpdk.sh b/src/cni/ovsdpdk/setup_ovsdpdk.sh
new file mode 100755
index 0000000..6009b7a
--- /dev/null
+++ b/src/cni/ovsdpdk/setup_ovsdpdk.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+netns=$1
+containerid=$2
+ip=$3
+pid=$(echo $netns | cut -f3 -d"/")
+
+sudo ovs-vsctl --may-exist add-br br-dpdk -- set bridge br-dpdk datapath_type=netdev
+sudo ovs-vsctl --may-exist add-port br-dpdk vhost-user-$pid -- set Interface vhost-user-$pid type=dpdkvhostuser
+
+sudo ln -sf $netns /var/run/netns/$pid
+sudo ip link add dummy-$pid type dummy
+sudo ip link set dummy-$pid netns $pid
+
+sudo mkdir -p /var/run/cni
+echo $ip | sudo tee /var/run/cni/netconf-$pid