From 9eab9eb2225912665fbee5fa13925232fd13881a Mon Sep 17 00:00:00 2001 From: xiongweimin Date: Mon, 13 Jul 2026 09:04:39 +0800 Subject: [PATCH] RDMA/rxe: Reject unimplemented implicit ODP cleanly rxe advertises ODP but not IB_ODP_SUPPORT_IMPLICIT. The reg_user_mr path still contained a dead branch that checked the implicit capability and could never succeed. Return -EOPNOTSUPP for the implicit ODP address range up front so the intent is obvious and the unreachable code is gone. Signed-off-by: xiongweimin Cc: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Link: https://patch.msgid.link/20260713010439.331054-1-15927021679@163.com Reviewed-by: Zhu Yanjun Signed-off-by: Leon Romanovsky --- drivers/infiniband/sw/rxe/rxe_odp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c index ff904d5e54a7..c189c033175d 100644 --- a/drivers/infiniband/sw/rxe/rxe_odp.c +++ b/drivers/infiniband/sw/rxe/rxe_odp.c @@ -87,14 +87,9 @@ int rxe_odp_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, rxe_mr_init(access_flags, mr); - if (!start && length == U64_MAX) { - if (iova != 0) - return -EINVAL; - if (!(rxe->attr.odp_caps.general_caps & IB_ODP_SUPPORT_IMPLICIT)) - return -EINVAL; - - /* Never reach here, for implicit ODP is not implemented. */ - } + /* Implicit ODP (start=0, length=U64_MAX) is not implemented. */ + if (!start && length == U64_MAX) + return -EOPNOTSUPP; umem_odp = ib_umem_odp_get(&rxe->ib_dev, start, length, access_flags, &rxe_mn_ops);