[RFC PATCH v2 4/5] RDMA/efa: Check EFA_CHUNK_PAYLOAD_SIZE against PAGE_SIZE_MIN

From: Eric Curtin

Date: Tue Dec 01 2026 - 22:21:16 EST


From: Eric Curtin <eric.curtin@xxxxxxxxxx>

With arm64 boot-time page size selection PAGE_SIZE is not a
compile-time constant, so it cannot be used in BUILD_BUG_ON().

Check that the chunk payload fits in a page against PAGE_SIZE_MIN, so
that it holds for every page size.

No functional change for compile-time page sizes.

Signed-off-by: Eric Curtin <eric.curtin@xxxxxxxxxx>
---
drivers/infiniband/hw/efa/efa_verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index d56eb132545b..1c27484e5b39 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -1478,7 +1478,7 @@ static int pbl_indirect_initialize(struct efa_dev *dev, struct pbl_context *pbl)
struct scatterlist *sgl;
int sg_dma_cnt, err;

- BUILD_BUG_ON(EFA_CHUNK_PAYLOAD_SIZE > PAGE_SIZE);
+ BUILD_BUG_ON(EFA_CHUNK_PAYLOAD_SIZE > PAGE_SIZE_MIN);
sgl = efa_vmalloc_buf_to_sg(pbl->pbl_buf, size_in_pages);
if (!sgl)
return -ENOMEM;