Skip to contentSkip to conversation

RDMA/core: Fix wrong rkey in test_qp_ex_rc_bind_mw

PATCH Superseded Bob Pearson 3 participants 3 messages May 18, 2022 – May 19, 2022 InfiniBand

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/core: Fix wrong rkey in test_qp_ex_rc_bind_mw

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.

---
 tests/test_qpex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test_qpex.py +1 -1
index 8f3f338e..a4c99910 100644
@@ -300,7 +300,7 @@ class QpExTestCase(RDMATestCase):
             if ex.error_code == errno.EOPNOTSUPP:
                 raise unittest.SkipTest('Memory Window allocation is not supported')
             raise ex
-        new_key = inc_rkey(server.mr.rkey)
+        new_key = inc_rkey(mw.rkey)
         server.qp.wr_bind_mw(mw, new_key, bind_info)
         server.qp.wr_complete()
         u.poll_cq(server.cq)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 11 lines · Bob Pearson

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.

This is for rdma-core? It had better add "for rdma core" in the subject line.

Zhu Yanjun

Quoted 20 lines
---
 tests/test_qpex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test_qpex.py +1 -2
index 8f3f338e..a4c99910 100644
@@ -300,7 +300,7 @@ class QpExTestCase(RDMATestCase):
             if ex.error_code == errno.EOPNOTSUPP:
                 raise unittest.SkipTest('Memory Window allocation is not supported')
             raise ex
-        new_key = inc_rkey(server.mr.rkey)
+        new_key = inc_rkey(mw.rkey)
         server.qp.wr_bind_mw(mw, new_key, bind_info)
         server.qp.wr_complete()
         u.poll_cq(server.cq)
--

2.34.1

#2 lore raw

Thanks Bob for the fix.

Could you please add a "Fixes" line?

Quoted 36 lines · Zhu Yanjun
Quoted 10 lines · Bob Pearson

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.

This is for rdma-core? It had better add "for rdma core" in the subject line.

Zhu Yanjun

Quoted 20 lines
---
  tests/test_qpex.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/test_qpex.py +1 -2
index 8f3f338e..a4c99910 100644
@@ -300,7 +300,7 @@ class QpExTestCase(RDMATestCase):
              if ex.error_code == errno.EOPNOTSUPP:
                  raise unittest.SkipTest('Memory Window allocation is not supported')
              raise ex
-        new_key = inc_rkey(server.mr.rkey)
+        new_key = inc_rkey(mw.rkey)
          server.qp.wr_bind_mw(mw, new_key, bind_info)
          server.qp.wr_complete()
          u.poll_cq(server.cq)
--

2.34.1