Skip to content

Commit

Permalink
fabtests/efa: Add simple unexpected test to MR exhaustion test
Browse files Browse the repository at this point in the history
A simple implementation of the unexpected pingpong test that does not do
inject and only sends one unexpected message at a time

Signed-off-by: Sai Sunku <[email protected]>
  • Loading branch information
sunkuamzn authored and a-szegel committed Dec 29, 2023
1 parent 070f269 commit f4c0be1
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
45 changes: 45 additions & 0 deletions fabtests/prov/efa/src/efa_exhaust_mr_reg_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,48 @@ int ft_efa_alloc_bufs(void **buffers, size_t buf_size, size_t count) {
}
return FI_SUCCESS;
}

int ft_efa_unexpected_pingpong(void)
{
int ret, i;

opts.options |= FT_OPT_OOB_CTRL;

ret = ft_sync();
if (ret)
return ret;

for (i = 0; i < opts.iterations + opts.warmup_iterations; i++) {
if (i == opts.warmup_iterations)
ft_start();

ret = ft_post_tx(ep, remote_fi_addr, opts.transfer_size, NO_CQ_DATA, &tx_ctx);
if (ret)
return ret;

ft_sync();

ret = ft_get_rx_comp(rx_seq);
if (ret)
return ret;

ret = ft_post_rx(ep, rx_size, &rx_ctx);
if (ret)
return ret;

ret = ft_get_tx_comp(tx_seq);
if (ret)
return ret;
}

ft_stop();

if (opts.machr)
show_perf_mr(opts.transfer_size, opts.iterations, &start, &end,
2, opts.argc, opts.argv);
else
show_perf(NULL, opts.transfer_size, opts.iterations, &start,
&end, 2);

return 0;
}
1 change: 1 addition & 0 deletions fabtests/prov/efa/src/efa_exhaust_mr_reg_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ int ft_efa_register_mr_reg(struct ibv_pd *pd, void **buffers, size_t buf_size,
struct ibv_mr **mr_reg_vec, size_t count, size_t *registered);
int ft_efa_deregister_mr_reg(struct ibv_mr **mr_reg_vec, size_t count);
int ft_efa_alloc_bufs(void **buffers, size_t buf_size, size_t count);
int ft_efa_unexpected_pingpong(void);

#endif /* _EFA_EXHAUST_MR_REG_COMMON_H */
20 changes: 15 additions & 5 deletions fabtests/prov/efa/src/efa_exhaust_mr_reg_rdm_pingpong.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "benchmarks/benchmark_shared.h"
#include "efa_exhaust_mr_reg_common.h"

static int run(void)
static int run(int (*pingpong_func)(void))
{
int i, ret = 0;

Expand All @@ -20,18 +20,18 @@ static int run(void)
continue;
opts.transfer_size = test_size[i].size;
init_test(&opts, test_name, sizeof(test_name));
ret = pingpong();
ret = pingpong_func();
if (ret)
return ret;
}
} else {
init_test(&opts, test_name, sizeof(test_name));
ret = pingpong();
ret = pingpong_func();
if (ret)
return ret;
}

return ft_finalize();
return 0;
}

int main(int argc, char **argv)
Expand Down Expand Up @@ -110,8 +110,14 @@ int main(int argc, char **argv)

ft_sync();
printf("Running pingpong test\n");
ret = run();
ret = run(pingpong);
if (ret)
goto out;

printf("Running unexpected pingpong test\n");
ret = run(ft_efa_unexpected_pingpong);

out:
if (opts.dst_addr) {
printf("Deregistering MRs on client\n");
err = ft_efa_deregister_mr_reg(mr_reg_vec, registered);
Expand All @@ -120,6 +126,10 @@ int main(int argc, char **argv)
ft_efa_destroy_ibv_pd(pd);
}

free(buffers);
free(mr_reg_vec);

ft_finalize();
ft_free_res();

return ft_exit_code(ret);
Expand Down

0 comments on commit f4c0be1

Please sign in to comment.