Whamcloud - gitweb
LU-13510 lnd: Allow independent ko2iblnd timeout 59/38459/6
authorChris Horn <hornc@cray.com>
Sat, 2 May 2020 15:13:41 +0000 (10:13 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 May 2020 05:05:22 +0000 (05:05 +0000)
Allow ko2iblnd timeout parameter to be set independent of the
lnet_transaction_timeout and retry_count.

Test-Parameters: trivial
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I5b9a0da83c597c77f597db0c5cebbd933b5988fc
Reviewed-on: https://review.whamcloud.com/38459
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.h
lnet/klnds/o2iblnd/o2iblnd_cb.c
lnet/klnds/o2iblnd/o2iblnd_modparams.c

index 93de3df..3793817 100644 (file)
@@ -785,6 +785,12 @@ extern void kiblnd_hdev_destroy(struct kib_hca_dev *hdev);
 
 int kiblnd_msg_queue_size(int version, struct lnet_ni *ni);
 
+static inline int kiblnd_timeout(void)
+{
+       return *kiblnd_tunables.kib_timeout ? *kiblnd_tunables.kib_timeout :
+               lnet_get_lnd_timeout();
+}
+
 static inline int
 kiblnd_concurrent_sends(int version, struct lnet_ni *ni)
 {
index 1bd8844..b116f2b 100644 (file)
@@ -1234,7 +1234,7 @@ kiblnd_queue_tx_locked(struct kib_tx *tx, struct kib_conn *conn)
                return;
        }
 
-       timeout_ns = lnet_get_lnd_timeout() * NSEC_PER_SEC;
+       timeout_ns = kiblnd_timeout() * NSEC_PER_SEC;
        tx->tx_queued = 1;
        tx->tx_deadline = ktime_add_ns(ktime_get(), timeout_ns);
 
@@ -1363,12 +1363,12 @@ kiblnd_connect_peer(struct kib_peer_ni *peer_ni)
 
        if (*kiblnd_tunables.kib_use_priv_port) {
                rc = kiblnd_resolve_addr(cmid, &srcaddr, &dstaddr,
-                                        lnet_get_lnd_timeout() * 1000);
+                                        kiblnd_timeout() * 1000);
        } else {
                rc = rdma_resolve_addr(cmid,
                                       (struct sockaddr *)&srcaddr,
                                       (struct sockaddr *)&dstaddr,
-                                      lnet_get_lnd_timeout() * 1000);
+                                      kiblnd_timeout() * 1000);
        }
        if (rc != 0) {
                /* Can't initiate address resolution:  */
@@ -3077,7 +3077,7 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                         rc = event->status;
                } else {
                        rc = rdma_resolve_route(
-                               cmid, lnet_get_lnd_timeout() * 1000);
+                               cmid, kiblnd_timeout() * 1000);
                        if (rc == 0) {
                                struct kib_net *net = peer_ni->ibp_ni->ni_data;
                                struct kib_dev *dev = net->ibn_dev;
@@ -3493,7 +3493,7 @@ kiblnd_connd (void *arg)
                          * connection within (n+1)/n times the timeout
                          * interval. */
 
-                       lnd_timeout = lnet_get_lnd_timeout();
+                       lnd_timeout = kiblnd_timeout();
                        if (lnd_timeout > n * p)
                                chunk = (chunk * n * p) / lnd_timeout;
                        if (chunk == 0)
index 2a329e5..2095958 100644 (file)
@@ -46,7 +46,7 @@ static int cksum = 0;
 module_param(cksum, int, 0644);
 MODULE_PARM_DESC(cksum, "set non-zero to enable message (not RDMA) checksums");
 
-static int timeout = 50;
+static int timeout;
 module_param(timeout, int, 0644);
 MODULE_PARM_DESC(timeout, "timeout (seconds)");