X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Finclude%2Flnet%2Flib-types.h;h=ed52e0a5e4f8c086d1e9e9f2b820707fcef60cc8;hb=0131d39a622f1efc07dc49df7bceed1bbe16357d;hp=dc85f3413f03fff9df8c5d321a369c13d0aa4b30;hpb=6427da97ef6e90e5bca565675ef6227dc21fe879;p=fs%2Flustre-release.git diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index dc85f34..ed52e0a 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -27,7 +27,6 @@ */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. * * lnet/include/lnet/lib-types.h * @@ -46,6 +45,7 @@ #include #include #include +#include #include #include @@ -62,6 +62,7 @@ * All local and peer NIs created have their health default to this value. */ #define LNET_MAX_HEALTH_VALUE 1000 +#define LNET_MAX_SELECTION_PRIORITY UINT_MAX /* forward refs */ struct lnet_libmd; @@ -241,6 +242,21 @@ struct lnet_test_peer { #define LNET_COOKIE_TYPE_BITS 2 #define LNET_COOKIE_MASK ((1ULL << LNET_COOKIE_TYPE_BITS) - 1ULL) +struct netstrfns { + u32 nf_type; + char *nf_name; + char *nf_modname; + void (*nf_addr2str)(u32 addr, char *str, size_t size); + int (*nf_str2addr)(const char *str, int nob, u32 *addr); + int (*nf_parse_addrlist)(char *str, int len, + struct list_head *list); + int (*nf_print_addrlist)(char *buffer, int count, + struct list_head *list); + int (*nf_match_addr)(u32 addr, struct list_head *list); + int (*nf_min_max)(struct list_head *nidlist, u32 *min_nid, + u32 *max_nid); +}; + struct lnet_ni; /* forward ref */ struct socket; @@ -369,8 +385,8 @@ struct lnet_net { * lnet/include/lnet/nidstr.h */ __u32 net_id; - /* priority of the network */ - __u32 net_prio; + /* round robin selection */ + __u32 net_seq; /* total number of CPTs in the array */ __u32 net_ncpts; @@ -378,6 +394,9 @@ struct lnet_net { /* cumulative CPTs of all NIs in this net */ __u32 *net_cpts; + /* relative net selection priority */ + __u32 net_sel_priority; + /* network tunables */ struct lnet_ioctl_config_lnd_cmn_tunables net_tunables; @@ -404,6 +423,9 @@ struct lnet_net { /* protects access to net_last_alive */ spinlock_t net_lock; + + /* list of router nids preferred for this network */ + struct list_head net_rtr_pref_nids; }; struct lnet_ni { @@ -451,6 +473,13 @@ struct lnet_ni { /* Recovery state. Protected by lnet_ni_lock() */ __u32 ni_recovery_state; + /* When to send the next recovery ping */ + time64_t ni_next_ping; + /* How many pings sent during current recovery period did not receive + * a reply. NB: reset whenever _any_ message arrives on this NI + */ + unsigned int ni_ping_count; + /* per NI LND tunables */ struct lnet_lnd_tunables ni_lnd_tunables; @@ -483,11 +512,13 @@ struct lnet_ni { */ atomic_t ni_fatal_error_on; + /* the relative selection priority of this NI */ + __u32 ni_sel_priority; + /* - * equivalent interfaces to use - * This is an array because socklnd bonding can still be configured + * equivalent interface to use */ - char *ni_interfaces[LNET_INTERFACES_NUM]; + char *ni_interface; struct net *ni_net_ns; /* original net namespace */ }; @@ -514,6 +545,11 @@ struct lnet_ping_buffer { #define LNET_PING_INFO_TO_BUFFER(PINFO) \ container_of((PINFO), struct lnet_ping_buffer, pb_info) +struct lnet_nid_list { + struct list_head nl_list; + lnet_nid_t nl_nid; +}; + struct lnet_peer_ni { /* chain on lpn_peer_nis */ struct list_head lpni_peer_nis; @@ -551,11 +587,17 @@ struct lnet_peer_ni { /* peer's NID */ lnet_nid_t lpni_nid; /* # refs */ - atomic_t lpni_refcount; + struct kref lpni_kref; /* health value for the peer */ atomic_t lpni_healthv; /* recovery ping mdh */ struct lnet_handle_md lpni_recovery_ping_mdh; + /* When to send the next recovery ping */ + time64_t lpni_next_ping; + /* How many pings sent during current recovery period did not receive + * a reply. NB: reset whenever _any_ message arrives from this peer NI + */ + unsigned int lpni_ping_count; /* CPT this peer attached on */ int lpni_cpt; /* state flags -- protected by lpni_lock */ @@ -573,8 +615,12 @@ struct lnet_peer_ni { /* preferred local nids: if only one, use lpni_pref.nid */ union lpni_pref { lnet_nid_t nid; - lnet_nid_t *nids; + struct list_head nids; } lpni_pref; + /* list of router nids preferred for this peer NI */ + struct list_head lpni_rtr_pref_nids; + /* The relative selection priority of this peer NI */ + __u32 lpni_sel_priority; /* number of preferred NIDs in lnpi_pref_nids */ __u32 lpni_pref_nnids; }; @@ -745,6 +791,8 @@ struct lnet_peer { /* peer is marked for deletion */ #define LNET_PEER_MARK_DELETION BIT(18) +/* lnet_peer_del()/lnet_peer_del_locked() has been called on the peer */ +#define LNET_PEER_MARK_DELETED BIT(19) struct lnet_peer_net { /* chain on lp_peer_nets */ @@ -762,12 +810,15 @@ struct lnet_peer_net { /* peer net health */ int lpn_healthv; - /* time of last router net check attempt */ - time64_t lpn_rtrcheck_timestamp; + /* time of next router ping on this net */ + time64_t lpn_next_ping; /* selection sequence number */ __u32 lpn_seq; + /* relative peer net selection priority */ + __u32 lpn_sel_priority; + /* reference count */ atomic_t lpn_refcount; }; @@ -817,7 +868,7 @@ struct lnet_route { int lr_seq; /* sequence for round-robin */ __u32 lr_hops; /* how far I am */ unsigned int lr_priority; /* route priority */ - bool lr_alive; /* cached route aliveness */ + atomic_t lr_alive; /* cached route aliveness */ bool lr_single_hop; /* this route is single-hop */ };