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
88 changes: 58 additions & 30 deletions src/perftest_parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define HEX_BASE (16)
#define DEFAULT_JSON_FILE_NAME "perftest_out.json"
static const char *connStr[] = {"RC","UC","UD","RawEth","XRC","DC","SRD"};
static const char *testsStr[] = {"Send","RDMA_Write","RDMA_Write_imm","RDMA_Read","Atomic"};
static const char *testsStr[] = {"Send", "Send_imm", "RDMA_Write","RDMA_Write_imm","RDMA_Read","Atomic"};
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"};
Expand Down Expand Up @@ -283,7 +283,7 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection
}

if (connection_type != RawEth) {
if (verb == SEND) {
if (verb == SEND || verb == SEND_IMM) {
printf(" -c, --connection=<RC/XRC/UC/UD/DC/SRD> ");
printf(" Connection type RC/XRC/UC/UD/DC/SRD (default RC) (SYMMETRIC)\n");
} else if (verb == WRITE || verb == WRITE_IMM) {
Expand Down Expand Up @@ -417,7 +417,7 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection
printf(" Generate Cqe only after <--cq-mod> completion\n");
}

if ((verb == SEND || verb == WRITE_IMM) && tst != FS_RATE) {
if ((verb == SEND || verb == SEND_IMM || verb == WRITE_IMM) && tst != FS_RATE) {
printf(" -r, --rx-depth=<dep> ");
printf(" Rx queue size (default %d).",DEF_RX_SEND);
printf(" If using srq, rx-depth controls max-wr size of the srq\n");
Expand Down Expand Up @@ -527,7 +527,7 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection
printf(" Force the link(s) to a specific type: IB or Ethernet.\n");
}

if (verb == SEND) {
if (verb == SEND || verb == SEND_IMM) {
printf(" --use-srq ");
printf(" Use a Shared Receive Queue. --rx-depth controls max-wr size of the SRQ \n");
}
Expand Down Expand Up @@ -755,6 +755,11 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection
#endif
}

if ((tst == LAT || tst == BW) && verb == SEND) {
printf(" --send_with_imm ");
printf(" Use send-with-immediate verb instead of send\n");
}

putchar('\n');
}
/******************************************************************************
Expand Down Expand Up @@ -877,8 +882,11 @@ static void init_perftest_params(struct perftest_parameters *user_param)
user_param->use_mcg = OFF;
user_param->use_rdma_cm = OFF;
user_param->work_rdma_cm = OFF;
user_param->rx_depth = (user_param->verb == SEND || user_param->verb == WRITE || user_param->verb == WRITE_IMM)
? DEF_RX_SEND : DEF_RX_RDMA;
user_param->rx_depth = (user_param->verb == SEND ||
user_param->verb == SEND_IMM ||
user_param->verb == WRITE ||
user_param->verb == WRITE_IMM)
? DEF_RX_SEND : DEF_RX_RDMA;
user_param->duplex = OFF;
user_param->noPeak = OFF;
user_param->req_cq_mod = 0;
Expand Down Expand Up @@ -995,9 +1003,10 @@ static void init_perftest_params(struct perftest_parameters *user_param)
user_param->perform_warm_up = 0;
user_param->use_ooo = 0;
user_param->disable_pcir = 0;
user_param->source_ip = NULL;
user_param->has_source_ip = 0;
user_param->use_write_with_imm = 0;
user_param->source_ip = NULL;
user_param->has_source_ip = 0;
user_param->use_write_with_imm = 0;
user_param->use_send_with_imm = 0;
user_param->use_unsolicited_write = 0;
user_param->congest_type = OFF;
user_param->no_lock = OFF;
Expand Down Expand Up @@ -1071,7 +1080,7 @@ static void change_conn_type(int *cptr, VerbType verb, const char *optarg)

} else if (strcmp(connStr[2], optarg)==0) {
*cptr = UD;
if (verb != SEND) {
if (verb != SEND && verb != SEND_IMM) {
fprintf(stderr," UD connection only possible in SEND verb\n");
exit(1);
}
Expand Down Expand Up @@ -1253,7 +1262,7 @@ static void force_dependecies(struct perftest_parameters *user_param)
user_param->tx_depth = user_param->iters;
}

if ((user_param->verb == SEND || user_param->verb == WRITE_IMM) &&
if ((user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM) &&
user_param->rx_depth > user_param->iters) {
user_param->rx_depth = user_param->iters;
}
Expand Down Expand Up @@ -1316,9 +1325,9 @@ static void force_dependecies(struct perftest_parameters *user_param)
exit (1);
}

if (user_param->use_srq && user_param->verb != SEND) {
if (user_param->use_srq && user_param->verb != SEND && user_param->verb != SEND_IMM) {
printf(RESULT_LINE);
printf(" Using SRQ only avavilible in SEND tests.\n");
printf(" Using SRQ only avavilible in SEND / SEND_IMM tests.\n");
exit (1);
}

Expand Down Expand Up @@ -1346,8 +1355,9 @@ static void force_dependecies(struct perftest_parameters *user_param)
if (user_param->connection_type == DC && !user_param->use_srq)
user_param->use_srq = ON;

if (user_param->use_srq && user_param->verb == SEND &&
user_param->num_of_qps > user_param->rx_depth) {
if (user_param->use_srq
&& (user_param->verb == SEND || user_param->verb == SEND_IMM)
&& (user_param->num_of_qps > user_param->rx_depth)) {
printf(RESULT_LINE);
printf(" Using SRQ depth should be greater than number of QPs.\n");
exit (1);
Expand Down Expand Up @@ -1600,8 +1610,8 @@ static void force_dependecies(struct perftest_parameters *user_param)
}
}

if ((user_param->verb == SEND || user_param->verb == WRITE_IMM) && user_param->tst == BW
&& user_param->machine == SERVER && !user_param->duplex ) {
if ((user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM)
&& user_param->tst == BW && user_param->machine == SERVER && !user_param->duplex ) {
if (user_param->noPeak == OFF)
printf(" WARNING: BW peak won't be measured in this run.\n");
user_param->noPeak = ON;
Expand All @@ -1626,9 +1636,10 @@ static void force_dependecies(struct perftest_parameters *user_param)

}

if (user_param->duplex && (user_param->verb == SEND || user_param->verb == WRITE_IMM)) {
if (user_param->duplex &&
(user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM)) {
printf(RESULT_LINE);
fprintf(stderr," run_infinitely mode is not supported in SEND or WRITE_IMM "
fprintf(stderr," run_infinitely mode is not supported in SEND, SEND_IMM or WRITE_IMM "
"Bidirectional BW test\n");
exit(1);
}
Expand Down Expand Up @@ -1820,9 +1831,10 @@ static void force_dependecies(struct perftest_parameters *user_param)
}

if (user_param->rate_limit_type == SW_RATE_LIMIT) {
if (user_param->tst != BW || user_param->verb == ATOMIC || (user_param->verb == SEND && user_param->duplex)) {
if (user_param->tst != BW || user_param->verb == ATOMIC
|| ((user_param->verb == SEND || user_param->verb == SEND_IMM) && user_param->duplex)) {
printf(RESULT_LINE);
fprintf(stderr,"SW Rate limiter cann't be executed on non-BW, ATOMIC or bidirectional SEND tests\n");
fprintf(stderr,"SW Rate limiter cann't be executed on non-BW, ATOMIC or bidirectional SEND / SEND_IMM tests\n");
exit(1);
}
} else if (user_param->rate_limit_type == HW_RATE_LIMIT) {
Expand Down Expand Up @@ -1973,7 +1985,8 @@ static void force_dependecies(struct perftest_parameters *user_param)
}

/* WA for a bug when rx_depth is odd in SEND */
if ((user_param->verb == SEND || user_param->verb == WRITE_IMM) && (user_param->rx_depth % 2 == 1) && user_param->test_method == RUN_REGULAR)
if ((user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM)
&& (user_param->rx_depth % 2 == 1) && user_param->test_method == RUN_REGULAR)
user_param->rx_depth += 1;

if (user_param->test_type == ITERATIONS && user_param->iters > 20000 && user_param->noPeak == OFF && user_param->tst == BW) {
Expand Down Expand Up @@ -2460,6 +2473,7 @@ static void ctx_set_max_inline(struct ibv_context *context,struct perftest_param
switch(user_param->verb) {
case WRITE_IMM:
case WRITE: user_param->inline_size = (user_param->connection_type == DC)? DEF_INLINE_DC : DEF_INLINE_WRITE; break;
case SEND_IMM:
case SEND : user_param->inline_size = (user_param->connection_type == DC)? DEF_INLINE_DC : (user_param->connection_type == UD)? DEF_INLINE_SEND_UD :
DEF_INLINE_SEND_RC_UC_XRC ; break;
default : user_param->inline_size = 0;
Expand Down Expand Up @@ -2607,6 +2621,7 @@ 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 use_send_with_imm_flag = 0;
#ifdef HAVE_SRD_WITH_UNSOLICITED_WRITE_RECV
static int unsolicited_write_flag = 0;
#endif
Expand Down Expand Up @@ -2812,6 +2827,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
#endif
{.name = "bind_source_ip", .has_arg = 1, .flag = &source_ip_flag, .val = 1},
{.name = "write_with_imm", .has_arg = 0, .flag = &use_write_with_imm_flag, .val = 1 },
{.name = "send_with_imm", .has_arg = 0, .flag = &use_send_with_imm_flag, .val = 1 },
#ifdef HAVE_OOO_RECV_WRS
{ .name = "no_enhanced_reorder", .has_arg = 0, .flag = &no_enhanced_reorder_flag, .val = 1},
#endif
Expand Down Expand Up @@ -2909,7 +2925,8 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
break;
case 'M': GET_STRING(user_param->user_mgid,strdupa(optarg)); break;
case 'r': CHECK_VALUE_IN_RANGE(user_param->rx_depth,int,MIN_RX,MAX_RX," Rx depth",not_int_ptr);
if (user_param->verb != SEND && user_param->verb != WRITE && user_param->verb != WRITE_IMM && user_param->rx_depth > DEF_RX_RDMA) {
if (user_param->verb != SEND && user_param->verb != SEND_IMM &&
user_param->verb != WRITE && user_param->verb != WRITE_IMM && user_param->rx_depth > DEF_RX_RDMA) {
fprintf(stderr," On RDMA verbs rx depth can be only 1\n");
free(duplicates_checker);
return FAILURE;
Expand Down Expand Up @@ -3575,6 +3592,14 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc)
user_param->verb = WRITE_IMM;
use_write_with_imm_flag = 0;
}
if (use_send_with_imm_flag) {
if ((user_param->tst != LAT && user_param->tst != BW) || user_param->verb != SEND) {
fprintf(stderr, "Send_with_imm can only be used with send_lat and send_bw tests\n");
return FAILURE;
}
user_param->verb = SEND_IMM;
use_send_with_imm_flag = 0;
}
#ifdef HAVE_SRD_WITH_UNSOLICITED_WRITE_RECV
if (unsolicited_write_flag) {
user_param->use_unsolicited_write = 1;
Expand Down Expand Up @@ -4041,7 +4066,8 @@ void ctx_print_test_info(struct perftest_parameters *user_param)
if (user_param->recv_post_list > 1)
printf(" Recv Post List : %d\n", user_param->recv_post_list);

if ((user_param->verb == SEND || user_param->verb == WRITE_IMM) && (user_param->machine == SERVER || user_param->duplex)) {
if ((user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM)
&& (user_param->machine == SERVER || user_param->duplex)) {
printf(" RX depth : %d\n",user_param->rx_depth);
}

Expand Down Expand Up @@ -4189,7 +4215,7 @@ void print_report_bw (struct perftest_parameters *user_param, struct bw_report_d
exit(1);
}

run_inf_bi_factor = (user_param->duplex && user_param->test_method == RUN_INFINITELY) ? (user_param->verb == SEND ? 1 : 2) : 1 ;
run_inf_bi_factor = (user_param->duplex && user_param->test_method == RUN_INFINITELY) ? ((user_param->verb == SEND || user_param->verb == SEND_IMM) ? 1 : 2) : 1 ;
tsize = run_inf_bi_factor * user_param->size;
num_of_calculated_iters *= (user_param->test_type == DURATION) ? 1 : num_of_qps;
location_arr = (user_param->noPeak) ? 0 : num_of_calculated_iters - 1;
Expand Down Expand Up @@ -4227,8 +4253,9 @@ void print_report_bw (struct perftest_parameters *user_param, struct bw_report_d
my_bw_rep->msgRate_avg_p2 = msgRate_avg_p2;
my_bw_rep->sl = user_param->sl;

if (!user_param->duplex || ((user_param->verb == SEND || user_param->verb == WRITE_IMM) && user_param->test_type == DURATION)
|| user_param->test_method == RUN_INFINITELY || user_param->connection_type == RawEth)
if (!user_param->duplex
|| ((user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM) && user_param->test_type == DURATION)
|| user_param->test_method == RUN_INFINITELY || user_param->connection_type == RawEth)
print_full_bw_report(user_param, my_bw_rep, NULL);

if (free_my_bw_rep == 1) {
Expand Down Expand Up @@ -4300,8 +4327,8 @@ static void write_test_info_to_file(int out_json_fds, struct perftest_parameters
if (user_param->recv_post_list > 1)
dprintf(out_json_fds, "\"Recv_Post_List\": %d,\n", user_param->recv_post_list);

if ((user_param->verb == SEND || user_param->verb == WRITE_IMM) &&
(user_param->machine == SERVER || user_param->duplex)) {
if ((user_param->verb == SEND || user_param->verb == SEND_IMM || user_param->verb == WRITE_IMM) &&
(user_param->machine == SERVER || user_param->duplex)) {
dprintf(out_json_fds, "\"RX_depth\": %d,\n",user_param->rx_depth);
}

Expand Down Expand Up @@ -4397,7 +4424,8 @@ void print_full_bw_report (struct perftest_parameters *user_param, struct bw_rep
msgRate_avg_p2 += rem_bw_rep->msgRate_avg_p2;
}

if ( (user_param->duplex && rem_bw_rep != NULL) || (!user_param->duplex && rem_bw_rep == NULL) || (user_param->duplex && user_param->verb == SEND)) {
if ((user_param->duplex && rem_bw_rep != NULL) || (!user_param->duplex && rem_bw_rep == NULL)
|| (user_param->duplex && (user_param->verb == SEND || user_param->verb == SEND_IMM))) {
/* Verify Limits */
if ( ((user_param->is_limit_bw == ON )&& (user_param->limit_bw > bw_avg)) )
user_param->is_bw_limit_passed |= 0;
Expand Down
3 changes: 2 additions & 1 deletion src/perftest_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
} while (0)

/* The Verb of the benchmark. */
typedef enum { SEND , WRITE, WRITE_IMM, READ, ATOMIC } VerbType;
typedef enum { SEND, SEND_IMM, WRITE, WRITE_IMM, READ, ATOMIC } VerbType;

/* The type of the test */
typedef enum { LAT , BW , LAT_BY_BW, FS_RATE } TestType;
Expand Down Expand Up @@ -673,6 +673,7 @@ struct perftest_parameters {
int has_source_ip;
int ah_allocated;
int use_write_with_imm;
int use_send_with_imm;
int use_unsolicited_write;
int use_enhanced_reorder;
int no_enhanced_reorder;
Expand Down
Loading