RDMA/cma: Use ACK timeout for RoCE packetLifeTime
The cma is currently using a hard-coded value, CMA_IBOE_PACKET_LIFETIME, for the PacketLifeTime, as it can not be determined from the network. This value might not be optimal for all networks. The cma module supports the function rdma_set_ack_timeout to set the ACK timeout for a QP associated with a connection. As per IBTA 12.7.34 local ACK timeout = (2 * PacketLifeTime + Local CA’s ACK delay). Assuming a negligible local ACK delay, we can use PacketLifeTime = local ACK timeout/2 as a reasonable approximation for RoCE networks. Link: https://lore.kernel.org/r/1572439440-17416-1-git-send-email-dag.moxnes@oracle.com Signed-off-by: Dag Moxnes <dag.moxnes@oracle.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
72b894b09a
commit
e1ee1e62be
1 changed files with 13 additions and 2 deletions
|
@ -2504,7 +2504,9 @@ EXPORT_SYMBOL(rdma_set_service_type);
|
||||||
* This function should be called before rdma_connect() on active side,
|
* This function should be called before rdma_connect() on active side,
|
||||||
* and on passive side before rdma_accept(). It is applicable to primary
|
* and on passive side before rdma_accept(). It is applicable to primary
|
||||||
* path only. The timeout will affect the local side of the QP, it is not
|
* path only. The timeout will affect the local side of the QP, it is not
|
||||||
* negotiated with remote side and zero disables the timer.
|
* negotiated with remote side and zero disables the timer. In case it is
|
||||||
|
* set before rdma_resolve_route, the value will also be used to determine
|
||||||
|
* PacketLifeTime for RoCE.
|
||||||
*
|
*
|
||||||
* Return: 0 for success
|
* Return: 0 for success
|
||||||
*/
|
*/
|
||||||
|
@ -2913,7 +2915,16 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
|
||||||
route->path_rec->rate = iboe_get_rate(ndev);
|
route->path_rec->rate = iboe_get_rate(ndev);
|
||||||
dev_put(ndev);
|
dev_put(ndev);
|
||||||
route->path_rec->packet_life_time_selector = IB_SA_EQ;
|
route->path_rec->packet_life_time_selector = IB_SA_EQ;
|
||||||
route->path_rec->packet_life_time = CMA_IBOE_PACKET_LIFETIME;
|
/* In case ACK timeout is set, use this value to calculate
|
||||||
|
* PacketLifeTime. As per IBTA 12.7.34,
|
||||||
|
* local ACK timeout = (2 * PacketLifeTime + Local CA’s ACK delay).
|
||||||
|
* Assuming a negligible local ACK delay, we can use
|
||||||
|
* PacketLifeTime = local ACK timeout/2
|
||||||
|
* as a reasonable approximation for RoCE networks.
|
||||||
|
*/
|
||||||
|
route->path_rec->packet_life_time = id_priv->timeout_set ?
|
||||||
|
id_priv->timeout - 1 : CMA_IBOE_PACKET_LIFETIME;
|
||||||
|
|
||||||
if (!route->path_rec->mtu) {
|
if (!route->path_rec->mtu) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err2;
|
goto err2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue