xref: /illumos-gate/usr/src/uts/common/sys/ib/clients/of/sol_ofs/sol_ib_cma.h (revision c39526b769298791ff5b0b6c5e761f49aabaeb4e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef	_SYS_IB_CLIENTS_OF_SOL_OFS_SOL_IB_CMA_H
27 #define	_SYS_IB_CLIENTS_OF_SOL_OFS_SOL_IB_CMA_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <sys/types.h>
34 #include <sys/modctl.h>
35 #include <sys/errno.h>
36 #include <sys/stat.h>
37 #include <sys/ddi.h>
38 #include <sys/sunddi.h>
39 #include <sys/modctl.h>
40 #include <sys/file.h>
41 #include <sys/ib/ibtl/ibvti.h>
42 
43 /* Global qkey for UDP QPs and multicast groups. */
44 #define	RDMA_UDP_QKEY 0x01234567
45 
46 typedef struct {
47 	uint64_t		dev_node_guid;
48 	uint8_t			dev_port_num;
49 	uint16_t		dev_pkey_ix;
50 	ib_pkey_t		dev_pkey;
51 	ib_gid_t		dev_sgid;
52 	ibt_ip_addr_t		dev_ipaddr;
53 } ibcma_dev_t;
54 
55 #define	IBCMA_LOCAL_ADDR_SET_FLAG	0x01
56 #define	IBCMA_REMOTE_ADDR_SET_FLAG	0x02
57 #define	IBCMA_LOCAL_ADDR_IFADDRANY	0x10
58 
59 typedef struct ibcma_chan_s {
60 	/* Pathinfo for CM ID */
61 	ibt_path_info_t		*chan_pathp;
62 	uint8_t			chan_numpaths;
63 	size_t			chan_path_size;
64 
65 	/* Address & Service ID for CM ID */
66 	ibt_ip_addr_t		chan_local_addr;
67 	ibt_ip_addr_t		chan_remote_addr;
68 	in_port_t		chan_port;
69 	ib_svc_id_t		chan_sid;
70 	uint8_t			chan_addr_flag;
71 
72 	/* RC REQ information */
73 	struct rdma_cm_id	*chan_req_idp;	/* Chan created for Req */
74 	ibt_adds_vect_t		chan_rcreq_addr;
75 	ib_qpn_t		chan_rcreq_qpn;
76 	uint8_t			chan_rcreq_ra_in;
77 	ibt_ofuvcm_req_data_t	chan_rtr_data;
78 
79 	/* QP Information for CM ID */
80 	uint8_t			chan_qpmodifyflag;
81 
82 	/* Local device Information */
83 	ibcma_dev_t		*chan_devp;
84 
85 	/* Multicast list for the CM ID */
86 	genlist_t		chan_mcast_list;
87 	int			chan_mcast_cnt;
88 } ibcma_chan_t;
89 
90 typedef struct ibcma_mcast_s {
91 	struct rdma_cm_id	*mcast_idp;
92 	void			*mcast_ctx;
93 	struct sockaddr_in6	mcast_addr;
94 	ib_gid_t		mcast_gid;
95 } ibcma_mcast_t;
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* _SYS_IB_CLIENTS_OF_SOL_OFS_SOL_IB_CMA_H */
102