Skip to content

Commit

Permalink
tests: Skip rc_flush tests if not supported in kernel
Browse files Browse the repository at this point in the history
Older kernels (<6.2) that doesn't support IBV_ACCESS_FLUSH_GLOBAL return
EINVAL on MR registration with this flag. This makes rc_flush tests to
fail on such kernels. Fix this by skipping those test if EINVAL has been
returned.

Signed-off-by: Michael Margolin <[email protected]>
  • Loading branch information
mrgolin committed May 7, 2023
1 parent a7e2b08 commit ddd4bec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_qpex.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ def create_qps(self):
create_qp_ex(self, e.IBV_QPT_RC, e.IBV_QP_EX_WITH_FLUSH | e.IBV_QP_EX_WITH_RDMA_WRITE)

def create_mr(self):
self.mr = u.create_custom_mr(self, e.IBV_ACCESS_FLUSH_GLOBAL | e.IBV_ACCESS_REMOTE_WRITE)
try:
self.mr = u.create_custom_mr(self, e.IBV_ACCESS_FLUSH_GLOBAL | e.IBV_ACCESS_REMOTE_WRITE)
except PyverbsRDMAError as ex:
if ex.error_code == errno.EINVAL:
raise unittest.SkipTest('Create mr with IBV_ACCESS_FLUSH_GLOBAL access flag is not supported in kernel')
raise ex


class QpExRCAtomicWrite(RCResources):
Expand Down

0 comments on commit ddd4bec

Please sign in to comment.