From: "yangx.jy@fujitsu.com" <yangx.jy@fujitsu.com>
To: "leon@kernel.org" <leon@kernel.org>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"yangx.jy@fujitsu.com" <yangx.jy@fujitsu.com>
Subject: [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route()
Date: Thu, 1 Sep 2022 07:38:41 +0000 [thread overview]
Message-ID: <20220901073836.1573-1-yangx.jy@fujitsu.com> (raw)
test_create_ah() or test_destroy_ah() always triggered the following
error on SoftRoCE because the specified gid index didn't work.
$ bin/run_tests.py --dev rxe_enp0s5 --gid 1 -v tests.test_addr.AHTest.test_create_ah
test_create_ah (tests.test_addr.AHTest)
Test ibv_create_ah. ... ERROR
======================================================================
ERROR: test_create_ah (tests.test_addr.AHTest)
Test ibv_create_ah.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/rdma-core/tests/test_addr.py", line 51, in test_create_ah
raise ex
File "/root/rdma-core/tests/test_addr.py", line 47, in test_create_ah
AH(pd, attr=ah_attr)
File "addr.pyx", line 410, in pyverbs.addr.AH.__init__
pyverbs.pyverbs_error.PyverbsRDMAError: Failed to create AH. Errno: 110, Connection timed out
----------------------------------------------------------------------
Ran 1 test in 1.271s
FAILED (errors=1)
Try to fix the issue by passing the specified gid index to u.get_global_route().
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
tests/base.py | 4 ++++
tests/test_addr.py | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/base.py b/tests/base.py
index 9229df35..2bf19ff0 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -76,6 +76,7 @@ class PyverbsAPITestCase(unittest.TestCase):
self.ctx = None
self.attr = None
self.attr_ex = None
+ self.gid_index = 0
def setUp(self):
"""
@@ -93,6 +94,9 @@ class PyverbsAPITestCase(unittest.TestCase):
raise unittest.SkipTest('No IB devices found')
self.dev_name = dev_list[0].name.decode()
+ if self.config['gid']:
+ self.gid_index = self.config['gid']
+
self.create_context()
self.attr = self.ctx.query_device()
self.attr_ex = self.ctx.query_device_ex()
diff --git a/tests/test_addr.py b/tests/test_addr.py
index 561812de..5b6c5efb 100644
--- a/tests/test_addr.py
+++ b/tests/test_addr.py
@@ -38,7 +38,7 @@ class AHTest(PyverbsAPITestCase):
Test ibv_create_ah.
"""
self.verify_state(self.ctx)
- gr = u.get_global_route(self.ctx, port_num=self.ib_port)
+ gr = u.get_global_route(self.ctx, gid_index=self.gid_index, port_num=self.ib_port)
port_attrs = self.ctx.query_port(self.ib_port)
dlid = port_attrs.lid if port_attrs.link_layer == e.IBV_LINK_LAYER_INFINIBAND else 0
ah_attr = AHAttr(dlid=dlid, gr=gr, is_global=1, port_num=self.ib_port)
@@ -72,7 +72,7 @@ class AHTest(PyverbsAPITestCase):
Test ibv_destroy_ah.
"""
self.verify_state(self.ctx)
- gr = u.get_global_route(self.ctx, port_num=self.ib_port)
+ gr = u.get_global_route(self.ctx, gid_index=self.gid_index, port_num=self.ib_port)
port_attrs = self.ctx.query_port(self.ib_port)
dlid = port_attrs.lid if port_attrs.link_layer == e.IBV_LINK_LAYER_INFINIBAND else 0
ah_attr = AHAttr(dlid=dlid, gr=gr, is_global=1, port_num=self.ib_port)
--
2.34.1
next reply other threads:[~2022-09-01 7:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 7:38 yangx.jy [this message]
2022-09-05 12:13 ` [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route() Leon Romanovsky
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=20220901073836.1573-1-yangx.jy@fujitsu.com \
--to=yangx.jy@fujitsu.com \
--cc=leon@kernel.org \
--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.