Skip to content

Commit 1aefe5c

Browse files
ddmatsujgunthorpe
authored andcommitted
RDMA/rxe: Prevent faulty rkey generation
If you create MRs more than 0x10000 times after loading the module, responder starts to reply NAKs for RDMA/Atomic operations because of rkey violation detected in check_rkey(). The root cause is that rkeys are incremented each time a new MR is created and the value overflows into the range reserved for MWs. This commit also increases the value of RXE_MAX_MW that has been limited unlike other parameters. Fixes: 0994a1b ("RDMA/rxe: Bump up default maximum values used via uverbs") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daisuke Matsuda <[email protected]> Tested-by: Li Zhijian <[email protected]> Reviewed-by: Li Zhijian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 3a73746 commit 1aefe5c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/infiniband/sw/rxe/rxe_param.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ enum rxe_device_param {
9898
RXE_MAX_SRQ = DEFAULT_MAX_VALUE - RXE_MIN_SRQ_INDEX,
9999

100100
RXE_MIN_MR_INDEX = 0x00000001,
101-
RXE_MAX_MR_INDEX = DEFAULT_MAX_VALUE,
102-
RXE_MAX_MR = DEFAULT_MAX_VALUE - RXE_MIN_MR_INDEX,
103-
RXE_MIN_MW_INDEX = 0x00010001,
104-
RXE_MAX_MW_INDEX = 0x00020000,
105-
RXE_MAX_MW = 0x00001000,
101+
RXE_MAX_MR_INDEX = DEFAULT_MAX_VALUE >> 1,
102+
RXE_MAX_MR = RXE_MAX_MR_INDEX - RXE_MIN_MR_INDEX,
103+
RXE_MIN_MW_INDEX = RXE_MAX_MR_INDEX + 1,
104+
RXE_MAX_MW_INDEX = DEFAULT_MAX_VALUE,
105+
RXE_MAX_MW = RXE_MAX_MW_INDEX - RXE_MIN_MW_INDEX,
106106

107107
RXE_MAX_PKT_PER_ACK = 64,
108108

0 commit comments

Comments
 (0)