From 91fadb5f2798776ad57dba014cd554a185312023 Mon Sep 17 00:00:00 2001 From: Shmuel Shaul Date: Mon, 16 Sep 2024 10:00:33 +0300 Subject: [PATCH] Perftest: fix qp_timeout with rdma_cm and UD Upstream commit b8aa202 add a rdma cm qp_timeout support over datapath, which is not supported over UD qp type. This commit enable it over RC qp type only. Signed-off-by: Shmuel Shaul --- src/perftest_communication.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/perftest_communication.c b/src/perftest_communication.c index c3d4485f..4b9b481c 100755 --- a/src/perftest_communication.c +++ b/src/perftest_communication.c @@ -2329,12 +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; + if (user_param->connection_type == RC) { + 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); @@ -2472,12 +2474,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; + if (user_param->connection_type == RC) { + 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);