4 #include "build_check.h"
6 #include <linux/libcfs.h>
7 #include <portals/errno.h>
9 /* This implementation uses the same type for API function return codes and
10 * the completion status in an event */
11 #define PTL_NI_OK PTL_OK
12 typedef ptl_err_t ptl_ni_fail_t;
14 typedef __u32 ptl_uid_t;
15 typedef __u32 ptl_jid_t;
16 typedef __u64 ptl_nid_t;
17 typedef __u32 ptl_pid_t;
18 typedef __u32 ptl_pt_index_t;
19 typedef __u32 ptl_ac_index_t;
20 typedef __u64 ptl_match_bits_t;
21 typedef __u64 ptl_hdr_data_t;
22 typedef __u32 ptl_size_t;
24 #define PTL_TIME_FOREVER (-1)
27 unsigned long nal_idx; /* which network interface */
28 __u64 cookie; /* which thing on that interface */
31 typedef ptl_handle_any_t ptl_handle_ni_t;
32 typedef ptl_handle_any_t ptl_handle_eq_t;
33 typedef ptl_handle_any_t ptl_handle_md_t;
34 typedef ptl_handle_any_t ptl_handle_me_t;
36 #define PTL_INVALID_HANDLE \
37 ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
38 #define PTL_EQ_NONE PTL_INVALID_HANDLE
40 static inline int PtlHandleIsEqual (ptl_handle_any_t h1, ptl_handle_any_t h2)
42 return (h1.nal_idx == h2.nal_idx && h1.cookie == h2.cookie);
45 #define PTL_UID_ANY ((ptl_uid_t) -1)
46 #define PTL_JID_ANY ((ptl_jid_t) -1)
47 #define PTL_NID_ANY ((ptl_nid_t) -1)
48 #define PTL_PID_ANY ((ptl_pid_t) -1)
52 ptl_pid_t pid; /* node id / process id */
72 ptl_handle_eq_t eq_handle;
75 /* Options for the MD structure */
76 #define PTL_MD_OP_PUT (1 << 0)
77 #define PTL_MD_OP_GET (1 << 1)
78 #define PTL_MD_MANAGE_REMOTE (1 << 2)
80 #define PTL_MD_TRUNCATE (1 << 4)
81 #define PTL_MD_ACK_DISABLE (1 << 5)
82 #define PTL_MD_IOVEC (1 << 6)
83 #define PTL_MD_MAX_SIZE (1 << 7)
84 #define PTL_MD_KIOV (1 << 8)
85 #define PTL_MD_EVENT_START_DISABLE (1 << 9)
86 #define PTL_MD_EVENT_END_DISABLE (1 << 10)
88 /* For compatibility with Cray Portals */
89 #define PTL_MD_LUSTRE_COMPLETION_SEMANTICS 0
92 #define PTL_MD_THRESH_INF (-1)
94 /* NB lustre portals uses struct iovec internally! */
95 typedef struct iovec ptl_md_iovec_t;
98 struct page *kiov_page;
99 unsigned int kiov_len;
100 unsigned int kiov_offset;
110 PTL_EVENT_REPLY_START,
115 PTL_EVENT_SEND_START,
121 #define PTL_SEQ_BASETYPE long
122 typedef unsigned PTL_SEQ_BASETYPE ptl_seq_t;
123 #define PTL_SEQ_GT(a,b) (((signed PTL_SEQ_BASETYPE)((a) - (b))) > 0)
126 * cygwin need the pragma line, not clear if it's needed in other places.
130 #pragma pack(push, 4)
133 ptl_event_kind_t type;
134 ptl_process_id_t initiator;
137 ptl_pt_index_t pt_index;
138 ptl_match_bits_t match_bits;
142 ptl_handle_md_t md_handle;
144 ptl_hdr_data_t hdr_data;
146 ptl_ni_fail_t ni_fail_type;
150 volatile ptl_seq_t sequence;
161 typedef void (*ptl_eq_handler_t)(ptl_event_t *event);
162 #define PTL_EQ_HANDLER_NONE NULL
188 typedef int ptl_sr_value_t;
190 typedef int ptl_interface_t;
191 #define PTL_IFACE_DEFAULT (-1)