]> git.ipfire.org Git - thirdparty/linux.git/commit
IB/mad: Add flow control for solicited MADs
authorOr Har-Toov <ohartoov@nvidia.com>
Mon, 30 Jun 2025 10:16:43 +0000 (13:16 +0300)
committerLeon Romanovsky <leon@kernel.org>
Wed, 9 Jul 2025 06:51:30 +0000 (02:51 -0400)
commit314cb74cea847db6226f3eaba4167198501d7ba3
tree7f08fa5632c3ed529df40de4d8af7f2f2877bb3c
parent1cf0d8990155c132019371bae96b5cfac661c0a9
IB/mad: Add flow control for solicited MADs

Currently, MADs sent via an agent are being forwarded directly to the
corresponding MAD QP layer.

MADs with a timeout value set and requiring a response (solicited MADs)
will be resent if the timeout expires without receiving a response.
In a congested subnet, flooding MAD QP layer with more solicited send
requests from the agent will only worsen the situation by triggering
more timeouts and therefore more retries.

Thus, add flow control for non-user solicited MADs to block agents from
issuing new solicited MAD requests to the MAD QP until outstanding
requests are completed and the MAD QP is ready to process additional
requests. While at it, keep track of the total outstanding solicited
MAD work requests in send or wait list. The number of outstanding send
WRs will be limited by a fraction of the RQ size, and any new send WR
that exceeds that limit will be held in a backlog list.
Backlog MADs will be forwarded to agent send list only once the total
number of outstanding send WRs falls below the limit.

Unsolicited MADs, RMPP MADs and MADs which are not SA, SMP or CM are
not subject to this flow control mechanism and will not be affected by
this change.

For this purpose, a new state is introduced:
- 'IB_MAD_STATE_QUEUED': MAD is in backlog list

Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Signed-off-by: Vlad Dumitrescu <vdumitrescu@nvidia.com>
Link: https://patch.msgid.link/c0ecaa1821badee124cd13f3bf860f67ce453beb.1751278420.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/mad.c
drivers/infiniband/core/mad_priv.h