From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Ido Kalir <idok@mellanox.com>,
Leon Romanovsky <leonro@mellanox.com>,
linux-rdma@vger.kernel.org
Subject: [PATCH rdma-core 12/12] tests: Add test for rdmacm ECE mechanism
Date: Mon, 20 Apr 2020 17:06:48 +0300 [thread overview]
Message-ID: <20200420140648.275554-13-leon@kernel.org> (raw)
In-Reply-To: <20200420140648.275554-1-leon@kernel.org>
From: Ido Kalir <idok@mellanox.com>
Add test case that use the ECE mechanism in RDMA CM connection
establishment.
Signed-off-by: Ido Kalir <idok@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
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
prev parent reply other threads:[~2020-04-20 14:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 14:06 [PATCH rdma-core 00/12] Add Enhanced Connection Established (ECE) APIs Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 01/12] Update kernel headers Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 02/12] libibverbs: Add interfaces to configure and use ECE Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 03/12] libibverbs: Document ECE API Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 04/12] debian: Install all available librdmacm man pages Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 05/12] librdmacm: Provide interface to use ECE for external QPs Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 06/12] librdmacm: Connect rdma_connect to the ECE Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 07/12] librdmacm: Return ECE results through rdma_accept Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 08/12] librdmacm: Add an option to reject ECE request Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 09/12] librdmacm: Implement ECE handshake logic Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 10/12] librdmacm: Document ECE API Leon Romanovsky
2020-04-20 14:06 ` [PATCH rdma-core 11/12] pyverbs: Add support for ECE Leon Romanovsky
2020-04-20 14:06 ` Leon Romanovsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200420140648.275554-13-leon@kernel.org \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=idok@mellanox.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.