Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] RDMA/rxe: Reject unimplemented implicit ODP cleanly
@ 2026-07-13  1:04 weimin xiong
  2026-07-14  2:55 ` Zhu Yanjun
  0 siblings, 1 reply; 3+ messages in thread
From: weimin xiong @ 2026-07-13  1:04 UTC (permalink / raw)
  To: linux-rdma; +Cc: jgg, xiongweimin

From: xiongweimin <xiongweimin@kylinos.cn>

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 <xiongweimin@kylinos.cn>
Cc: linux-rdma@vger.kernel.org
Cc: Jason Gunthorpe <jgg@nvidia.com>
---

--- a/drivers/infiniband/sw/rxe/rxe_odp.c
+++ b/drivers/infiniband/sw/rxe/rxe_odp.c
@@ -87,14 +87,9 @@
 
 	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);


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

* Re: [PATCH] RDMA/rxe: Reject unimplemented implicit ODP cleanly
  2026-07-13  1:04 [PATCH] RDMA/rxe: Reject unimplemented implicit ODP cleanly weimin xiong
@ 2026-07-14  2:55 ` Zhu Yanjun
  2026-07-14  3:17   ` Xiong Weimin
  0 siblings, 1 reply; 3+ messages in thread
From: Zhu Yanjun @ 2026-07-14  2:55 UTC (permalink / raw)
  To: weimin xiong, linux-rdma, yanjun.zhu@linux.dev; +Cc: jgg, xiongweimin

在 2026/7/12 18:04, weimin xiong 写道:
> From: xiongweimin <xiongweimin@kylinos.cn>
> 
> 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 <xiongweimin@kylinos.cn>
> Cc: linux-rdma@vger.kernel.org
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> ---
> 
> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
> @@ -87,14 +87,9 @@
>   
>   	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. */
> -	}

It seems that the above are for implicit ODP. However the implicit ODP 
is not implemented currently. I am fine with removing this.

Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Zhu Yanjun


> +	/* 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);
> 


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

* Re:Re: [PATCH] RDMA/rxe: Reject unimplemented implicit ODP cleanly
  2026-07-14  2:55 ` Zhu Yanjun
@ 2026-07-14  3:17   ` Xiong Weimin
  0 siblings, 0 replies; 3+ messages in thread
From: Xiong Weimin @ 2026-07-14  3:17 UTC (permalink / raw)
  To: Zhu Yanjun; +Cc: linux-rdma, jgg, xiongweimin




Thanks Zhu, I will add your Reviewed-by tag.


At 2026-07-14 10:55:37, "Zhu Yanjun" <yanjun.zhu@linux.dev> wrote:
>在 2026/7/12 18:04, weimin xiong 写道:
>> From: xiongweimin <xiongweimin@kylinos.cn>
>> 
>> 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 <xiongweimin@kylinos.cn>
>> Cc: linux-rdma@vger.kernel.org
>> Cc: Jason Gunthorpe <jgg@nvidia.com>
>> ---
>> 
>> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
>> @@ -87,14 +87,9 @@
>>   
>>   	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. */
>> -	}
>
>It seems that the above are for implicit ODP. However the implicit ODP 
>is not implemented currently. I am fine with removing this.
>
>Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
>
>Zhu Yanjun
>
>
>> +	/* 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);
>> 

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

end of thread, other threads:[~2026-07-14  3:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13  1:04 [PATCH] RDMA/rxe: Reject unimplemented implicit ODP cleanly weimin xiong
2026-07-14  2:55 ` Zhu Yanjun
2026-07-14  3:17   ` Xiong Weimin

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