summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2021-02-24 11:51:22 +0100
committerLuc Provoost <luc.provoost@intel.com>2021-02-25 21:09:17 +0000
commit8442f6a8ce0962d818b7cd800150980c65983719 (patch)
tree60c798e933d08c8a2261644860d59f27b8bd1da2 /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
parent4057a0ae92833e89a90f9cd44c459c08980500fe (diff)
Preparation for packet mis-ordering stats
Changed PROX and the python scripts so that the "lat all stats" command also returns the mis_ordered, extent and duplicate statistics. In order to make this work properly, we need now to also stop and restart the latency cores, every time we stop and start the generator cores, since the sequence numbers are reinitialised every time we start the generator core. Change-Id: Ic4212a989c8ee9d0f026a34ca63a08b982c32b71 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
index fb96760e..e97b255a 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
@@ -50,6 +50,10 @@ class RapidMachine(object):
self.machine_params = machine_params
self.vim = vim
self.cpu_mapping = None
+ PROXConfigfile = open (self.machine_params['config_file'], 'r')
+ PROXConfig = PROXConfigfile.read()
+ PROXConfigfile.close()
+ self.all_tasks_for_this_cfg = set(re.findall("task\s*=\s*(\d+)",PROXConfig))
def __del__(self):
if ((not self.configonly) and self.machine_params['prox_socket']):
@@ -127,11 +131,7 @@ class RapidMachine(object):
result = self._client.run_cmd(DevBindFileName)
RapidLog.debug('devbind.sh running for port {} on {} {}'.format(index, self.name, result))
- def generate_lua(self, vim, prox_config_file, appendix = ''):
- PROXConfigfile = open (prox_config_file, 'r')
- PROXConfig = PROXConfigfile.read()
- PROXConfigfile.close()
- self.all_tasks_for_this_cfg = set(re.findall("task\s*=\s*(\d+)",PROXConfig))
+ def generate_lua(self, appendix = ''):
self.LuaFileName = 'parameters-{}.lua'.format(self.ip)
with open(self.LuaFileName, "w") as LuaFile:
LuaFile.write('require "helper"\n')
@@ -139,7 +139,7 @@ class RapidMachine(object):
for index, dp_port in enumerate(self.dp_ports, start = 1):
LuaFile.write('local_ip{}="{}"\n'.format(index, dp_port['ip']))
LuaFile.write('local_hex_ip{}=convertIPToHex(local_ip{})\n'.format(index, index))
- if vim in ['kubernetes']:
+ if self.vim in ['kubernetes']:
LuaFile.write("eal=\"--socket-mem=512,0 --file-prefix %s --pci-whitelist %s\"\n" % (self.name, self.machine_params['dp_pci_dev']))
else:
LuaFile.write("eal=\"\"\n")
@@ -168,7 +168,7 @@ class RapidMachine(object):
self.read_cpuset()
self.remap_all_cpus()
_, prox_config_file_name = os.path.split(self.machine_params['config_file'])
- self.generate_lua(self.vim, self.machine_params['config_file'])
+ self.generate_lua()
self._client.scp_put(self.machine_params['config_file'], '{}/{}'.format(self.rundir, prox_config_file_name))
if ((not self.configonly) and self.machine_params['prox_launch_exit']):
cmd = 'sudo {}/prox {} -t -o cli -f {}/{}'.format(self.rundir, autostart, self.rundir, prox_config_file_name)