Skip to content

Commit 3a73746

Browse files
ddmatsujgunthorpe
authored andcommitted
RDMA/rxe: Fix inaccurate constants in rxe_type_info
ibv_query_device() has reported incorrect device attributes, which are actually not used by the device. Make the constants correspond with the attributes shown to users. Fixes: 3ccffe8 ("RDMA/rxe: Move max_elem into rxe_type_info") Fixes: 3225717 ("RDMA/rxe: Replace red-black trees by xarrays") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daisuke Matsuda <[email protected]> Reviewed-by: Li Zhijian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent b7bfaa7 commit 3a73746

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/infiniband/sw/rxe/rxe_pool.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ static const struct rxe_type_info {
2323
.size = sizeof(struct rxe_ucontext),
2424
.elem_offset = offsetof(struct rxe_ucontext, elem),
2525
.min_index = 1,
26-
.max_index = UINT_MAX,
27-
.max_elem = UINT_MAX,
26+
.max_index = RXE_MAX_UCONTEXT,
27+
.max_elem = RXE_MAX_UCONTEXT,
2828
},
2929
[RXE_TYPE_PD] = {
3030
.name = "pd",
3131
.size = sizeof(struct rxe_pd),
3232
.elem_offset = offsetof(struct rxe_pd, elem),
3333
.min_index = 1,
34-
.max_index = UINT_MAX,
35-
.max_elem = UINT_MAX,
34+
.max_index = RXE_MAX_PD,
35+
.max_elem = RXE_MAX_PD,
3636
},
3737
[RXE_TYPE_AH] = {
3838
.name = "ah",
3939
.size = sizeof(struct rxe_ah),
4040
.elem_offset = offsetof(struct rxe_ah, elem),
4141
.min_index = RXE_MIN_AH_INDEX,
4242
.max_index = RXE_MAX_AH_INDEX,
43-
.max_elem = RXE_MAX_AH_INDEX - RXE_MIN_AH_INDEX + 1,
43+
.max_elem = RXE_MAX_AH,
4444
},
4545
[RXE_TYPE_SRQ] = {
4646
.name = "srq",
@@ -49,7 +49,7 @@ static const struct rxe_type_info {
4949
.cleanup = rxe_srq_cleanup,
5050
.min_index = RXE_MIN_SRQ_INDEX,
5151
.max_index = RXE_MAX_SRQ_INDEX,
52-
.max_elem = RXE_MAX_SRQ_INDEX - RXE_MIN_SRQ_INDEX + 1,
52+
.max_elem = RXE_MAX_SRQ,
5353
},
5454
[RXE_TYPE_QP] = {
5555
.name = "qp",
@@ -58,16 +58,16 @@ static const struct rxe_type_info {
5858
.cleanup = rxe_qp_cleanup,
5959
.min_index = RXE_MIN_QP_INDEX,
6060
.max_index = RXE_MAX_QP_INDEX,
61-
.max_elem = RXE_MAX_QP_INDEX - RXE_MIN_QP_INDEX + 1,
61+
.max_elem = RXE_MAX_QP,
6262
},
6363
[RXE_TYPE_CQ] = {
6464
.name = "cq",
6565
.size = sizeof(struct rxe_cq),
6666
.elem_offset = offsetof(struct rxe_cq, elem),
6767
.cleanup = rxe_cq_cleanup,
6868
.min_index = 1,
69-
.max_index = UINT_MAX,
70-
.max_elem = UINT_MAX,
69+
.max_index = RXE_MAX_CQ,
70+
.max_elem = RXE_MAX_CQ,
7171
},
7272
[RXE_TYPE_MR] = {
7373
.name = "mr",
@@ -76,7 +76,7 @@ static const struct rxe_type_info {
7676
.cleanup = rxe_mr_cleanup,
7777
.min_index = RXE_MIN_MR_INDEX,
7878
.max_index = RXE_MAX_MR_INDEX,
79-
.max_elem = RXE_MAX_MR_INDEX - RXE_MIN_MR_INDEX + 1,
79+
.max_elem = RXE_MAX_MR,
8080
},
8181
[RXE_TYPE_MW] = {
8282
.name = "mw",
@@ -85,7 +85,7 @@ static const struct rxe_type_info {
8585
.cleanup = rxe_mw_cleanup,
8686
.min_index = RXE_MIN_MW_INDEX,
8787
.max_index = RXE_MAX_MW_INDEX,
88-
.max_elem = RXE_MAX_MW_INDEX - RXE_MIN_MW_INDEX + 1,
88+
.max_elem = RXE_MAX_MW,
8989
},
9090
};
9191

0 commit comments

Comments
 (0)