On Thu, May 19, 2022 at 10:58:11AM -0500, Bob Pearson wrote: > The current test_qp_ex_rc_bind_mw in tests/test_qpex.py uses an incorrect > value for the new_rkey based on the old mr.rkey. This patch fixes that > behavior by basing the new rkey on the old mw.rkey instead. > > Before this patch the test will fail for the rxe driver about 1 in 256 > tries since randomly that is the freguency of new_rkeys which have the > same 8 bit key portion as the current mw which is not allowed. With > this patch those errors do not occur. While this patch seems correct, I don't understand these remarks. IBA says: After the bind operation completes, the R_Key must consist of the 24 bit index associated with the Type 2 Memory Window and the 8 bit key supplied by the Con- sumer in the Post Send Bind Memory Window Work Request. Meaning the bind should only be processing the lower variant bits in the first place, and there should be no condition where the bind could fail since all varient bits are always legal. Bind does not allow changing the upper fixed bit - only allocation can change those. So if rxe kernel side is changing the upper bits it is also buggy. IMHO it would be appropriate to fail the operation if given rkey has unmatched upper bits. Jason