Whamcloud - gitweb
LU-9120 lnet: calculate the lnd timeout
[fs/lustre-release.git] / lnet / klnds / socklnd / socklnd.c
index 1e36746..0f5b15a 100644 (file)
@@ -1288,7 +1288,7 @@ ksocknal_create_conn(struct lnet_ni *ni, struct ksock_route *route,
        /* Set the deadline for the outgoing HELLO to drain */
        conn->ksnc_tx_bufnob = sock->sk->sk_wmem_queued;
        conn->ksnc_tx_deadline = ktime_get_seconds() +
        /* Set the deadline for the outgoing HELLO to drain */
        conn->ksnc_tx_bufnob = sock->sk->sk_wmem_queued;
        conn->ksnc_tx_deadline = ktime_get_seconds() +
-                                *ksocknal_tunables.ksnd_timeout;
+                                lnet_get_lnd_timeout();
        smp_mb();   /* order with adding to peer_ni's conn list */
 
        list_add(&conn->ksnc_list, &peer_ni->ksnp_conns);
        smp_mb();   /* order with adding to peer_ni's conn list */
 
        list_add(&conn->ksnc_list, &peer_ni->ksnp_conns);
@@ -1669,7 +1669,7 @@ ksocknal_destroy_conn(struct ksock_conn *conn)
         switch (conn->ksnc_rx_state) {
         case SOCKNAL_RX_LNET_PAYLOAD:
                 last_rcv = conn->ksnc_rx_deadline -
         switch (conn->ksnc_rx_state) {
         case SOCKNAL_RX_LNET_PAYLOAD:
                 last_rcv = conn->ksnc_rx_deadline -
-                          *ksocknal_tunables.ksnd_timeout;
+                          lnet_get_lnd_timeout();
                CERROR("Completing partial receive from %s[%d], "
                       "ip %pI4h:%d, with error, wanted: %d, left: %d, "
                       "last alive is %lld secs ago\n",
                CERROR("Completing partial receive from %s[%d], "
                       "ip %pI4h:%d, with error, wanted: %d, left: %d, "
                       "last alive is %lld secs ago\n",
@@ -1843,7 +1843,7 @@ ksocknal_query(struct lnet_ni *ni, lnet_nid_t nid, time64_t *when)
                        if (bufnob < conn->ksnc_tx_bufnob) {
                                /* something got ACKed */
                                conn->ksnc_tx_deadline = ktime_get_seconds() +
                        if (bufnob < conn->ksnc_tx_bufnob) {
                                /* something got ACKed */
                                conn->ksnc_tx_deadline = ktime_get_seconds() +
-                                                        *ksocknal_tunables.ksnd_timeout;
+                                                        lnet_get_lnd_timeout();
                                 peer_ni->ksnp_last_alive = now;
                                 conn->ksnc_tx_bufnob = bufnob;
                         }
                                 peer_ni->ksnp_last_alive = now;
                                 conn->ksnc_tx_bufnob = bufnob;
                         }