All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get()
@ 2021-06-21  7:14 ice_yangxiao
  2021-06-21  8:53 ` Zhu Yanjun
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ice_yangxiao @ 2021-06-21  7:14 UTC (permalink / raw)
  To: linux-rdma; +Cc: leon, zyjzyj2000, Xiao Yang

From: Xiao Yang <yangx.jy@fujitsu.com>

rxe_mr_init_user() always returns the fixed -EINVAL when ib_umem_get()
fails so it's hard for user to know which actual error happens in
ib_umem_get(). For example, ib_umem_get() will return -EOPNOTSUPP
when trying to pin pages on a DAX file.

Return actual error as mlx4/mlx5 does.

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
index 9f63947bab12..fe2b7d223183 100644
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
@@ -135,7 +135,7 @@ int rxe_mr_init_user(struct rxe_pd *pd, u64 start, u64 length, u64 iova,
 	if (IS_ERR(umem)) {
 		pr_warn("err %d from rxe_umem_get\n",
 			(int)PTR_ERR(umem));
-		err = -EINVAL;
+		err = PTR_ERR(umem);
 		goto err1;
 	}
 
-- 
2.26.2


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

* Re: [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get()
  2021-06-21  7:14 [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get() ice_yangxiao
@ 2021-06-21  8:53 ` Zhu Yanjun
  2021-06-22  0:06 ` Jason Gunthorpe
  2021-06-22  0:07 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Zhu Yanjun @ 2021-06-21  8:53 UTC (permalink / raw)
  To: ice_yangxiao; +Cc: RDMA mailing list, Leon Romanovsky, Xiao Yang

On Mon, Jun 21, 2021 at 3:15 PM <ice_yangxiao@163.com> wrote:
>
> From: Xiao Yang <yangx.jy@fujitsu.com>
>
> rxe_mr_init_user() always returns the fixed -EINVAL when ib_umem_get()
> fails so it's hard for user to know which actual error happens in
> ib_umem_get(). For example, ib_umem_get() will return -EOPNOTSUPP
> when trying to pin pages on a DAX file.
>
> Return actual error as mlx4/mlx5 does.
>
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
> index 9f63947bab12..fe2b7d223183 100644
> --- a/drivers/infiniband/sw/rxe/rxe_mr.c
> +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
> @@ -135,7 +135,7 @@ int rxe_mr_init_user(struct rxe_pd *pd, u64 start, u64 length, u64 iova,
>         if (IS_ERR(umem)) {
>                 pr_warn("err %d from rxe_umem_get\n",
>                         (int)PTR_ERR(umem));
> -               err = -EINVAL;
> +               err = PTR_ERR(umem);

Thanks. I am fine with this.

Zhu Yanjun

>                 goto err1;
>         }
>
> --
> 2.26.2
>

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

* Re: [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get()
  2021-06-21  7:14 [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get() ice_yangxiao
  2021-06-21  8:53 ` Zhu Yanjun
@ 2021-06-22  0:06 ` Jason Gunthorpe
  2021-06-22  0:07 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2021-06-22  0:06 UTC (permalink / raw)
  To: ice_yangxiao; +Cc: linux-rdma, leon, zyjzyj2000, Xiao Yang

On Mon, Jun 21, 2021 at 03:14:56PM +0800, ice_yangxiao@163.com wrote:
> From: Xiao Yang <yangx.jy@fujitsu.com>
> 
> rxe_mr_init_user() always returns the fixed -EINVAL when ib_umem_get()
> fails so it's hard for user to know which actual error happens in
> ib_umem_get(). For example, ib_umem_get() will return -EOPNOTSUPP
> when trying to pin pages on a DAX file.
> 
> Return actual error as mlx4/mlx5 does.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

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

* Re: [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get()
  2021-06-21  7:14 [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get() ice_yangxiao
  2021-06-21  8:53 ` Zhu Yanjun
  2021-06-22  0:06 ` Jason Gunthorpe
@ 2021-06-22  0:07 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2021-06-22  0:07 UTC (permalink / raw)
  To: ice_yangxiao; +Cc: linux-rdma, leon, zyjzyj2000, Xiao Yang

On Mon, Jun 21, 2021 at 03:14:56PM +0800, ice_yangxiao@163.com wrote:
> From: Xiao Yang <yangx.jy@fujitsu.com>
> 
> rxe_mr_init_user() always returns the fixed -EINVAL when ib_umem_get()
> fails so it's hard for user to know which actual error happens in
> ib_umem_get(). For example, ib_umem_get() will return -EOPNOTSUPP
> when trying to pin pages on a DAX file.
> 
> Return actual error as mlx4/mlx5 does.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

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

end of thread, other threads:[~2021-06-22  0:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  7:14 [PATCH RESEND] RDMA/rxe: Don't overwrite errno from ib_umem_get() ice_yangxiao
2021-06-21  8:53 ` Zhu Yanjun
2021-06-22  0:06 ` Jason Gunthorpe
2021-06-22  0:07 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.