summaryrefslogtreecommitdiffstats
path: root/external_libs/ibverbs/include/infiniband/opcode.h
blob: fd4bc96a2c962fd56448cc6861c258dcec45a069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * Copyright (c) 2005 Topspin Communications.  All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef INFINIBAND_OPCODE_H
#define INFINIBAND_OPCODE_H

/*
 * This macro cleans up the definitions of constants for BTH opcodes.
 * It is used to define constants such as IBV_OPCODE_UD_SEND_ONLY,
 * which becomes IBV_OPCODE_UD + IBV_OPCODE_SEND_ONLY, and this gives
 * the correct value.
 *
 * In short, user code should use the constants defined using the
 * macro rather than worrying about adding together other constants.
*/
#define IBV_OPCODE(transport, op) \
	IBV_OPCODE_ ## transport ## _ ## op = \
		IBV_OPCODE_ ## transport + IBV_OPCODE_ ## op

enum {
	/* transport types -- just used to define real constants */
	IBV_OPCODE_RC                                = 0x00,
	IBV_OPCODE_UC                                = 0x20,
	IBV_OPCODE_RD                                = 0x40,
	IBV_OPCODE_UD                                = 0x60,

	/* operations -- just used to define real constants */
	IBV_OPCODE_SEND_FIRST                        = 0x00,
	IBV_OPCODE_SEND_MIDDLE                       = 0x01,
	IBV_OPCODE_SEND_LAST                         = 0x02,
	IBV_OPCODE_SEND_LAST_WITH_IMMEDIATE          = 0x03,
	IBV_OPCODE_SEND_ONLY                         = 0x04,
	IBV_OPCODE_SEND_ONLY_WITH_IMMEDIATE          = 0x05,
	IBV_OPCODE_RDMA_WRITE_FIRST                  = 0x06,
	IBV_OPCODE_RDMA_WRITE_MIDDLE                 = 0x07,
	IBV_OPCODE_RDMA_WRITE_LAST                   = 0x08,
	IBV_OPCODE_RDMA_WRITE_LAST_WITH_IMMEDIATE    = 0x09,
	IBV_OPCODE_RDMA_WRITE_ONLY                   = 0x0a,
	IBV_OPCODE_RDMA_WRITE_ONLY_WITH_IMMEDIATE    = 0x0b,
	IBV_OPCODE_RDMA_READ_REQUEST                 = 0x0c,
	IBV_OPCODE_RDMA_READ_RESPONSE_FIRST          = 0x0d,
	IBV_OPCODE_RDMA_READ_RESPONSE_MIDDLE         = 0x0e,
	IBV_OPCODE_RDMA_READ_RESPONSE_LAST           = 0x0f,
	IBV_OPCODE_RDMA_READ_RESPONSE_ONLY           = 0x10,
	IBV_OPCODE_ACKNOWLEDGE                       = 0x11,
	IBV_OPCODE_ATOMIC_ACKNOWLEDGE                = 0x12,
	IBV_OPCODE_COMPARE_SWAP                      = 0x13,
	IBV_OPCODE_FETCH_ADD                         = 0x14,

	/* real constants follow -- see comment about above IBV_OPCODE()
	   macro for more details */

	/* RC */
	IBV_OPCODE(RC, SEND_FIRST),
	IBV_OPCODE(RC, SEND_MIDDLE),
	IBV_OPCODE(RC, SEND_LAST),
	IBV_OPCODE(RC, SEND_LAST_WITH_IMMEDIATE),
	IBV_OPCODE(RC, SEND_ONLY),
	IBV_OPCODE(RC, SEND_ONLY_WITH_IMMEDIATE),
	IBV_OPCODE(RC, RDMA_WRITE_FIRST),
	IBV_OPCODE(RC, RDMA_WRITE_MIDDLE),
	IBV_OPCODE(RC, RDMA_WRITE_LAST),
	IBV_OPCODE(RC, RDMA_WRITE_LAST_WITH_IMMEDIATE),
	IBV_OPCODE(RC, RDMA_WRITE_ONLY),
	IBV_OPCODE(RC, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
	IBV_OPCODE(RC, RDMA_READ_REQUEST),
	IBV_OPCODE(RC, RDMA_READ_RESPONSE_FIRST),
	IBV_OPCODE(RC, RDMA_READ_RESPONSE_MIDDLE),
	IBV_OPCODE(RC, RDMA_READ_RESPONSE_LAST),
	IBV_OPCODE(RC, RDMA_READ_RESPONSE_ONLY),
	IBV_OPCODE(RC, ACKNOWLEDGE),
	IBV_OPCODE(RC, ATOMIC_ACKNOWLEDGE),
	IBV_OPCODE(RC, COMPARE_SWAP),
	IBV_OPCODE(RC, FETCH_ADD),

	/* UC */
	IBV_OPCODE(UC, SEND_FIRST),
	IBV_OPCODE(UC, SEND_MIDDLE),
	IBV_OPCODE(UC, SEND_LAST),
	IBV_OPCODE(UC, SEND_LAST_WITH_IMMEDIATE),
	IBV_OPCODE(UC, SEND_ONLY),
	IBV_OPCODE(UC, SEND_ONLY_WITH_IMMEDIATE),
	IBV_OPCODE(UC, RDMA_WRITE_FIRST),
	IBV_OPCODE(UC, RDMA_WRITE_MIDDLE),
	IBV_OPCODE(UC, RDMA_WRITE_LAST),
	IBV_OPCODE(UC, RDMA_WRITE_LAST_WITH_IMMEDIATE),
	IBV_OPCODE(UC, RDMA_WRITE_ONLY),
	IBV_OPCODE(UC, RDMA_WRITE_ONLY_WITH_IMMEDIATE),

	/* RD */
	IBV_OPCODE(RD, SEND_FIRST),
	IBV_OPCODE(RD, SEND_MIDDLE),
	IBV_OPCODE(RD, SEND_LAST),
	IBV_OPCODE(RD, SEND_LAST_WITH_IMMEDIATE),
	IBV_OPCODE(RD, SEND_ONLY),
	IBV_OPCODE(RD, SEND_ONLY_WITH_IMMEDIATE),
	IBV_OPCODE(RD, RDMA_WRITE_FIRST),
	IBV_OPCODE(RD, RDMA_WRITE_MIDDLE),
	IBV_OPCODE(RD, RDMA_WRITE_LAST),
	IBV_OPCODE(RD, RDMA_WRITE_LAST_WITH_IMMEDIATE),
	IBV_OPCODE(RD, RDMA_WRITE_ONLY),
	IBV_OPCODE(RD, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
	IBV_OPCODE(RD, RDMA_READ_REQUEST),
	IBV_OPCODE(RD, RDMA_READ_RESPONSE_FIRST),
	IBV_OPCODE(RD, RDMA_READ_RESPONSE_MIDDLE),
	IBV_OPCODE(RD, RDMA_READ_RESPONSE_LAST),
	IBV_OPCODE(RD, RDMA_READ_RESPONSE_ONLY),
	IBV_OPCODE(RD, ACKNOWLEDGE),
	IBV_OPCODE(RD, ATOMIC_ACKNOWLEDGE),
	IBV_OPCODE(RD, COMPARE_SWAP),
	IBV_OPCODE(RD, FETCH_ADD),

	/* UD */
	IBV_OPCODE(UD, SEND_ONLY),
	IBV_OPCODE(UD, SEND_ONLY_WITH_IMMEDIATE)
};

#endif /* INFINIBAND_OPCODE_H */