/* this is really lnet_proc.c */
-#define LNET_PROC_STATS "sys/lnet/stats"
-#define LNET_PROC_ROUTES "sys/lnet/routes"
-#define LNET_PROC_ROUTERS "sys/lnet/routers"
-#define LNET_PROC_PEERS "sys/lnet/peers"
-#define LNET_PROC_BUFFERS "sys/lnet/buffers"
-#define LNET_PROC_NIS "sys/lnet/nis"
+#define LNET_PROC_ROOT "sys/lnet"
+#define LNET_PROC_STATS LNET_PROC_ROOT"/stats"
+#define LNET_PROC_ROUTES LNET_PROC_ROOT"/routes"
+#define LNET_PROC_ROUTERS LNET_PROC_ROOT"/routers"
+#define LNET_PROC_PEERS LNET_PROC_ROOT"/peers"
+#define LNET_PROC_BUFFERS LNET_PROC_ROOT"/buffers"
+#define LNET_PROC_NIS LNET_PROC_ROOT"/nis"
static int
lnet_router_proc_stats_read (char *page, char **start, off_t off,
LNET_UNLOCK();
- seq_printf(s,
+ seq_printf(s,
"%-4d %7d %9d %6s %12lu %s\n", nrefs, nrtrrefs,
alive_cnt, alive ? "up" : "down",
last_ping, libcfs_nid2str(nid));
lnet_peer_seq_show (struct seq_file *s, void *iter)
{
lnet_peer_seq_iterator_t *lpsi = iter;
+ char *aliveness = "NA";
lnet_peer_t *lp;
lnet_nid_t nid;
int maxcr;
int txcr;
int minrtrcr;
int rtrcr;
- int alive;
- int rtr;
int txqnob;
int nrefs;
mintxcr = lp->lp_mintxcredits;
rtrcr = lp->lp_rtrcredits;
minrtrcr = lp->lp_minrtrcredits;
- rtr = lnet_isrouter(lp);
- alive = lp->lp_alive;
txqnob = lp->lp_txqnob;
nrefs = lp->lp_refcount;
+ if (lnet_isrouter(lp) || lp->lp_ni->ni_peertimeout > 0)
+ aliveness = lp->lp_alive ? "up" : "down";
+
LNET_UNLOCK();
seq_printf(s, "%-24s %4d %5s %5d %5d %5d %5d %5d %d\n",
- libcfs_nid2str(nid), nrefs,
- !rtr ? "~rtr" : (alive ? "up" : "down"),
+ libcfs_nid2str(nid), nrefs, aliveness,
maxcr, rtrcr, minrtrcr, txcr, mintxcr, txqnob);
return 0;
}
int txcr;
int mintxcr;
int npeertxcr;
+ int npeerrtrcr;
lnet_nid_t nid;
int nref;
if (lnsi->lnsi_off == 0) {
- seq_printf(s, "%-24s %4s %4s %5s %5s %5s\n",
- "nid", "refs", "peer", "max", "tx", "min");
+ seq_printf(s, "%-24s %4s %4s %4s %5s %5s %5s\n",
+ "nid", "refs", "peer", "rtr", "max", "tx", "min");
return 0;
}
ni = lnsi->lnsi_ni;
- maxtxcr = ni->ni_maxtxcredits;
- txcr = ni->ni_txcredits;
- mintxcr = ni->ni_mintxcredits;
- npeertxcr = ni->ni_peertxcredits;
- nid = ni->ni_nid;
- nref = ni->ni_refcount;
+ maxtxcr = ni->ni_maxtxcredits;
+ txcr = ni->ni_txcredits;
+ mintxcr = ni->ni_mintxcredits;
+ npeertxcr = ni->ni_peertxcredits;
+ npeerrtrcr = ni->ni_peerrtrcredits;
+ nid = ni->ni_nid;
+ nref = ni->ni_refcount;
LNET_UNLOCK();
- seq_printf(s, "%-24s %4d %4d %5d %5d %5d\n",
+ seq_printf(s, "%-24s %4d %4d %4d %5d %5d %5d\n",
libcfs_nid2str(nid), nref,
- npeertxcr, maxtxcr, txcr, mintxcr);
+ npeertxcr, npeerrtrcr, maxtxcr, txcr, mintxcr);
return 0;
}
{
struct proc_dir_entry *pde;
+#if 0
+ pde = proc_mkdir(LNET_PROC_ROOT, NULL);
+ if (pde == NULL) {
+ CERROR("couldn't create "LNET_PROC_ROOT"\n");
+ return;
+ }
+#endif
/* Initialize LNET_PROC_STATS */
pde = create_proc_entry (LNET_PROC_STATS, 0644, NULL);
if (pde == NULL) {
remove_proc_entry(LNET_PROC_PEERS, 0);
remove_proc_entry(LNET_PROC_BUFFERS, 0);
remove_proc_entry(LNET_PROC_NIS, 0);
+#if 0
+ remove_proc_entry(LNET_PROC_ROOT, 0);
+#endif
}
#else