static uint64_t perf_by_size_size = 1 * ONE_GIGABYTE;
static uint64_t perf_by_time_secs = 10;
+static uint32_t force_packet_size = 0;
+
struct node {
int nodeid;
int links;
printf(" -s nodeid that will generate traffic for benchmarks\n");
printf(" -S [size|seconds] when used in combination with -T perf-by-size it indicates how many GB of traffic to generate for the test. (default: 1GB)\n");
printf(" when used in combination with -T perf-by-time it indicates how many Seconds of traffic to generate for the test. (default: 10 seconds)\n");
+ printf(" -x force packet size for perf-by-time or perf-by-size\n");
printf(" -C repeat the test continously (default: off)\n");
printf(" -X[XX] show stats at the end of the run (default: 1)\n");
printf(" 1: show handle stats, 2: show summary link stats\n");
memset(nodes, 0, sizeof(nodes));
- while ((rv = getopt(argc, argv, "aCT:S:s:ldfom:wb:t:n:c:p:X::P:z:h")) != EOF) {
+ while ((rv = getopt(argc, argv, "aCT:S:s:ldfom:wb:t:n:c:p:x:X::P:z:h")) != EOF) {
switch(rv) {
case 'h':
print_help();
perf_by_size_size = (uint64_t)atoi(optarg) * ONE_GIGABYTE;
perf_by_time_secs = (uint64_t)atoi(optarg);
break;
+ case 'x':
+ force_packet_size = (uint32_t)atoi(optarg);
+ if ((force_packet_size < 1) || (force_packet_size > 65536)) {
+ printf("Unsupported packet size %u (accepted 1 - 65536)\n", force_packet_size);
+ exit(FAIL);
+ }
+ break;
case 'C':
continous = 1;
break;
printf("TXT: Unable to malloc!\n");
return -1;
}
- memset(tx_buf[i], 0, KNET_MAX_PACKET_SIZE);
+ memset(tx_buf[i], i, KNET_MAX_PACKET_SIZE);
iov_out[i].iov_base = (void *)tx_buf[i];
memset(&msg[i].msg_hdr, 0, sizeof(struct msghdr));
msg[i].msg_hdr.msg_iov = &iov_out[i];
setup_send_buffers_common(msg, iov_out, tx_buf);
while (packetsize <= KNET_MAX_PACKET_SIZE) {
+ if (force_packet_size) {
+ packetsize = force_packet_size;
+ }
for (i = 0; i < PCKT_FRAG_MAX; i++) {
iov_out[i].iov_len = packetsize;
}
knet_send(knet_h, ctrl_message, TEST_STOP, channel);
- if (packetsize == KNET_MAX_PACKET_SIZE) {
+ if ((packetsize == KNET_MAX_PACKET_SIZE) || (force_packet_size)) {
break;
}
memset(&clock_end, 0, sizeof(clock_start));
while (packetsize <= KNET_MAX_PACKET_SIZE) {
+ if (force_packet_size) {
+ packetsize = force_packet_size;
+ }
for (i = 0; i < PCKT_FRAG_MAX; i++) {
iov_out[i].iov_len = packetsize;
}
knet_send(knet_h, ctrl_message, TEST_STOP, channel);
- if (packetsize == KNET_MAX_PACKET_SIZE) {
+ if ((packetsize == KNET_MAX_PACKET_SIZE) || (force_packet_size)) {
break;
}