+ cat packet loss control and max packet loss tolerance \ + output and parse packet loss for master and slaves
This commit is contained in:
parent
1fd9be7f13
commit
162d41a4cc
175
cat/cat.cc
175
cat/cat.cc
@ -28,6 +28,7 @@ constexpr static unsigned int RX_RING_SIZE = 1024;
|
||||
constexpr static unsigned int TX_RING_SIZE = 1024;
|
||||
constexpr static unsigned int BURST_SIZE = 32;
|
||||
constexpr static unsigned int MAX_SLAVES = 32;
|
||||
constexpr static unsigned int SLAVES_MAX_WAIT_MS = 1000;
|
||||
|
||||
static const struct rte_eth_conf port_conf_default {
|
||||
};
|
||||
@ -45,6 +46,11 @@ struct datapt {
|
||||
uint64_t srv_sw_rx;
|
||||
};
|
||||
|
||||
constexpr static uint32_t STATE_WAIT = 0; // waiting for sending
|
||||
constexpr static uint32_t STATE_SENT = 1; // we sent a packet
|
||||
constexpr static uint32_t STATE_COMPLETE = 2; // we received everything
|
||||
constexpr static uint32_t STATE_PKTLOSS = 3; // last packet sent was lost
|
||||
|
||||
struct options_t {
|
||||
// parameters
|
||||
unsigned int run_time { 5 };
|
||||
@ -57,7 +63,8 @@ struct options_t {
|
||||
};
|
||||
uint64_t cpu_mask { 0x4 }; // 2nd core
|
||||
std::vector<struct net_spec *> slaves;
|
||||
unsigned long rage_quit_time { (unsigned long)-1 };
|
||||
uint32_t pkt_loss_failure_threshold { 0 };
|
||||
uint32_t pkt_loss_time_ms { UINT32_MAX };
|
||||
|
||||
// states
|
||||
struct rte_mempool *mbuf_pool { nullptr };
|
||||
@ -71,11 +78,13 @@ struct options_t {
|
||||
unsigned int s_txqid { 0 };
|
||||
// for qps calculation
|
||||
std::atomic<uint32_t> s_total_pkts { 0 };
|
||||
std::atomic<uint32_t> s_pkt_loss { 0 };
|
||||
std::atomic<uint64_t> s_start_time { 0 };
|
||||
std::atomic<uint64_t> s_end_time { 0 };
|
||||
std::atomic<uint32_t> s_slave_qps { 0 };
|
||||
std::atomic<uint32_t> s_slave_total { 0 };
|
||||
std::atomic<uint32_t> s_slave_loss { 0 };
|
||||
uint32_t s_state { STATE_WAIT };
|
||||
|
||||
Generator *s_iagen { nullptr };
|
||||
std::vector<struct datapt *> s_data;
|
||||
@ -98,6 +107,10 @@ rx_add_timestamp(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
|
||||
};
|
||||
int ret;
|
||||
|
||||
if (options.s_state != STATE_SENT) {
|
||||
return nb_pkts;
|
||||
}
|
||||
|
||||
for (int i = 0; i < nb_pkts; i++) {
|
||||
pkt_data = check_valid_packet(
|
||||
pkts[i], &options.s_host_spec.mac_addr);
|
||||
@ -155,6 +168,10 @@ tx_add_timestamp(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
|
||||
uint64_t now = nm_tsc2ns(rte_rdtsc());
|
||||
struct pkt_hdr *pkt_data;
|
||||
|
||||
if (options.s_state != STATE_SENT) {
|
||||
return nb_pkts;
|
||||
}
|
||||
|
||||
for (int i = 0; i < nb_pkts; i++) {
|
||||
pkt_data = check_valid_packet(
|
||||
pkts[i], &options.s_host_spec.mac_addr);
|
||||
@ -320,7 +337,7 @@ wait_for_slaves(uint16_t etype, struct rte_mbuf **out)
|
||||
}
|
||||
}
|
||||
|
||||
if (now - start > options.rage_quit_time * MS2NS) {
|
||||
if (now - start > SLAVES_MAX_WAIT_MS * MS2NS) {
|
||||
rte_exit(
|
||||
EXIT_FAILURE, "waiting for too long. I QUIT!!");
|
||||
}
|
||||
@ -339,9 +356,6 @@ pkt_loop()
|
||||
bool recv_stat = true;
|
||||
bool recv_resp = true;
|
||||
|
||||
uint64_t next_ts = nm_get_uptime_ns();
|
||||
uint64_t last_ts = next_ts + options.rage_quit_time * MS2NS;
|
||||
|
||||
if (rte_eth_dev_socket_id(options.s_portid) > 0 &&
|
||||
rte_eth_dev_socket_id(options.s_portid) != (int)rte_socket_id()) {
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_WARNING,
|
||||
@ -351,6 +365,11 @@ pkt_loop()
|
||||
options.s_portid);
|
||||
}
|
||||
|
||||
uint64_t next_ts = nm_get_uptime_ns();
|
||||
uint64_t last_send_ts = next_ts;
|
||||
bool is_last_pkt_lost = false;
|
||||
uint32_t num_cts_pkt_lost = 0;
|
||||
|
||||
while (!options.s_stop.load()) {
|
||||
uint64_t now = nm_get_uptime_ns();
|
||||
// always pop incoming packets
|
||||
@ -359,6 +378,13 @@ pkt_loop()
|
||||
|
||||
if (nb_rx > 0) {
|
||||
for (int i = 0; i < nb_rx; i++) {
|
||||
if (options.s_state != STATE_SENT) {
|
||||
// only need to process packets after we
|
||||
// sent one
|
||||
rte_pktmbuf_free(rx_bufs[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
struct pkt_hdr *each = check_valid_packet(
|
||||
rx_bufs[i], &options.s_host_spec.mac_addr);
|
||||
|
||||
@ -395,8 +421,6 @@ pkt_loop()
|
||||
break;
|
||||
}
|
||||
|
||||
options.s_total_pkts.fetch_add(1);
|
||||
|
||||
recv_resp = true;
|
||||
break;
|
||||
case PKT_TYPE_STAT:
|
||||
@ -427,6 +451,7 @@ pkt_loop()
|
||||
rte_be_to_cpu_64(pld_stat->sw_rx);
|
||||
|
||||
recv_stat = true;
|
||||
is_last_pkt_lost = false;
|
||||
break;
|
||||
default:
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_DEBUG,
|
||||
@ -438,12 +463,59 @@ pkt_loop()
|
||||
}
|
||||
}
|
||||
|
||||
if (read_tx && recv_stat & recv_resp) {
|
||||
// if we have all the data
|
||||
if (options.s_state == STATE_SENT) {
|
||||
// check if hw ts is read
|
||||
if (!read_tx) {
|
||||
struct timespec ts;
|
||||
if (rte_eth_timesync_read_tx_timestamp(
|
||||
options.s_portid, &ts) == 0) {
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_DEBUG,
|
||||
"locore_main: read hw tx timestamp %lu.\n",
|
||||
(ts.tv_nsec + ts.tv_sec * S2NS));
|
||||
options.s_last_datapt->clt_hw_tx =
|
||||
ts.tv_nsec + ts.tv_sec * S2NS;
|
||||
read_tx = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.s_last_datapt != nullptr) {
|
||||
// push the data to the queue if we haven't done
|
||||
// so already
|
||||
if (read_tx && recv_resp && recv_stat) {
|
||||
options.s_state = STATE_COMPLETE;
|
||||
} else {
|
||||
// check packet loss
|
||||
if (now - last_send_ts >
|
||||
options.pkt_loss_time_ms * MS2NS) {
|
||||
|
||||
if (is_last_pkt_lost) {
|
||||
num_cts_pkt_lost++;
|
||||
} else {
|
||||
is_last_pkt_lost = true;
|
||||
num_cts_pkt_lost = 1;
|
||||
}
|
||||
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_DEBUG,
|
||||
"locore_main: packet loss: waiting too long for epoch %d. %d in a row.\n",
|
||||
options.s_last_datapt->epoch,
|
||||
num_cts_pkt_lost);
|
||||
|
||||
delete options.s_last_datapt;
|
||||
options.s_last_datapt = nullptr;
|
||||
options.s_state = STATE_PKTLOSS;
|
||||
options.s_pkt_loss.fetch_add(1);
|
||||
|
||||
if (num_cts_pkt_lost >
|
||||
options
|
||||
.pkt_loss_failure_threshold) {
|
||||
rte_exit(EXIT_FAILURE,
|
||||
"too many continuous packet loss detected\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.s_state == STATE_COMPLETE ||
|
||||
options.s_state == STATE_PKTLOSS ||
|
||||
options.s_state == STATE_WAIT) {
|
||||
if (options.s_state == STATE_COMPLETE) {
|
||||
options.s_data.push_back(options.s_last_datapt);
|
||||
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_DEBUG,
|
||||
@ -470,6 +542,8 @@ pkt_loop()
|
||||
options.s_last_datapt = nullptr;
|
||||
}
|
||||
|
||||
options.s_state = STATE_WAIT;
|
||||
|
||||
if (now >= next_ts) {
|
||||
struct pkt_payload_epoch *pld_epoch;
|
||||
uint32_t epoch;
|
||||
@ -494,11 +568,13 @@ pkt_loop()
|
||||
options.s_last_datapt->epoch = epoch;
|
||||
options.s_last_datapt->valid =
|
||||
options.s_record.load();
|
||||
options.s_total_pkts.fetch_add(1);
|
||||
|
||||
read_tx = false;
|
||||
recv_resp = false;
|
||||
recv_stat = false;
|
||||
last_ts = now;
|
||||
last_send_ts = now;
|
||||
options.s_state = STATE_SENT;
|
||||
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_DEBUG,
|
||||
"locore_main: sending packet %p with epoch %d\n",
|
||||
@ -514,29 +590,6 @@ pkt_loop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!recv_stat) {
|
||||
// if we haven't recevied the stats get ready to rage
|
||||
// quit
|
||||
if (now - last_ts > options.rage_quit_time * MS2NS) {
|
||||
rte_exit(EXIT_FAILURE,
|
||||
"waiting too long for resp. I QUIT!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!read_tx) {
|
||||
struct timespec ts {
|
||||
};
|
||||
if (rte_eth_timesync_read_tx_timestamp(
|
||||
options.s_portid, &ts) == 0) {
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_DEBUG,
|
||||
"locore_main: read hw tx timestamp %lu.\n",
|
||||
(ts.tv_nsec + ts.tv_sec * S2NS));
|
||||
options.s_last_datapt->clt_hw_tx = ts.tv_nsec +
|
||||
ts.tv_sec * S2NS;
|
||||
read_tx = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -695,15 +748,16 @@ dump_options()
|
||||
" run time = %d\n"
|
||||
" warmup time = %d\n"
|
||||
" output file = %s\n"
|
||||
" rage quit time = %ld\n"
|
||||
" cpu mask = 0x%lx\n"
|
||||
" interarrival dist = %s\n"
|
||||
" target qps = %d\n"
|
||||
" host IP = 0x%x\n",
|
||||
" host IP = 0x%x\n"
|
||||
" pkt loss time = %u\n"
|
||||
" pkt loss failure threshold = %u\n",
|
||||
ntr_get_level(NTR_DEP_USER1) - NTR_LEVEL_WARNING, options.run_time,
|
||||
options.warmup_time, options.output, options.rage_quit_time,
|
||||
options.cpu_mask, options.ia_gen_str, options.target_qps,
|
||||
options.s_host_spec.ip);
|
||||
options.warmup_time, options.output, options.cpu_mask,
|
||||
options.ia_gen_str, options.target_qps, options.s_host_spec.ip,
|
||||
options.pkt_loss_time_ms, options.pkt_loss_failure_threshold);
|
||||
|
||||
for (auto slave : options.slaves) {
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_INFO,
|
||||
@ -731,9 +785,10 @@ usage()
|
||||
" -o: output filename\n"
|
||||
" -A: affinity mask\n"
|
||||
" -i: inter-arrival time distribution\n"
|
||||
" -r: rage quit time (in ms)\n"
|
||||
" -q: target qps\n"
|
||||
" -H: host net spec\n");
|
||||
" -H: host net spec\n"
|
||||
" -L: pkt loss failure threshold\n"
|
||||
" -l: pkt loss time threshold\n");
|
||||
}
|
||||
|
||||
int
|
||||
@ -761,8 +816,8 @@ main(int argc, char *argv[])
|
||||
int c;
|
||||
// parse arguments
|
||||
struct net_spec *ns;
|
||||
while (
|
||||
(c = getopt(argc, argv, "vs:S:t:T:ho:A:i:r:q:H:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "vs:S:t:T:ho:A:i:q:H:L:l:")) !=
|
||||
-1) {
|
||||
switch (c) {
|
||||
case 'v':
|
||||
ntr_set_level(NTR_DEP_USER1,
|
||||
@ -810,10 +865,6 @@ main(int argc, char *argv[])
|
||||
strncpy(options.ia_gen_str, optarg,
|
||||
sizeof(options.ia_gen_str) - 1);
|
||||
break;
|
||||
case 'r':
|
||||
options.rage_quit_time = strtoul(
|
||||
optarg, nullptr, 10);
|
||||
break;
|
||||
case 'q':
|
||||
options.target_qps = strtoul(
|
||||
optarg, nullptr, 10);
|
||||
@ -826,6 +877,17 @@ main(int argc, char *argv[])
|
||||
"invalid host net spec.\n");
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
options.pkt_loss_failure_threshold = strtoul(
|
||||
optarg, nullptr, 10);
|
||||
break;
|
||||
case 'l':
|
||||
options.pkt_loss_time_ms = strtoul(
|
||||
optarg, nullptr, 10);
|
||||
if (options.pkt_loss_time_ms == 0) {
|
||||
options.pkt_loss_time_ms = UINT32_MAX;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
rte_exit(
|
||||
@ -928,17 +990,19 @@ main(int argc, char *argv[])
|
||||
rte_exit(EXIT_FAILURE, "failed to wait for job completion\n");
|
||||
|
||||
// calculate QPS
|
||||
uint32_t qps = (uint32_t)((double)options.s_total_pkts.load()) /
|
||||
uint32_t qps = ((double)(options.s_total_pkts.load() -
|
||||
options.s_pkt_loss.load())) /
|
||||
(((double)(options.s_end_time.load() -
|
||||
options.s_start_time.load()) /
|
||||
(double)S2NS));
|
||||
qps += options.s_slave_qps.load();
|
||||
|
||||
uint32_t tot = options.s_slave_total.load() + options.s_total_pkts.load();
|
||||
uint32_t loss = options.s_slave_loss.load();
|
||||
|
||||
// dump stats
|
||||
log_file << qps << ',' << tot << ',' << loss << std::endl;
|
||||
log_file << qps << ',' << options.s_total_pkts.load() << ','
|
||||
<< options.s_pkt_loss.load() << ','
|
||||
<< options.s_slave_total.load() << ','
|
||||
<< options.s_slave_loss.load() << ',' << std::endl;
|
||||
|
||||
for (auto it : options.s_data) {
|
||||
if (it->valid) {
|
||||
log_file << it->clt_sw_rx << ',' << it->clt_sw_tx << ','
|
||||
@ -950,7 +1014,8 @@ main(int argc, char *argv[])
|
||||
}
|
||||
log_file.close();
|
||||
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_INFO, "qps = %d, total = %d, loss = %d\n", qps, tot, loss);
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_INFO, "qps = %d, total = %d, loss = %d, slave total = %d, slave loss = %d\n",
|
||||
qps, options.s_total_pkts.load(), options.s_pkt_loss.load(), options.s_slave_total.load(), options.s_slave_loss.load());
|
||||
|
||||
// clean up
|
||||
rte_eth_dev_stop(portid);
|
||||
|
@ -1,13 +0,0 @@
|
||||
-xc++
|
||||
-O2
|
||||
-std=c++11
|
||||
-Wall
|
||||
-Wextra
|
||||
-Werror
|
||||
-I/usr/include/dpdk
|
||||
-Iinc
|
||||
-Wno-deprecated-declarations
|
||||
-Wno-packed-not-aligned
|
||||
-Wno-address-of-packed-member
|
||||
-Wno-zero-length-array
|
||||
-Wno-gnu-zero-variadic-macro-arguments
|
3
pyenv.sh
Normal file
3
pyenv.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
THIS_FOLDER=$(dirname "$0")
|
||||
export PYTHONPATH="$PYTHONPATH:$THIS_FOLDER/scripts/libs"
|
32
rat/rat.cc
32
rat/rat.cc
@ -389,6 +389,8 @@ pkt_loop(struct thread_info *tinfo)
|
||||
"failed to send packet\n");
|
||||
}
|
||||
|
||||
options.s_state.store(STATE_FIN);
|
||||
|
||||
ntr(NTR_DEP_USER1,
|
||||
NTR_LEVEL_DEBUG,
|
||||
"pkt_loop <thread %d>: sent FIN_ACK to cat. QPS = %d.\n",
|
||||
@ -526,7 +528,7 @@ pkt_loop(struct thread_info *tinfo)
|
||||
}
|
||||
if (nm_get_uptime_ns() - last_recv_ts > options.rage_quit_time * MS2NS) {
|
||||
rte_exit(EXIT_FAILURE,
|
||||
"thread %d waiting too long for resp. I QUIT!!\n", tinfo->id);
|
||||
"rat: thread %d waiting too long for resp. I QUIT!!\n", tinfo->id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,11 +673,11 @@ dump_options()
|
||||
" cpu mask = 0x%lx\n"
|
||||
" slave mode = %d\n"
|
||||
" interarrival dist = %s\n"
|
||||
" load dist = %s\n"
|
||||
" workload dist = %s\n"
|
||||
" qps = %d\n"
|
||||
" host IP = 0x%x\n"
|
||||
" depth = %u\n"
|
||||
" packet loss threshold = %u\n",
|
||||
" packet loss time threshold = %u\n",
|
||||
ntr_get_level(NTR_DEP_USER1) - NTR_LEVEL_WARNING, options.run_time,
|
||||
options.s_num_threads, options.rage_quit_time, options.cpu_mask,
|
||||
options.slave_mode, options.ia_gen, options.ld_gen,
|
||||
@ -695,12 +697,12 @@ usage()
|
||||
" -S: slave(rat) mode\n"
|
||||
" -A: affinity mask\n"
|
||||
" -i: inter-arrival time distribution\n"
|
||||
" -l: load distribution\n"
|
||||
" -w: workload distribution\n"
|
||||
" -r: rage quit time (in ms)\n"
|
||||
" -q: target QPS\n"
|
||||
" -H: host net spec\n"
|
||||
" -D: max number of packets in flight\n"
|
||||
" -L: the threshold in ms after which a packet should be considered lost\n");
|
||||
" -l: packet loss time threshold\n");
|
||||
}
|
||||
|
||||
int
|
||||
@ -728,7 +730,7 @@ main(int argc, char *argv[])
|
||||
int c;
|
||||
// parse arguments
|
||||
while (
|
||||
(c = getopt(argc, argv, "vht:s:SA:i:l:r:q:H:D:L:")) != -1) {
|
||||
(c = getopt(argc, argv, "vht:s:SA:i:w:r:q:H:D:l:")) != -1) {
|
||||
switch (c) {
|
||||
case 'v':
|
||||
ntr_set_level(NTR_DEP_USER1,
|
||||
@ -767,7 +769,7 @@ main(int argc, char *argv[])
|
||||
strncpy(options.ia_gen, optarg,
|
||||
sizeof(options.ia_gen) - 1);
|
||||
break;
|
||||
case 'l':
|
||||
case 'w':
|
||||
strncpy(options.ld_gen, optarg,
|
||||
sizeof(options.ld_gen) - 1);
|
||||
break;
|
||||
@ -793,7 +795,7 @@ main(int argc, char *argv[])
|
||||
options.depth = UINT32_MAX;
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
case 'l':
|
||||
options.pkt_loss_delay_ms = strtol(
|
||||
optarg, nullptr, 10);
|
||||
if (options.pkt_loss_delay_ms == 0) {
|
||||
@ -893,17 +895,12 @@ main(int argc, char *argv[])
|
||||
|
||||
// poor man's timer
|
||||
uint32_t second = 0;
|
||||
uint32_t qps;
|
||||
uint32_t total_pkts;
|
||||
uint32_t total_loss;
|
||||
// this loop exit is signaled by SYNC_FIN in slave mode and by itself in
|
||||
// non slave mode
|
||||
while (options.s_state.load() != STATE_FIN) {
|
||||
if (options.slave_mode != 1) {
|
||||
if (second >= options.run_time) {
|
||||
options.s_state.store(STATE_FIN);
|
||||
calc_stats(nm_get_uptime_ns(), &qps,
|
||||
&total_pkts, &total_loss);
|
||||
break;
|
||||
}
|
||||
usleep(1 * S2US);
|
||||
@ -921,10 +918,11 @@ main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (options.slave_mode != 1) {
|
||||
fprintf(stdout, "main: total QPS = %d, packet loss = %2f%%\n",
|
||||
qps, (double)total_loss / (double)total_pkts);
|
||||
}
|
||||
uint32_t qps;
|
||||
uint32_t total_pkts;
|
||||
uint32_t total_loss;
|
||||
calc_stats(nm_get_uptime_ns(), &qps, &total_pkts, &total_loss);
|
||||
ntr(NTR_DEP_USER1, NTR_LEVEL_INFO, "qps = %d, total = %d, loss = %d\n", qps, total_pkts, total_loss);
|
||||
|
||||
for (auto each : options.s_thr_info) {
|
||||
delete each->load_gen;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
test_dir="/numam.d"
|
||||
root=".."
|
||||
root="$(dirname "$0")/.."
|
||||
servers="skylake2.rcs.uwaterloo.ca skylake3.rcs.uwaterloo.ca skylake6.rcs.uwaterloo.ca skylake7.rcs.uwaterloo.ca skylake8.rcs.uwaterloo.ca"
|
||||
rsync_flags="-vchr"
|
||||
ssh_args="-o StrictHostKeyChecking=no -p77"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
dpdk_dir="/dpdk"
|
||||
root=".."
|
||||
root="$(dirname "$0")/.."
|
||||
servers="skylake2.rcs.uwaterloo.ca skylake3.rcs.uwaterloo.ca skylake6.rcs.uwaterloo.ca skylake7.rcs.uwaterloo.ca skylake8.rcs.uwaterloo.ca"
|
||||
rsync_flags="-vchr"
|
||||
ssh_args="-o StrictHostKeyChecking=no -p77"
|
||||
|
@ -12,8 +12,10 @@ class khat_parser:
|
||||
self.c_hrx = 0
|
||||
self.c_stx = 0
|
||||
self.c_srx = 0
|
||||
self.total = 0
|
||||
self.loss = 0
|
||||
self.master_total = 0
|
||||
self.master_loss = 0
|
||||
self.slave_total = 0
|
||||
self.slave_loss = 0
|
||||
self.qps = 0
|
||||
|
||||
def __init__(self):
|
||||
@ -37,11 +39,13 @@ class khat_parser:
|
||||
# the first line is qps
|
||||
cells = line.split(',')
|
||||
if (first):
|
||||
if len(cells) != 3:
|
||||
if len(cells) != 5:
|
||||
raise Exception("Invalid headline:" + line)
|
||||
self.qps = int(cells[0])
|
||||
self.total = int(cells[1])
|
||||
self.loss = int(cells[2])
|
||||
self.master_total = int(cells[1])
|
||||
self.master_loss = int(cells[2])
|
||||
self.slave_total = int(cells[3])
|
||||
self.slave_loss = int(cells[4])
|
||||
first = False
|
||||
continue
|
||||
if len(cells) != 8:
|
||||
|
@ -28,8 +28,8 @@ root_dir = os.path.join(file_dir,"..")
|
||||
sample_filename = "sample.txt"
|
||||
|
||||
affinity = [
|
||||
"0xAA", # all first socket
|
||||
"0xAA000000", # all 2nd socket
|
||||
"0xA0", # all first socket
|
||||
"0x0A000000", # all 2nd socket
|
||||
]
|
||||
|
||||
master = ["skylake2.rcs.uwaterloo.ca"]
|
||||
@ -39,8 +39,8 @@ master_cpumask = "0x4" # 1 thread
|
||||
server = ["skylake3.rcs.uwaterloo.ca"]
|
||||
server_spec = ["192.168.123.9@3c:15:fb:c9:f3:4b"]
|
||||
|
||||
clients = ["skylake6.rcs.uwaterloo.ca", "skylake7.rcs.uwaterloo.ca", "skylake8.rcs.uwaterloo.ca"]
|
||||
client_spec = ["192.168.123.11@3c:15:fb:62:9b:2f", "192.168.123.12@3c:15:fb:c9:f3:44", "192.168.123.13@3c:15:fb:62:9c:be"]
|
||||
clients = ["skylake6.rcs.uwaterloo.ca", "skylake7.rcs.uwaterloo.ca" ] #, "skylake8.rcs.uwaterloo.ca"]
|
||||
client_spec = ["192.168.123.11@3c:15:fb:62:9b:2f", "192.168.123.12@3c:15:fb:c9:f3:44"] #, "192.168.123.13@3c:15:fb:62:9c:be"]
|
||||
client_cpumask = "0xAAAAAAAAAAAA"
|
||||
|
||||
rage_quit = 1000 #1s
|
||||
@ -101,7 +101,8 @@ def run_exp(affinity : str, ld : int):
|
||||
" -q " + str(calc_client_ld(ld)) + \
|
||||
" -H " + client_spec[i] + \
|
||||
" -s " + server_spec[0] + \
|
||||
" -r " + str(rage_quit)
|
||||
" -r " + str(rage_quit) + \
|
||||
" -D 0 -L 100 "
|
||||
tc.log_print(client_cmd)
|
||||
sclt.append(tc.remote_exec([clients[i]], client_cmd, blocking=False)[0])
|
||||
|
||||
@ -167,7 +168,7 @@ def keep_results():
|
||||
tc.log_print(mvcmd)
|
||||
sp.check_call(mvcmd, shell=True)
|
||||
|
||||
tc.log_print("=== Summary - qps: " + str(parser.qps) + " packet loss: " + str(float(parser.loss) / float(parser.total)) * 100.0 + "%" )
|
||||
tc.log_print("=== Summary - qps: " + str(parser.qps) + " master loss: " + str(float(parser.master_loss) / float(parser.master_total)) + " slave loss: " + str(float(parser.slave_loss) / float(parser.slave_total)) * 100.0 + "%" )
|
||||
tc.log_print("=== Server HW:")
|
||||
tc.log_print(par.mutilate_data.build_mut_output(parser.srv_hwlat, [parser.qps]) + "\n")
|
||||
tc.log_print("=== Server SW:")
|
||||
|
Loading…
Reference in New Issue
Block a user