xref: /freebsd/sys/ofed/include/uapi/rdma/ib_user_sa.h (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3  *
4  * Copyright (c) 2005 Intel Corporation.  All rights reserved.
5  *
6  * This software is available to you under a choice of one of two
7  * licenses.  You may choose to be licensed under the terms of the GNU
8  * General Public License (GPL) Version 2, available from the file
9  * COPYING in the main directory of this source tree, or the
10  * OpenIB.org BSD license below:
11  *
12  *     Redistribution and use in source and binary forms, with or
13  *     without modification, are permitted provided that the following
14  *     conditions are met:
15  *
16  *      - Redistributions of source code must retain the above
17  *        copyright notice, this list of conditions and the following
18  *        disclaimer.
19  *
20  *      - Redistributions in binary form must reproduce the above
21  *        copyright notice, this list of conditions and the following
22  *        disclaimer in the documentation and/or other materials
23  *        provided with the distribution.
24  *
25  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32  * SOFTWARE.
33  */
34 
35 #ifndef IB_USER_SA_H
36 #define IB_USER_SA_H
37 
38 #ifdef _KERNEL
39 #include <linux/types.h>
40 #else
41 #include <infiniband/types.h>
42 #endif
43 
44 enum {
45 	IB_PATH_GMP		= 1,
46 	IB_PATH_PRIMARY		= (1<<1),
47 	IB_PATH_ALTERNATE	= (1<<2),
48 	IB_PATH_OUTBOUND	= (1<<3),
49 	IB_PATH_INBOUND		= (1<<4),
50 	IB_PATH_INBOUND_REVERSE = (1<<5),
51 	IB_PATH_BIDIRECTIONAL	= IB_PATH_OUTBOUND | IB_PATH_INBOUND_REVERSE
52 };
53 
54 struct ib_path_rec_data {
55 	__u32	flags;
56 	__u32	reserved;
57 	__u32	path_rec[16];
58 };
59 
60 struct ib_user_path_rec {
61 	__u8	dgid[16];
62 	__u8	sgid[16];
63 	__be16	dlid;
64 	__be16	slid;
65 	__u32	raw_traffic;
66 	__be32	flow_label;
67 	__u32	reversible;
68 	__u32	mtu;
69 	__be16	pkey;
70 	__u8	hop_limit;
71 	__u8	traffic_class;
72 	__u8	numb_path;
73 	__u8	sl;
74 	__u8	mtu_selector;
75 	__u8	rate_selector;
76 	__u8	rate;
77 	__u8	packet_life_time_selector;
78 	__u8	packet_life_time;
79 	__u8	preference;
80 };
81 
82 #endif /* IB_USER_SA_H */
83