Skip to content

Commit

Permalink
Set qp_timeout for create_rdma_cm_connection path
Browse files Browse the repository at this point in the history
Upstream commit ccae524 added some
calls to set qp_timeout for the RDMA Connection Manager path using
rdma_set_option() with the RDMA_OPTION_ID_ACK_TIMEOUT optname, but it
only set qp_timeout for the establish_connection() path, which creates
a connection for setup, not data transfer.

To support the qp_timeout argument properly, we must add the
rdma_set_option(RDMA_OPTION_ID_ACK_TIMEOUT) call for the data transfer
connection, which is setup by create_rdma_cm_connection(). Therefore
this change adds these required calls in rdma_cm_address_handler()
for the client and rdma_cm_connection_request_handler() for the server.
For the client path, the rdma_set_option() call is added before
rdma_resolve_route() and for the server path it is added before
rdma_accept() just like in establish_connection().

With this change the --qp-timeout/-u argument should work properly for
all perftest variants in the RDMA Connection Manager path.

Signed-off-by: Raphael Norwitz <[email protected]>
  • Loading branch information
raphael-s-norwitz committed Sep 5, 2024
1 parent f136038 commit b8aa202
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/perftest_communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,14 @@ int rdma_cm_address_handler(struct pingpong_context *ctx,
}
}

rc = rdma_set_option(cma_id, RDMA_OPTION_ID, RDMA_OPTION_ID_ACK_TIMEOUT,
&user_param->qp_timeout, sizeof(uint8_t));
if (rc) {
error_message = "Failed to set qp_timeout.";
rdma_cm_connect_error(ctx);
goto error;
}

rc = rdma_resolve_route(cma_id, 2000);
if (rc) {
error_message = "Failed to resolve RDMA CM route.";
Expand Down Expand Up @@ -2464,6 +2472,14 @@ int rdma_cm_connection_request_handler(struct pingpong_context *ctx,
goto error_2;
}

rc = rdma_set_option(ctx->cm_id, RDMA_OPTION_ID,
RDMA_OPTION_ID_ACK_TIMEOUT,
&user_param->qp_timeout, sizeof(uint8_t));
if (rc) {
error_message = "Failed to set qp_timeout.";
goto error_2;
}

rc = rdma_accept(ctx->cm_id, &conn_param);
if (rc) {
error_message = "Failed to accept RDMA CM connection.";
Expand Down

0 comments on commit b8aa202

Please sign in to comment.