From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Vlad Dumitrescu <vdumitrescu@nvidia.com>,
linux-rdma@vger.kernel.org, Sean Hefty <shefty@nvidia.com>
Subject: [PATCH rdma-next 1/9] IB/mad: Apply timeout modification (CM MRA) only once
Date: Thu, 5 Dec 2024 15:49:31 +0200 [thread overview]
Message-ID: <14281da695b89e5d58890996f29d15145d85b960.1733405453.git.leon@kernel.org> (raw)
In-Reply-To: <cover.1733405453.git.leon@kernel.org>
From: Vlad Dumitrescu <vdumitrescu@nvidia.com>
ib_modify_mad with non-zero timeout is used exclusively for CM MRA [1].
The timeout is computed as the sum of the local timeout (set via
cm_init_av_by_path) and a constant 60s+ Service Timeout
(CMA_CM_MRA_SETTING) passed via the MRA message by the remote. MRAs are
generated when duplicate messages are received.
Overwriting send_buf.timeout_ms means the MRA Service Timeout requested
by the remote will apply to all remaining retry attempts. This can lead
to unnecessary and extreme delays when a receiver is only temporarily
overloaded.
Do not save the MRA timeout so that it only applies to the next retry.
ib_modify_mad is also called with a zero timeout, to implement
ib_cancel_mad. The timeout was also saved in that case, but it is not
required as timeout_sends will skip the retry_send (which reads the
saved value) call anyway, based on the non-successful status.
[1] IBTA v1.7 - Section 12.6.6 - MRA - Message Receipt Acknowledgment
Signed-off-by: Vlad Dumitrescu <vdumitrescu@nvidia.com>
Reviewed-by: Sean Hefty <shefty@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/infiniband/core/mad.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 86e846b12e2f..bcfbb2a5c02b 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -2623,7 +2623,6 @@ int ib_modify_mad(struct ib_mad_send_buf *send_buf, u32 timeout_ms)
if (!timeout_ms)
mad_send_wr->status = IB_WC_WR_FLUSH_ERR;
- mad_send_wr->send_buf.timeout_ms = timeout_ms;
if (mad_send_wr->state == IB_MAD_STATE_SEND_START ||
(mad_send_wr->state == IB_MAD_STATE_QUEUED && timeout_ms))
mad_send_wr->timeout = msecs_to_jiffies(timeout_ms);
--
2.47.0
next prev parent reply other threads:[~2024-12-05 13:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 13:49 [PATCH rdma-next 0/9] Rework retry algorithm used when sending MADs Leon Romanovsky
2024-12-05 13:49 ` Leon Romanovsky [this message]
2024-12-05 13:49 ` [PATCH rdma-next 2/9] IB/mad: Add deadline for send MADs Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 3/9] RDMA/sa_query: Enforce min retry interval and deadline Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 4/9] RDMA/nldev: Add sa-min-timeout management attribute Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 5/9] IB/umad: Set deadline when sending non-RMPP MADs Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 6/9] IB/cm: Set deadline when sending MADs Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 7/9] IB/mad: Exponential backoff when retrying sends Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 8/9] RDMA/nldev: Add mad-linear-timeouts management attribute Leon Romanovsky
2024-12-05 13:49 ` [PATCH rdma-next 9/9] IB/cma: Lower response timeout to roughly 1s 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=14281da695b89e5d58890996f29d15145d85b960.1733405453.git.leon@kernel.org \
--to=leon@kernel.org \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=shefty@nvidia.com \
--cc=vdumitrescu@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox