struct list_head msg_list; /* Q for credits/MD */
lnet_process_id_t msg_target;
+ /* Primary NID of the source. */
+ lnet_nid_t msg_initiator;
/* where is it from, it's only for building event */
lnet_nid_t msg_from;
__u32 msg_type;
LNET_NI_STATE_DELETING
};
+struct lnet_element_stats {
+ atomic_t send_count;
+ atomic_t recv_count;
+ atomic_t drop_count;
+};
+
struct lnet_net {
/* chain on the ln_nets */
struct list_head net_list;
- /* net ID, which is compoed of
+ /* net ID, which is composed of
* (net_type << 16) | net_num.
- * net_type can be one of the enumarated types defined in
+ * net_type can be one of the enumerated types defined in
* lnet/include/lnet/nidstr.h */
__u32 net_id;
/* instance-specific data */
void *ni_data;
+ /* per ni credits */
+ atomic_t ni_tx_credits;
+
/* percpt TX queues */
struct lnet_tx_queue **ni_tx_queues;
/* lnd tunables set explicitly */
bool ni_lnd_tunables_set;
+ /* NI statistics */
+ struct lnet_element_stats ni_stats;
+
+ /* physical device CPT */
+ int dev_cpt;
+
/* sequence number used to round robin over nis within a net */
__u32 ni_seq;
} lnet_rc_data_t;
struct lnet_peer_ni {
- /* cahian on peer_net */
+ /* chain on peer_net */
struct list_head lpni_on_peer_net_list;
+ /* chain on remote peer list */
+ struct list_head lpni_on_remote_peer_ni_list;
/* chain on peer hash */
struct list_head lpni_hashlist;
/* messages blocking for tx credits */
struct list_head lpni_rtr_list;
/* pointer to peer net I'm part of */
struct lnet_peer_net *lpni_peer_net;
+ /* statistics kept on each peer NI */
+ struct lnet_element_stats lpni_stats;
+ /* spin lock protecting credits and lpni_txq / lpni_rtrq */
+ spinlock_t lpni_lock;
/* # tx credits available */
int lpni_txcredits;
/* low water mark */
/* low water mark */
int lpni_minrtrcredits;
/* alive/dead? */
- unsigned int lpni_alive:1;
+ bool lpni_alive;
/* notification outstanding? */
- unsigned int lpni_notify:1;
+ bool lpni_notify;
/* outstanding notification for LND? */
- unsigned int lpni_notifylnd:1;
+ bool lpni_notifylnd;
/* some thread is handling notification */
- unsigned int lpni_notifying:1;
+ bool lpni_notifying;
/* SEND event outstanding from ping */
- unsigned int lpni_ping_notsent;
- /* # times router went dead<->alive */
+ bool lpni_ping_notsent;
+ /* # times router went dead<->alive. Protected with lpni_lock */
int lpni_alive_count;
/* bytes queued for sending */
long lpni_txqnob;
__u32 lpni_seq;
/* health flag */
bool lpni_healthy;
- /* returned RC ping features */
+ /* returned RC ping features. Protected with lpni_lock */
unsigned int lpni_ping_feats;
/* routes on this peer */
struct list_head lpni_routes;
/* peer hash table */
struct lnet_peer_table {
int pt_version; /* /proc validity stamp */
- int pt_number; /* # peers extant */
- int pt_zombies; /* # zombies to go to deathrow
- * (and not there yet) */
- struct list_head pt_deathrow; /* zombie peers */
+ atomic_t pt_number; /* # peers extant */
struct list_head *pt_hash; /* NID->peer hash */
+ struct list_head pt_zombie_list; /* zombie peers */
+ int pt_zombies; /* # zombie peers */
+ spinlock_t pt_zombie_lock; /* protect list and count */
};
/* peer aliveness is enabled only on routers for peers in a network where the
struct lnet_peer_table **ln_peer_tables;
/* list of configured or discovered peers */
struct list_head ln_peers;
+ /* list of peer nis not on a local network */
+ struct list_head ln_remote_peer_ni_list;
/* failure simulation */
struct list_head ln_test_peers;
struct list_head ln_drop_rules;