From 54bd47daca353104f4d0ab5658a19d2b1202f898 Mon Sep 17 00:00:00 2001 From: Firas Jahjah Date: Mon, 24 Nov 2025 14:52:42 +0200 Subject: [PATCH] Support CUDA latency test with write w/ immediate verb Write with immediate doesn't poll data and instead polls CQ. There's no reason to read/write from buffers and therefore we can support write with immediate verb. Remove writing to the buffer during this verb. Reviewed-by: Michael Margolin Reviewed-by: Nitzan Lavy Signed-off-by: Firas Jahjah --- src/perftest_parameters.c | 4 ++-- src/perftest_resources.c | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/perftest_parameters.c b/src/perftest_parameters.c index 85ace6c3..09176d44 100755 --- a/src/perftest_parameters.c +++ b/src/perftest_parameters.c @@ -1949,9 +1949,9 @@ static void force_dependecies(struct perftest_parameters *user_param) exit(1); } - if (user_param->memory_type == MEMORY_CUDA && user_param->tst == LAT && (user_param->verb == WRITE || user_param->verb == WRITE_IMM)) { + if (user_param->memory_type == MEMORY_CUDA && user_param->tst == LAT && user_param->verb == WRITE) { printf(RESULT_LINE); - fprintf(stderr,"Perftest supports CUDA latency tests with read/send verbs only\n"); + fprintf(stderr, "Perftest doesn't support CUDA latency test with write (without immediate) verb\n"); exit(1); } diff --git a/src/perftest_resources.c b/src/perftest_resources.c index 94e95864..c7bc95bd 100755 --- a/src/perftest_resources.c +++ b/src/perftest_resources.c @@ -5222,7 +5222,6 @@ int run_iter_lat_write_imm(struct pingpong_context *ctx,struct perftest_paramete uint64_t rcnt = 0; int ne; int err = 0; - volatile char *post_buf = NULL; int size_per_qp = (user_param->use_srq) ? user_param->rx_depth/user_param->num_of_qps : user_param->rx_depth; @@ -5246,8 +5245,6 @@ int run_iter_lat_write_imm(struct pingpong_context *ctx,struct perftest_paramete ctx->wr[0].send_flags |= IBV_SEND_INLINE; } - post_buf = (char*)ctx->buf[0] + user_param->size - 1; - /* Duration support in latency tests. */ if (user_param->test_type == DURATION) { duration_param=user_param; @@ -5313,8 +5310,7 @@ int run_iter_lat_write_imm(struct pingpong_context *ctx,struct perftest_paramete if (user_param->test_type == ITERATIONS) user_param->tposted[scnt] = get_cycles(); - *post_buf = (char)++scnt; - + ++scnt; err = post_send_method(ctx, 0, user_param); if (err) {