OpenMPI  0.1.1
btl_wv_def.h
1 /*
2  * Structs for infiniband
3  */
4 #ifndef BTL_WV_DEF_H
5 #define BTL_WV_DEF_H
6 #include <windows.h>
7 #include <rdma\winverbs.h>
8 #include <comp_channel.h>
9 
10 typedef unsigned __int8 uint8_t;
11 typedef unsigned __int16 uint16_t;
12 typedef unsigned __int32 uint32_t;
13 typedef unsigned __int64 uint64_t;
14 
15 union wv_gid
16 {
17  uint8_t raw[16];
18  struct
19  {
20  uint64_t subnet_prefix;
21  uint64_t interface_id;
22  }global;
23 };
24 
25 enum wv_node_type
26 {
27  WV_NODE_UNKNOWN = -1,
28  WV_NODE_CA = 1,
29  WV_NODE_SWITCH,
30  WV_NODE_ROUTER,
31 };
32 
33 struct wv_device
34 {
35  enum wv_node_type node_type;
36  WV_DEVICE_TYPE transport_type;
37  char name[64];
38 };
39 
40 struct wv_context
41 {
42  struct wv_device *device;
43  IWVDevice *device_if;
44  COMP_CHANNEL channel;
45 };
46 
47 enum wv_mtu
48 {
49  WV_MTU_256 = 1,
50  WV_MTU_512 = 2,
51  WV_MTU_1024 = 3,
52  WV_MTU_2048 = 4,
53  WV_MTU_4096 = 5
54 };
55 
56 struct wv_pd
57 {
58  struct wv_context *context;
59  IWVProtectionDomain *handle;
60 };
61 
62 struct wv_mr
63 {
64  struct wv_context *context;
65  struct wv_pd *pd;
66  void *addr;
67  size_t length;
68  uint32_t lkey;
69  uint32_t rkey;
70 };
71 
73 {
74  uint32_t max_wr;
75  uint32_t max_sge;
76  uint32_t srq_limit;
77 };
78 
80 {
81  void *srq_context;
82  struct wv_srq_attr attr;
83 };
84 
85 struct wv_recv_wr
86 {
87  uint64_t wr_id;
88  struct wv_recv_wr *next;
89  WV_SGE *sg_list;
90  int num_sge;
91 };
92 
93 struct wv_srq
94 {
95  struct wv_context *context;
96  void *srq_context;
97  struct wv_pd *pd;
98  IWVSharedReceiveQueue *handle;
99 };
100 
101 struct wv_qp
102 {
103  struct wv_context *context;
104  void *qp_context;
105  struct wv_pd *pd;
106  struct wv_cq *send_cq;
107  struct wv_cq *recv_cq;
108  struct wv_srq *srq;
109  IWVQueuePair *handle;
110  union
111  {
112  IWVDatagramQueuePair *ud_handle;
113  IWVConnectQueuePair *conn_handle;
114  };
115  uint32_t qp_num;
116  WV_QP_STATE state;
117  WV_QP_TYPE qp_type;
118 };
119 
121 {
122  struct wv_context *context;
123  COMP_CHANNEL comp_channel;
124 };
125 
126 struct wv_cq
127 {
128  struct wv_context *context;
129  struct wv_comp_channel *channel;
130  void *cq_context;
131  IWVCompletionQueue *handle;
132  int cqe;
133  COMP_ENTRY comp_entry;
134  LONG volatile notify_cnt;
135  LONG volatile ack_cnt;
136 };
137 
139 {
140  struct wv_device device;
141  uint64_t guid;
142  uint8_t phys_port_cnt;
143 };
144 
146 {
147  COMP_ENTRY comp_entry;
148  DWORD event_flag;
149  uint8_t port_num;
150 };
151 
153 {
154  struct wv_context context;
155  struct wverbs_device device;
156  uint8_t closing;
157  struct wverbs_port *port;
158  wverbs_port *event_port;
159 };
160 
161 struct wv_ah
162 {
163  IWVAddressHandle *handle;
164  ULONG_PTR key;
165 };
166 #endif
Definition: btl_wv_def.h:152
Definition: btl_wv_def.h:126
Definition: btl_wv_def.h:138
Definition: btl_wv_def.h:85
Definition: btl_wv_def.h:161
Definition: btl_wv_def.h:15
Definition: btl_wv_def.h:72
Definition: btl_wv_def.h:101
Definition: btl_wv_def.h:120
Definition: btl_wv_def.h:62
Definition: btl_wv_def.h:40
Definition: btl_wv_def.h:79
Definition: btl_wv_def.h:56
Definition: btl_wv_def.h:33
Definition: btl_wv_def.h:93
Definition: btl_wv_def.h:145