+typedef struct
+{
+ __u64 ksnn_incarnation; /* my epoch */
+ spinlock_t ksnn_lock; /* serialise */
+ struct list_head ksnn_list; /* chain on global list */
+ int ksnn_npeers; /* # peers */
+ int ksnn_shutdown; /* shutting down? */
+ int ksnn_ninterfaces; /* IP interfaces */
+ ksock_interface_t ksnn_interfaces[LNET_MAX_INTERFACES];
+} ksock_net_t;
+
+/** connd timeout */
+#define SOCKNAL_CONND_TIMEOUT 120
+/** reserved thread for accepting & creating new connd */
+#define SOCKNAL_CONND_RESV 1
+
+typedef struct
+{
+ int ksnd_init; /* initialisation state */
+ int ksnd_nnets; /* # networks set up */
+ struct list_head ksnd_nets; /* list of nets */
+ /* stabilize peer/conn ops */
+ rwlock_t ksnd_global_lock;
+ /* hash table of all my known peers */
+ struct list_head *ksnd_peers;
+ int ksnd_peer_hash_size; /* size of ksnd_peers */
+
+ int ksnd_nthreads; /* # live threads */
+ int ksnd_shuttingdown; /* tell threads to exit */
+ /* schedulers information */
+ struct ksock_sched_info **ksnd_sched_info;
+
+ atomic_t ksnd_nactive_txs; /* #active txs */
+
+ /* conns to close: reaper_lock*/
+ struct list_head ksnd_deathrow_conns;
+ /* conns to free: reaper_lock */
+ struct list_head ksnd_zombie_conns;
+ /* conns to retry: reaper_lock*/
+ struct list_head ksnd_enomem_conns;
+ /* reaper sleeps here */
+ wait_queue_head_t ksnd_reaper_waitq;
+ /* when reaper will wake */
+ cfs_time_t ksnd_reaper_waketime;
+ /* serialise */
+ spinlock_t ksnd_reaper_lock;
+
+ int ksnd_enomem_tx; /* test ENOMEM sender */
+ int ksnd_stall_tx; /* test sluggish sender */
+ int ksnd_stall_rx; /* test sluggish receiver */
+
+ /* incoming connection requests */
+ struct list_head ksnd_connd_connreqs;
+ /* routes waiting to be connected */
+ struct list_head ksnd_connd_routes;
+ /* connds sleep here */
+ wait_queue_head_t ksnd_connd_waitq;
+ /* # connds connecting */
+ int ksnd_connd_connecting;
+ /** time stamp of the last failed connecting attempt */
+ long ksnd_connd_failed_stamp;
+ /** # starting connd */
+ unsigned ksnd_connd_starting;
+ /** time stamp of the last starting connd */
+ long ksnd_connd_starting_stamp;
+ /** # running connd */
+ unsigned ksnd_connd_running;
+ /* serialise */
+ spinlock_t ksnd_connd_lock;
+
+ /* list head for freed noop tx */
+ struct list_head ksnd_idle_noop_txs;
+ /* serialise, g_lock unsafe */
+ spinlock_t ksnd_tx_lock;