From: Ido Kalir <idok@xxxxxxxxxxxx> Add test case that use the ECE mechanism in RDMA CM connection establishment. Signed-off-by: Ido Kalir <idok@xxxxxxxxxxxx> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- tests/rdmacm_utils.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/rdmacm_utils.py b/tests/rdmacm_utils.py index c71bab18..d8d22f65 100755 --- a/tests/rdmacm_utils.py +++ b/tests/rdmacm_utils.py @@ -4,10 +4,12 @@ Provide some useful helper function for pyverbs rdmacm' tests. """ from tests.utils import validate, poll_cq, get_send_element, get_recv_wr -from pyverbs.pyverbs_error import PyverbsError +from pyverbs.pyverbs_error import PyverbsError, PyverbsRDMAError from tests.base import CMResources from pyverbs.cmid import CMEvent import pyverbs.cm_enums as ce +import unittest +import errno import os events_dict = {ce.RDMA_CM_EVENT_ADDR_ERROR: 'Resolve Address Error', @@ -117,6 +119,13 @@ def event_handler(agr_obj): agr_obj.create_qp() param = agr_obj.create_conn_param() if agr_obj.with_ext_qp: + try: + ece = agr_obj.qp.query_ece() + agr_obj.cmid.set_local_ece(ece) + except PyverbsRDMAError as ex: + if ex.error_code == errno.EOPNOTSUPP: + pass + raise ex param.qpn = agr_obj.qp.qp_num agr_obj.cmid.connect(param) elif cm_event.event_type == ce.RDMA_CM_EVENT_CONNECT_REQUEST: @@ -124,6 +133,13 @@ def event_handler(agr_obj): param = agr_obj.create_conn_param() agr_obj.create_qp() if agr_obj.with_ext_qp: + try: + ece = agr_obj.child_id.get_remote_ece() + agr_obj.qp.set_ece(ece) + except PyverbsRDMAError as ex: + if ex.error_code == errno.EOPNOTSUPP: + pass + raise ex agr_obj.modify_ext_qp_to_rts() param.qpn = agr_obj.qp.qp_num agr_obj.child_id.accept(param) -- 2.25.2