Whamcloud - gitweb
LU-12302 lnet: Fix NI status in proc for loopback ni 71/34871/2
authorChris Horn <hornc@cray.com>
Wed, 15 May 2019 19:07:20 +0000 (14:07 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 1 Jun 2019 03:55:33 +0000 (03:55 +0000)
The loopback NI is never really "down", but since its associated
ns_status is used for other purposes that's how it is reported in
proc_lnet_nis(). There's an existing check for lolnd so just hardcode
the status as "up" there.

Test-Parameters: trivial
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: If3f29dbc08c14aa187b00d680d0045a7dbb7f2d8
Reviewed-on: https://review.whamcloud.com/34871
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/router_proc.c

index bbcc0fd..24d9c0f 100644 (file)
@@ -737,16 +737,18 @@ proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer,
                        if (the_lnet.ln_routing)
                                last_alive = now - ni->ni_last_alive;
 
                        if (the_lnet.ln_routing)
                                last_alive = now - ni->ni_last_alive;
 
-                       /* @lo forever alive */
-                       if (ni->ni_net->net_lnd->lnd_type == LOLND)
-                               last_alive = 0;
-
                        lnet_ni_lock(ni);
                        LASSERT(ni->ni_status != NULL);
                        stat = (ni->ni_status->ns_status ==
                                LNET_NI_STATUS_UP) ? "up" : "down";
                        lnet_ni_unlock(ni);
 
                        lnet_ni_lock(ni);
                        LASSERT(ni->ni_status != NULL);
                        stat = (ni->ni_status->ns_status ==
                                LNET_NI_STATUS_UP) ? "up" : "down";
                        lnet_ni_unlock(ni);
 
+                       /* @lo forever alive */
+                       if (ni->ni_net->net_lnd->lnd_type == LOLND) {
+                               last_alive = 0;
+                               stat = "up";
+                       }
+
                        /* we actually output credits information for
                         * TX queue of each partition */
                        cfs_percpt_for_each(tq, i, ni->ni_tx_queues) {
                        /* we actually output credits information for
                         * TX queue of each partition */
                        cfs_percpt_for_each(tq, i, ni->ni_tx_queues) {