From 2a320f1ee698e489b2f96a462f5ae8ee11f787d7 Mon Sep 17 00:00:00 2001 From: PukNgae Cryolitia Date: Thu, 9 Jan 2025 20:46:47 +0800 Subject: [PATCH] prov/opx: use `page_sizes[OFI_PAGE_SIZE]-1` instead of `PAGE_MASK` Fix: https://github.com/ofiwg/libfabric/issues/10661 Signed-off-by: PukNgae Cryolitia --- prov/opx/include/rdma/opx/opx_hfi1_pre_cn5000.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prov/opx/include/rdma/opx/opx_hfi1_pre_cn5000.h b/prov/opx/include/rdma/opx/opx_hfi1_pre_cn5000.h index 2b57bc16115..c83eb5b75da 100644 --- a/prov/opx/include/rdma/opx/opx_hfi1_pre_cn5000.h +++ b/prov/opx/include/rdma/opx/opx_hfi1_pre_cn5000.h @@ -38,6 +38,7 @@ #include #include "fi_opx_hfi1.h" +#include "ofi_mem.h" /* Implementation PRE-CN5000 */ #ifdef OPX_PRE_CN5000 @@ -116,7 +117,7 @@ int opx_get_port(struct hfi1_user_info_dep *uinfo) #define OPX_HFI1_MMAP_MAGIC 0xdabbad00 -#define opx_offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) +#define opx_offset_in_page(p) ((unsigned long)(p) & (page_sizes[OFI_PAGE_SIZE]-1)) #define OPX_HFI1_MMAP_TOKEN_SET(field, val) \ (((val) & OPX_HFI1_MMAP_##field##_MASK) << OPX_HFI1_MMAP_##field##_SHIFT)