From da807f1c7e376e4007b6530fa8445307ebd0257b Mon Sep 17 00:00:00 2001 From: Jessie Yang Date: Mon, 7 Oct 2024 14:04:37 -0700 Subject: [PATCH] Abort for MR > 4GB Find the test that registers memory > 4GB in PR CI. Signed-off-by: Jessie Yang --- prov/efa/src/efa_mr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prov/efa/src/efa_mr.c b/prov/efa/src/efa_mr.c index 1e1f803b777..fc1cf013fe3 100644 --- a/prov/efa/src/efa_mr.c +++ b/prov/efa/src/efa_mr.c @@ -831,6 +831,12 @@ static int efa_mr_reg_impl(struct efa_mr *efa_mr, uint64_t flags, const void *at } efa_mr->domain->ibv_mr_reg_ct++; efa_mr->domain->ibv_mr_reg_sz += efa_mr->ibv_mr->length; + if (efa_mr->ibv_mr->length >= (size_t) BIT(32)) { + fprintf(stderr, + "mr >4GB.\n" + "Your application will now abort.\n"); + abort(); + } EFA_INFO(FI_LOG_MR, "Registered memory of size %zu for ibv pd %p, total mr reg size %zu, mr reg count %zu\n", efa_mr->ibv_mr->length, efa_mr->domain->ibv_pd, efa_mr->domain->ibv_mr_reg_sz, efa_mr->domain->ibv_mr_reg_ct); efa_mr->mr_fid.key = efa_mr->ibv_mr->rkey;