Skip to content

Commit f961e40

Browse files
committed
Perftest: Add null-mr support over server side
Currently perftest support null-mr over client only (sender). this commit add support over server side (receiver). Signed-off-by: Shmuel Shaul <[email protected]>
1 parent 64330bb commit f961e40

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

man/perftest.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ many different options and modes.
345345
Not relevant for raw_ethernet_fs_rate.
346346
.TP
347347
.B --use-null-mr
348-
Allocate a null memory region for the client with \fBibv_alloc_null_mr\fR(3)
348+
Allocate a null memory region with \fBibv_alloc_null_mr\fR(3)
349349
.TP
350350
.B --use_cuda=<cuda device id>
351351
Use CUDA specific device for GPUDirect RDMA testing.

src/perftest_communication.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ int set_up_connection(struct pingpong_context *ctx,
904904

905905
my_dest[i].qpn = ctx->qp[i]->qp_num;
906906
my_dest[i].psn = lrand48() & 0xffffff;
907-
my_dest[i].rkey = ctx->mr[i]->rkey;
907+
my_dest[i].rkey = user_param->use_null_mr ? ctx->null_mr->lkey : ctx->mr[i]->rkey;
908908

909909
/* Each qp gives his receive buffer address.*/
910910
my_dest[i].out_reads = user_param->out_reads;

src/perftest_parameters.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection
689689

690690
if (verb == WRITE || verb == WRITE_IMM || verb == READ) {
691691
printf(" --use-null-mr ");
692-
printf(" Allocate a null memory region for the client with ibv_alloc_null_mr.\n");
692+
printf(" Allocate a null memory region with ibv_alloc_null_mr.\n");
693693
}
694694

695695
if (tst == BW || tst == LAT_BY_BW) {

src/perftest_resources.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3166,10 +3166,7 @@ void ctx_set_send_reg_wqes(struct pingpong_context *ctx,
31663166
ctx->sge_list[i*user_param->post_list + j].length =
31673167
(user_param->connection_type == RawEth) ? (user_param->size - HW_CRC_ADDITION) : user_param->size;
31683168

3169-
ctx->sge_list[i*user_param->post_list + j].lkey = ctx->mr[i]->lkey;
3170-
if (user_param->use_null_mr) {
3171-
ctx->sge_list[i*user_param->post_list + j].lkey = ctx->null_mr->lkey;
3172-
}
3169+
ctx->sge_list[i*user_param->post_list + j].lkey = user_param->use_null_mr ? ctx->null_mr->lkey : ctx->mr[i]->lkey;
31733170

31743171
if (j > 0) {
31753172

@@ -3319,7 +3316,7 @@ int ctx_set_recv_wqes(struct pingpong_context *ctx,struct perftest_parameters *u
33193316

33203317
for (j = 0; j < user_param->recv_post_list; j++) {
33213318
ctx->recv_sge_list[i * user_param->recv_post_list + j].length = length;
3322-
ctx->recv_sge_list[i * user_param->recv_post_list + j].lkey = ctx->mr[i]->lkey;
3319+
ctx->recv_sge_list[i * user_param->recv_post_list + j].lkey = user_param->use_null_mr ? ctx->null_mr->lkey : ctx->mr[i]->lkey;
33233320

33243321
if (j > 0) {
33253322
ctx->recv_sge_list[i * user_param->recv_post_list + j].addr = ctx->recv_sge_list[i * user_param->recv_post_list + j - 1].addr;

0 commit comments

Comments
 (0)