OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

osc_rdma_header.h
1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University.
3 * All rights reserved.
4 * Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
5 * All rights reserved.
6 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
7 * University of Stuttgart. All rights reserved.
8 * Copyright (c) 2004-2005 The Regents of the University of California.
9 * All rights reserved.
10 * Copyright (c) 2007 Los Alamos National Security, LLC. All rights
11 * reserved.
12 * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
13 * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
14 * $COPYRIGHT$
15 *
16 * Additional copyrights may follow
17 *
18 * $HEADER$
19 */
20
21 #ifndef OMPI_MCA_OSC_RDMA_HDR_H
22 #define OMPI_MCA_OSC_RDMA_HDR_H
23
24 #ifdef HAVE_NETINET_IN_H
25 #include <netinet/in.h>
26 #endif
27
28 #include "opal/types.h"
29
30 /* Note -- 0x05 to 0x0C are of control_hdr type */
31 #define OMPI_OSC_RDMA_HDR_PUT 0x01
32 #define OMPI_OSC_RDMA_HDR_ACC 0x02
33 #define OMPI_OSC_RDMA_HDR_GET 0x03
34 #define OMPI_OSC_RDMA_HDR_REPLY 0x04
35 #define OMPI_OSC_RDMA_HDR_POST 0x05
36 #define OMPI_OSC_RDMA_HDR_COMPLETE 0x06
37 #define OMPI_OSC_RDMA_HDR_LOCK_REQ 0x07
38 #define OMPI_OSC_RDMA_HDR_UNLOCK_REQ 0x08
39 #define OMPI_OSC_RDMA_HDR_UNLOCK_REPLY 0x09
40 #define OMPI_OSC_RDMA_HDR_RDMA_COMPLETE 0x0A
41 #define OMPI_OSC_RDMA_HDR_MULTI_END 0x0B
42 #define OMPI_OSC_RDMA_HDR_RDMA_INFO 0x0C
43
44 #define OMPI_OSC_RDMA_HDR_FLAG_ALIGN_MASK 0x0F
45 #define OMPI_OSC_RDMA_HDR_FLAG_NBO 0x10
46 #define OMPI_OSC_RDMA_HDR_FLAG_MULTI 0x20
47
48 struct ompi_osc_rdma_base_header_t {
49 uint8_t hdr_type;
50 /* eventually, this will include endian information */
51 uint8_t hdr_flags;
52 };
53 typedef struct ompi_osc_rdma_base_header_t ompi_osc_rdma_base_header_t;
54
55 #define OMPI_OSC_RDMA_BASE_HDR_NTOH(h)
56 #define OMPI_OSC_RDMA_BASE_HDR_HTON(h)
57
58 struct ompi_osc_rdma_send_header_t {
59 ompi_osc_rdma_base_header_t hdr_base;
60 uint16_t hdr_windx;
61
62 int32_t hdr_origin;
63 ompi_ptr_t hdr_origin_sendreq;
64 int32_t hdr_origin_tag;
65
66 uint64_t hdr_target_disp;
67 int32_t hdr_target_count;
68 int32_t hdr_target_op;
69
70 int32_t hdr_msg_length; /* 0 if payload is not included */
71 };
72 typedef struct ompi_osc_rdma_send_header_t ompi_osc_rdma_send_header_t;
73
74 #define OMPI_OSC_RDMA_SEND_HDR_HTON(hdr) \
75 do { \
76 OMPI_OSC_RDMA_BASE_HDR_HTON((hdr).hdr_base) \
77 (hdr).hdr_windx = htons((hdr).hdr_windx); \
78 (hdr).hdr_origin = htonl((hdr).hdr_origin); \
79 (hdr).hdr_origin_tag = htonl((hdr).hdr_origin_tag); \
80 (hdr).hdr_target_disp = hton64((hdr).hdr_target_disp); \
81 (hdr).hdr_target_count = htonl((hdr).hdr_target_count); \
82 (hdr).hdr_target_op = htonl((hdr).hdr_target_op); \
83 (hdr).hdr_msg_length = htonl((hdr).hdr_msg_length); \
84 } while (0)
85
86 #define OMPI_OSC_RDMA_SEND_HDR_NTOH(hdr) \
87 do { \
88 OMPI_OSC_RDMA_BASE_HDR_NTOH((hdr).hdr_base) \
89 (hdr).hdr_windx = ntohs((hdr).hdr_windx); \
90 (hdr).hdr_origin = ntohl((hdr).hdr_origin); \
91 (hdr).hdr_origin_tag = ntohl((hdr).hdr_origin_tag); \
92 (hdr).hdr_target_disp = ntoh64((hdr).hdr_target_disp); \
93 (hdr).hdr_target_count = ntohl((hdr).hdr_target_count); \
94 (hdr).hdr_target_op = ntohl((hdr).hdr_target_op); \
95 (hdr).hdr_msg_length = ntohl((hdr).hdr_msg_length); \
96 } while (0)
97
98
99 struct ompi_osc_rdma_reply_header_t {
100 ompi_osc_rdma_base_header_t hdr_base;
101
102 ompi_ptr_t hdr_origin_sendreq;
103
104 int32_t hdr_target_tag;
105 int32_t hdr_msg_length;
106 };
107 typedef struct ompi_osc_rdma_reply_header_t ompi_osc_rdma_reply_header_t;
108
109 #define OMPI_OSC_RDMA_REPLY_HDR_HTON(hdr) \
110 do { \
111 OMPI_OSC_RDMA_BASE_HDR_HTON((hdr).hdr_base) \
112 (hdr).hdr_target_tag = htonl((hdr).hdr_target_tag); \
113 (hdr).hdr_msg_length = htonl((hdr).hdr_msg_length); \
114 } while (0)
115
116 #define OMPI_OSC_RDMA_REPLY_HDR_NTOH(hdr) \
117 do { \
118 OMPI_OSC_RDMA_BASE_HDR_NTOH((hdr).hdr_base) \
119 (hdr).hdr_target_tag = ntohl((hdr).hdr_target_tag); \
120 (hdr).hdr_msg_length = ntohl((hdr).hdr_msg_length); \
121 } while (0)
122
123
124 struct ompi_osc_rdma_control_header_t {
125 ompi_osc_rdma_base_header_t hdr_base;
126 int16_t hdr_windx;
127 int32_t hdr_value[2];
128 };
129 typedef struct ompi_osc_rdma_control_header_t ompi_osc_rdma_control_header_t;
130
131 #define OMPI_OSC_RDMA_CONTROL_HDR_HTON(hdr) \
132 do { \
133 OMPI_OSC_RDMA_BASE_HDR_HTON((hdr).hdr_base); \
134 (hdr).hdr_windx = htons((hdr).hdr_windx); \
135 (hdr).hdr_value[0] = htonl((hdr).hdr_value[0]); \
136 (hdr).hdr_value[1] = htonl((hdr).hdr_value[1]); \
137 } while (0)
138
139 #define OMPI_OSC_RDMA_CONTROL_HDR_NTOH(hdr) \
140 do { \
141 OMPI_OSC_RDMA_BASE_HDR_NTOH((hdr).hdr_base); \
142 (hdr).hdr_windx = ntohs((hdr).hdr_windx); \
143 (hdr).hdr_value[0] = ntohl((hdr).hdr_value[0]); \
144 (hdr).hdr_value[1] = ntohl((hdr).hdr_value[1]); \
145 } while (0)
146
147
148 struct ompi_osc_rdma_rdma_info_header_t {
149 ompi_osc_rdma_base_header_t hdr_base;
150 int16_t hdr_windx;
151 int32_t hdr_origin;
152 uint64_t hdr_segkey;
153 };
154 typedef struct ompi_osc_rdma_rdma_info_header_t ompi_osc_rdma_rdma_info_header_t;
155
156 #define OMPI_OSC_RDMA_RDMA_INFO_HDR_HTON(hdr) \
157 do { \
158 OMPI_OSC_RDMA_BASE_HDR_HTON((hdr).hdr_base); \
159 (hdr).hdr_windx = htons((hdr).hdr_windx); \
160 (hdr).hdr_origin = htonl((hdr).hdr_origin); \
161 (hdr).hdr_segkey = hton64((hdr).hdr_segkey); \
162 } while (0)
163
164 #define OMPI_OSC_RDMA_RDMA_INFO_HDR_NTOH(hdr) \
165 do { \
166 OMPI_OSC_RDMA_BASE_HDR_NTOH((hdr).hdr_base); \
167 (hdr).hdr_windx = ntohs((hdr).hdr_windx); \
168 (hdr).hdr_origin = ntohl((hdr).hdr_origin); \
169 (hdr).hdr_segkey = ntoh64((hdr).hdr_segkey); \
170 } while (0)
171
172
173 #endif /* OMPI_MCA_OSC_RDMA_HDR_H */
ompi_ptr_t
Definition: types.h:52
ompi_osc_rdma_send_header_t
Definition: osc_rdma_header.h:58
ompi_osc_rdma_control_header_t
Definition: osc_rdma_header.h:124
ompi_osc_rdma_base_header_t
Definition: osc_rdma_header.h:48
ompi_osc_rdma_reply_header_t
Definition: osc_rdma_header.h:99
ompi_osc_rdma_rdma_info_header_t
Definition: osc_rdma_header.h:148