Whamcloud - gitweb
56b7b995cbbdd3ea028857b64f306f153cc9cce2
[fs/lustre-release.git] / lnet / include / lnet / api.h
1 #ifndef P30_API_H
2 #define P30_API_H
3
4 #include "build_check.h"
5
6 #include <portals/types.h>
7
8 int PtlInit(int *);
9 void PtlFini(void);
10
11 int PtlNIInit(ptl_interface_t interface, ptl_pid_t requested_pid,
12               ptl_ni_limits_t *desired_limits, ptl_ni_limits_t *actual_limits,
13               ptl_handle_ni_t *interface_out);
14
15 int PtlNIInitialized(ptl_interface_t);
16
17 int PtlNIFini(ptl_handle_ni_t interface_in);
18
19 int PtlGetId(ptl_handle_ni_t ni_handle, ptl_process_id_t *id);
20
21 int PtlGetUid(ptl_handle_ni_t ni_handle, ptl_uid_t *uid);
22
23
24 /*
25  * Network interfaces
26  */
27
28 int PtlNIStatus(ptl_handle_ni_t interface_in, ptl_sr_index_t register_in,
29                 ptl_sr_value_t * status_out);
30
31 int PtlNIDist(ptl_handle_ni_t interface_in, ptl_process_id_t process_in,
32               unsigned long *distance_out);
33
34 int PtlNIHandle(ptl_handle_any_t handle_in, ptl_handle_ni_t * interface_out);
35
36
37 /* 
38  * PtlNIFailNid
39  *
40  * Not an official Portals 3 API call.  It provides a way of simulating
41  * communications failures to all (nid == PTL_NID_ANY), or specific peers
42  * (via multiple calls), either until further notice (threshold == -1), or
43  * for a specific number of messages.  Passing a threshold of zero, "heals"
44  * the given peer.
45  */
46 int PtlFailNid (ptl_handle_ni_t ni, ptl_nid_t nid, unsigned int threshold);
47
48 /*
49  * PtlSnprintHandle: 
50  *
51  * This is not an official Portals 3 API call.  It is provided
52  * so that an application can print an opaque handle.
53  */
54 void PtlSnprintHandle (char *str, int str_len, ptl_handle_any_t handle);
55
56 /*
57  * Match entries
58  */
59
60 int PtlMEAttach(ptl_handle_ni_t interface_in, ptl_pt_index_t index_in,
61                 ptl_process_id_t match_id_in, ptl_match_bits_t match_bits_in,
62                 ptl_match_bits_t ignore_bits_in, ptl_unlink_t unlink_in,
63                 ptl_ins_pos_t pos_in, ptl_handle_me_t * handle_out);
64
65 int PtlMEInsert(ptl_handle_me_t current_in, ptl_process_id_t match_id_in,
66                 ptl_match_bits_t match_bits_in, ptl_match_bits_t ignore_bits_in,
67                 ptl_unlink_t unlink_in, ptl_ins_pos_t position_in,
68                 ptl_handle_me_t * handle_out);
69
70 int PtlMEUnlink(ptl_handle_me_t current_in);
71
72 int PtlMEUnlinkList(ptl_handle_me_t current_in);
73
74
75
76 /*
77  * Memory descriptors
78  */
79
80 int PtlMDAttach(ptl_handle_me_t current_in, ptl_md_t md_in,
81                 ptl_unlink_t unlink_in, ptl_handle_md_t * handle_out);
82
83 int PtlMDBind(ptl_handle_ni_t ni_in, ptl_md_t md_in,
84               ptl_unlink_t unlink_in, ptl_handle_md_t * handle_out);
85
86 int PtlMDUnlink(ptl_handle_md_t md_in);
87
88 int PtlMDUpdate(ptl_handle_md_t md_in, ptl_md_t * old_inout,
89                 ptl_md_t * new_inout, ptl_handle_eq_t testq_in);
90
91
92 /* These should not be called by users */
93 int PtlMDUpdate_internal(ptl_handle_md_t md_in, ptl_md_t * old_inout,
94                          ptl_md_t * new_inout, ptl_handle_eq_t testq_in,
95                          ptl_seq_t sequence_in);
96
97
98
99
100 /*
101  * Event queues
102  */
103 int PtlEQAlloc(ptl_handle_ni_t ni_in, ptl_size_t count_in,
104                ptl_eq_handler_t handler,
105                ptl_handle_eq_t *handle_out);
106 int PtlEQFree(ptl_handle_eq_t eventq_in);
107
108 int PtlEQGet(ptl_handle_eq_t eventq_in, ptl_event_t * event_out);
109
110
111 int PtlEQWait(ptl_handle_eq_t eventq_in, ptl_event_t * event_out);
112
113 int PtlEQPoll(ptl_handle_eq_t *eventqs_in, int neq_in, int timeout,
114               ptl_event_t *event_out, int *which_out);
115
116 /*
117  * Access Control Table
118  */
119 int PtlACEntry(ptl_handle_ni_t ni_in, ptl_ac_index_t index_in,
120                ptl_process_id_t match_id_in, ptl_pt_index_t portal_in);
121
122
123 /*
124  * Data movement
125  */
126
127 int PtlPut(ptl_handle_md_t md_in, ptl_ack_req_t ack_req_in,
128            ptl_process_id_t target_in, ptl_pt_index_t portal_in,
129            ptl_ac_index_t cookie_in, ptl_match_bits_t match_bits_in,
130            ptl_size_t offset_in, ptl_hdr_data_t hdr_data_in);
131
132 int PtlGet(ptl_handle_md_t md_in, ptl_process_id_t target_in,
133            ptl_pt_index_t portal_in, ptl_ac_index_t cookie_in,
134            ptl_match_bits_t match_bits_in, ptl_size_t offset_in);
135
136
137
138 #endif