*
* Copyright (c) 2011, 2017, Intel Corporation.
*
- * This file is part of Lustre, https://wiki.hpdd.intel.com/
+ * This file is part of Lustre, https://wiki.whamcloud.com/
*
* Portals is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
#include <linux/uaccess.h>
-#include <libcfs/linux/linux-misc.h>
#include <libcfs/libcfs.h>
#include <lnet/lib-lnet.h>
{
int rc;
struct lnet_counters *ctrs;
+ struct lnet_counters_common common;
int len;
char *tmpstr;
const int tmpsiz = 256; /* 7 %u and 4 __u64 */
}
lnet_counters_get(ctrs);
+ common = ctrs->lct_common;
len = snprintf(tmpstr, tmpsiz,
"%u %u %u %u %u %u %u %llu %llu "
"%llu %llu",
- ctrs->msgs_alloc, ctrs->msgs_max,
- ctrs->errors,
- ctrs->send_count, ctrs->recv_count,
- ctrs->route_count, ctrs->drop_count,
- ctrs->send_length, ctrs->recv_length,
- ctrs->route_length, ctrs->drop_length);
+ common.lcc_msgs_alloc, common.lcc_msgs_max,
+ common.lcc_errors,
+ common.lcc_send_count, common.lcc_recv_count,
+ common.lcc_route_count, common.lcc_drop_count,
+ common.lcc_send_length, common.lcc_recv_length,
+ common.lcc_route_length, common.lcc_drop_length);
if (pos >= min_t(int, len, strlen(tmpstr)))
rc = 0;
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);
+ /* @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) {
if (rc < 0)
goto out;
- tmp = cfs_trimwhite(buf);
+ tmp = strim(buf);
rc = -EINVAL;
lnet_res_lock(0);
.mode = 0644,
.proc_handler = &proc_lnet_portal_rotor,
},
- { 0 }
+ { .procname = NULL }
};
void lnet_router_debugfs_init(void)
{
- lnet_insert_debugfs(lnet_table, NULL);
+ lnet_insert_debugfs(lnet_table);
+}
+
+void lnet_router_debugfs_fini(void)
+{
+ lnet_remove_debugfs(lnet_table);
}