Commit 71d23639 authored by yangx.jy@fujitsu.com's avatar yangx.jy@fujitsu.com Committed by Leon Romanovsky

RDMA/rxe: Remove the member 'type' of struct rxe_mr

The member 'type' is included in both struct rxe_mr and struct ib_mr
so remove the duplicate one of struct rxe_mr.
Signed-off-by: default avatarXiao Yang <yangx.jy@fujitsu.com>
Link: https://lore.kernel.org/r/20221021134513.17730-1-yangx.jy@fujitsu.comReviewed-by: default avatarBob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 65bf0342
...@@ -26,7 +26,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length) ...@@ -26,7 +26,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length)
{ {
switch (mr->type) { switch (mr->ibmr.type) {
case IB_MR_TYPE_DMA: case IB_MR_TYPE_DMA:
return 0; return 0;
...@@ -39,7 +39,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length) ...@@ -39,7 +39,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length)
default: default:
pr_warn("%s: mr type (%d) not supported\n", pr_warn("%s: mr type (%d) not supported\n",
__func__, mr->type); __func__, mr->ibmr.type);
return -EFAULT; return -EFAULT;
} }
} }
...@@ -109,7 +109,7 @@ void rxe_mr_init_dma(int access, struct rxe_mr *mr) ...@@ -109,7 +109,7 @@ void rxe_mr_init_dma(int access, struct rxe_mr *mr)
mr->access = access; mr->access = access;
mr->state = RXE_MR_STATE_VALID; mr->state = RXE_MR_STATE_VALID;
mr->type = IB_MR_TYPE_DMA; mr->ibmr.type = IB_MR_TYPE_DMA;
} }
int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova, int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova,
...@@ -178,7 +178,7 @@ int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova, ...@@ -178,7 +178,7 @@ int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova,
mr->access = access; mr->access = access;
mr->offset = ib_umem_offset(umem); mr->offset = ib_umem_offset(umem);
mr->state = RXE_MR_STATE_VALID; mr->state = RXE_MR_STATE_VALID;
mr->type = IB_MR_TYPE_USER; mr->ibmr.type = IB_MR_TYPE_USER;
return 0; return 0;
...@@ -205,7 +205,7 @@ int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr) ...@@ -205,7 +205,7 @@ int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr)
mr->max_buf = max_pages; mr->max_buf = max_pages;
mr->state = RXE_MR_STATE_FREE; mr->state = RXE_MR_STATE_FREE;
mr->type = IB_MR_TYPE_MEM_REG; mr->ibmr.type = IB_MR_TYPE_MEM_REG;
return 0; return 0;
...@@ -304,7 +304,7 @@ int rxe_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length, ...@@ -304,7 +304,7 @@ int rxe_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length,
if (length == 0) if (length == 0)
return 0; return 0;
if (mr->type == IB_MR_TYPE_DMA) { if (mr->ibmr.type == IB_MR_TYPE_DMA) {
u8 *src, *dest; u8 *src, *dest;
src = (dir == RXE_TO_MR_OBJ) ? addr : ((void *)(uintptr_t)iova); src = (dir == RXE_TO_MR_OBJ) ? addr : ((void *)(uintptr_t)iova);
...@@ -547,8 +547,8 @@ int rxe_invalidate_mr(struct rxe_qp *qp, u32 key) ...@@ -547,8 +547,8 @@ int rxe_invalidate_mr(struct rxe_qp *qp, u32 key)
goto err_drop_ref; goto err_drop_ref;
} }
if (unlikely(mr->type != IB_MR_TYPE_MEM_REG)) { if (unlikely(mr->ibmr.type != IB_MR_TYPE_MEM_REG)) {
pr_warn("%s: mr->type (%d) is wrong type\n", __func__, mr->type); pr_warn("%s: mr type (%d) is wrong\n", __func__, mr->ibmr.type);
ret = -EINVAL; ret = -EINVAL;
goto err_drop_ref; goto err_drop_ref;
} }
......
...@@ -304,7 +304,6 @@ struct rxe_mr { ...@@ -304,7 +304,6 @@ struct rxe_mr {
u32 lkey; u32 lkey;
u32 rkey; u32 rkey;
enum rxe_mr_state state; enum rxe_mr_state state;
enum ib_mr_type type;
u32 offset; u32 offset;
int access; int access;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment