From 17d9cf2c5a168bc22b6e98d2220cd7f802861233 Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Tue, 17 Dec 2024 01:35:47 +0000 Subject: [PATCH] util/pingpong: close mr after ep close pingpong doesn't support FI_MR_ENDPOINT today, so the mr is associated with domain instead of ep. It is unsafe to close mr before closing ep because it can cause an EBUSY error when there are outstanding recvs of the mr posted to the ep/qp. This patch fixes this issue by moving the mr close after the ep close. Signed-off-by: Shi Jin --- util/pingpong.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/pingpong.c b/util/pingpong.c index 68a554c8752..9597d305121 100644 --- a/util/pingpong.c +++ b/util/pingpong.c @@ -1875,12 +1875,12 @@ static void pp_free_res(struct ct_pingpong *ct) { PP_DEBUG("Freeing resources of test suite\n"); - if (ct->mr != &(ct->no_mr)) - PP_CLOSE_FID(ct->mr); PP_CLOSE_FID(ct->ep); PP_CLOSE_FID(ct->pep); PP_CLOSE_FID(ct->rxcq); PP_CLOSE_FID(ct->txcq); + if (ct->mr != &(ct->no_mr)) + PP_CLOSE_FID(ct->mr); PP_CLOSE_FID(ct->av); PP_CLOSE_FID(ct->eq); PP_CLOSE_FID(ct->domain);