X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Flnet%2Frouter_proc.c;h=0d2d6700451c7a2cc5648f23081211499ea5cff0;hb=8cbb8cd3e771;hp=cf771dc01c989080060b4e3404cc8421c4e9e349;hpb=054ecbba403b2be103be7418289c87e1658cdbd6;p=fs%2Flustre-release.git diff --git a/lnet/lnet/router_proc.c b/lnet/lnet/router_proc.c index cf771dc0..0d2d670 100644 --- a/lnet/lnet/router_proc.c +++ b/lnet/lnet/router_proc.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. * * This file is part of Lustre, https://wiki.hpdd.intel.com/ * @@ -490,19 +490,19 @@ proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer, p = NULL; hoff = 1; hash++; - } + } if (peer != NULL) { - lnet_nid_t nid = peer->lp_nid; - int nrefs = peer->lp_refcount; - int lastalive = -1; - char *aliveness = "NA"; - int maxcr = peer->lp_ni->ni_peertxcredits; - int txcr = peer->lp_txcredits; - int mintxcr = peer->lp_mintxcredits; - int rtrcr = peer->lp_rtrcredits; - int minrtrcr = peer->lp_minrtrcredits; - int txqnob = peer->lp_txqnob; + lnet_nid_t nid = peer->lp_nid; + int nrefs = peer->lp_refcount; + int lastalive = -1; + char *aliveness = "NA"; + int maxcr = peer->lp_net->net_tunables.lct_peer_tx_credits; + int txcr = peer->lp_txcredits; + int mintxcr = peer->lp_mintxcredits; + int rtrcr = peer->lp_rtrcredits; + int minrtrcr = peer->lp_minrtrcredits; + int txqnob = peer->lp_txqnob; if (lnet_isrouter(peer) || lnet_peer_aliveness_enabled(peer)) @@ -656,32 +656,19 @@ proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer, "%-24s %6s %5s %4s %4s %4s %5s %5s %5s\n", "nid", "status", "alive", "refs", "peer", "rtr", "max", "tx", "min"); - LASSERT(tmpstr + tmpsiz - s > 0); + LASSERT (tmpstr + tmpsiz - s > 0); } else { - struct list_head *n; - lnet_ni_t *ni = NULL; - int skip = *ppos - 1; + lnet_ni_t *ni = NULL; + int skip = *ppos - 1; lnet_net_lock(0); - n = the_lnet.ln_nis.next; - - while (n != &the_lnet.ln_nis) { - lnet_ni_t *a_ni = list_entry(n, lnet_ni_t, ni_list); - - if (skip == 0) { - ni = a_ni; - break; - } - - skip--; - n = n->next; - } + ni = lnet_get_ni_idx_locked(skip); if (ni != NULL) { struct lnet_tx_queue *tq; char *stat; - long now = cfs_time_current_sec(); + time64_t now = ktime_get_real_seconds(); int last_alive = -1; int i; int j; @@ -690,7 +677,7 @@ proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer, last_alive = now - ni->ni_last_alive; /* @lo forever alive */ - if (ni->ni_lnd->lnd_type == LOLND) + if (ni->ni_net->net_lnd->lnd_type == LOLND) last_alive = 0; lnet_ni_lock(ni); @@ -718,8 +705,8 @@ proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer, "%-24s %6s %5d %4d %4d %4d %5d %5d %5d\n", libcfs_nid2str(ni->ni_nid), stat, last_alive, *ni->ni_refs[i], - ni->ni_peertxcredits, - ni->ni_peerrtrcredits, + ni->ni_net->net_tunables.lct_peer_tx_credits, + ni->ni_net->net_tunables.lct_peer_rtr_credits, tq->tq_credits_max, tq->tq_credits, tq->tq_credits_min); if (i != 0)