xref: /onnv-gate/usr/src/uts/common/sys/rds.h (revision 12198:4db936bda957)
1*12198SEiji.Ota@Sun.COM /*
2*12198SEiji.Ota@Sun.COM  * CDDL HEADER START
3*12198SEiji.Ota@Sun.COM  *
4*12198SEiji.Ota@Sun.COM  * The contents of this file are subject to the terms of the
5*12198SEiji.Ota@Sun.COM  * Common Development and Distribution License (the "License").
6*12198SEiji.Ota@Sun.COM  * You may not use this file except in compliance with the License.
7*12198SEiji.Ota@Sun.COM  *
8*12198SEiji.Ota@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*12198SEiji.Ota@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*12198SEiji.Ota@Sun.COM  * See the License for the specific language governing permissions
11*12198SEiji.Ota@Sun.COM  * and limitations under the License.
12*12198SEiji.Ota@Sun.COM  *
13*12198SEiji.Ota@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*12198SEiji.Ota@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*12198SEiji.Ota@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*12198SEiji.Ota@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*12198SEiji.Ota@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*12198SEiji.Ota@Sun.COM  *
19*12198SEiji.Ota@Sun.COM  * CDDL HEADER END
20*12198SEiji.Ota@Sun.COM  */
21*12198SEiji.Ota@Sun.COM /*
22*12198SEiji.Ota@Sun.COM  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23*12198SEiji.Ota@Sun.COM  */
24*12198SEiji.Ota@Sun.COM 
25*12198SEiji.Ota@Sun.COM /*
26*12198SEiji.Ota@Sun.COM  * Copyright (c) 2008 Oracle.  All rights reserved.
27*12198SEiji.Ota@Sun.COM  *
28*12198SEiji.Ota@Sun.COM  * This software is available to you under a choice of one of two
29*12198SEiji.Ota@Sun.COM  * licenses.  You may choose to be licensed under the terms of the GNU
30*12198SEiji.Ota@Sun.COM  * General Public License (GPL) Version 2, available from the file
31*12198SEiji.Ota@Sun.COM  * COPYING in the main directory of this source tree, or the
32*12198SEiji.Ota@Sun.COM  * OpenIB.org BSD license below:
33*12198SEiji.Ota@Sun.COM  *
34*12198SEiji.Ota@Sun.COM  *     Redistribution and use in source and binary forms, with or
35*12198SEiji.Ota@Sun.COM  *     without modification, are permitted provided that the following
36*12198SEiji.Ota@Sun.COM  *     conditions are met:
37*12198SEiji.Ota@Sun.COM  *
38*12198SEiji.Ota@Sun.COM  *      - Redistributions of source code must retain the above
39*12198SEiji.Ota@Sun.COM  *        copyright notice, this list of conditions and the following
40*12198SEiji.Ota@Sun.COM  *        disclaimer.
41*12198SEiji.Ota@Sun.COM  *
42*12198SEiji.Ota@Sun.COM  *      - Redistributions in binary form must reproduce the above
43*12198SEiji.Ota@Sun.COM  *        copyright notice, this list of conditions and the following
44*12198SEiji.Ota@Sun.COM  *        disclaimer in the documentation and/or other materials
45*12198SEiji.Ota@Sun.COM  *        provided with the distribution.
46*12198SEiji.Ota@Sun.COM  *
47*12198SEiji.Ota@Sun.COM  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
48*12198SEiji.Ota@Sun.COM  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49*12198SEiji.Ota@Sun.COM  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
50*12198SEiji.Ota@Sun.COM  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
51*12198SEiji.Ota@Sun.COM  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
52*12198SEiji.Ota@Sun.COM  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
53*12198SEiji.Ota@Sun.COM  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54*12198SEiji.Ota@Sun.COM  * SOFTWARE.
55*12198SEiji.Ota@Sun.COM  *
56*12198SEiji.Ota@Sun.COM  */
57*12198SEiji.Ota@Sun.COM 
58*12198SEiji.Ota@Sun.COM /*
59*12198SEiji.Ota@Sun.COM  * Include this file if the application uses rdsv3 sockets.
60*12198SEiji.Ota@Sun.COM  */
61*12198SEiji.Ota@Sun.COM 
62*12198SEiji.Ota@Sun.COM /*
63*12198SEiji.Ota@Sun.COM  * This file contains definitions from the ofed rds.h and rds_rdma.h
64*12198SEiji.Ota@Sun.COM  * header file.
65*12198SEiji.Ota@Sun.COM  */
66*12198SEiji.Ota@Sun.COM #ifndef _RDSV3_RDS_H
67*12198SEiji.Ota@Sun.COM #define	_RDSV3_RDS_H
68*12198SEiji.Ota@Sun.COM 
69*12198SEiji.Ota@Sun.COM #include <sys/types.h>
70*12198SEiji.Ota@Sun.COM 
71*12198SEiji.Ota@Sun.COM #ifdef __cplusplus
72*12198SEiji.Ota@Sun.COM extern "C" {
73*12198SEiji.Ota@Sun.COM #endif
74*12198SEiji.Ota@Sun.COM 
75*12198SEiji.Ota@Sun.COM #define	RDS_IB_ABI_VERSION		0x301
76*12198SEiji.Ota@Sun.COM 
77*12198SEiji.Ota@Sun.COM #define	AF_RDS				AF_INET_OFFLOAD
78*12198SEiji.Ota@Sun.COM #define	PF_RDS				AF_INET_OFFLOAD
79*12198SEiji.Ota@Sun.COM 
80*12198SEiji.Ota@Sun.COM #define	SOL_RDS				272
81*12198SEiji.Ota@Sun.COM 
82*12198SEiji.Ota@Sun.COM /*
83*12198SEiji.Ota@Sun.COM  * setsockopt/getsockopt for SOL_RDS
84*12198SEiji.Ota@Sun.COM  */
85*12198SEiji.Ota@Sun.COM #define	RDSV3_CANCEL_SENT_TO		1
86*12198SEiji.Ota@Sun.COM #define	RDSV3_GET_MR			2
87*12198SEiji.Ota@Sun.COM #define	RDSV3_FREE_MR			3
88*12198SEiji.Ota@Sun.COM /* deprecated: RDS_BARRIER 4 */
89*12198SEiji.Ota@Sun.COM #define	RDSV3_RECVERR			5
90*12198SEiji.Ota@Sun.COM #define	RDSV3_CONG_MONITOR		6
91*12198SEiji.Ota@Sun.COM 
92*12198SEiji.Ota@Sun.COM /*
93*12198SEiji.Ota@Sun.COM  * Control message types for SOL_RDS.
94*12198SEiji.Ota@Sun.COM  *
95*12198SEiji.Ota@Sun.COM  * RDS_CMSG_RDMA_ARGS (sendmsg)
96*12198SEiji.Ota@Sun.COM  *	Request a RDMA transfer to/from the specified
97*12198SEiji.Ota@Sun.COM  *	memory ranges.
98*12198SEiji.Ota@Sun.COM  *	The cmsg_data is a struct rdsv3_rdma_args.
99*12198SEiji.Ota@Sun.COM  * RDS_CMSG_RDMA_DEST (recvmsg, sendmsg)
100*12198SEiji.Ota@Sun.COM  *	Kernel informs application about intended
101*12198SEiji.Ota@Sun.COM  *	source/destination of a RDMA transfer
102*12198SEiji.Ota@Sun.COM  * RDS_CMSG_RDMA_MAP (sendmsg)
103*12198SEiji.Ota@Sun.COM  *	Application asks kernel to map the given
104*12198SEiji.Ota@Sun.COM  *	memory range into a IB MR, and send the
105*12198SEiji.Ota@Sun.COM  *	R_Key along in an RDS extension header.
106*12198SEiji.Ota@Sun.COM  *	The cmsg_data is a struct rdsv3_get_mr_args,
107*12198SEiji.Ota@Sun.COM  *	the same as for the GET_MR setsockopt.
108*12198SEiji.Ota@Sun.COM  * RDS_CMSG_RDMA_STATUS (recvmsg)
109*12198SEiji.Ota@Sun.COM  *	Returns the status of a completed RDMA operation.
110*12198SEiji.Ota@Sun.COM  */
111*12198SEiji.Ota@Sun.COM #define	RDSV3_CMSG_RDMA_ARGS		1
112*12198SEiji.Ota@Sun.COM #define	RDSV3_CMSG_RDMA_DEST		2
113*12198SEiji.Ota@Sun.COM #define	RDSV3_CMSG_RDMA_MAP		3
114*12198SEiji.Ota@Sun.COM #define	RDSV3_CMSG_RDMA_STATUS		4
115*12198SEiji.Ota@Sun.COM #define	RDSV3_CMSG_CONG_UPDATE		5
116*12198SEiji.Ota@Sun.COM 
117*12198SEiji.Ota@Sun.COM /*
118*12198SEiji.Ota@Sun.COM  * RDMA related types
119*12198SEiji.Ota@Sun.COM  */
120*12198SEiji.Ota@Sun.COM 
121*12198SEiji.Ota@Sun.COM /*
122*12198SEiji.Ota@Sun.COM  * This encapsulates a remote memory location.
123*12198SEiji.Ota@Sun.COM  * In the current implementation, it contains the R_Key
124*12198SEiji.Ota@Sun.COM  * of the remote memory region, and the offset into it
125*12198SEiji.Ota@Sun.COM  * (so that the application does not have to worry about
126*12198SEiji.Ota@Sun.COM  * alignment).
127*12198SEiji.Ota@Sun.COM  */
128*12198SEiji.Ota@Sun.COM typedef uint64_t	rdsv3_rdma_cookie_t;
129*12198SEiji.Ota@Sun.COM 
130*12198SEiji.Ota@Sun.COM struct rdsv3_iovec {
131*12198SEiji.Ota@Sun.COM 	uint64_t	addr;
132*12198SEiji.Ota@Sun.COM 	uint64_t	bytes;
133*12198SEiji.Ota@Sun.COM };
134*12198SEiji.Ota@Sun.COM 
135*12198SEiji.Ota@Sun.COM struct rdsv3_get_mr_args {
136*12198SEiji.Ota@Sun.COM 	struct rdsv3_iovec vec;
137*12198SEiji.Ota@Sun.COM 	uint64_t	cookie_addr;
138*12198SEiji.Ota@Sun.COM 	uint64_t	flags;
139*12198SEiji.Ota@Sun.COM };
140*12198SEiji.Ota@Sun.COM 
141*12198SEiji.Ota@Sun.COM struct rdsv3_free_mr_args {
142*12198SEiji.Ota@Sun.COM 	rdsv3_rdma_cookie_t cookie;
143*12198SEiji.Ota@Sun.COM 	uint64_t	flags;
144*12198SEiji.Ota@Sun.COM };
145*12198SEiji.Ota@Sun.COM 
146*12198SEiji.Ota@Sun.COM struct rdsv3_rdma_args {
147*12198SEiji.Ota@Sun.COM 	rdsv3_rdma_cookie_t cookie;
148*12198SEiji.Ota@Sun.COM 	struct rdsv3_iovec remote_vec;
149*12198SEiji.Ota@Sun.COM 	uint64_t	local_vec_addr;
150*12198SEiji.Ota@Sun.COM 	uint64_t	nr_local;
151*12198SEiji.Ota@Sun.COM 	uint64_t	flags;
152*12198SEiji.Ota@Sun.COM 	uint64_t	user_token;
153*12198SEiji.Ota@Sun.COM };
154*12198SEiji.Ota@Sun.COM 
155*12198SEiji.Ota@Sun.COM struct rdsv3_rdma_notify {
156*12198SEiji.Ota@Sun.COM 	uint64_t	user_token;
157*12198SEiji.Ota@Sun.COM 	int32_t		status;
158*12198SEiji.Ota@Sun.COM };
159*12198SEiji.Ota@Sun.COM 
160*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_SUCCESS	0
161*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_REMOTE_ERROR	1
162*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_CANCELED	2
163*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_DROPPED	3
164*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_OTHER_ERROR	4
165*12198SEiji.Ota@Sun.COM 
166*12198SEiji.Ota@Sun.COM /*
167*12198SEiji.Ota@Sun.COM  * Common set of flags for all RDMA related structs
168*12198SEiji.Ota@Sun.COM  */
169*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_READWRITE	0x0001
170*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_FENCE	0x0002	/* use FENCE for immediate send */
171*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_INVALIDATE	0x0004	/* invalidate R_Key after freeing MR */
172*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_USE_ONCE	0x0008	/* free MR after use */
173*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_DONTWAIT	0x0010	/* Don't wait in SET_BARRIER */
174*12198SEiji.Ota@Sun.COM #define	RDSV3_RDMA_NOTIFY_ME	0x0020	/* Notify when operation completes */
175*12198SEiji.Ota@Sun.COM 
176*12198SEiji.Ota@Sun.COM /*
177*12198SEiji.Ota@Sun.COM  * Congestion monitoring.
178*12198SEiji.Ota@Sun.COM  * Congestion control in RDS happens at the host connection
179*12198SEiji.Ota@Sun.COM  * level by exchanging a bitmap marking congested ports.
180*12198SEiji.Ota@Sun.COM  * By default, a process sleeping in poll() is always woken
181*12198SEiji.Ota@Sun.COM  * up when the congestion map is updated.
182*12198SEiji.Ota@Sun.COM  * With explicit monitoring, an application can have more
183*12198SEiji.Ota@Sun.COM  * fine-grained control.
184*12198SEiji.Ota@Sun.COM  * The application installs a 64bit mask value in the socket,
185*12198SEiji.Ota@Sun.COM  * where each bit corresponds to a group of ports.
186*12198SEiji.Ota@Sun.COM  * When a congestion update arrives, RDS checks the set of
187*12198SEiji.Ota@Sun.COM  * ports that are now uncongested against the list bit mask
188*12198SEiji.Ota@Sun.COM  * installed in the socket, and if they overlap, we queue a
189*12198SEiji.Ota@Sun.COM  * cong_notification on the socket.
190*12198SEiji.Ota@Sun.COM  *
191*12198SEiji.Ota@Sun.COM  * To install the congestion monitor bitmask, use RDS_CONG_MONITOR
192*12198SEiji.Ota@Sun.COM  * with the 64bit mask.
193*12198SEiji.Ota@Sun.COM  * Congestion updates are received via RDS_CMSG_CONG_UPDATE
194*12198SEiji.Ota@Sun.COM  * control messages.
195*12198SEiji.Ota@Sun.COM  *
196*12198SEiji.Ota@Sun.COM  * The correspondence between bits and ports is
197*12198SEiji.Ota@Sun.COM  *	1 << (portnum % 64)
198*12198SEiji.Ota@Sun.COM  */
199*12198SEiji.Ota@Sun.COM #define	RDSV3_CONG_MONITOR_SIZE	64
200*12198SEiji.Ota@Sun.COM #define	RDSV3_CONG_MONITOR_BIT(port)	\
201*12198SEiji.Ota@Sun.COM 	(((unsigned int) port) % RDSV3_CONG_MONITOR_SIZE)
202*12198SEiji.Ota@Sun.COM #define	RDSV3_CONG_MONITOR_MASK(port) (1ULL << RDSV3_CONG_MONITOR_BIT(port))
203*12198SEiji.Ota@Sun.COM 
204*12198SEiji.Ota@Sun.COM /* rds-info related */
205*12198SEiji.Ota@Sun.COM 
206*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_FIRST		10000
207*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_COUNTERS		10000
208*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_CONNECTIONS		10001
209*12198SEiji.Ota@Sun.COM /* 10002 aka RDS_INFO_FLOWS is deprecated */
210*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_SEND_MESSAGES	10003
211*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_RETRANS_MESSAGES	10004
212*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_RECV_MESSAGES	10005
213*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_SOCKETS		10006
214*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_TCP_SOCKETS		10007
215*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_IB_CONNECTIONS	10008
216*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_CONNECTION_STATS	10009
217*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_IWARP_CONNECTIONS	10010
218*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_LAST			10010
219*12198SEiji.Ota@Sun.COM 
220*12198SEiji.Ota@Sun.COM #ifndef __lock_lint
221*12198SEiji.Ota@Sun.COM #pragma pack(1)
222*12198SEiji.Ota@Sun.COM struct rdsv3_info_counter {
223*12198SEiji.Ota@Sun.COM 	uint8_t	name[32];
224*12198SEiji.Ota@Sun.COM 	uint64_t	value;
225*12198SEiji.Ota@Sun.COM } __attribute__((packed));
226*12198SEiji.Ota@Sun.COM #pragma pack()
227*12198SEiji.Ota@Sun.COM #else
228*12198SEiji.Ota@Sun.COM struct rdsv3_info_counter {
229*12198SEiji.Ota@Sun.COM 	uint8_t	name[32];
230*12198SEiji.Ota@Sun.COM 	uint64_t	value;
231*12198SEiji.Ota@Sun.COM };
232*12198SEiji.Ota@Sun.COM #endif
233*12198SEiji.Ota@Sun.COM 
234*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_CONNECTION_FLAG_SENDING	0x01
235*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_CONNECTION_FLAG_CONNECTING	0x02
236*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_CONNECTION_FLAG_CONNECTED	0x04
237*12198SEiji.Ota@Sun.COM 
238*12198SEiji.Ota@Sun.COM #ifndef __lock_lint
239*12198SEiji.Ota@Sun.COM #pragma pack(1)
240*12198SEiji.Ota@Sun.COM struct rdsv3_info_connection {
241*12198SEiji.Ota@Sun.COM 	uint64_t	next_tx_seq;
242*12198SEiji.Ota@Sun.COM 	uint64_t	next_rx_seq;
243*12198SEiji.Ota@Sun.COM 	uint32_t	laddr;			/* network order */
244*12198SEiji.Ota@Sun.COM 	uint32_t	faddr;			/* network order */
245*12198SEiji.Ota@Sun.COM 	uint8_t		transport[15];		/* null term ascii */
246*12198SEiji.Ota@Sun.COM 	uint8_t		flags;
247*12198SEiji.Ota@Sun.COM } __attribute__((packed));
248*12198SEiji.Ota@Sun.COM #pragma pack()
249*12198SEiji.Ota@Sun.COM #else
250*12198SEiji.Ota@Sun.COM struct rdsv3_info_connection {
251*12198SEiji.Ota@Sun.COM 	uint64_t	next_tx_seq;
252*12198SEiji.Ota@Sun.COM 	uint64_t	next_rx_seq;
253*12198SEiji.Ota@Sun.COM 	uint32_t	laddr;			/* network order */
254*12198SEiji.Ota@Sun.COM 	uint32_t	faddr;			/* network order */
255*12198SEiji.Ota@Sun.COM 	uint8_t		transport[15];		/* null term ascii */
256*12198SEiji.Ota@Sun.COM 	uint8_t		flags;
257*12198SEiji.Ota@Sun.COM };
258*12198SEiji.Ota@Sun.COM #endif
259*12198SEiji.Ota@Sun.COM 
260*12198SEiji.Ota@Sun.COM #ifndef __lock_lint
261*12198SEiji.Ota@Sun.COM #pragma pack(1)
262*12198SEiji.Ota@Sun.COM struct rdsv3_info_flow {
263*12198SEiji.Ota@Sun.COM 	uint32_t	laddr;			/* network order */
264*12198SEiji.Ota@Sun.COM 	uint32_t	faddr;			/* network order */
265*12198SEiji.Ota@Sun.COM 	uint32_t	bytes;
266*12198SEiji.Ota@Sun.COM 	uint16_t	lport;			/* network order */
267*12198SEiji.Ota@Sun.COM 	uint16_t	fport;			/* network order */
268*12198SEiji.Ota@Sun.COM } __attribute__((packed));
269*12198SEiji.Ota@Sun.COM #pragma pack()
270*12198SEiji.Ota@Sun.COM #else
271*12198SEiji.Ota@Sun.COM struct rdsv3_info_flow {
272*12198SEiji.Ota@Sun.COM 	uint32_t	laddr;			/* network order */
273*12198SEiji.Ota@Sun.COM 	uint32_t	faddr;			/* network order */
274*12198SEiji.Ota@Sun.COM 	uint32_t	bytes;
275*12198SEiji.Ota@Sun.COM 	uint16_t	lport;			/* network order */
276*12198SEiji.Ota@Sun.COM 	uint16_t	fport;			/* network order */
277*12198SEiji.Ota@Sun.COM };
278*12198SEiji.Ota@Sun.COM #endif
279*12198SEiji.Ota@Sun.COM 
280*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_MESSAGE_FLAG_ACK		0x01
281*12198SEiji.Ota@Sun.COM #define	RDSV3_INFO_MESSAGE_FLAG_FAST_ACK		0x02
282*12198SEiji.Ota@Sun.COM 
283*12198SEiji.Ota@Sun.COM #ifndef __lock_lint
284*12198SEiji.Ota@Sun.COM #pragma pack(1)
285*12198SEiji.Ota@Sun.COM struct rdsv3_info_message {
286*12198SEiji.Ota@Sun.COM 	uint64_t	seq;
287*12198SEiji.Ota@Sun.COM 	uint32_t	len;
288*12198SEiji.Ota@Sun.COM 	uint32_t	laddr;			/* network order */
289*12198SEiji.Ota@Sun.COM 	uint32_t	faddr;			/* network order */
290*12198SEiji.Ota@Sun.COM 	uint16_t	lport;			/* network order */
291*12198SEiji.Ota@Sun.COM 	uint16_t	fport;			/* network order */
292*12198SEiji.Ota@Sun.COM 	uint8_t		flags;
293*12198SEiji.Ota@Sun.COM } __attribute__((packed));
294*12198SEiji.Ota@Sun.COM #pragma pack()
295*12198SEiji.Ota@Sun.COM #else
296*12198SEiji.Ota@Sun.COM struct rdsv3_info_message {
297*12198SEiji.Ota@Sun.COM 	uint64_t	seq;
298*12198SEiji.Ota@Sun.COM 	uint32_t	len;
299*12198SEiji.Ota@Sun.COM 	uint32_t	laddr;			/* network order */
300*12198SEiji.Ota@Sun.COM 	uint32_t	faddr;			/* network order */
301*12198SEiji.Ota@Sun.COM 	uint16_t	lport;			/* network order */
302*12198SEiji.Ota@Sun.COM 	uint16_t	fport;			/* network order */
303*12198SEiji.Ota@Sun.COM 	uint8_t		flags;
304*12198SEiji.Ota@Sun.COM };
305*12198SEiji.Ota@Sun.COM #endif
306*12198SEiji.Ota@Sun.COM 
307*12198SEiji.Ota@Sun.COM #ifndef __lock_lint
308*12198SEiji.Ota@Sun.COM #pragma pack(1)
309*12198SEiji.Ota@Sun.COM struct rdsv3_info_socket {
310*12198SEiji.Ota@Sun.COM 	uint32_t	sndbuf;
311*12198SEiji.Ota@Sun.COM 	uint32_t	bound_addr;		/* network order */
312*12198SEiji.Ota@Sun.COM 	uint32_t	connected_addr;		/* network order */
313*12198SEiji.Ota@Sun.COM 	uint16_t	bound_port;		/* network order */
314*12198SEiji.Ota@Sun.COM 	uint16_t	connected_port;		/* network order */
315*12198SEiji.Ota@Sun.COM 	uint32_t	rcvbuf;
316*12198SEiji.Ota@Sun.COM 	uint64_t	inum;
317*12198SEiji.Ota@Sun.COM } __attribute__((packed));
318*12198SEiji.Ota@Sun.COM #pragma pack()
319*12198SEiji.Ota@Sun.COM #else
320*12198SEiji.Ota@Sun.COM struct rdsv3_info_socket {
321*12198SEiji.Ota@Sun.COM 	uint32_t	sndbuf;
322*12198SEiji.Ota@Sun.COM 	uint32_t	bound_addr;		/* network order */
323*12198SEiji.Ota@Sun.COM 	uint32_t	connected_addr;		/* network order */
324*12198SEiji.Ota@Sun.COM 	uint16_t	bound_port;		/* network order */
325*12198SEiji.Ota@Sun.COM 	uint16_t	connected_port;		/* network order */
326*12198SEiji.Ota@Sun.COM 	uint32_t	rcvbuf;
327*12198SEiji.Ota@Sun.COM 	uint64_t	inum;
328*12198SEiji.Ota@Sun.COM };
329*12198SEiji.Ota@Sun.COM #endif
330*12198SEiji.Ota@Sun.COM 
331*12198SEiji.Ota@Sun.COM #ifndef __lock_lint
332*12198SEiji.Ota@Sun.COM #pragma pack(1)
333*12198SEiji.Ota@Sun.COM struct rdsv3_info_socket_v1 {
334*12198SEiji.Ota@Sun.COM 	uint32_t	sndbuf;
335*12198SEiji.Ota@Sun.COM 	uint32_t	bound_addr;		/* network order */
336*12198SEiji.Ota@Sun.COM 	uint32_t	connected_addr;		/* network order */
337*12198SEiji.Ota@Sun.COM 	uint16_t	bound_port;		/* network order */
338*12198SEiji.Ota@Sun.COM 	uint16_t	connected_port;		/* network order */
339*12198SEiji.Ota@Sun.COM 	uint32_t	rcvbuf;
340*12198SEiji.Ota@Sun.COM } __attribute__((packed));
341*12198SEiji.Ota@Sun.COM #pragma pack()
342*12198SEiji.Ota@Sun.COM #else
343*12198SEiji.Ota@Sun.COM struct rdsv3_info_socket_v1 {
344*12198SEiji.Ota@Sun.COM 	uint32_t	sndbuf;
345*12198SEiji.Ota@Sun.COM 	uint32_t	bound_addr;		/* network order */
346*12198SEiji.Ota@Sun.COM 	uint32_t	connected_addr;		/* network order */
347*12198SEiji.Ota@Sun.COM 	uint16_t	bound_port;		/* network order */
348*12198SEiji.Ota@Sun.COM 	uint16_t	connected_port;		/* network order */
349*12198SEiji.Ota@Sun.COM 	uint32_t	rcvbuf;
350*12198SEiji.Ota@Sun.COM };
351*12198SEiji.Ota@Sun.COM #endif
352*12198SEiji.Ota@Sun.COM 
353*12198SEiji.Ota@Sun.COM #define	RDS_IB_GID_LEN	16
354*12198SEiji.Ota@Sun.COM struct rdsv3_info_rdma_connection {
355*12198SEiji.Ota@Sun.COM 	uint32_t	src_addr;		/* network order */
356*12198SEiji.Ota@Sun.COM 	uint32_t	dst_addr;		/* network order */
357*12198SEiji.Ota@Sun.COM 	uint8_t		src_gid[RDS_IB_GID_LEN];
358*12198SEiji.Ota@Sun.COM 	uint8_t		dst_gid[RDS_IB_GID_LEN];
359*12198SEiji.Ota@Sun.COM 
360*12198SEiji.Ota@Sun.COM 	uint32_t	max_send_wr;
361*12198SEiji.Ota@Sun.COM 	uint32_t	max_recv_wr;
362*12198SEiji.Ota@Sun.COM 	uint32_t	max_send_sge;
363*12198SEiji.Ota@Sun.COM 	uint32_t	rdma_mr_max;
364*12198SEiji.Ota@Sun.COM 	uint32_t	rdma_mr_size;
365*12198SEiji.Ota@Sun.COM };
366*12198SEiji.Ota@Sun.COM 
367*12198SEiji.Ota@Sun.COM #define	rdsv3_info_ib_connection rdsv3_info_rdma_connection
368*12198SEiji.Ota@Sun.COM #define	rdma_fmr_max rdma_mr_max
369*12198SEiji.Ota@Sun.COM #define	rdma_fmr_size rdma_mr_size
370*12198SEiji.Ota@Sun.COM 
371*12198SEiji.Ota@Sun.COM #ifdef	__cplusplus
372*12198SEiji.Ota@Sun.COM }
373*12198SEiji.Ota@Sun.COM #endif
374*12198SEiji.Ota@Sun.COM 
375*12198SEiji.Ota@Sun.COM #endif /* _RDSV3_RDS_H */
376