Whamcloud - gitweb
LU-13265 lnet: Modify push MD to have single threshold
[fs/lustre-release.git] / lnet / include / lnet / api.h
index 4fa2f66..a36510b 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2016, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -47,7 +47,7 @@
 # error This include is only for kernel use.
 #endif
 
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
 
 /** \defgroup lnet_init_fini Initialization and cleanup
  * The LNet must be properly initialized before any LNet calls can be made.
@@ -78,6 +78,7 @@ int LNetNIFini(void);
 int LNetGetId(unsigned int index, struct lnet_process_id *id);
 int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, __u32 *order);
 lnet_nid_t LNetPrimaryNID(lnet_nid_t nid);
+bool LNetIsPeerLocal(lnet_nid_t nid);
 
 /** @} lnet_addr */
 
@@ -92,25 +93,17 @@ lnet_nid_t LNetPrimaryNID(lnet_nid_t nid);
  * and a set of match criteria. The match criteria can be used to reject
  * incoming requests based on process ID or the match bits provided in the
  * request. MEs can be dynamically inserted into a match list by LNetMEAttach()
- * and LNetMEInsert(), and removed from its list by LNetMEUnlink().
+ * and removed from its list by LNetMEUnlink().
  * @{ */
-int LNetMEAttach(unsigned int     portal,
-                struct lnet_process_id match_id_in,
-                __u64             match_bits_in,
-                __u64             ignore_bits_in,
-                enum lnet_unlink       unlink_in,
-                enum lnet_ins_pos      pos_in,
-                struct lnet_handle_me  *handle_out);
-
-int LNetMEInsert(struct lnet_handle_me current_in,
-                struct lnet_process_id match_id_in,
-                __u64             match_bits_in,
-                __u64             ignore_bits_in,
-                enum lnet_unlink  unlink_in,
-                enum lnet_ins_pos position_in,
-                struct lnet_handle_me *handle_out);
-
-int LNetMEUnlink(struct lnet_handle_me current_in);
+struct lnet_me *
+LNetMEAttach(unsigned int portal,
+            struct lnet_process_id match_id_in,
+            __u64 match_bits_in,
+            __u64 ignore_bits_in,
+            enum lnet_unlink unlink_in,
+            enum lnet_ins_pos pos_in);
+
+void LNetMEUnlink(struct lnet_me *current_in);
 /** @} lnet_me */
 
 /** \defgroup lnet_md Memory descriptors
@@ -125,9 +118,9 @@ int LNetMEUnlink(struct lnet_handle_me current_in);
  * and LNetMDBind(); one operation to unlink and release the resources
  * associated with a MD: LNetMDUnlink().
  * @{ */
-int LNetMDAttach(struct lnet_handle_me current_in,
-                struct lnet_md    md_in,
-                enum lnet_unlink  unlink_in,
+int LNetMDAttach(struct lnet_me *current_in,
+                struct lnet_md md_in,
+                enum lnet_unlink unlink_in,
                 struct lnet_handle_md *md_handle_out);
 
 int LNetMDBind(struct lnet_md   md_in,
@@ -143,39 +136,24 @@ int LNetMDUnlink(struct lnet_handle_md md_in);
  * local MDs. In particular, they signal the completion of a data transmission
  * into or out of a MD. They can also be used to hold acknowledgments for
  * completed PUT operations and indicate when a MD has been unlinked. Multiple
- * MDs can share a single EQ. An EQ may have an optional event handler
- * associated with it. If an event handler exists, it will be run for each
- * event that is deposited into the EQ.
+ * MDs can share a single EQ. An EQ must have an event handler
+ * associated with it. It will be run for each event that is deposited into
+ * the EQ.
  *
- * In addition to the struct lnet_handle_eq, the LNet API defines two types
+ * In addition to the struct lnet_eq, the LNet API defines two types
  * associated with events: The ::lnet_event_kind defines the kinds of events
  * that can be stored in an EQ. The struct lnet_event defines a structure that
  * holds the information about with an event.
  *
- * There are five functions for dealing with EQs: LNetEQAlloc() is used to
- * create an EQ and allocate the resources needed, while LNetEQFree()
- * releases these resources and free the EQ. LNetEQGet() retrieves the next
- * event from an EQ, and LNetEQWait() can be used to block a process until
- * an EQ has at least one event. LNetEQPoll() can be used to test or wait
- * on multiple EQs.
+ * There are two functions for dealing with EQs: LNetEQAlloc() is used
+ * to create an EQ and allocate the resources needed, while LNetEQFree()
+ * releases these resources and frees the EQ.
  * @{ */
-int LNetEQAlloc(unsigned int      count_in,
-               lnet_eq_handler_t  handler,
-               struct lnet_handle_eq *handle_out);
+struct lnet_eq *
+LNetEQAlloc(lnet_eq_handler_t handler);
 
-int LNetEQFree(struct lnet_handle_eq eventq_in);
+int LNetEQFree(struct lnet_eq *eventq_in);
 
-int LNetEQGet(struct lnet_handle_eq eventq_in,
-             struct lnet_event *event_out);
-
-int LNetEQWait(struct lnet_handle_eq eventq_in,
-              struct lnet_event *event_out);
-
-int LNetEQPoll(struct lnet_handle_eq *eventqs_in,
-              int               neq_in,
-              signed long       timeout,
-              struct lnet_event *event_out,
-              int              *which_eq_out);
 /** @} lnet_eq */
 
 /** \defgroup lnet_data Data movement operations
@@ -197,7 +175,8 @@ int LNetGet(lnet_nid_t            self,
            struct lnet_process_id target_in,
            unsigned int      portal_in,
            __u64             match_bits_in,
-           unsigned int      offset_in);
+           unsigned int      offset_in,
+           bool              recovery);
 /** @} lnet_data */
 
 
@@ -209,6 +188,7 @@ int LNetSetLazyPortal(int portal);
 int LNetClearLazyPortal(int portal);
 int LNetCtl(unsigned int cmd, void *arg);
 void LNetDebugPeer(struct lnet_process_id id);
+int LNetGetPeerDiscoveryStatus(void);
 
 /** @} lnet_misc */