public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next v1] RDMA/rxe: Remove redundant page presence check
@ 2025-06-08  9:37 Daisuke Matsuda
  2025-06-08  9:51 ` Daisuke Matsuda
  0 siblings, 1 reply; 2+ messages in thread
From: Daisuke Matsuda @ 2025-06-08  9:37 UTC (permalink / raw)
  To: linux-rdma, leon, jgg, zyjzyj2000; +Cc: Daisuke Matsuda

hmm_pfn_to_page() does not return NULL. ib_umem_odp_map_dma_and_lock()
should return an error in case the target pages cannot be mapped until
timeout, so these checks can safely be removed.

Signed-off-by: Daisuke Matsuda <dskmtsd@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_odp.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
index dbc5a5600eb7..fb88f2901c58 100644
--- a/drivers/infiniband/sw/rxe/rxe_odp.c
+++ b/drivers/infiniband/sw/rxe/rxe_odp.c
@@ -203,8 +203,6 @@ static int __rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr,
 
 		page = hmm_pfn_to_page(umem_odp->map.pfn_list[idx]);
 		user_va = kmap_local_page(page);
-		if (!user_va)
-			return -EFAULT;
 
 		src = (dir == RXE_TO_MR_OBJ) ? addr : user_va;
 		dest = (dir == RXE_TO_MR_OBJ) ? user_va : addr;
@@ -286,8 +284,6 @@ static enum resp_states rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova,
 	idx = rxe_odp_iova_to_index(umem_odp, iova);
 	page_offset = rxe_odp_iova_to_page_offset(umem_odp, iova);
 	page = hmm_pfn_to_page(umem_odp->map.pfn_list[idx]);
-	if (!page)
-		return RESPST_ERR_RKEY_VIOLATION;
 
 	if (unlikely(page_offset & 0x7)) {
 		rxe_dbg_mr(mr, "iova not aligned\n");
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-next v1] RDMA/rxe: Remove redundant page presence check
  2025-06-08  9:37 [PATCH for-next v1] RDMA/rxe: Remove redundant page presence check Daisuke Matsuda
@ 2025-06-08  9:51 ` Daisuke Matsuda
  0 siblings, 0 replies; 2+ messages in thread
From: Daisuke Matsuda @ 2025-06-08  9:51 UTC (permalink / raw)
  To: linux-rdma, leon, jgg, zyjzyj2000

Sorry, I mistakenly sent an intermediate work. Please ignore this one and see v2.

On 2025/06/08 18:37, Daisuke Matsuda wrote:
> hmm_pfn_to_page() does not return NULL. ib_umem_odp_map_dma_and_lock()
> should return an error in case the target pages cannot be mapped until
> timeout, so these checks can safely be removed.
> 
> Signed-off-by: Daisuke Matsuda <dskmtsd@gmail.com>
> ---
>   drivers/infiniband/sw/rxe/rxe_odp.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
> index dbc5a5600eb7..fb88f2901c58 100644
> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
> @@ -203,8 +203,6 @@ static int __rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr,
>   
>   		page = hmm_pfn_to_page(umem_odp->map.pfn_list[idx]);
>   		user_va = kmap_local_page(page);
> -		if (!user_va)
> -			return -EFAULT;
>   
>   		src = (dir == RXE_TO_MR_OBJ) ? addr : user_va;
>   		dest = (dir == RXE_TO_MR_OBJ) ? user_va : addr;
> @@ -286,8 +284,6 @@ static enum resp_states rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova,
>   	idx = rxe_odp_iova_to_index(umem_odp, iova);
>   	page_offset = rxe_odp_iova_to_page_offset(umem_odp, iova);
>   	page = hmm_pfn_to_page(umem_odp->map.pfn_list[idx]);
> -	if (!page)
> -		return RESPST_ERR_RKEY_VIOLATION;
>   
>   	if (unlikely(page_offset & 0x7)) {
>   		rxe_dbg_mr(mr, "iova not aligned\n");


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-08  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08  9:37 [PATCH for-next v1] RDMA/rxe: Remove redundant page presence check Daisuke Matsuda
2025-06-08  9:51 ` Daisuke Matsuda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox