From: "Michael J. Ruhl" <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH rdma-core v4 1/4] ibacm: Fix an incorrect expiration check for the retry timer
Date: Wed, 15 Nov 2017 14:34:44 -0500 [thread overview]
Message-ID: <20171115193430.470.61687.stgit@phlsvslse11.ph.intel.com> (raw)
In-Reply-To: <20171115193155.470.85049.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
The acmp_process_wait_queue() checks to see if a message expiration
time has passed.
Because the check is for less than (<), if the timeout expires matches
the current time, the check will result in a timeout value of 0, and
the wait loop will spin until the next millisecond has passed.
Using example values to demonstrate the issue, we can see:
With '<':
wait = -2106577636 (no work)
wait = 2510 (message wait)
(process spins)
wait = 0 (expires - current time == 0)
wait = 0
wait = 0
... (1 ms of output)
wait = 0
wait = -2106580147 (retry complete)
wait = 2512
With '<=':
wait = -2106688780 (no work)
wait = 2512 ( message wait)
(process sleeps)
wait = -2106691293 (retry complete)
wait = 2512
Expire the message if the expires is less than or equal.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
ibacm/prov/acmp/src/acmp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index 78d9a29..d707b8e 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -1507,7 +1507,7 @@ static void acmp_process_wait_queue(struct acmp_ep *ep, uint64_t *next_expire)
struct ibv_send_wr *bad_wr;
list_for_each_safe(&ep->wait_queue, msg, next, entry) {
- if (msg->expires < time_stamp_ms()) {
+ if (msg->expires <= time_stamp_ms()) {
list_del(&msg->entry);
(void) atomic_dec(&wait_cnt);
if (--msg->tries) {
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-11-15 19:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 19:34 [PATCH rdma-core v4 0/4] ibacm: acmp retry issues Michael J. Ruhl
[not found] ` <20171115193155.470.85049.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-11-15 19:34 ` Michael J. Ruhl [this message]
2017-11-15 19:35 ` [PATCH rdma-core v4 2/4] ibacm: Calculate correct tv_nsec value in event_wait() Michael J. Ruhl
2017-11-15 19:35 ` [PATCH rdma-core v4 3/4] ibacm: Fix a retry loop calculation race condition Michael J. Ruhl
2017-11-15 19:35 ` [PATCH rdma-core v4 4/4] ibacm: Use MONOTONIC time base to avoid timer expiration issues Michael J. Ruhl
[not found] ` <20171115193524.470.17499.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-11-16 12:09 ` Ruhl, Michael J
2017-11-17 0:11 ` [PATCH rdma-core v4 0/4] ibacm: acmp retry issues Jason Gunthorpe
2017-11-20 8:28 ` 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=20171115193430.470.61687.stgit@phlsvslse11.ph.intel.com \
--to=michael.j.ruhl-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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