Skip to content

Commit

Permalink
tests: Add test to check full SQ bad flow
Browse files Browse the repository at this point in the history
Add SRD error flow test to check traffic in full SQ in QP.

Reviewed-by: Chen Brasch <cbrasch@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Firas Jahjah <firasj@amazon.com>
  • Loading branch information
YonatanNachum authored and firasj committed Jan 19, 2022
1 parent 4ab2a13 commit b779467
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_efa_srd.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ def create_players(self, send_ops_flags=0, qp_count=8):
self.client.pre_run(self.server.psns, self.server.qps_num)
self.server.pre_run(self.client.psns, self.client.qps_num)

def full_sq_bad_flow(self):
"""
Check post_send while qp's sq is full.
- Find qp's sq length
- Fill the qp with work requests until overflow
"""
qp_idx = 0
send_op = e.IBV_QP_EX_WITH_SEND
ah = u.get_global_ah(self.client, self.gid_index, self.ib_port)
qp_attr, _ = self.client.qps[qp_idx].query(e.IBV_QP_CAP)
max_send_wr = qp_attr.cap.max_send_wr
with self.assertRaises(PyverbsRDMAError) as ex:
for _ in range (max_send_wr + 1):
_, c_sg = u.get_send_elements(self.client, False)
u.send(self.client, c_sg, send_op, new_send=True, qp_idx=qp_idx, ah=ah)
self.assertEqual(ex.exception.error_code, errno.ENOMEM)

def test_qp_ex_srd_send(self):
send_op = e.IBV_QP_EX_WITH_SEND
self.create_players(send_op)
Expand Down Expand Up @@ -86,3 +103,8 @@ def test_full_rq_bad_flow(self):
send_op = e.IBV_QP_EX_WITH_SEND
self.create_players(send_op, qp_count=1)
u.full_rq_bad_flow(self)

def test_full_sq_bad_flow(self):
send_op = e.IBV_QP_EX_WITH_SEND
self.create_players(send_op, qp_count=1)
self.full_sq_bad_flow()

0 comments on commit b779467

Please sign in to comment.