aboutsummaryrefslogtreecommitdiffstats
path: root/vicn/resource/vpp/vpp.py
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2017-08-28 15:42:53 +0200
committerAlberto <acompagn+fdio@cisco.com>2017-08-28 17:11:45 +0200
commit190c70c461a3808297b397cda14f35867bd837f8 (patch)
treea758805fd0db3f36499b854c2a3407346cb86d01 /vicn/resource/vpp/vpp.py
parente4d3f8ca1c9e130c4cbb3211b9ac0850c2456973 (diff)
Using no-pci option rather than removing the dpdk-plugin in vpp. Removed starting and stopping of vpp in the host to add the uio devices in the containers. Added executable option in the TextFile resource. vICN now deploy the vppctl_wrapper command in every container runing vpp. Several bugfixes on the cicn plugin.
Change-Id: I395bf92771bf27cf25324d208b847b640ccc475c Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'vicn/resource/vpp/vpp.py')
-rw-r--r--vicn/resource/vpp/vpp.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/vicn/resource/vpp/vpp.py b/vicn/resource/vpp/vpp.py
index 8250f99a..9d4f7068 100644
--- a/vicn/resource/vpp/vpp.py
+++ b/vicn/resource/vpp/vpp.py
@@ -31,10 +31,11 @@ from vicn.resource.linux.file import TextFile
from vicn.resource.vpp.dpdk_device import DpdkDevice
from vicn.resource.vpp.scripts import FN_VPP_DPDK_SCRIPT
from vicn.resource.vpp.scripts import TPL_VPP_DPDK_DAEMON_SCRIPT
+from vicn.resource.vpp.scripts import FN_VPPCTL_WRAPPER_SCRIPT
+from vicn.resource.vpp.scripts import TPL_VPPCTL_WRAPPER_SCRIPT
from vicn.resource.vpp.vpp_commands import CMD_VPP_DISABLE, CMD_VPP_STOP
from vicn.resource.vpp.vpp_commands import CMD_VPP_START
from vicn.resource.vpp.vpp_commands import CMD_VPP_ENABLE_PLUGIN
-from vicn.resource.vpp.vpp_commands import CMD_REMOVE_DPDK_PLUGIN
from vicn.resource.vpp.vpp_host import VPPHost
#------------------------------------------------------------------------------
@@ -136,8 +137,8 @@ class VPP(LinuxApplication):
dpdk_list.append('dev ' + interface.pci_address)
setup = setup + '''\n}\n\n'''
+ setup = setup + 'dpdk {'
if dpdk_list:
- setup = setup + 'dpdk {'
# add socket_mem
# On numa architecture socket-mem requires to set the amount of memory
# to be reserved on each numa node
@@ -156,13 +157,21 @@ class VPP(LinuxApplication):
for dpdk_dev in dpdk_list:
setup = setup + ''' \n ''' + dpdk_dev
setup = setup + '''\n}'''
+ else:
+ setup = setup + '''\n no-pci \n}'''
dpdk_setup_file = TextFile(node = self.node,
filename = FN_VPP_DPDK_SCRIPT,
content = setup,
overwrite = True)
- return dpdk_setup_file
+ vppctl_wrapper_file = TextFile(node = self.node,
+ filename = FN_VPPCTL_WRAPPER_SCRIPT,
+ content = TPL_VPPCTL_WRAPPER_SCRIPT,
+ executable = True,
+ overwrite = True)
+
+ return dpdk_setup_file | vppctl_wrapper_file
@inherit_parent
def __create__(self):
@@ -179,11 +188,7 @@ class VPP(LinuxApplication):
found = True
break
- remove_dpdk_plugin = EmptyTask()
- if (not found):
- remove_dpdk_plugin = BashTask(self.node, CMD_REMOVE_DPDK_PLUGIN, lock = lock)
-
- return (((vpp_disable > vpp_stop) | enable_ip_forward) > (remove_dpdk_plugin > start_vpp))
+ return (((vpp_disable > vpp_stop) | enable_ip_forward) > start_vpp)
@inherit_parent
def __delete__(self):