summaryrefslogtreecommitdiffstats
path: root/src/cni/ovsdpdk/setup_ovsdpdk.sh
diff options
context:
space:
mode:
authorXuan Jia <jason.jiaxuan@gmail.com>2017-08-03 13:32:36 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-03 13:32:36 +0000
commitd14bcec5cbfaa1972fafdd3e1ad849f1014a4360 (patch)
tree6e9eeef74792cf54e35d99c62dad1af37f30bf27 /src/cni/ovsdpdk/setup_ovsdpdk.sh
parent79c38bff1b279a6d73bbbffd98f44613d76afbfe (diff)
parentf2b811df691ded8deb1bf4c1a54ac65d886d3a18 (diff)
Merge "add ovsdpdk cni"
Diffstat (limited to 'src/cni/ovsdpdk/setup_ovsdpdk.sh')
-rwxr-xr-xsrc/cni/ovsdpdk/setup_ovsdpdk.sh14
1 files changed, 14 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..a1813c9
--- /dev/null
+++ b/src/cni/ovsdpdk/setup_ovsdpdk.sh
@@ -0,0 +1,14 @@
+#!/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