+enum lnet_net_state {
+ /* set when net block is allocated */
+ LNET_NET_STATE_INIT = 0,
+ /* set when NIs in net are started successfully */
+ LNET_NET_STATE_ACTIVE,
+ /* set if all NIs in net are in FAILED state */
+ LNET_NET_STATE_INACTIVE,
+ /* set when shutting down a NET */
+ LNET_NET_STATE_DELETING
+};
+
+enum lnet_ni_state {
+ /* set when NI block is allocated */
+ LNET_NI_STATE_INIT = 0,
+ /* set when NI is started successfully */
+ LNET_NI_STATE_ACTIVE,
+ /* set when LND notifies NI failed */
+ LNET_NI_STATE_FAILED,
+ /* set when LND notifies NI degraded */
+ LNET_NI_STATE_DEGRADED,
+ /* set when shuttding down NI */
+ 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 composed of
+ * (net_type << 16) | net_num.
+ * net_type can be one of the enumerated types defined in
+ * lnet/include/lnet/nidstr.h */
+ __u32 net_id;
+
+ /* priority of the network */
+ __u32 net_prio;
+
+ /* total number of CPTs in the array */
+ __u32 net_ncpts;
+
+ /* cumulative CPTs of all NIs in this net */
+ __u32 *net_cpts;
+
+ /* network tunables */
+ struct lnet_ioctl_config_lnd_cmn_tunables net_tunables;
+
+ /*
+ * boolean to indicate that the tunables have been set and
+ * shouldn't be reset
+ */
+ bool net_tunables_set;
+
+ /* procedural interface */
+ lnd_t *net_lnd;
+
+ /* list of NIs on this net */
+ struct list_head net_ni_list;
+
+ /* list of NIs being added, but not started yet */
+ struct list_head net_ni_added;
+
+ /* dying LND instances */
+ struct list_head net_ni_zombie;
+
+ /* network state */
+ enum lnet_net_state net_state;
+};
+