* [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op()
@ 2025-03-13 6:45 Daisuke Matsuda
2025-03-13 12:30 ` Leon Romanovsky
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Daisuke Matsuda @ 2025-03-13 6:45 UTC (permalink / raw)
To: linux-rdma, leon, jgg, zyjzyj2000; +Cc: Daisuke Matsuda
rxe_mr_do_atomic_op() returns enum resp_states numbers, so the ODP
counterpart must not return raw errno codes.
Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
---
drivers/infiniband/sw/rxe/rxe_odp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
index 94f7bbe14981..9f6e2bb2a269 100644
--- a/drivers/infiniband/sw/rxe/rxe_odp.c
+++ b/drivers/infiniband/sw/rxe/rxe_odp.c
@@ -316,7 +316,7 @@ int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
err = rxe_odp_map_range_and_lock(mr, iova, sizeof(char),
RXE_PAGEFAULT_DEFAULT);
if (err < 0)
- return err;
+ return RESPST_ERR_RKEY_VIOLATION;
err = rxe_odp_do_atomic_op(mr, iova, opcode, compare, swap_add,
orig_val);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op()
2025-03-13 6:45 [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() Daisuke Matsuda
@ 2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:36 ` Zhu Yanjun
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2025-03-13 12:30 UTC (permalink / raw)
To: Daisuke Matsuda, zyjzyj2000; +Cc: linux-rdma, jgg
On Thu, Mar 13, 2025 at 03:45:40PM +0900, Daisuke Matsuda wrote:
> rxe_mr_do_atomic_op() returns enum resp_states numbers, so the ODP
> counterpart must not return raw errno codes.
>
> Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
> ---
> drivers/infiniband/sw/rxe/rxe_odp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
> index 94f7bbe14981..9f6e2bb2a269 100644
> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
> @@ -316,7 +316,7 @@ int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> err = rxe_odp_map_range_and_lock(mr, iova, sizeof(char),
> RXE_PAGEFAULT_DEFAULT);
> if (err < 0)
> - return err;
> + return RESPST_ERR_RKEY_VIOLATION;
I applied this patch for now, but please work to remove enum
resp_states. It is very bad practice to hide original in-kernel errors.
thanks
>
> err = rxe_odp_do_atomic_op(mr, iova, opcode, compare, swap_add,
> orig_val);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op()
2025-03-13 6:45 [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() Daisuke Matsuda
2025-03-13 12:30 ` Leon Romanovsky
@ 2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:36 ` Zhu Yanjun
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2025-03-13 12:30 UTC (permalink / raw)
To: linux-rdma, jgg, zyjzyj2000, Daisuke Matsuda
On Thu, 13 Mar 2025 15:45:40 +0900, Daisuke Matsuda wrote:
> rxe_mr_do_atomic_op() returns enum resp_states numbers, so the ODP
> counterpart must not return raw errno codes.
>
>
Applied, thanks!
[1/1] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op()
https://git.kernel.org/rdma/rdma/c/9e98eb80c518e1
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op()
2025-03-13 6:45 [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() Daisuke Matsuda
2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:30 ` Leon Romanovsky
@ 2025-03-13 12:36 ` Zhu Yanjun
2 siblings, 0 replies; 4+ messages in thread
From: Zhu Yanjun @ 2025-03-13 12:36 UTC (permalink / raw)
To: Daisuke Matsuda, linux-rdma, leon, jgg, zyjzyj2000
On 13.03.25 07:45, Daisuke Matsuda wrote:
> rxe_mr_do_atomic_op() returns enum resp_states numbers, so the ODP
> counterpart must not return raw errno codes.
>
> Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
Thanks. I am fine with it.
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Zhu Yanjun
> ---
> drivers/infiniband/sw/rxe/rxe_odp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
> index 94f7bbe14981..9f6e2bb2a269 100644
> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
> @@ -316,7 +316,7 @@ int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> err = rxe_odp_map_range_and_lock(mr, iova, sizeof(char),
> RXE_PAGEFAULT_DEFAULT);
> if (err < 0)
> - return err;
> + return RESPST_ERR_RKEY_VIOLATION;
>
> err = rxe_odp_do_atomic_op(mr, iova, opcode, compare, swap_add,
> orig_val);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-13 12:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 6:45 [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() Daisuke Matsuda
2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:36 ` Zhu Yanjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox