From: Bob Pearson <rpearsonhpe@gmail.com>
To: linux-rdma@vger.kernel.org
Subject: Fwd: pyverbs test_resize_cq fails in some cases
Date: Thu, 23 Mar 2023 21:38:28 -0500 [thread overview]
Message-ID: <b43c8172-a1c3-2ebd-e70e-198ae68248b5@gmail.com> (raw)
In-Reply-To: <f218337a-b975-bfa7-635d-bafc42c2df04@gmail.com>
-------- Forwarded Message --------
Subject: pyverbs test_resize_cq fails in some cases
Date: Thu, 23 Mar 2023 21:37:28 -0500
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Edward Srouji <edwards@nvidia.com>
CC: Jason Gunthorpe <jgg@nvidia.com>, Zhu Yanjun <zyjzyj2000@gmail.com>
Edward,
The pyverbs test: test_resize_cq fails for the rxe driver in some cases.
The code is definitely racy:
def test_resize_cq(self):
"""
Test resize CQ, start with specific value and then increase and decrease
the CQ size. The test also check bad flow of decrease the CQ size when
there are more completions on it than the new value.
"""
self.create_players(CQUDResources, cq_depth=3)
# Decrease the CQ size.
new_cq_size = 1
try:
self.client.cq.resize(new_cq_size)
except PyverbsRDMAError as ex:
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest('Resize CQ is not supported')
raise ex
self.assertTrue(self.client.cq.cqe >= new_cq_size,
f'The actual CQ size ({self.client.cq.cqe}) is less '
'than guaranteed ({new_cq_size})')
# Increase the CQ size.
new_cq_size = 7
self.client.cq.resize(new_cq_size)
self.assertTrue(self.client.cq.cqe >= new_cq_size,
f'The actual CQ size ({self.client.cq.cqe}) is less '
'than guaranteed ({new_cq_size})')
# Fill the CQ entries except one for avoid cq_overrun warnings.
send_wr, _ = u.get_send_elements(self.client, False)
ah_client = u.get_global_ah(self.client, self.gid_index, self.ib_port)
for i in range(self.client.cq.cqe - 1):
u.send(self.client, send_wr, ah=ah_client)
### This posts 6 send work requests but does not wait for them to complete
### The following proceeds while the sends are executing in the background
### and the test can fail. An easy fix is to add the line
time.sleep(1/1000) ### or maybe something a little larger but this works for me.
### alternatively you could test the data at the destination.
# Decrease the CQ size to less than the CQ unpolled entries.
new_cq_size = 1
with self.assertRaises(PyverbsRDMAError) as ex:
self.client.cq.resize(new_cq_size)
self.assertEqual(ex.exception.error_code, errno.EINVAL)
Bob
next parent reply other threads:[~2023-03-24 2:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f218337a-b975-bfa7-635d-bafc42c2df04@gmail.com>
2023-03-24 2:38 ` Bob Pearson [this message]
2023-07-18 2:08 ` Fwd: pyverbs test_resize_cq fails in some cases Bob Pearson
2023-07-18 15:13 ` Edward Srouji
2023-07-19 16:14 ` Bob Pearson
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=b43c8172-a1c3-2ebd-e70e-198ae68248b5@gmail.com \
--to=rpearsonhpe@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox