Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions man/perftest.1
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,15 @@ many different options and modes.
.B --write_with_imm
Use write-with-immediate verb instead of write.
Write tests only.
.TP
.B --data_validation=<random|serial|pattern>
Perform data validation on transferred packets.
random: Data is randomized.
serial: Data is filled with sequential numeric series. Use --data_start_value=<N> to set starting point.
pattern: Data is filled using contents of file provided by --payload_file_path=<file>.
.TP
.B --data_start_value
Starting value for serial data validation. Set to 0 by default.
.SS RawEth only options
.TP
.B -B, --source_mac
Expand Down
8 changes: 7 additions & 1 deletion src/perftest_communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static int ethernet_write_keys(struct pingpong_dest *my_dest,
} else {
char msg[KEY_MSG_SIZE_GID];
sprintf(msg,KEY_PRINT_FMT_GID, my_dest->lid,my_dest->out_reads,
my_dest->qpn,my_dest->psn, my_dest->rkey, my_dest->vaddr,
my_dest->qpn,my_dest->psn, my_dest->rkey, my_dest->vaddr, my_dest->data_validation_hint,
my_dest->gid.raw[0],my_dest->gid.raw[1],
my_dest->gid.raw[2],my_dest->gid.raw[3],
my_dest->gid.raw[4],my_dest->gid.raw[5],
Expand Down Expand Up @@ -404,6 +404,12 @@ static int ethernet_read_keys(struct pingpong_dest *rem_dest,

rem_dest->vaddr = strtoull(tmp, NULL, 16); /*VA*/

pstr += term - pstr + 1;
term = strpbrk(pstr, ":");
memcpy(tmp, pstr, term - pstr);
tmp[term - pstr] = 0;
rem_dest->data_validation_hint = (uint32_t)strtoul(tmp, NULL, 16); /*DATA_VALIDATION_HINT*/

for (i = 0; i < 15; ++i) {
pstr += term - pstr + 1;
term = strpbrk(pstr, ":");
Expand Down
4 changes: 2 additions & 2 deletions src/perftest_communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@
#define hton_int(x) (int) htonl((uint32_t) (x))

#define KEY_MSG_SIZE (59) /* Message size without gid. */
#define KEY_MSG_SIZE_GID (108) /* Message size with gid (MGID as well). */
#define KEY_MSG_SIZE_GID (129) /* Message size with gid (MGID as well). */
#define SYNC_SPEC_ID (5)

/* The Format of the message we pass through sockets , without passing Gid. */
#define KEY_PRINT_FMT "%04x:%04x:%06x:%06x:%08x:%016llx:%08x"

/* The Format of the message we pass through sockets (With Gid). */
#define KEY_PRINT_FMT_GID "%04x:%04x:%06x:%06x:%08x:%016llx:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%08x:"
#define KEY_PRINT_FMT_GID "%04x:%04x:%06x:%06x:%08x:%016llx:%08x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%08x:"

/* The Basic print format for all verbs. */
#define BASIC_ADDR_FMT " %s address: LID %#04x QPN %#06x PSN %#06x"
Expand Down
76 changes: 76 additions & 0 deletions src/perftest_parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ static const char *portStates[] = {"Nop","Down","Init","Armed","","Active Defer"
static const char *qp_state[] = {"OFF","ON"};
static const char *exchange_state[] = {"Ethernet","rdma_cm"};
static const char *atomicTypesStr[] = {"CMP_AND_SWAP","FETCH_AND_ADD"};
static const char *dataValidationTypesStr[] = {"none","random", "serial", "pattern"};
#ifdef HAVE_HNSDV
static const char *congestStr[] = {"DCQCN","LDCP","HC3","DIP"};
#endif
Expand Down Expand Up @@ -621,6 +622,16 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection

printf(" --run_infinitely ");
printf(" Run test forever, print results every <duration> seconds (SYMMETRIC)\n");

printf(" --data_validation=<random|serial|pattern> ");
printf(" Perform data validation on transferred packets\n");
printf(" random: Data is randomized.\n");
printf(" serial: Data is filled with sequential numeric series. Use --data_start_value=<N> to set starting point.\n");
printf(" pattern: Data is filled using contents of file provided by --payload_file_path=<file>.\n");

printf(" --data_start_value ");
printf(" Starting value for serial data validation. Set to 0 by default.\n");

}

if (connection_type != RawEth) {
Expand Down Expand Up @@ -1013,6 +1024,8 @@ static void init_perftest_params(struct perftest_parameters *user_param)
user_param->cpu_id = -1;
user_param->processing_hints = -1;
user_param->dynamic_cqe_poll = ON;
user_param->data_validation = NONE;
user_param->data_start_value = 0;
}

static int open_file_write(const char* file_path)
Expand Down Expand Up @@ -2082,6 +2095,44 @@ static void force_dependecies(struct perftest_parameters *user_param)
}
#endif

if (user_param->data_validation) {
if (user_param->post_list != user_param->tx_depth || user_param->recv_post_list != user_param->rx_depth) {
printf(RESULT_LINE);
fprintf(stderr, " Invalid data validation qps configuration. Post list size should be equal to corresponding queue depth.\n");
exit(1);
}

if (user_param->tst != BW || user_param->verb != WRITE_IMM) {
printf(RESULT_LINE);
fprintf(stderr, " Data validation can only be used with write with immediate BW test.\n");
exit(1);
}

if (user_param->duplex) {
printf(RESULT_LINE);
fprintf(stderr, "Bidirectional mode not supported in data validation.\n");
exit(1);
}

if (user_param->has_payload_modification && user_param->data_validation != PATTERN) {
printf(RESULT_LINE);
fprintf(stderr, "Payload modification input is not supported with random or serial data validation.\n");
exit(1);
}

if (user_param->mr_per_qp) {
printf(RESULT_LINE);
fprintf(stderr, "MR per QP is not supported in data validation.\n");
exit(1);
}

if (user_param->data_validation == PATTERN && !user_param->has_payload_modification) {
printf(RESULT_LINE);
fprintf(stderr, "Payload modification input is required for pattern data validation.\n");
exit(1);
}
}

return;
}
/******************************************************************************
Expand Down Expand Up @@ -2634,6 +2685,8 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
static int recv_post_list_flag = 0;
static int payload_flag = 0;
static int use_write_with_imm_flag = 0;
static int data_validation_flag = 0;
static int data_start_value_flag = 0;
#ifdef HAVE_SRD_WITH_UNSOLICITED_WRITE_RECV
static int unsolicited_write_flag = 0;
#endif
Expand Down Expand Up @@ -2860,6 +2913,8 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
#ifdef HAVE_SIG_OFFLOAD
{.name = "sig_offload", .has_arg = 0, .flag = &sig_offload_flag, .val = 1 },
#endif
{.name = "data_validation", .has_arg = 1, .flag = &data_validation_flag, .val = 1},
{.name = "data_start_value", .has_arg = 1, .flag = &data_start_value_flag, .val = 1},
{0}
};
if (!duplicates_checker) {
Expand Down Expand Up @@ -3609,6 +3664,27 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
user_param->verb = WRITE_IMM;
use_write_with_imm_flag = 0;
}
if (data_validation_flag) {

int i, types_array_size = GET_ARRAY_SIZE(dataValidationTypesStr);
for (i = 1; i < types_array_size; i++) {
if (strcmp(dataValidationTypesStr[i],optarg) == 0) {
user_param->data_validation = i;
break;
}
}

if (i == types_array_size) {
fprintf(stderr, " Invalid data validation type flag. Please use random, serial or pattern.\n");
return FAILURE;
}

data_validation_flag = 0;
}
if (data_start_value_flag) {
user_param->data_start_value = (uint32_t)strtoul(optarg, NULL, 10);
data_start_value_flag = 0;
}
#ifdef HAVE_SRD_WITH_UNSOLICITED_WRITE_RECV
if (unsolicited_write_flag) {
user_param->use_unsolicited_write = 1;
Expand Down
5 changes: 5 additions & 0 deletions src/perftest_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ enum rate_limiter_units {MEGA_BYTE_PS, GIGA_BIT_PS, PACKET_PS};
/*Types rate limit*/
enum rate_limiter_types {HW_RATE_LIMIT, SW_RATE_LIMIT, PP_RATE_LIMIT, DISABLE_RATE_LIMIT};

/*Types data validation*/
enum data_validation_types {NONE, RANDOM, SERIAL, PATTERN};

/* Verbosity Levels for test report */
enum verbosity_level {FULL_VERBOSITY=-1, OUTPUT_BW=0, OUTPUT_MR, OUTPUT_LAT };

Expand Down Expand Up @@ -686,6 +689,8 @@ struct perftest_parameters {
int processing_hints;
int dynamic_cqe_poll;
int sig_offload;
enum data_validation_types data_validation;
uint32_t data_start_value;
};

struct report_options {
Expand Down
Loading