From b8aa202a048802ed31af5f7ebae8535b3a80413a Mon Sep 17 00:00:00 2001 From: Raphael Norwitz Date: Thu, 5 Sep 2024 19:00:46 +0000 Subject: [PATCH] Set qp_timeout for create_rdma_cm_connection path Upstream commit ccae5242bbdb2c8642fdc66d949b901ee3b81eaf 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 --- src/perftest_communication.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/perftest_communication.c b/src/perftest_communication.c index eb300510..c3d4485f 100755 --- a/src/perftest_communication.c +++ b/src/perftest_communication.c @@ -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."; @@ -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.";