+
+ /*
+ * peer specific health sensitivity value to decrement peer nis in
+ * this peer with if set to something other than 0
+ */
+ __u32 lp_health_sensitivity;
+
+ /* messages blocking for router credits */
+ struct list_head lp_rtrq;
+
+ /* routes on this peer */
+ struct list_head lp_routes;
+
+ /* time of last router check attempt */
+ time64_t lp_rtrcheck_timestamp;
+
+ /* reference count */
+ atomic_t lp_refcount;
+
+ /* lock protecting peer state flags and lpni_rtrq */
+ spinlock_t lp_lock;
+
+ /* peer state flags */
+ unsigned lp_state;
+
+ /* buffer for data pushed by peer */
+ struct lnet_ping_buffer *lp_data;
+
+ /* MD handle for ping in progress */
+ struct lnet_handle_md lp_ping_mdh;
+
+ /* MD handle for push in progress */
+ struct lnet_handle_md lp_push_mdh;
+
+ /* number of NIDs for sizing push data */
+ int lp_data_nnis;
+
+ /* NI config sequence number of peer */
+ __u32 lp_peer_seqno;
+
+ /* Local NI config sequence number acked by peer */
+ __u32 lp_node_seqno;
+
+ /* Local NI config sequence number sent to peer */
+ __u32 lp_node_seqno_sent;
+
+ /* Ping error encountered during discovery. */
+ int lp_ping_error;
+
+ /* Push error encountered during discovery. */
+ int lp_push_error;
+
+ /* Error encountered during discovery. */
+ int lp_dc_error;
+
+ /* time it was put on the ln_dc_working queue */
+ time64_t lp_last_queued;
+
+ /* link on discovery-related lists */
+ struct list_head lp_dc_list;
+
+ /* tasks waiting on discovery of this peer */
+ wait_queue_head_t lp_dc_waitq;
+};
+
+/*
+ * The status flags in lp_state. Their semantics have chosen so that
+ * lp_state can be zero-initialized.
+ *
+ * A peer is marked MULTI_RAIL in two cases: it was configured using DLC
+ * as multi-rail aware, or the LNET_PING_FEAT_MULTI_RAIL bit was set.
+ *
+ * A peer is marked NO_DISCOVERY if the LNET_PING_FEAT_DISCOVERY bit was
+ * NOT set when the peer was pinged by discovery.
+ *
+ * A peer is marked ROUTER if it indicates so in the feature bit.
+ */
+#define LNET_PEER_MULTI_RAIL (1 << 0) /* Multi-rail aware */
+#define LNET_PEER_NO_DISCOVERY (1 << 1) /* Peer disabled discovery */
+#define LNET_PEER_ROUTER_ENABLED (1 << 2) /* router feature enabled */
+
+/*
+ * A peer is marked CONFIGURED if it was configured by DLC.
+ *
+ * In addition, a peer is marked DISCOVERED if it has fully passed
+ * through Peer Discovery.
+ *
+ * When Peer Discovery is disabled, the discovery thread will mark
+ * peers REDISCOVER to indicate that they should be re-examined if
+ * discovery is (re)enabled on the node.
+ *
+ * A peer that was created as the result of inbound traffic will not
+ * be marked at all.
+ */
+#define LNET_PEER_CONFIGURED (1 << 3) /* Configured via DLC */
+#define LNET_PEER_DISCOVERED (1 << 4) /* Peer was discovered */
+#define LNET_PEER_REDISCOVER (1 << 5) /* Discovery was disabled */
+/*
+ * A peer is marked DISCOVERING when discovery is in progress.
+ * The other flags below correspond to stages of discovery.
+ */
+#define LNET_PEER_DISCOVERING (1 << 6) /* Discovering */
+#define LNET_PEER_DATA_PRESENT (1 << 7) /* Remote peer data present */
+#define LNET_PEER_NIDS_UPTODATE (1 << 8) /* Remote peer info uptodate */
+#define LNET_PEER_PING_SENT (1 << 9) /* Waiting for REPLY to Ping */
+#define LNET_PEER_PUSH_SENT (1 << 10) /* Waiting for ACK of Push */
+#define LNET_PEER_PING_FAILED (1 << 11) /* Ping send failure */
+#define LNET_PEER_PUSH_FAILED (1 << 12) /* Push send failure */
+/*
+ * A ping can be forced as a way to fix up state, or as a manual
+ * intervention by an admin.
+ * A push can be forced in circumstances that would normally not
+ * allow for one to happen.
+ */
+#define LNET_PEER_FORCE_PING (1 << 13) /* Forced Ping */
+#define LNET_PEER_FORCE_PUSH (1 << 14) /* Forced Push */
+
+/* force delete even if router */
+#define LNET_PEER_RTR_NI_FORCE_DEL (1 << 15)
+
+/* gw undergoing alive discovery */
+#define LNET_PEER_RTR_DISCOVERY (1 << 16)
+
+struct lnet_peer_net {
+ /* chain on lp_peer_nets */
+ struct list_head lpn_peer_nets;
+
+ /* list of peer_nis on this network */
+ struct list_head lpn_peer_nis;
+
+ /* pointer to the peer I'm part of */
+ struct lnet_peer *lpn_peer;
+
+ /* Net ID */
+ __u32 lpn_net_id;
+
+ /* reference count */
+ atomic_t lpn_refcount;
+};