From bf7189e88c92b61695df7a7149912a1f88847f81 Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Sat, 22 Feb 2025 00:59:45 +0000 Subject: [PATCH] fabtests/common: Set the min of tx/rx_mr_size In FT_OPT_ALLOC_MULT_MR mode, currently tx/rx_mr_size is set as the opts.transfer_size, and the subsequent ft_alloc_ctx_array will use this size to allocate tx/rx buffers in the ctx array. However, when test call ft_post_rx_buf, it will finally post a size as MAX(opts.transfer_size, FT_MAX_CTRL_MSG). When opts.transfer_size is smaller than FT_MAX_CTRL_MSG, it will cause test call fi_recv of size larger than the actual buffer (and MR) size and cause error when the provider offload the recv directly to hardware. This patch fixes this issue by making the tx/rx_mr_size has a min value as the FT_MAX_CTRL_MSG. Signed-off-by: Shi Jin --- fabtests/common/shared.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fabtests/common/shared.c b/fabtests/common/shared.c index dc99eb574a0..334689aa40d 100644 --- a/fabtests/common/shared.c +++ b/fabtests/common/shared.c @@ -592,6 +592,8 @@ int ft_alloc_msgs(void) if (opts.options & FT_OPT_ALLOC_MULT_MR) { ft_set_tx_rx_sizes(&tx_mr_size, &rx_mr_size); + tx_mr_size = MAX(FT_MAX_CTRL_MSG, tx_mr_size); + rx_mr_size = MAX(FT_MAX_CTRL_MSG, rx_mr_size); rx_size = FT_MAX_CTRL_MSG + ft_rx_prefix_size(); tx_size = FT_MAX_CTRL_MSG + ft_tx_prefix_size(); rx_buf_size = rx_size;