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