if (input->reply) {
char buf[128];
snprintf(buf, sizeof(buf),
- "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%u,%u\n",
+ "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%u,%u,%"PRIu64",%"PRIu64",%"PRIu64"\n",
lat_min_usec,
lat_max_usec,
lat_avg_usec,
last_tsc,
rte_get_tsc_hz(),
lcore_id,
- task_id);
+ task_id,
+ stats->mis_ordered,
+ stats->extent,
+ stats->duplicate);
input->reply(input, buf, strlen(buf));
}
else {
- plog_info("core: %u, task: %u, min: %"PRIu64", max: %"PRIu64", avg: %"PRIu64", min since reset: %"PRIu64", max since reset: %"PRIu64"\n",
- lcore_id,
- task_id,
- lat_min_usec,
- lat_max_usec,
- lat_avg_usec,
- tot_lat_min_usec,
- tot_lat_max_usec);
+ plog_info("core: %u, task: %u, min: %"PRIu64", max: %"PRIu64", avg: %"PRIu64", min since reset: %"PRIu64", max since reset: %"PRIu64", mis_ordered: %"PRIu64", extent: %"PRIu64", duplicates: %"PRIu64"\n",
+ lcore_id,
+ task_id,
+ lat_min_usec,
+ lat_max_usec,
+ lat_avg_usec,
+ tot_lat_min_usec,
+ tot_lat_max_usec,
+ stats->mis_ordered,
+ stats->extent,
+ stats->duplicate);
}
}
hz = int(stats[6])
#coreid = int(stats[7])
#taskid = int(stats[8])
+ mis_ordered = int(stats[9])
+ extent = int(stats[10])
+ duplicate = int(stats[11])
stats = self._recv().split(':')
if stats[0].startswith('error'):
RapidLog.critical("lat stats error: unexpected lat bucket \
def run(self):
result_details = {'Details': 'Nothing'}
- self.gen_machine.start_latency_cores()
TestResult = 0
for imix in self.test['imixs']:
size = mean(imix)
self.udp_dest_port_offset = udp_header_start_offset + 2
self.udp_length_offset = udp_header_start_offset + 4
self.ipv6 = ipv6
+ if 'bucket_size_exp' in machine_params.keys():
+ self.bucket_size_exp = machine_params['bucket_size_exp']
+ else:
+ self.bucket_size_exp = 11
super().__init__(key, user, vim, rundir, resultsdir, machine_params,
configonly)
RapidLog.debug('{} ({}): latcores {} remapped to {}'.format(self.name, self.ip, self.machine_params['latcores'], cpus_remapped))
self.machine_params['latcores'] = cpus_remapped
- def generate_lua(self, vim, prox_config_file):
+ def generate_lua(self):
appendix = 'gencores="%s"\n'% ','.join(map(str,
self.machine_params['gencores']))
appendix = appendix + 'latcores="%s"\n'% ','.join(map(str,
appendix = appendix + 'gw_ip{}="{}"\n'.format(index, gw_ip)
appendix = (appendix + 'gw_hex_ip{}=convertIPToHex(gw_ip{})\n'.
format(index, index))
- if 'bucket_size_exp' in self.machine_params.keys():
- self.bucket_size_exp = self.machine_params['bucket_size_exp']
- else:
- self.bucket_size_exp = 11
appendix = (appendix +
'bucket_size_exp="{}"\n'.format(self.bucket_size_exp))
if 'heartbeat' in self.machine_params.keys():
'heartbeat="%s"\n'% self.machine_params['heartbeat'])
else:
appendix = appendix + 'heartbeat="60"\n'
- super().generate_lua(vim, prox_config_file, appendix)
+ super().generate_lua(appendix)
def start_prox(self):
# Start the generator with the -e option so that the cores don't
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']):
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')
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")
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)
r = 0;
sleep_time = 2
while (r < self.test['maxr']):
+ self.gen_machine.start_latency_cores()
time.sleep(sleep_time)
# Sleep_time is needed to be able to do accurate measurements to check for packet loss. We need to make this time large enough so that we do not take the first measurement while some packets from the previous tests migth still be in flight
t1_rx, t1_non_dp_rx, t1_tx, t1_non_dp_tx, t1_drop, t1_tx_fail, t1_tsc, abs_tsc_hz = self.gen_machine.core_stats()
drop_rate = 100.0*tot_dp_drop/dp_tx
if ((drop_rate < self.test['drop_rate_threshold']) or (tot_dp_drop == self.test['drop_rate_threshold'] ==0) or (tot_dp_drop > self.test['maxz'])):
break
+ self.gen_machine.stop_latency_cores()
return(pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,percentile,percentile_max,lat_max,dp_tx,dp_rx,tot_dp_drop,(t4_tx_fail - t1_tx_fail),drop_rate,lat_min,used_avg,r,tot_core_measurement_duration,avg_bg_rate,bucket_size,buckets)