From: Noa Osherovich <noaos@mellanox.com>
To: dledford@redhat.com, jgg@mellanox.com, leonro@mellanox.com
Cc: linux-rdma@vger.kernel.org, Maxim Chicherin <maximc@mellanox.com>
Subject: [PATCH rdma-core 10/12] tests: Fixes to to_rts() in RCResources
Date: Mon, 9 Sep 2019 12:07:10 +0300 [thread overview]
Message-ID: <20190909090712.11029-11-noaos@mellanox.com> (raw)
In-Reply-To: <20190909090712.11029-1-noaos@mellanox.com>
From: Maxim Chicherin <maximc@mellanox.com>
Move RCResources constants outside of the class in order to expose them
to other classes. Avoid passing parameters that are available to the
class.
Signed-off-by: Maxim Chicherin <maximc@mellanox.com>
---
tests/base.py | 49 +++++++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 22 deletions(-)
mode change 100644 => 100755 tests/base.py
diff --git a/tests/base.py b/tests/base.py
old mode 100644
new mode 100755
index b9bdaea93c96..ce9ea83b6b53
--- a/tests/base.py
+++ b/tests/base.py
@@ -13,6 +13,14 @@ from pyverbs.pd import PD
from pyverbs.cq import CQ
from pyverbs.mr import MR
+PATH_MTU = e.IBV_MTU_1024
+MAX_DEST_RD_ATOMIC = 1
+MAX_RD_ATOMIC = 1
+MIN_RNR_TIMER =12
+RETRY_CNT = 7
+RNR_RETRY = 7
+TIMEOUT = 14
+
class PyverbsAPITestCase(unittest.TestCase):
def setUp(self):
@@ -231,33 +239,24 @@ class TrafficResources(BaseResources):
class RCResources(TrafficResources):
- PATH_MTU = e.IBV_MTU_1024
- MAX_DEST_RD_ATOMIC = 1
- MAX_RD_ATOMIC = 1
- MIN_RNR_TIMER =12
- RETRY_CNT = 7
- RNR_RETRY = 7
- TIMEOUT = 14
-
- def to_rts(self, rpsn, rqpn):
+
+ def to_rts(self):
"""
Set the QP attributes' values to arbitrary values (same values used in
ibv_rc_pingpong).
- :param rpsn: Remote PSN (packet serial number)
- :param rqpn: Remote QP number
:return: None
"""
attr = QPAttr(port_num=self.ib_port)
- attr.dest_qp_num = rqpn
- attr.path_mtu = self.PATH_MTU
- attr.max_dest_rd_atomic = self.MAX_DEST_RD_ATOMIC
- attr.min_rnr_timer = self.MIN_RNR_TIMER
- attr.rq_psn = rpsn
- attr.sq_psn = self.psn
- attr.timeout = self.TIMEOUT
- attr.retry_cnt = self.RETRY_CNT
- attr.rnr_retry = self.RNR_RETRY
- attr.max_rd_atomic = self.MAX_RD_ATOMIC
+ attr.dest_qp_num = self.rqpn
+ attr.path_mtu = PATH_MTU
+ attr.max_dest_rd_atomic = MAX_DEST_RD_ATOMIC
+ attr.min_rnr_timer = MIN_RNR_TIMER
+ attr.rq_psn = self.psn
+ attr.sq_psn = self.rpsn
+ attr.timeout = TIMEOUT
+ attr.retry_cnt = RETRY_CNT
+ attr.rnr_retry = RNR_RETRY
+ attr.max_rd_atomic = MAX_RD_ATOMIC
gr = GlobalRoute(dgid=self.ctx.query_gid(self.ib_port, self.gid_index),
sgid_index=self.gid_index)
ah_attr = AHAttr(port_num=self.ib_port, is_global=1, gr=gr,
@@ -266,9 +265,15 @@ class RCResources(TrafficResources):
self.qp.to_rts(attr)
def pre_run(self, rpsn, rqpn):
+ """
+ Configure Resources before running traffic
+ :param rpsn: Remote PSN (packet serial number)
+ :param rqpn: Remote QP number
+ :return: None
+ """
self.rqpn = rqpn
self.rpsn = rpsn
- self.to_rts(rpsn, rqpn)
+ self.to_rts()
class UDResources(TrafficResources):
--
2.21.0
next prev parent reply other threads:[~2019-09-09 9:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 9:07 [PATCH rdma-core 00/12] Add XRCD and SRQ support to pyverbs Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 01/12] pyverbs: Fix WC creation process Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 02/12] pyverbs: Fix CQ and PD assignment in QPAttr Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 03/12] pyverbs: Remove TM enums Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 04/12] pyverbs: Introducing XRCD class Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 05/12] pyverbs: Introducing SRQ class Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 06/12] pyverbs: Support XRC QPs when modifying QP states Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 07/12] pyverbs: Add XRC to ODPCaps Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 08/12] Documentation: Document creation of XRCD and SRQ Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 09/12] tests: Add missing constant in UDResources Noa Osherovich
2019-09-09 9:07 ` Noa Osherovich [this message]
2019-09-09 9:07 ` [PATCH rdma-core 11/12] tests: Add XRCResources class Noa Osherovich
2019-09-09 9:07 ` [PATCH rdma-core 12/12] tests: Add XRC ODP test case Noa Osherovich
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=20190909090712.11029-11-noaos@mellanox.com \
--to=noaos@mellanox.com \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=maximc@mellanox.com \
/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.