From f2b811df691ded8deb1bf4c1a54ac65d886d3a18 Mon Sep 17 00:00:00 2001 From: Guo Ruijing Date: Tue, 1 Aug 2017 14:44:21 -0700 Subject: add ovsdpdk cni Change-Id: Id3eba33d3b33deee815596c0a56bbe77954e2214 Signed-off-by: Guo Ruijing --- src/cni/ovsdpdk/setup_ovsdpdk.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 src/cni/ovsdpdk/setup_ovsdpdk.sh (limited to 'src/cni/ovsdpdk/setup_ovsdpdk.sh') 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 -- cgit 1.2.3-korg