* [PATCH for-next] RDMA/rxe: Fix mismatched type declarations
@ 2025-04-09 10:27 Daisuke Matsuda
2025-04-10 4:30 ` Zhu Yanjun
2025-04-11 17:44 ` Leon Romanovsky
0 siblings, 2 replies; 3+ messages in thread
From: Daisuke Matsuda @ 2025-04-09 10:27 UTC (permalink / raw)
To: linux-rdma, leon, jgg, zyjzyj2000; +Cc: Daisuke Matsuda
Some functions return int values while they are defined as enum resp_states
variables. This patch resolve the mismatches in rxe.
Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
---
drivers/infiniband/sw/rxe/rxe_loc.h | 14 +++++++-------
drivers/infiniband/sw/rxe/rxe_mr.c | 12 ++++++------
drivers/infiniband/sw/rxe/rxe_odp.c | 11 ++++++-----
3 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
index d27bd05ed21f..a3ce64249357 100644
--- a/drivers/infiniband/sw/rxe/rxe_loc.h
+++ b/drivers/infiniband/sw/rxe/rxe_loc.h
@@ -70,9 +70,9 @@ int copy_data(struct rxe_pd *pd, int access, struct rxe_dma_info *dma,
void *addr, int length, enum rxe_mr_copy_dir dir);
int rxe_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg,
int sg_nents, unsigned int *sg_offset);
-int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
- u64 compare, u64 swap_add, u64 *orig_val);
-int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value);
+enum resp_states rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
+ u64 compare, u64 swap_add, u64 *orig_val);
+enum resp_states rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value);
struct rxe_mr *lookup_mr(struct rxe_pd *pd, int access, u32 key,
enum rxe_mr_lookup_type type);
int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length);
@@ -192,8 +192,8 @@ int rxe_odp_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length,
u64 iova, int access_flags, struct rxe_mr *mr);
int rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length,
enum rxe_mr_copy_dir dir);
-int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
- u64 compare, u64 swap_add, u64 *orig_val);
+enum resp_states rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
+ u64 compare, u64 swap_add, u64 *orig_val);
int rxe_odp_flush_pmem_iova(struct rxe_mr *mr, u64 iova,
unsigned int length);
#else /* CONFIG_INFINIBAND_ON_DEMAND_PAGING */
@@ -208,9 +208,9 @@ static inline int rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr,
{
return -EOPNOTSUPP;
}
-static inline int
+static inline enum resp_states
rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
- u64 compare, u64 swap_add, u64 *orig_val)
+ u64 compare, u64 swap_add, u64 *orig_val)
{
return RESPST_ERR_UNSUPPORTED_OPCODE;
}
diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
index d40fbe10633f..1a74013a14ab 100644
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
@@ -483,8 +483,8 @@ int rxe_flush_pmem_iova(struct rxe_mr *mr, u64 start, unsigned int length)
/* Guarantee atomicity of atomic operations at the machine level. */
DEFINE_SPINLOCK(atomic_ops_lock);
-int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
- u64 compare, u64 swap_add, u64 *orig_val)
+enum resp_states rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
+ u64 compare, u64 swap_add, u64 *orig_val)
{
unsigned int page_offset;
struct page *page;
@@ -536,12 +536,12 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
kunmap_local(va);
- return 0;
+ return RESPST_NONE;
}
#if defined CONFIG_64BIT
/* only implemented or called for 64 bit architectures */
-int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
+enum resp_states rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
{
unsigned int page_offset;
struct page *page;
@@ -578,10 +578,10 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
smp_store_release(&va[page_offset >> 3], value);
kunmap_local(va);
- return 0;
+ return RESPST_NONE;
}
#else
-int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
+enum resp_states rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
{
return RESPST_ERR_UNSUPPORTED_OPCODE;
}
diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
index 02de05d759c6..fa5e8f5017cc 100644
--- a/drivers/infiniband/sw/rxe/rxe_odp.c
+++ b/drivers/infiniband/sw/rxe/rxe_odp.c
@@ -266,8 +266,9 @@ int rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length,
return err;
}
-static int rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
- u64 compare, u64 swap_add, u64 *orig_val)
+static enum resp_states rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova,
+ int opcode, u64 compare,
+ u64 swap_add, u64 *orig_val)
{
struct ib_umem_odp *umem_odp = to_ib_umem_odp(mr->umem);
unsigned int page_offset;
@@ -315,11 +316,11 @@ static int rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
kunmap_local(va);
- return 0;
+ return RESPST_NONE;
}
-int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
- u64 compare, u64 swap_add, u64 *orig_val)
+enum resp_states rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
+ u64 compare, u64 swap_add, u64 *orig_val)
{
struct ib_umem_odp *umem_odp = to_ib_umem_odp(mr->umem);
int err;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for-next] RDMA/rxe: Fix mismatched type declarations
2025-04-09 10:27 [PATCH for-next] RDMA/rxe: Fix mismatched type declarations Daisuke Matsuda
@ 2025-04-10 4:30 ` Zhu Yanjun
2025-04-11 17:44 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Zhu Yanjun @ 2025-04-10 4:30 UTC (permalink / raw)
To: Daisuke Matsuda, linux-rdma, leon, jgg, zyjzyj2000
在 2025/4/9 12:27, Daisuke Matsuda 写道:
> Some functions return int values while they are defined as enum resp_states
> variables. This patch resolve the mismatches in rxe.
resolves ?
Thanks a lot.
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Zhu Yanjun
>
> Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
> ---
> drivers/infiniband/sw/rxe/rxe_loc.h | 14 +++++++-------
> drivers/infiniband/sw/rxe/rxe_mr.c | 12 ++++++------
> drivers/infiniband/sw/rxe/rxe_odp.c | 11 ++++++-----
> 3 files changed, 19 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
> index d27bd05ed21f..a3ce64249357 100644
> --- a/drivers/infiniband/sw/rxe/rxe_loc.h
> +++ b/drivers/infiniband/sw/rxe/rxe_loc.h
> @@ -70,9 +70,9 @@ int copy_data(struct rxe_pd *pd, int access, struct rxe_dma_info *dma,
> void *addr, int length, enum rxe_mr_copy_dir dir);
> int rxe_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg,
> int sg_nents, unsigned int *sg_offset);
> -int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> - u64 compare, u64 swap_add, u64 *orig_val);
> -int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value);
> +enum resp_states rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> + u64 compare, u64 swap_add, u64 *orig_val);
> +enum resp_states rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value);
> struct rxe_mr *lookup_mr(struct rxe_pd *pd, int access, u32 key,
> enum rxe_mr_lookup_type type);
> int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length);
> @@ -192,8 +192,8 @@ int rxe_odp_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length,
> u64 iova, int access_flags, struct rxe_mr *mr);
> int rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length,
> enum rxe_mr_copy_dir dir);
> -int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> - u64 compare, u64 swap_add, u64 *orig_val);
> +enum resp_states rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> + u64 compare, u64 swap_add, u64 *orig_val);
> int rxe_odp_flush_pmem_iova(struct rxe_mr *mr, u64 iova,
> unsigned int length);
> #else /* CONFIG_INFINIBAND_ON_DEMAND_PAGING */
> @@ -208,9 +208,9 @@ static inline int rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr,
> {
> return -EOPNOTSUPP;
> }
> -static inline int
> +static inline enum resp_states
> rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> - u64 compare, u64 swap_add, u64 *orig_val)
> + u64 compare, u64 swap_add, u64 *orig_val)
> {
> return RESPST_ERR_UNSUPPORTED_OPCODE;
> }
> diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
> index d40fbe10633f..1a74013a14ab 100644
> --- a/drivers/infiniband/sw/rxe/rxe_mr.c
> +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
> @@ -483,8 +483,8 @@ int rxe_flush_pmem_iova(struct rxe_mr *mr, u64 start, unsigned int length)
> /* Guarantee atomicity of atomic operations at the machine level. */
> DEFINE_SPINLOCK(atomic_ops_lock);
>
> -int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> - u64 compare, u64 swap_add, u64 *orig_val)
> +enum resp_states rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> + u64 compare, u64 swap_add, u64 *orig_val)
> {
> unsigned int page_offset;
> struct page *page;
> @@ -536,12 +536,12 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
>
> kunmap_local(va);
>
> - return 0;
> + return RESPST_NONE;
> }
>
> #if defined CONFIG_64BIT
> /* only implemented or called for 64 bit architectures */
> -int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
> +enum resp_states rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
> {
> unsigned int page_offset;
> struct page *page;
> @@ -578,10 +578,10 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
> smp_store_release(&va[page_offset >> 3], value);
> kunmap_local(va);
>
> - return 0;
> + return RESPST_NONE;
> }
> #else
> -int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
> +enum resp_states rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
> {
> return RESPST_ERR_UNSUPPORTED_OPCODE;
> }
> diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
> index 02de05d759c6..fa5e8f5017cc 100644
> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
> @@ -266,8 +266,9 @@ int rxe_odp_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length,
> return err;
> }
>
> -static int rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> - u64 compare, u64 swap_add, u64 *orig_val)
> +static enum resp_states rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova,
> + int opcode, u64 compare,
> + u64 swap_add, u64 *orig_val)
> {
> struct ib_umem_odp *umem_odp = to_ib_umem_odp(mr->umem);
> unsigned int page_offset;
> @@ -315,11 +316,11 @@ static int rxe_odp_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
>
> kunmap_local(va);
>
> - return 0;
> + return RESPST_NONE;
> }
>
> -int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> - u64 compare, u64 swap_add, u64 *orig_val)
> +enum resp_states rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
> + u64 compare, u64 swap_add, u64 *orig_val)
> {
> struct ib_umem_odp *umem_odp = to_ib_umem_odp(mr->umem);
> int err;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-next] RDMA/rxe: Fix mismatched type declarations
2025-04-09 10:27 [PATCH for-next] RDMA/rxe: Fix mismatched type declarations Daisuke Matsuda
2025-04-10 4:30 ` Zhu Yanjun
@ 2025-04-11 17:44 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2025-04-11 17:44 UTC (permalink / raw)
To: linux-rdma, jgg, zyjzyj2000, Daisuke Matsuda
On Wed, 09 Apr 2025 19:27:01 +0900, Daisuke Matsuda wrote:
> Some functions return int values while they are defined as enum resp_states
> variables. This patch resolve the mismatches in rxe.
>
>
Applied, thanks!
[1/1] RDMA/rxe: Fix mismatched type declarations
https://git.kernel.org/rdma/rdma/c/81f4e032b86050
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-11 17:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 10:27 [PATCH for-next] RDMA/rxe: Fix mismatched type declarations Daisuke Matsuda
2025-04-10 4:30 ` Zhu Yanjun
2025-04-11 17:44 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox