[PATCH for-next] RDMA: return -EOPNOSUPP for ODP unsupported device

Li Zhijian posted 1 patch 1 year, 6 months ago
include/rdma/ib_verbs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH for-next] RDMA: return -EOPNOSUPP for ODP unsupported device
Posted by Li Zhijian 1 year, 6 months ago
ib_reg_mr(3) which is used to register a MR with specific access flags
for specific HCA will set errno when something go wrong.
So, here we should return the specific -EOPNOTSUPP when the being
requested ODP access flag is unspported by the HCA(such as RXE).

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 include/rdma/ib_verbs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 975d6e9efbcb..a1f4d53a4bb6 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4334,7 +4334,7 @@ static inline int ib_check_mr_access(struct ib_device *ib_dev,
 
 	if (flags & IB_ACCESS_ON_DEMAND &&
 	    !(ib_dev->attrs.kernel_cap_flags & IBK_ON_DEMAND_PAGING))
-		return -EINVAL;
+		return -EOPNOTSUPP;
 	return 0;
 }
 
-- 
2.31.1
Re: [PATCH for-next] RDMA: return -EOPNOSUPP for ODP unsupported device
Posted by Leon Romanovsky 1 year, 6 months ago
On Sat, 1 Oct 2022 10:00:45 +0800, Li Zhijian wrote:
> ib_reg_mr(3) which is used to register a MR with specific access flags
> for specific HCA will set errno when something go wrong.
> So, here we should return the specific -EOPNOTSUPP when the being
> requested ODP access flag is unspported by the HCA(such as RXE).
> 
> 

Applied, thanks!

[1/1] RDMA: return -EOPNOSUPP for ODP unsupported device
      https://git.kernel.org/rdma/rdma/c/0154331c318907

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>
Re: [PATCH for-next] RDMA: return -EOPNOSUPP for ODP unsupported device
Posted by Zhu Yanjun 1 year, 6 months ago
On Sat, Oct 1, 2022 at 10:00 AM Li Zhijian <lizhijian@fujitsu.com> wrote:
>
> ib_reg_mr(3) which is used to register a MR with specific access flags
> for specific HCA will set errno when something go wrong.
> So, here we should return the specific -EOPNOTSUPP when the being
> requested ODP access flag is unspported by the HCA(such as RXE).
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

Reviewed-by: Zhu Yanjun <zyjzyj2000@gmail.com>

Thanks.
Zhu Yanjun
> ---
>  include/rdma/ib_verbs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 975d6e9efbcb..a1f4d53a4bb6 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -4334,7 +4334,7 @@ static inline int ib_check_mr_access(struct ib_device *ib_dev,
>
>         if (flags & IB_ACCESS_ON_DEMAND &&
>             !(ib_dev->attrs.kernel_cap_flags & IBK_ON_DEMAND_PAGING))
> -               return -EINVAL;
> +               return -EOPNOTSUPP;
>         return 0;
>  }
>
> --
> 2.31.1
>