4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
31 * This file is part of Lustre, http://www.lustre.org/
32 * Lustre is a trademark of Sun Microsystems, Inc.
34 * lnet/include/lnet/lib-lnet.h
36 * Top level include for library side routines
39 #ifndef __LNET_LIB_LNET_H__
40 #define __LNET_LIB_LNET_H__
42 #if defined(__linux__)
43 #include <lnet/linux/lib-lnet.h>
44 #elif defined(__APPLE__)
45 #include <lnet/darwin/lib-lnet.h>
46 #elif defined(__WINNT__)
47 #include <lnet/winnt/lib-lnet.h>
49 #error Unsupported Operating System
52 #include <libcfs/libcfs.h>
53 #include <lnet/types.h>
54 #include <lnet/lnet.h>
55 #include <lnet/lib-types.h>
57 extern lnet_t the_lnet; /* THE network */
59 static inline int lnet_is_wire_handle_none (lnet_handle_wire_t *wh)
61 return (wh->wh_interface_cookie == LNET_WIRE_HANDLE_COOKIE_NONE &&
62 wh->wh_object_cookie == LNET_WIRE_HANDLE_COOKIE_NONE);
65 static inline int lnet_md_exhausted (lnet_libmd_t *md)
67 return (md->md_threshold == 0 ||
68 ((md->md_options & LNET_MD_MAX_SIZE) != 0 &&
69 md->md_offset + md->md_max_size > md->md_length));
72 static inline int lnet_md_unlinkable (lnet_libmd_t *md)
74 /* Should unlink md when its refcount is 0 and either:
75 * - md has been flagged for deletion (by auto unlink or LNetM[DE]Unlink,
76 * in the latter case md may not be exhausted).
77 * - auto unlink is on and md is exhausted.
79 if (md->md_refcount != 0)
82 if ((md->md_flags & LNET_MD_FLAG_ZOMBIE) != 0)
85 return ((md->md_flags & LNET_MD_FLAG_AUTO_UNLINK) != 0 &&
86 lnet_md_exhausted(md));
89 static inline unsigned int
90 lnet_match_to_hash(lnet_process_id_t id, __u64 mbits)
92 mbits += id.nid + id.pid;
93 return cfs_hash_long((unsigned long)mbits, LNET_PORTAL_HASH_BITS);
97 #define LNET_LOCK() cfs_spin_lock(&the_lnet.ln_lock)
98 #define LNET_UNLOCK() cfs_spin_unlock(&the_lnet.ln_lock)
99 #define LNET_MUTEX_LOCK(m) cfs_mutex_lock(m)
100 #define LNET_MUTEX_UNLOCK(m) cfs_mutex_unlock(m)
102 # ifndef HAVE_LIBPTHREAD
103 #define LNET_SINGLE_THREADED_LOCK(l) \
105 LASSERT ((l) == 0); \
109 #define LNET_SINGLE_THREADED_UNLOCK(l) \
111 LASSERT ((l) == 1); \
115 #define LNET_LOCK() LNET_SINGLE_THREADED_LOCK(the_lnet.ln_lock)
116 #define LNET_UNLOCK() LNET_SINGLE_THREADED_UNLOCK(the_lnet.ln_lock)
117 #define LNET_MUTEX_LOCK(m) LNET_SINGLE_THREADED_LOCK(*(m))
118 #define LNET_MUTEX_UNLOCK(m) LNET_SINGLE_THREADED_UNLOCK(*(m))
120 #define LNET_LOCK() pthread_mutex_lock(&the_lnet.ln_lock)
121 #define LNET_UNLOCK() pthread_mutex_unlock(&the_lnet.ln_lock)
122 #define LNET_MUTEX_LOCK(m) pthread_mutex_lock(m)
123 #define LNET_MUTEX_UNLOCK(m) pthread_mutex_unlock(m)
127 #define MAX_PORTALS 64
129 /* these are only used by code with LNET_USE_LIB_FREELIST, but we still
130 * exported them to !LNET_USE_LIB_FREELIST for easy implemetation */
131 #define LNET_FL_MAX_MES 2048
132 #define LNET_FL_MAX_MDS 2048
133 #define LNET_FL_MAX_EQS 512
134 #define LNET_FL_MAX_MSGS 2048 /* Outstanding messages */
136 #ifdef LNET_USE_LIB_FREELIST
138 int lnet_freelist_init(lnet_freelist_t *fl, int n, int size);
139 void lnet_freelist_fini(lnet_freelist_t *fl);
142 lnet_freelist_alloc (lnet_freelist_t *fl)
144 /* ALWAYS called with liblock held */
147 if (cfs_list_empty (&fl->fl_list))
150 o = cfs_list_entry (fl->fl_list.next, lnet_freeobj_t, fo_list);
151 cfs_list_del (&o->fo_list);
152 return ((void *)&o->fo_contents);
156 lnet_freelist_free (lnet_freelist_t *fl, void *obj)
158 /* ALWAYS called with liblock held */
159 lnet_freeobj_t *o = cfs_list_entry (obj, lnet_freeobj_t, fo_contents);
161 cfs_list_add (&o->fo_list, &fl->fl_list);
165 static inline lnet_eq_t *
168 /* NEVER called with resource lock held */
169 struct lnet_res_container *rec = &the_lnet.ln_eq_container;
173 eq = (lnet_eq_t *)lnet_freelist_alloc(&rec->rec_freelist);
180 lnet_eq_free_locked(lnet_eq_t *eq)
182 /* ALWAYS called with resource lock held */
183 struct lnet_res_container *rec = &the_lnet.ln_eq_container;
185 lnet_freelist_free(&rec->rec_freelist, eq);
189 lnet_eq_free(lnet_eq_t *eq)
192 lnet_eq_free_locked(eq);
196 static inline lnet_libmd_t *
197 lnet_md_alloc (lnet_md_t *umd)
199 /* NEVER called with resource lock held */
200 struct lnet_res_container *rec = &the_lnet.ln_md_container;
204 md = (lnet_libmd_t *)lnet_freelist_alloc(&rec->rec_freelist);
208 CFS_INIT_LIST_HEAD(&md->md_list);
214 lnet_md_free_locked(lnet_libmd_t *md)
216 /* ALWAYS called with resource lock held */
217 struct lnet_res_container *rec = &the_lnet.ln_md_container;
219 lnet_freelist_free(&rec->rec_freelist, md);
223 lnet_md_free(lnet_libmd_t *md)
226 lnet_md_free_locked(md);
230 static inline lnet_me_t *
233 /* NEVER called with resource lock held */
234 struct lnet_res_container *rec = &the_lnet.ln_me_container;
238 me = (lnet_me_t *)lnet_freelist_alloc(&rec->rec_freelist);
245 lnet_me_free_locked(lnet_me_t *me)
247 /* ALWAYS called with resource lock held */
248 struct lnet_res_container *rec = &the_lnet.ln_me_container;
250 lnet_freelist_free(&rec->rec_freelist, me);
254 lnet_me_free(lnet_me_t *me)
257 lnet_me_free_locked(me);
261 static inline lnet_msg_t *
262 lnet_msg_alloc (void)
264 /* NEVER called with liblock held */
268 msg = (lnet_msg_t *)lnet_freelist_alloc(&the_lnet.ln_free_msgs);
272 /* NULL pointers, clear flags etc */
273 memset (msg, 0, sizeof (*msg));
275 msg->msg_ev.uid = LNET_UID_ANY;
282 lnet_msg_free_locked(lnet_msg_t *msg)
284 /* ALWAYS called with network lock held */
285 LASSERT(!msg->msg_onactivelist);
286 lnet_freelist_free(&the_lnet.ln_free_msgs, msg);
290 lnet_msg_free (lnet_msg_t *msg)
293 lnet_msg_free_locked(msg);
297 #else /* !LNET_USE_LIB_FREELIST */
299 static inline lnet_eq_t *
302 /* NEVER called with liblock held */
305 LIBCFS_ALLOC(eq, sizeof(*eq));
310 lnet_eq_free(lnet_eq_t *eq)
312 /* ALWAYS called with resource lock held */
313 LIBCFS_FREE(eq, sizeof(*eq));
316 static inline lnet_libmd_t *
317 lnet_md_alloc (lnet_md_t *umd)
319 /* NEVER called with liblock held */
324 if ((umd->options & LNET_MD_KIOV) != 0) {
326 size = offsetof(lnet_libmd_t, md_iov.kiov[niov]);
328 niov = ((umd->options & LNET_MD_IOVEC) != 0) ?
330 size = offsetof(lnet_libmd_t, md_iov.iov[niov]);
333 LIBCFS_ALLOC(md, size);
336 /* Set here in case of early free */
337 md->md_options = umd->options;
339 CFS_INIT_LIST_HEAD(&md->md_list);
346 lnet_md_free(lnet_libmd_t *md)
348 /* ALWAYS called with resource lock held */
351 if ((md->md_options & LNET_MD_KIOV) != 0)
352 size = offsetof(lnet_libmd_t, md_iov.kiov[md->md_niov]);
354 size = offsetof(lnet_libmd_t, md_iov.iov[md->md_niov]);
356 LIBCFS_FREE(md, size);
359 static inline lnet_me_t *
362 /* NEVER called with liblock held */
365 LIBCFS_ALLOC(me, sizeof(*me));
370 lnet_me_free(lnet_me_t *me)
372 /* ALWAYS called with resource lock held */
373 LIBCFS_FREE(me, sizeof(*me));
376 static inline lnet_msg_t *
379 /* NEVER called with liblock held */
382 LIBCFS_ALLOC(msg, sizeof(*msg));
384 /* no need to zero, LIBCFS_ALLOC does for us */
388 msg->msg_ev.uid = LNET_UID_ANY;
395 lnet_msg_free(lnet_msg_t *msg)
397 /* ALWAYS called with network lock held */
398 LASSERT(!msg->msg_onactivelist);
399 LIBCFS_FREE(msg, sizeof(*msg));
402 #define lnet_eq_free_locked(eq) lnet_eq_free(eq)
403 #define lnet_md_free_locked(md) lnet_md_free(md)
404 #define lnet_me_free_locked(me) lnet_me_free(me)
405 #define lnet_msg_free_locked(msg) lnet_msg_free(msg)
407 #endif /* LNET_USE_LIB_FREELIST */
409 lnet_libhandle_t *lnet_res_lh_lookup(struct lnet_res_container *rec,
411 void lnet_res_lh_initialize(struct lnet_res_container *rec,
412 lnet_libhandle_t *lh);
414 lnet_res_lh_invalidate(lnet_libhandle_t *lh)
416 /* ALWAYS called with resource lock held */
417 cfs_list_del(&lh->lh_hash_chain);
421 lnet_eq2handle (lnet_handle_eq_t *handle, lnet_eq_t *eq)
424 LNetInvalidateHandle(handle);
428 handle->cookie = eq->eq_lh.lh_cookie;
431 static inline lnet_eq_t *
432 lnet_handle2eq(lnet_handle_eq_t *handle)
434 /* ALWAYS called with resource lock held */
435 lnet_libhandle_t *lh;
437 lh = lnet_res_lh_lookup(&the_lnet.ln_eq_container, handle->cookie);
441 return lh_entry(lh, lnet_eq_t, eq_lh);
445 lnet_md2handle (lnet_handle_md_t *handle, lnet_libmd_t *md)
447 handle->cookie = md->md_lh.lh_cookie;
450 static inline lnet_libmd_t *
451 lnet_handle2md(lnet_handle_md_t *handle)
453 /* ALWAYS called with resource lock held */
454 lnet_libhandle_t *lh;
456 lh = lnet_res_lh_lookup(&the_lnet.ln_md_container, handle->cookie);
460 return lh_entry(lh, lnet_libmd_t, md_lh);
463 static inline lnet_libmd_t *
464 lnet_wire_handle2md(lnet_handle_wire_t *wh)
466 /* ALWAYS called with resource lock held */
467 lnet_libhandle_t *lh;
469 if (wh->wh_interface_cookie != the_lnet.ln_interface_cookie)
472 lh = lnet_res_lh_lookup(&the_lnet.ln_md_container,
473 wh->wh_object_cookie);
477 return lh_entry(lh, lnet_libmd_t, md_lh);
481 lnet_me2handle (lnet_handle_me_t *handle, lnet_me_t *me)
483 handle->cookie = me->me_lh.lh_cookie;
486 static inline lnet_me_t *
487 lnet_handle2me(lnet_handle_me_t *handle)
489 /* ALWAYS called with resource lock held */
490 lnet_libhandle_t *lh;
492 lh = lnet_res_lh_lookup(&the_lnet.ln_me_container, handle->cookie);
496 return lh_entry(lh, lnet_me_t, me_lh);
500 lnet_portal_is_lazy(lnet_portal_t *ptl)
502 return !!(ptl->ptl_options & LNET_PTL_LAZY);
506 lnet_portal_is_unique(lnet_portal_t *ptl)
508 return !!(ptl->ptl_options & LNET_PTL_MATCH_UNIQUE);
512 lnet_portal_is_wildcard(lnet_portal_t *ptl)
514 return !!(ptl->ptl_options & LNET_PTL_MATCH_WILDCARD);
518 lnet_portal_setopt(lnet_portal_t *ptl, int opt)
520 ptl->ptl_options |= opt;
524 lnet_portal_unsetopt(lnet_portal_t *ptl, int opt)
526 ptl->ptl_options &= ~opt;
530 lnet_match_is_unique(lnet_process_id_t match_id,
531 __u64 match_bits, __u64 ignore_bits)
533 return ignore_bits == 0 &&
534 match_id.nid != LNET_NID_ANY &&
535 match_id.pid != LNET_PID_ANY;
538 static inline cfs_list_t *
539 lnet_portal_me_head(int index, lnet_process_id_t id, __u64 mbits)
541 lnet_portal_t *ptl = &the_lnet.ln_portals[index];
543 if (lnet_portal_is_wildcard(ptl)) {
544 return &ptl->ptl_mlist;
545 } else if (lnet_portal_is_unique(ptl)) {
546 LASSERT (ptl->ptl_mhash != NULL);
547 return &ptl->ptl_mhash[lnet_match_to_hash(id, mbits)];
552 cfs_list_t *lnet_portal_mhash_alloc(void);
553 void lnet_portal_mhash_free(cfs_list_t *mhash);
556 lnet_peer_addref_locked(lnet_peer_t *lp)
558 LASSERT (lp->lp_refcount > 0);
562 extern void lnet_destroy_peer_locked(lnet_peer_t *lp);
565 lnet_peer_decref_locked(lnet_peer_t *lp)
567 LASSERT (lp->lp_refcount > 0);
569 if (lp->lp_refcount == 0)
570 lnet_destroy_peer_locked(lp);
574 lnet_isrouter(lnet_peer_t *lp)
576 return lp->lp_rtr_refcount != 0;
580 lnet_ni_addref_locked(lnet_ni_t *ni)
582 LASSERT (ni->ni_refcount > 0);
587 lnet_ni_addref(lnet_ni_t *ni)
590 lnet_ni_addref_locked(ni);
595 lnet_ni_decref_locked(lnet_ni_t *ni)
597 LASSERT (ni->ni_refcount > 0);
599 if (ni->ni_refcount == 0)
600 cfs_list_add_tail(&ni->ni_list, &the_lnet.ln_zombie_nis);
604 lnet_ni_decref(lnet_ni_t *ni)
607 lnet_ni_decref_locked(ni);
611 static inline cfs_list_t *
612 lnet_nid2peerhash (lnet_nid_t nid)
614 unsigned int idx = LNET_NIDADDR(nid) % LNET_PEER_HASHSIZE;
616 return &the_lnet.ln_peer_hash[idx];
619 extern lnd_t the_lolnd;
622 /* unconditional registration */
623 #define LNET_REGISTER_ULND(lnd) \
627 lnet_register_lnd(&(lnd)); \
630 /* conditional registration */
631 #define LNET_REGISTER_ULND_IF_PRESENT(lnd) \
633 extern lnd_t lnd __attribute__ ((weak, alias("the_lolnd"))); \
635 if (&(lnd) != &the_lolnd) \
636 lnet_register_lnd(&(lnd)); \
642 lnet_set_msg_uid(lnet_ni_t *ni, lnet_msg_t *msg, lnet_uid_t uid)
644 LASSERT (msg->msg_ev.uid == LNET_UID_ANY);
645 msg->msg_ev.uid = uid;
649 extern lnet_ni_t *lnet_nid2ni_locked (lnet_nid_t nid);
650 extern lnet_ni_t *lnet_net2ni_locked (__u32 net);
651 static inline lnet_ni_t *
652 lnet_net2ni (__u32 net)
657 ni = lnet_net2ni_locked(net);
663 int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, cfs_time_t when);
664 void lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive, cfs_time_t when);
665 int lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway_nid);
666 int lnet_check_routes(void);
667 int lnet_del_route(__u32 net, lnet_nid_t gw_nid);
668 void lnet_destroy_routes(void);
669 int lnet_get_route(int idx, __u32 *net, __u32 *hops,
670 lnet_nid_t *gateway, __u32 *alive);
671 void lnet_proc_init(void);
672 void lnet_proc_fini(void);
673 void lnet_init_rtrpools(void);
674 int lnet_alloc_rtrpools(int im_a_router);
675 void lnet_free_rtrpools(void);
676 lnet_remotenet_t *lnet_find_net_locked (__u32 net);
678 int lnet_islocalnid(lnet_nid_t nid);
679 int lnet_islocalnet(__u32 net);
681 void lnet_build_unlink_event(lnet_libmd_t *md, lnet_event_t *ev);
682 void lnet_enq_event_locked(lnet_eq_t *eq, lnet_event_t *ev);
683 void lnet_prep_send(lnet_msg_t *msg, int type, lnet_process_id_t target,
684 unsigned int offset, unsigned int len);
685 int lnet_send(lnet_nid_t nid, lnet_msg_t *msg);
686 void lnet_return_credits_locked (lnet_msg_t *msg);
687 void lnet_match_blocked_msg(lnet_libmd_t *md);
688 int lnet_parse (lnet_ni_t *ni, lnet_hdr_t *hdr,
689 lnet_nid_t fromnid, void *private, int rdma_req);
690 void lnet_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
691 unsigned int offset, unsigned int mlen, unsigned int rlen);
692 lnet_msg_t *lnet_create_reply_msg (lnet_ni_t *ni, lnet_msg_t *get_msg);
693 void lnet_set_reply_msg_len(lnet_ni_t *ni, lnet_msg_t *msg, unsigned int len);
694 void lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int rc);
696 char *lnet_msgtyp2str (int type);
697 void lnet_print_hdr (lnet_hdr_t * hdr);
698 int lnet_fail_nid(lnet_nid_t nid, unsigned int threshold);
700 unsigned int lnet_iov_nob (unsigned int niov, struct iovec *iov);
701 int lnet_extract_iov (int dst_niov, struct iovec *dst,
702 int src_niov, struct iovec *src,
703 unsigned int offset, unsigned int len);
705 unsigned int lnet_kiov_nob (unsigned int niov, lnet_kiov_t *iov);
706 int lnet_extract_kiov (int dst_niov, lnet_kiov_t *dst,
707 int src_niov, lnet_kiov_t *src,
708 unsigned int offset, unsigned int len);
710 void lnet_copy_iov2iov (unsigned int ndiov, struct iovec *diov,
711 unsigned int doffset,
712 unsigned int nsiov, struct iovec *siov,
713 unsigned int soffset, unsigned int nob);
714 void lnet_copy_kiov2iov (unsigned int niov, struct iovec *iov,
715 unsigned int iovoffset,
716 unsigned int nkiov, lnet_kiov_t *kiov,
717 unsigned int kiovoffset, unsigned int nob);
718 void lnet_copy_iov2kiov (unsigned int nkiov, lnet_kiov_t *kiov,
719 unsigned int kiovoffset,
720 unsigned int niov, struct iovec *iov,
721 unsigned int iovoffset, unsigned int nob);
722 void lnet_copy_kiov2kiov (unsigned int ndkiov, lnet_kiov_t *dkiov,
723 unsigned int doffset,
724 unsigned int nskiov, lnet_kiov_t *skiov,
725 unsigned int soffset, unsigned int nob);
728 lnet_copy_iov2flat(int dlen, void *dest, unsigned int doffset,
729 unsigned int nsiov, struct iovec *siov, unsigned int soffset,
732 struct iovec diov = {/*.iov_base = */ dest, /*.iov_len = */ dlen};
734 lnet_copy_iov2iov(1, &diov, doffset,
735 nsiov, siov, soffset, nob);
739 lnet_copy_kiov2flat(int dlen, void *dest, unsigned int doffset,
740 unsigned int nsiov, lnet_kiov_t *skiov, unsigned int soffset,
743 struct iovec diov = {/* .iov_base = */ dest, /* .iov_len = */ dlen};
745 lnet_copy_kiov2iov(1, &diov, doffset,
746 nsiov, skiov, soffset, nob);
750 lnet_copy_flat2iov(unsigned int ndiov, struct iovec *diov, unsigned int doffset,
751 int slen, void *src, unsigned int soffset, unsigned int nob)
753 struct iovec siov = {/*.iov_base = */ src, /*.iov_len = */slen};
754 lnet_copy_iov2iov(ndiov, diov, doffset,
755 1, &siov, soffset, nob);
759 lnet_copy_flat2kiov(unsigned int ndiov, lnet_kiov_t *dkiov, unsigned int doffset,
760 int slen, void *src, unsigned int soffset, unsigned int nob)
762 struct iovec siov = {/* .iov_base = */ src, /* .iov_len = */ slen};
763 lnet_copy_iov2kiov(ndiov, dkiov, doffset,
764 1, &siov, soffset, nob);
767 void lnet_me_unlink(lnet_me_t *me);
769 void lnet_md_unlink(lnet_libmd_t *md);
770 void lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd);
772 void lnet_register_lnd(lnd_t *lnd);
773 void lnet_unregister_lnd(lnd_t *lnd);
774 int lnet_set_ip_niaddr (lnet_ni_t *ni);
777 int lnet_connect(cfs_socket_t **sockp, lnet_nid_t peer_nid,
778 __u32 local_ip, __u32 peer_ip, int peer_port);
779 void lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
780 __u32 peer_ip, int port);
781 int lnet_count_acceptor_nis(void);
782 int lnet_acceptor_timeout(void);
783 int lnet_acceptor_port(void);
785 void lnet_router_checker(void);
788 #ifdef HAVE_LIBPTHREAD
789 int lnet_count_acceptor_nis(void);
790 int lnet_acceptor_port(void);
793 int lnet_acceptor_start(void);
794 void lnet_acceptor_stop(void);
796 void lnet_get_tunables(void);
797 int lnet_peers_start_down(void);
798 int lnet_peer_buffer_credits(lnet_ni_t *ni);
800 int lnet_router_checker_start(void);
801 void lnet_router_checker_stop(void);
802 void lnet_swap_pinginfo(lnet_ping_info_t *info);
803 int lnet_router_down_ni(lnet_peer_t *rtr, __u32 net);
805 int lnet_ping_target_init(void);
806 void lnet_ping_target_fini(void);
807 int lnet_ping(lnet_process_id_t id, int timeout_ms,
808 lnet_process_id_t *ids, int n_ids);
810 int lnet_parse_ip2nets (char **networksp, char *ip2nets);
811 int lnet_parse_routes (char *route_str, int *im_a_router);
812 int lnet_parse_networks (cfs_list_t *nilist, char *networks);
814 int lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid);
815 lnet_peer_t *lnet_find_peer_locked (lnet_nid_t nid);
816 void lnet_clear_peer_table(void);
817 void lnet_destroy_peer_table(void);
818 int lnet_create_peer_table(void);
819 void lnet_debug_peer(lnet_nid_t nid);
823 lnet_parse_int_tunable(int *value, char *name)
825 char *env = getenv(name);
831 *value = strtoull(env, &end, 0);
835 CERROR("Can't parse tunable %s=%s\n", name, env);