RDMA/core/sa_query: Retry SA queries
authorHåkon Bugge <haakon.bugge@oracle.com>
Thu, 12 Aug 2021 16:12:35 +0000 (18:12 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 25 Aug 2021 16:42:47 +0000 (13:42 -0300)
commit5f5a650999d5718af766fc70a120230b04235a6f
tree56a54f99f6a083a13322b932fafa9666ee8352ca
parentf0a64199195e5adfff921cb7bf4e4e67e1916401
RDMA/core/sa_query: Retry SA queries

A MAD packet is sent as an unreliable datagram (UD). SA requests are sent
as MAD packets. As such, SA requests or responses may be silently dropped.

IB Core's MAD layer has a timeout and retry mechanism, which amongst
other, is used by RDMA CM. But it is not used by SA queries. The lack of
retries of SA queries leads to long specified timeout, and error being
returned in case of packet loss. The ULP or user-land process has to
perform the retry.

Fix this by taking advantage of the MAD layer's retry mechanism.

First, a check against a zero timeout is added in rdma_resolve_route(). In
send_mad(), we set the MAD layer timeout to one tenth of the specified
timeout and the number of retries to 10. The special case when timeout is
less than 10 is handled.

With this fix:

 # ucmatose -c 1000 -S 1024 -C 1

runs stable on an Infiniband fabric. Without this fix, we see an
intermittent behavior and it errors out with:

cmatose: event: RDMA_CM_EVENT_ROUTE_ERROR, error: -110

(110 is ETIMEDOUT)

Link: https://lore.kernel.org/r/1628784755-28316-1-git-send-email-haakon.bugge@oracle.com
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/cma.c
drivers/infiniband/core/sa_query.c