Skip to content

Commit

Permalink
fabtests/common: Set the min of tx/rx_mr_size
Browse files Browse the repository at this point in the history
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 <sjina@amazon.com>
  • Loading branch information
shijin-aws committed Feb 22, 2025
1 parent b136180 commit bf7189e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bf7189e

Please sign in to comment.