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