* [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route()
@ 2022-09-01 7:38 yangx.jy
2022-09-05 12:13 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: yangx.jy @ 2022-09-01 7:38 UTC (permalink / raw)
To: leon@kernel.org; +Cc: linux-rdma@vger.kernel.org, yangx.jy@fujitsu.com
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route()
2022-09-01 7:38 [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route() yangx.jy
@ 2022-09-05 12:13 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2022-09-05 12:13 UTC (permalink / raw)
To: yangx.jy@fujitsu.com; +Cc: linux-rdma@vger.kernel.org
On Thu, Sep 01, 2022 at 07:38:41AM +0000, yangx.jy@fujitsu.com wrote:
> 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(-)
>
Thanks, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-05 12:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01 7:38 [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route() yangx.jy
2022-09-05 12:13 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox