2 * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
3 * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
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:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
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.
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
36 #if !defined(__IB_TYPES_H__)
37 #define __IB_TYPES_H__
40 #include <complib/cl_types.h>
41 #include <complib/cl_byteswap.h>
44 # define BEGIN_C_DECLS extern "C" {
45 # define END_C_DECLS }
46 #else /* !__cplusplus */
47 # define BEGIN_C_DECLS
49 #endif /* __cplusplus */
52 #if defined( WIN32 ) || defined( _WIN64 )
53 #if defined( EXPORT_AL_SYMBOLS )
54 #define OSM_EXPORT __declspec(dllexport)
56 #define OSM_EXPORT __declspec(dllimport)
58 #define OSM_API __stdcall
59 #define OSM_CDECL __cdecl
61 #define OSM_EXPORT extern
66 /****h* IBA Base/Constants
71 * The following constants are used throughout the IBA code base.
73 * Definitions are from the InfiniBand Architecture Specification v1.2
76 /****d* IBA Base: Constants/MAD_BLOCK_SIZE
81 * Size of a non-RMPP MAD datagram.
85 #define MAD_BLOCK_SIZE 256
87 /****d* IBA Base: Constants/MAD_RMPP_HDR_SIZE
92 * Size of an RMPP header, including the common MAD header.
96 #define MAD_RMPP_HDR_SIZE 36
98 /****d* IBA Base: Constants/MAD_RMPP_DATA_SIZE
103 * Size of an RMPP transaction data section.
107 #define MAD_RMPP_DATA_SIZE (MAD_BLOCK_SIZE - MAD_RMPP_HDR_SIZE)
109 /****d* IBA Base: Constants/MAD_BLOCK_GRH_SIZE
114 * Size of a MAD datagram, including the GRH.
118 #define MAD_BLOCK_GRH_SIZE 296
120 /****d* IBA Base: Constants/IB_LID_PERMISSIVE
129 #define IB_LID_PERMISSIVE 0xFFFF
131 /****d* IBA Base: Constants/IB_DEFAULT_PKEY
136 * P_Key value for the default partition.
140 #define IB_DEFAULT_PKEY 0xFFFF
142 /****d* IBA Base: Constants/IB_QP1_WELL_KNOWN_Q_KEY
144 * IB_QP1_WELL_KNOWN_Q_KEY
147 * Well-known Q_Key for QP1 privileged mode access (15.4.2).
151 #define IB_QP1_WELL_KNOWN_Q_KEY CL_HTON32(0x80010000)
154 #define IB_QP1 CL_HTON32(1)
155 #define IB_QP_PRIVILEGED_Q_KEY CL_HTON32(0x80000000)
156 /****d* IBA Base: Constants/IB_LID_UCAST_START
161 * Lowest valid unicast LID value.
165 #define IB_LID_UCAST_START_HO 0x0001
166 #define IB_LID_UCAST_START (CL_HTON16(IB_LID_UCAST_START_HO))
168 /****d* IBA Base: Constants/IB_LID_UCAST_END
173 * Highest valid unicast LID value.
177 #define IB_LID_UCAST_END_HO 0xBFFF
178 #define IB_LID_UCAST_END (CL_HTON16(IB_LID_UCAST_END_HO))
180 /****d* IBA Base: Constants/IB_LID_MCAST_START
185 * Lowest valid multicast LID value.
189 #define IB_LID_MCAST_START_HO 0xC000
190 #define IB_LID_MCAST_START (CL_HTON16(IB_LID_MCAST_START_HO))
192 /****d* IBA Base: Constants/IB_LID_MCAST_END
197 * Highest valid multicast LID value.
201 #define IB_LID_MCAST_END_HO 0xFFFE
202 #define IB_LID_MCAST_END (CL_HTON16(IB_LID_MCAST_END_HO))
204 /****d* IBA Base: Constants/IB_DEFAULT_SUBNET_PREFIX
206 * IB_DEFAULT_SUBNET_PREFIX
209 * Default subnet GID prefix.
213 #define IB_DEFAULT_SUBNET_PREFIX (CL_HTON64(0xFE80000000000000ULL))
215 /****d* IBA Base: Constants/IB_NODE_NUM_PORTS_MAX
217 * IB_NODE_NUM_PORTS_MAX
220 * Maximum number of ports in a single node (14.2.5.7).
223 #define IB_NODE_NUM_PORTS_MAX 0xFE
225 /****d* IBA Base: Constants/IB_INVALID_PORT_NUM
227 * IB_INVALID_PORT_NUM
230 * Value used to indicate an invalid port number (14.2.5.10).
234 #define IB_INVALID_PORT_NUM 0xFF
236 /****d* IBA Base: Constants/IB_SUBNET_PATH_HOPS_MAX
238 * IB_SUBNET_PATH_HOPS_MAX
241 * Maximum number of directed route switch hops in a subnet (14.2.1.2).
245 #define IB_SUBNET_PATH_HOPS_MAX 64
247 /****d* IBA Base: Constants/IB_HOPLIMIT_MAX
252 * Maximum number of router hops allowed.
256 #define IB_HOPLIMIT_MAX 255
258 /****d* IBA Base: Constants/IB_MC_SCOPE_*
263 * Scope component definitions from IBA 1.2 (Table 3 p. 146)
265 #define IB_MC_SCOPE_LINK_LOCAL 0x2
266 #define IB_MC_SCOPE_SITE_LOCAL 0x5
267 #define IB_MC_SCOPE_ORG_LOCAL 0x8
268 #define IB_MC_SCOPE_GLOBAL 0xE
270 /****d* IBA Base: Constants/IB_PKEY_MAX_BLOCKS
275 * Maximum number of PKEY blocks (14.2.5.7).
279 #define IB_PKEY_MAX_BLOCKS 2048
281 /****d* IBA Base: Constants/IB_MCAST_MAX_BLOCK_ID
283 * IB_MCAST_MAX_BLOCK_ID
286 * Maximum number of Multicast port mask blocks
290 #define IB_MCAST_MAX_BLOCK_ID 511
292 /****d* IBA Base: Constants/IB_MCAST_BLOCK_ID_MASK_HO
294 * IB_MCAST_BLOCK_ID_MASK_HO
297 * Mask (host order) to recover the Multicast block ID.
301 #define IB_MCAST_BLOCK_ID_MASK_HO 0x000001FF
303 /****d* IBA Base: Constants/IB_MCAST_BLOCK_SIZE
305 * IB_MCAST_BLOCK_SIZE
308 * Number of port mask entries in a multicast forwarding table block.
312 #define IB_MCAST_BLOCK_SIZE 32
314 /****d* IBA Base: Constants/IB_MCAST_MASK_SIZE
319 * Number of port mask bits in each entry in the multicast forwarding table.
323 #define IB_MCAST_MASK_SIZE 16
325 /****d* IBA Base: Constants/IB_MCAST_POSITION_MASK_HO
327 * IB_MCAST_POSITION_MASK_HO
330 * Mask (host order) to recover the multicast block position.
334 #define IB_MCAST_POSITION_MASK_HO 0xF0000000
336 /****d* IBA Base: Constants/IB_MCAST_POSITION_MAX
338 * IB_MCAST_POSITION_MAX
341 * Maximum value for the multicast block position.
345 #define IB_MCAST_POSITION_MAX 0xF
347 /****d* IBA Base: Constants/IB_MCAST_POSITION_SHIFT
349 * IB_MCAST_POSITION_SHIFT
352 * Shift value to normalize the multicast block position value.
356 #define IB_MCAST_POSITION_SHIFT 28
358 /****d* IBA Base: Constants/IB_PKEY_ENTRIES_MAX
360 * IB_PKEY_ENTRIES_MAX
363 * Maximum number of PKEY entries per port (14.2.5.7).
367 #define IB_PKEY_ENTRIES_MAX (IB_PKEY_MAX_BLOCKS * IB_NUM_PKEY_ELEMENTS_IN_BLOCK)
369 /****d* IBA Base: Constants/IB_PKEY_BASE_MASK
374 * Masks for the base P_Key value given a P_Key Entry.
378 #define IB_PKEY_BASE_MASK (CL_HTON16(0x7FFF))
380 /****d* IBA Base: Constants/IB_PKEY_TYPE_MASK
385 * Masks for the P_Key membership type given a P_Key Entry.
389 #define IB_PKEY_TYPE_MASK (CL_HTON16(0x8000))
391 /****d* IBA Base: Constants/IB_DEFAULT_PARTIAL_PKEY
393 * IB_DEFAULT_PARTIAL_PKEY
396 * 0x7FFF in network order
400 #define IB_DEFAULT_PARTIAL_PKEY (CL_HTON16(0x7FFF))
402 /****d* IBA Base: Constants/IB_MCLASS_SUBN_LID
407 * Subnet Management Class, Subnet Manager LID routed (13.4.4)
411 #define IB_MCLASS_SUBN_LID 0x01
413 /****d* IBA Base: Constants/IB_MCLASS_SUBN_DIR
418 * Subnet Management Class, Subnet Manager directed route (13.4.4)
422 #define IB_MCLASS_SUBN_DIR 0x81
424 /****d* IBA Base: Constants/IB_MCLASS_SUBN_ADM
429 * Management Class, Subnet Administration (13.4.4)
433 #define IB_MCLASS_SUBN_ADM 0x03
435 /****d* IBA Base: Constants/IB_MCLASS_PERF
440 * Management Class, Performance Management (13.4.4)
444 #define IB_MCLASS_PERF 0x04
446 /****d* IBA Base: Constants/IB_MCLASS_BM
451 * Management Class, Baseboard Management (13.4.4)
455 #define IB_MCLASS_BM 0x05
457 /****d* IBA Base: Constants/IB_MCLASS_DEV_MGMT
462 * Management Class, Device Management (13.4.4)
466 #define IB_MCLASS_DEV_MGMT 0x06
468 /****d* IBA Base: Constants/IB_MCLASS_COMM_MGMT
470 * IB_MCLASS_COMM_MGMT
473 * Management Class, Communication Management (13.4.4)
477 #define IB_MCLASS_COMM_MGMT 0x07
479 /****d* IBA Base: Constants/IB_MCLASS_SNMP
484 * Management Class, SNMP Tunneling (13.4.4)
488 #define IB_MCLASS_SNMP 0x08
490 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_LOW_RANGE_MIN
492 * IB_MCLASS_VENDOR_LOW_RANGE_MIN
495 * Management Class, Vendor Specific Low Range Start
499 #define IB_MCLASS_VENDOR_LOW_RANGE_MIN 0x09
501 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_LOW_RANGE_MAX
503 * IB_MCLASS_VENDOR_LOW_RANGE_MAX
506 * Management Class, Vendor Specific Low Range End
510 #define IB_MCLASS_VENDOR_LOW_RANGE_MAX 0x0f
512 /****d* IBA Base: Constants/IB_MCLASS_DEV_ADM
517 * Management Class, Device Administration
521 #define IB_MCLASS_DEV_ADM 0x10
523 /****d* IBA Base: Constants/IB_MCLASS_BIS
528 * Management Class, BIS
532 #define IB_MCLASS_BIS 0x12
534 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MIN
536 * IB_MCLASS_VENDOR_HIGH_RANGE_MIN
539 * Management Class, Vendor Specific High Range Start
543 #define IB_MCLASS_VENDOR_HIGH_RANGE_MIN 0x30
545 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MAX
547 * IB_MCLASS_VENDOR_HIGH_RANGE_MAX
550 * Management Class, Vendor Specific High Range End
554 #define IB_MCLASS_VENDOR_HIGH_RANGE_MAX 0x4f
556 /****f* IBA Base: Types/ib_class_is_vendor_specific_low
558 * ib_class_is_vendor_specific_low
561 * Indicates if the Class Code if a vendor specific class from
566 static inline boolean_t OSM_API
567 ib_class_is_vendor_specific_low(IN const uint8_t class_code)
569 return ((class_code >= IB_MCLASS_VENDOR_LOW_RANGE_MIN) &&
570 (class_code <= IB_MCLASS_VENDOR_LOW_RANGE_MAX));
576 * [in] The Management Datagram Class Code
579 * TRUE if the class is in the Low range of Vendor Specific MADs
585 * IB_MCLASS_VENDOR_LOW_RANGE_MIN, IB_MCLASS_VENDOR_LOW_RANGE_MAX
588 /****f* IBA Base: Types/ib_class_is_vendor_specific_high
590 * ib_class_is_vendor_specific_high
593 * Indicates if the Class Code if a vendor specific class from
598 static inline boolean_t OSM_API
599 ib_class_is_vendor_specific_high(IN const uint8_t class_code)
601 return ((class_code >= IB_MCLASS_VENDOR_HIGH_RANGE_MIN) &&
602 (class_code <= IB_MCLASS_VENDOR_HIGH_RANGE_MAX));
608 * [in] The Management Datagram Class Code
611 * TRUE if the class is in the High range of Vendor Specific MADs
617 * IB_MCLASS_VENDOR_HIGH_RANGE_MIN, IB_MCLASS_VENDOR_HIGH_RANGE_MAX
620 /****f* IBA Base: Types/ib_class_is_vendor_specific
622 * ib_class_is_vendor_specific
625 * Indicates if the Class Code if a vendor specific class
629 static inline boolean_t OSM_API
630 ib_class_is_vendor_specific(IN const uint8_t class_code)
632 return (ib_class_is_vendor_specific_low(class_code) ||
633 ib_class_is_vendor_specific_high(class_code));
639 * [in] The Management Datagram Class Code
642 * TRUE if the class is a Vendor Specific MAD
648 * ib_class_is_vendor_specific_low, ib_class_is_vendor_specific_high
651 /****f* IBA Base: Types/ib_class_is_rmpp
656 * Indicates if the Class Code supports RMPP
660 static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
662 return ((class_code == IB_MCLASS_SUBN_ADM) ||
663 (class_code == IB_MCLASS_DEV_MGMT) ||
664 (class_code == IB_MCLASS_DEV_ADM) ||
665 (class_code == IB_MCLASS_BIS) ||
666 ib_class_is_vendor_specific_high(class_code));
672 * [in] The Management Datagram Class Code
675 * TRUE if the class supports RMPP
686 /****d* IBA Base: Constants/IB_MAX_METHOD
691 * Total number of methods available to a class, not including the R-bit.
695 #define IB_MAX_METHODS 128
698 /****d* IBA Base: Constants/IB_MAD_METHOD_RESP_MASK
700 * IB_MAD_METHOD_RESP_MASK
703 * Response mask to extract 'R' bit from the method field. (13.4.5)
707 #define IB_MAD_METHOD_RESP_MASK 0x80
710 /****d* IBA Base: Constants/IB_MAD_METHOD_GET
715 * Get() Method (13.4.5)
719 #define IB_MAD_METHOD_GET 0x01
722 /****d* IBA Base: Constants/IB_MAD_METHOD_SET
727 * Set() Method (13.4.5)
731 #define IB_MAD_METHOD_SET 0x02
734 /****d* IBA Base: Constants/IB_MAD_METHOD_GET_RESP
736 * IB_MAD_METHOD_GET_RESP
739 * GetResp() Method (13.4.5)
743 #define IB_MAD_METHOD_GET_RESP 0x81
746 #define IB_MAD_METHOD_DELETE 0x15
748 /****d* IBA Base: Constants/IB_MAD_METHOD_GETTABLE
750 * IB_MAD_METHOD_GETTABLE
753 * SubnAdmGetTable() Method (15.2.2)
757 #define IB_MAD_METHOD_GETTABLE 0x12
760 /****d* IBA Base: Constants/IB_MAD_METHOD_GETTABLE_RESP
762 * IB_MAD_METHOD_GETTABLE_RESP
765 * SubnAdmGetTableResp() Method (15.2.2)
769 #define IB_MAD_METHOD_GETTABLE_RESP 0x92
773 #define IB_MAD_METHOD_GETTRACETABLE 0x13
774 #define IB_MAD_METHOD_GETMULTI 0x14
775 #define IB_MAD_METHOD_GETMULTI_RESP 0x94
777 /****d* IBA Base: Constants/IB_MAD_METHOD_SEND
782 * Send() Method (13.4.5)
786 #define IB_MAD_METHOD_SEND 0x03
789 /****d* IBA Base: Constants/IB_MAD_METHOD_TRAP
794 * Trap() Method (13.4.5)
798 #define IB_MAD_METHOD_TRAP 0x05
801 /****d* IBA Base: Constants/IB_MAD_METHOD_REPORT
803 * IB_MAD_METHOD_REPORT
806 * Report() Method (13.4.5)
810 #define IB_MAD_METHOD_REPORT 0x06
813 /****d* IBA Base: Constants/IB_MAD_METHOD_REPORT_RESP
815 * IB_MAD_METHOD_REPORT_RESP
818 * ReportResp() Method (13.4.5)
822 #define IB_MAD_METHOD_REPORT_RESP 0x86
825 /****d* IBA Base: Constants/IB_MAD_METHOD_TRAP_REPRESS
827 * IB_MAD_METHOD_TRAP_REPRESS
830 * TrapRepress() Method (13.4.5)
834 #define IB_MAD_METHOD_TRAP_REPRESS 0x07
837 /****d* IBA Base: Constants/IB_MAD_STATUS_BUSY
842 * Temporarily busy, MAD discarded (13.4.7)
846 #define IB_MAD_STATUS_BUSY (CL_HTON16(0x0001))
849 /****d* IBA Base: Constants/IB_MAD_STATUS_REDIRECT
851 * IB_MAD_STATUS_REDIRECT
854 * QP Redirection required (13.4.7)
858 #define IB_MAD_STATUS_REDIRECT (CL_HTON16(0x0002))
861 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_CLASS_VER
863 * IB_MAD_STATUS_UNSUP_CLASS_VER
866 * Unsupported class version (13.4.7)
870 #define IB_MAD_STATUS_UNSUP_CLASS_VER (CL_HTON16(0x0004))
873 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_METHOD
875 * IB_MAD_STATUS_UNSUP_METHOD
878 * Unsupported method (13.4.7)
882 #define IB_MAD_STATUS_UNSUP_METHOD (CL_HTON16(0x0008))
885 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_METHOD_ATTR
887 * IB_MAD_STATUS_UNSUP_METHOD_ATTR
890 * Unsupported method/attribute combination (13.4.7)
894 #define IB_MAD_STATUS_UNSUP_METHOD_ATTR (CL_HTON16(0x000C))
897 /****d* IBA Base: Constants/IB_MAD_STATUS_INVALID_FIELD
899 * IB_MAD_STATUS_INVALID_FIELD
902 * Attribute contains one or more invalid fields (13.4.7)
906 #define IB_MAD_STATUS_INVALID_FIELD (CL_HTON16(0x001C))
909 #define IB_MAD_STATUS_CLASS_MASK (CL_HTON16(0xFF00))
911 #define IB_SA_MAD_STATUS_SUCCESS (CL_HTON16(0x0000))
912 #define IB_SA_MAD_STATUS_NO_RESOURCES (CL_HTON16(0x0100))
913 #define IB_SA_MAD_STATUS_REQ_INVALID (CL_HTON16(0x0200))
914 #define IB_SA_MAD_STATUS_NO_RECORDS (CL_HTON16(0x0300))
915 #define IB_SA_MAD_STATUS_TOO_MANY_RECORDS (CL_HTON16(0x0400))
916 #define IB_SA_MAD_STATUS_INVALID_GID (CL_HTON16(0x0500))
917 #define IB_SA_MAD_STATUS_INSUF_COMPS (CL_HTON16(0x0600))
918 #define IB_SA_MAD_STATUS_DENIED (CL_HTON16(0x0700))
919 #define IB_SA_MAD_STATUS_PRIO_SUGGESTED (CL_HTON16(0x0800))
921 #define IB_DM_MAD_STATUS_NO_IOC_RESP (CL_HTON16(0x0100))
922 #define IB_DM_MAD_STATUS_NO_SVC_ENTRIES (CL_HTON16(0x0200))
923 #define IB_DM_MAD_STATUS_IOC_FAILURE (CL_HTON16(0x8000))
925 /****d* IBA Base: Constants/IB_MAD_ATTR_CLASS_PORT_INFO
927 * IB_MAD_ATTR_CLASS_PORT_INFO
930 * ClassPortInfo attribute (13.4.8)
934 #define IB_MAD_ATTR_CLASS_PORT_INFO (CL_HTON16(0x0001))
937 /****d* IBA Base: Constants/IB_MAD_ATTR_NOTICE
942 * Notice attribute (13.4.8)
946 #define IB_MAD_ATTR_NOTICE (CL_HTON16(0x0002))
949 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO
951 * IB_MAD_ATTR_INFORM_INFO
954 * InformInfo attribute (13.4.8)
958 #define IB_MAD_ATTR_INFORM_INFO (CL_HTON16(0x0003))
961 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_DESC
963 * IB_MAD_ATTR_NODE_DESC
966 * NodeDescription attribute (14.2.5)
970 #define IB_MAD_ATTR_NODE_DESC (CL_HTON16(0x0010))
972 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_SMPL_CTRL
974 * IB_MAD_ATTR_PORT_SMPL_CTRL
977 * PortSamplesControl attribute (16.1.3)
981 #define IB_MAD_ATTR_PORT_SMPL_CTRL (CL_HTON16(0x0010))
984 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_INFO
986 * IB_MAD_ATTR_NODE_INFO
989 * NodeInfo attribute (14.2.5)
993 #define IB_MAD_ATTR_NODE_INFO (CL_HTON16(0x0011))
996 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_SMPL_RSLT
998 * IB_MAD_ATTR_PORT_SMPL_RSLT
1001 * PortSamplesResult attribute (16.1.3)
1005 #define IB_MAD_ATTR_PORT_SMPL_RSLT (CL_HTON16(0x0011))
1008 /****d* IBA Base: Constants/IB_MAD_ATTR_SWITCH_INFO
1010 * IB_MAD_ATTR_SWITCH_INFO
1013 * SwitchInfo attribute (14.2.5)
1017 #define IB_MAD_ATTR_SWITCH_INFO (CL_HTON16(0x0012))
1020 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_CNTRS
1022 * IB_MAD_ATTR_PORT_CNTRS
1025 * PortCounters attribute (16.1.3)
1029 #define IB_MAD_ATTR_PORT_CNTRS (CL_HTON16(0x0012))
1032 /****d* IBA Base: Constants/IB_MAD_ATTR_GUID_INFO
1034 * IB_MAD_ATTR_GUID_INFO
1037 * GUIDInfo attribute (14.2.5)
1041 #define IB_MAD_ATTR_GUID_INFO (CL_HTON16(0x0014))
1044 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_INFO
1046 * IB_MAD_ATTR_PORT_INFO
1049 * PortInfo attribute (14.2.5)
1053 #define IB_MAD_ATTR_PORT_INFO (CL_HTON16(0x0015))
1056 /****d* IBA Base: Constants/IB_MAD_ATTR_P_KEY_TABLE
1058 * IB_MAD_ATTR_P_KEY_TABLE
1061 * PartitionTable attribute (14.2.5)
1065 #define IB_MAD_ATTR_P_KEY_TABLE (CL_HTON16(0x0016))
1068 /****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_TABLE
1070 * IB_MAD_ATTR_SLVL_TABLE
1073 * SL VL Mapping Table attribute (14.2.5)
1077 #define IB_MAD_ATTR_SLVL_TABLE (CL_HTON16(0x0017))
1080 /****d* IBA Base: Constants/IB_MAD_ATTR_VL_ARBITRATION
1082 * IB_MAD_ATTR_VL_ARBITRATION
1085 * VL Arbitration Table attribute (14.2.5)
1089 #define IB_MAD_ATTR_VL_ARBITRATION (CL_HTON16(0x0018))
1092 /****d* IBA Base: Constants/IB_MAD_ATTR_LIN_FWD_TBL
1094 * IB_MAD_ATTR_LIN_FWD_TBL
1097 * Switch linear forwarding table
1101 #define IB_MAD_ATTR_LIN_FWD_TBL (CL_HTON16(0x0019))
1104 /****d* IBA Base: Constants/IB_MAD_ATTR_RND_FWD_TBL
1106 * IB_MAD_ATTR_RND_FWD_TBL
1109 * Switch random forwarding table
1113 #define IB_MAD_ATTR_RND_FWD_TBL (CL_HTON16(0x001A))
1116 /****d* IBA Base: Constants/IB_MAD_ATTR_MCAST_FWD_TBL
1118 * IB_MAD_ATTR_MCAST_FWD_TBL
1121 * Switch multicast forwarding table
1125 #define IB_MAD_ATTR_MCAST_FWD_TBL (CL_HTON16(0x001B))
1128 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_RECORD
1130 * IB_MAD_ATTR_NODE_RECORD
1133 * NodeRecord attribute (15.2.5)
1137 #define IB_MAD_ATTR_NODE_RECORD (CL_HTON16(0x0011))
1140 /****d* IBA Base: Constants/IB_MAD_ATTR_PORTINFO_RECORD
1142 * IB_MAD_ATTR_PORTINFO_RECORD
1145 * PortInfoRecord attribute (15.2.5)
1149 #define IB_MAD_ATTR_PORTINFO_RECORD (CL_HTON16(0x0012))
1152 /****d* IBA Base: Constants/IB_MAD_ATTR_SWITCH_INFO_RECORD
1154 * IB_MAD_ATTR_SWITCH_INFO_RECORD
1157 * SwitchInfoRecord attribute (15.2.5)
1161 #define IB_MAD_ATTR_SWITCH_INFO_RECORD (CL_HTON16(0x0014))
1164 /****d* IBA Base: Constants/IB_MAD_ATTR_LINK_RECORD
1166 * IB_MAD_ATTR_LINK_RECORD
1169 * LinkRecord attribute (15.2.5)
1173 #define IB_MAD_ATTR_LINK_RECORD (CL_HTON16(0x0020))
1176 /****d* IBA Base: Constants/IB_MAD_ATTR_SM_INFO
1178 * IB_MAD_ATTR_SM_INFO
1181 * SMInfo attribute (14.2.5)
1185 #define IB_MAD_ATTR_SM_INFO (CL_HTON16(0x0020))
1188 /****d* IBA Base: Constants/IB_MAD_ATTR_SMINFO_RECORD
1190 * IB_MAD_ATTR_SMINFO_RECORD
1193 * SMInfoRecord attribute (15.2.5)
1197 #define IB_MAD_ATTR_SMINFO_RECORD (CL_HTON16(0x0018))
1200 /****d* IBA Base: Constants/IB_MAD_ATTR_GUIDINFO_RECORD
1202 * IB_MAD_ATTR_GUIDINFO_RECORD
1205 * GuidInfoRecord attribute (15.2.5)
1209 #define IB_MAD_ATTR_GUIDINFO_RECORD (CL_HTON16(0x0030))
1212 /****d* IBA Base: Constants/IB_MAD_ATTR_VENDOR_DIAG
1214 * IB_MAD_ATTR_VENDOR_DIAG
1217 * VendorDiag attribute (14.2.5)
1221 #define IB_MAD_ATTR_VENDOR_DIAG (CL_HTON16(0x0030))
1224 /****d* IBA Base: Constants/IB_MAD_ATTR_LED_INFO
1226 * IB_MAD_ATTR_LED_INFO
1229 * LedInfo attribute (14.2.5)
1233 #define IB_MAD_ATTR_LED_INFO (CL_HTON16(0x0031))
1236 /****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_RECORD
1238 * IB_MAD_ATTR_SERVICE_RECORD
1241 * ServiceRecord attribute (15.2.5)
1245 #define IB_MAD_ATTR_SERVICE_RECORD (CL_HTON16(0x0031))
1248 /****d* IBA Base: Constants/IB_MAD_ATTR_LFT_RECORD
1250 * IB_MAD_ATTR_LFT_RECORD
1253 * LinearForwardingTableRecord attribute (15.2.5.6)
1257 #define IB_MAD_ATTR_LFT_RECORD (CL_HTON16(0x0015))
1260 /****d* IBA Base: Constants/IB_MAD_ATTR_MFT_RECORD
1262 * IB_MAD_ATTR_MFT_RECORD
1265 * MulticastForwardingTableRecord attribute (15.2.5.8)
1269 #define IB_MAD_ATTR_MFT_RECORD (CL_HTON16(0x0017))
1272 /****d* IBA Base: Constants/IB_MAD_ATTR_PKEYTBL_RECORD
1274 * IB_MAD_ATTR_PKEYTBL_RECORD
1277 * PKEY Table Record attribute (15.2.5)
1281 #define IB_MAD_ATTR_PKEY_TBL_RECORD (CL_HTON16(0x0033))
1284 /****d* IBA Base: Constants/IB_MAD_ATTR_PATH_RECORD
1286 * IB_MAD_ATTR_PATH_RECORD
1289 * PathRecord attribute (15.2.5)
1293 #define IB_MAD_ATTR_PATH_RECORD (CL_HTON16(0x0035))
1296 /****d* IBA Base: Constants/IB_MAD_ATTR_VLARB_RECORD
1298 * IB_MAD_ATTR_VLARB_RECORD
1301 * VL Arbitration Table Record attribute (15.2.5)
1305 #define IB_MAD_ATTR_VLARB_RECORD (CL_HTON16(0x0036))
1308 /****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_RECORD
1310 * IB_MAD_ATTR_SLVL_RECORD
1313 * SLtoVL Mapping Table Record attribute (15.2.5)
1317 #define IB_MAD_ATTR_SLVL_RECORD (CL_HTON16(0x0013))
1320 /****d* IBA Base: Constants/IB_MAD_ATTR_MCMEMBER_RECORD
1322 * IB_MAD_ATTR_MCMEMBER_RECORD
1325 * MCMemberRecord attribute (15.2.5)
1329 #define IB_MAD_ATTR_MCMEMBER_RECORD (CL_HTON16(0x0038))
1332 /****d* IBA Base: Constants/IB_MAD_ATTR_TRACE_RECORD
1334 * IB_MAD_ATTR_TRACE_RECORD
1337 * TraceRecord attribute (15.2.5)
1341 #define IB_MAD_ATTR_TRACE_RECORD (CL_HTON16(0x0039))
1344 /****d* IBA Base: Constants/IB_MAD_ATTR_MULTIPATH_RECORD
1346 * IB_MAD_ATTR_MULTIPATH_RECORD
1349 * MultiPathRecord attribute (15.2.5)
1353 #define IB_MAD_ATTR_MULTIPATH_RECORD (CL_HTON16(0x003A))
1356 /****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
1358 * IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
1361 * Service Association Record attribute (15.2.5)
1365 #define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_HTON16(0x003B))
1368 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO_RECORD
1370 * IB_MAD_ATTR_INFORM_INFO_RECORD
1373 * InformInfo Record attribute (15.2.5)
1377 #define IB_MAD_ATTR_INFORM_INFO_RECORD (CL_HTON16(0x00F3))
1379 /****d* IBA Base: Constants/IB_MAD_ATTR_IO_UNIT_INFO
1381 * IB_MAD_ATTR_IO_UNIT_INFO
1384 * IOUnitInfo attribute (16.3.3)
1388 #define IB_MAD_ATTR_IO_UNIT_INFO (CL_HTON16(0x0010))
1391 /****d* IBA Base: Constants/IB_MAD_ATTR_IO_CONTROLLER_PROFILE
1393 * IB_MAD_ATTR_IO_CONTROLLER_PROFILE
1396 * IOControllerProfile attribute (16.3.3)
1400 #define IB_MAD_ATTR_IO_CONTROLLER_PROFILE (CL_HTON16(0x0011))
1403 /****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_ENTRIES
1405 * IB_MAD_ATTR_SERVICE_ENTRIES
1408 * ServiceEntries attribute (16.3.3)
1412 #define IB_MAD_ATTR_SERVICE_ENTRIES (CL_HTON16(0x0012))
1415 /****d* IBA Base: Constants/IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT
1417 * IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT
1420 * DiagnosticTimeout attribute (16.3.3)
1424 #define IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT (CL_HTON16(0x0020))
1427 /****d* IBA Base: Constants/IB_MAD_ATTR_PREPARE_TO_TEST
1429 * IB_MAD_ATTR_PREPARE_TO_TEST
1432 * PrepareToTest attribute (16.3.3)
1436 #define IB_MAD_ATTR_PREPARE_TO_TEST (CL_HTON16(0x0021))
1439 /****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_ONCE
1441 * IB_MAD_ATTR_TEST_DEVICE_ONCE
1444 * TestDeviceOnce attribute (16.3.3)
1448 #define IB_MAD_ATTR_TEST_DEVICE_ONCE (CL_HTON16(0x0022))
1451 /****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_LOOP
1453 * IB_MAD_ATTR_TEST_DEVICE_LOOP
1456 * TestDeviceLoop attribute (16.3.3)
1460 #define IB_MAD_ATTR_TEST_DEVICE_LOOP (CL_HTON16(0x0023))
1463 /****d* IBA Base: Constants/IB_MAD_ATTR_DIAG_CODE
1465 * IB_MAD_ATTR_DIAG_CODE
1468 * DiagCode attribute (16.3.3)
1472 #define IB_MAD_ATTR_DIAG_CODE (CL_HTON16(0x0024))
1475 /****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
1477 * IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
1480 * Service Association Record attribute (15.2.5)
1484 #define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_HTON16(0x003B))
1487 /****d* IBA Base: Constants/IB_NODE_TYPE_CA
1492 * Encoded generic node type used in MAD attributes (13.4.8.2)
1496 #define IB_NODE_TYPE_CA 0x01
1499 /****d* IBA Base: Constants/IB_NODE_TYPE_SWITCH
1501 * IB_NODE_TYPE_SWITCH
1504 * Encoded generic node type used in MAD attributes (13.4.8.2)
1508 #define IB_NODE_TYPE_SWITCH 0x02
1511 /****d* IBA Base: Constants/IB_NODE_TYPE_ROUTER
1513 * IB_NODE_TYPE_ROUTER
1516 * Encoded generic node type used in MAD attributes (13.4.8.2)
1520 #define IB_NODE_TYPE_ROUTER 0x03
1523 /****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_CA
1525 * IB_NOTICE_PRODUCER_TYPE_CA
1528 * Encoded generic producer type used in Notice attribute (13.4.8.2)
1532 #define IB_NOTICE_PRODUCER_TYPE_CA (CL_HTON32(0x000001))
1535 /****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_SWITCH
1537 * IB_NOTICE_PRODUCER_TYPE_SWITCH
1540 * Encoded generic producer type used in Notice attribute (13.4.8.2)
1544 #define IB_NOTICE_PRODUCER_TYPE_SWITCH (CL_HTON32(0x000002))
1547 /****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_ROUTER
1549 * IB_NOTICE_PRODUCER_TYPE_ROUTER
1552 * Encoded generic producer type used in Notice attribute (13.4.8.2)
1556 #define IB_NOTICE_PRODUCER_TYPE_ROUTER (CL_HTON32(0x000003))
1559 /****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
1561 * IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
1564 * Encoded generic producer type used in Notice attribute (13.4.8.2)
1568 #define IB_NOTICE_PRODUCER_TYPE_CLASS_MGR (CL_HTON32(0x000004))
1571 /****d* IBA Base: Constants/IB_MTU_LEN_TYPE
1586 #define IB_MTU_LEN_256 1
1587 #define IB_MTU_LEN_512 2
1588 #define IB_MTU_LEN_1024 3
1589 #define IB_MTU_LEN_2048 4
1590 #define IB_MTU_LEN_4096 5
1592 #define IB_MIN_MTU IB_MTU_LEN_256
1593 #define IB_MAX_MTU IB_MTU_LEN_4096
1597 /****d* IBA Base: Constants/IB_PATH_SELECTOR_TYPE
1599 * IB_PATH_SELECTOR_TYPE
1603 * 0: greater than specified
1604 * 1: less than specified
1605 * 2: exactly the specified
1606 * 3: largest available
1610 #define IB_PATH_SELECTOR_GREATER_THAN 0
1611 #define IB_PATH_SELECTOR_LESS_THAN 1
1612 #define IB_PATH_SELECTOR_EXACTLY 2
1613 #define IB_PATH_SELECTOR_LARGEST 3
1616 /****d* IBA Base: Constants/IB_SMINFO_STATE_NOTACTIVE
1618 * IB_SMINFO_STATE_NOTACTIVE
1621 * Encoded state value used in the SMInfo attribute.
1625 #define IB_SMINFO_STATE_NOTACTIVE 0
1628 /****d* IBA Base: Constants/IB_SMINFO_STATE_DISCOVERING
1630 * IB_SMINFO_STATE_DISCOVERING
1633 * Encoded state value used in the SMInfo attribute.
1637 #define IB_SMINFO_STATE_DISCOVERING 1
1640 /****d* IBA Base: Constants/IB_SMINFO_STATE_STANDBY
1642 * IB_SMINFO_STATE_STANDBY
1645 * Encoded state value used in the SMInfo attribute.
1649 #define IB_SMINFO_STATE_STANDBY 2
1652 /****d* IBA Base: Constants/IB_SMINFO_STATE_MASTER
1654 * IB_SMINFO_STATE_MASTER
1657 * Encoded state value used in the SMInfo attribute.
1661 #define IB_SMINFO_STATE_MASTER 3
1664 /****d* IBA Base: Constants/IB_PATH_REC_SL_MASK
1666 * IB_PATH_REC_SL_MASK
1669 * Mask for the sl field for path record
1673 #define IB_PATH_REC_SL_MASK 0x000F
1675 /****d* IBA Base: Constants/IB_MULTIPATH_REC_SL_MASK
1677 * IB_MILTIPATH_REC_SL_MASK
1680 * Mask for the sl field for MultiPath record
1684 #define IB_MULTIPATH_REC_SL_MASK 0x000F
1686 /****d* IBA Base: Constants/IB_PATH_REC_QOS_CLASS_MASK
1688 * IB_PATH_REC_QOS_CLASS_MASK
1691 * Mask for the QoS class field for path record
1695 #define IB_PATH_REC_QOS_CLASS_MASK 0xFFF0
1697 /****d* IBA Base: Constants/IB_MULTIPATH_REC_QOS_CLASS_MASK
1699 * IB_MULTIPATH_REC_QOS_CLASS_MASK
1702 * Mask for the QoS class field for MultiPath record
1706 #define IB_MULTIPATH_REC_QOS_CLASS_MASK 0xFFF0
1708 /****d* IBA Base: Constants/IB_PATH_REC_SELECTOR_MASK
1710 * IB_PATH_REC_SELECTOR_MASK
1713 * Mask for the selector field for path record MTU, rate,
1714 * and packet lifetime.
1718 #define IB_PATH_REC_SELECTOR_MASK 0xC0
1720 /****d* IBA Base: Constants/IB_MULTIPATH_REC_SELECTOR_MASK
1722 * IB_MULTIPATH_REC_SELECTOR_MASK
1725 * Mask for the selector field for multipath record MTU, rate,
1726 * and packet lifetime.
1730 #define IB_MULTIPATH_REC_SELECTOR_MASK 0xC0
1733 /****d* IBA Base: Constants/IB_PATH_REC_BASE_MASK
1735 * IB_PATH_REC_BASE_MASK
1738 * Mask for the base value field for path record MTU, rate,
1739 * and packet lifetime.
1743 #define IB_PATH_REC_BASE_MASK 0x3F
1746 /****d* IBA Base: Constants/IB_MULTIPATH_REC_BASE_MASK
1748 * IB_MULTIPATH_REC_BASE_MASK
1751 * Mask for the base value field for multipath record MTU, rate,
1752 * and packet lifetime.
1756 #define IB_MULTIPATH_REC_BASE_MASK 0x3F
1759 /****h* IBA Base/Type Definitions
1764 * Definitions are from the InfiniBand Architecture Specification v1.2
1768 /****d* IBA Base: Types/ib_net16_t
1773 * Defines the network ordered type for 16-bit values.
1777 typedef uint16_t ib_net16_t;
1780 /****d* IBA Base: Types/ib_net32_t
1785 * Defines the network ordered type for 32-bit values.
1789 typedef uint32_t ib_net32_t;
1792 /****d* IBA Base: Types/ib_net64_t
1797 * Defines the network ordered type for 64-bit values.
1801 typedef uint64_t ib_net64_t;
1804 /****d* IBA Base: Types/ib_gid_prefix_t
1812 typedef ib_net64_t ib_gid_prefix_t;
1815 /****d* IBA Base: Constants/ib_link_states_t
1820 * Defines the link states of a port.
1824 #define IB_LINK_NO_CHANGE 0
1825 #define IB_LINK_DOWN 1
1826 #define IB_LINK_INIT 2
1827 #define IB_LINK_ARMED 3
1828 #define IB_LINK_ACTIVE 4
1829 #define IB_LINK_ACT_DEFER 5
1832 static const char *const __ib_node_type_str[] = {
1839 /****f* IBA Base: Types/ib_get_node_type_str
1841 * ib_get_node_type_str
1844 * Returns a string for the specified node type.
1849 static inline const char *OSM_API ib_get_node_type_str(IN uint8_t node_type)
1851 if (node_type > IB_NODE_TYPE_ROUTER)
1853 return (__ib_node_type_str[node_type]);
1859 * [in] Encoded node type as returned in the NodeInfo attribute.
1862 * Pointer to the node type string.
1870 static const char *const __ib_producer_type_str[] = {
1878 /****f* IBA Base: Types/ib_get_producer_type_str
1880 * ib_get_producer_type_str
1883 * Returns a string for the specified producer type
1885 * 13.4.8.3 InformInfo
1889 static inline const char *OSM_API
1890 ib_get_producer_type_str(IN ib_net32_t producer_type)
1892 if (cl_ntoh32(producer_type) >
1893 CL_NTOH32(IB_NOTICE_PRODUCER_TYPE_CLASS_MGR))
1895 return (__ib_producer_type_str[cl_ntoh32(producer_type)]);
1901 * [in] Encoded producer type from the Notice attribute
1904 * Pointer to the producer type string.
1909 * ib_notice_get_prod_type
1912 static const char *const __ib_port_state_str[] = {
1913 "No State Change (NOP)",
1922 /****f* IBA Base: Types/ib_get_port_state_str
1924 * ib_get_port_state_str
1927 * Returns a string for the specified port state.
1931 static inline const char *OSM_API ib_get_port_state_str(IN uint8_t port_state)
1933 if (port_state > IB_LINK_ACTIVE)
1934 port_state = IB_LINK_ACTIVE + 1;
1935 return (__ib_port_state_str[port_state]);
1941 * [in] Encoded port state as returned in the PortInfo attribute.
1944 * Pointer to the port state string.
1952 /****f* IBA Base: Types/ib_get_port_state_from_str
1954 * ib_get_port_state_from_str
1957 * Returns a string for the specified port state.
1961 static inline uint8_t OSM_API
1962 ib_get_port_state_from_str(IN char *p_port_state_str)
1964 if (!strncmp(p_port_state_str, "No State Change (NOP)", 12))
1966 else if (!strncmp(p_port_state_str, "DOWN", 4))
1968 else if (!strncmp(p_port_state_str, "INIT", 4))
1970 else if (!strncmp(p_port_state_str, "ARMED", 5))
1972 else if (!strncmp(p_port_state_str, "ACTIVE", 6))
1974 else if (!strncmp(p_port_state_str, "ACTDEFER", 8))
1982 * [in] A string matching one returned by ib_get_port_state_str
1985 * The appropriate code.
1993 /****d* IBA Base: Constants/Join States
1998 * Defines the join state flags for multicast group management.
2002 #define IB_JOIN_STATE_FULL 1
2003 #define IB_JOIN_STATE_NON 2
2004 #define IB_JOIN_STATE_SEND_ONLY 4
2007 /****f* IBA Base: Types/ib_pkey_get_base
2012 * Returns the base P_Key value with the membership bit stripped.
2016 static inline ib_net16_t OSM_API ib_pkey_get_base(IN const ib_net16_t pkey)
2018 return ((ib_net16_t) (pkey & IB_PKEY_BASE_MASK));
2027 * Returns the base P_Key value with the membership bit stripped.
2034 /****f* IBA Base: Types/ib_pkey_is_full_member
2036 * ib_pkey_is_full_member
2039 * Indicates if the port is a full member of the parition.
2043 static inline boolean_t OSM_API ib_pkey_is_full_member(IN const ib_net16_t pkey)
2045 return ((pkey & IB_PKEY_TYPE_MASK) == IB_PKEY_TYPE_MASK);
2054 * TRUE if the port is a full member of the partition.
2060 * ib_pkey_get_base, ib_net16_t
2063 /****f* IBA Base: Types/ib_pkey_is_invalid
2065 * ib_pkey_is_invalid
2068 * Returns TRUE if the given P_Key is an invalid P_Key
2069 * C10-116: the CI shall regard a P_Key as invalid if its low-order
2070 * 15 bits are all zero...
2074 static inline boolean_t OSM_API ib_pkey_is_invalid(IN const ib_net16_t pkey)
2076 if (ib_pkey_get_base(pkey) == 0x0000)
2088 * Returns the base P_Key value with the membership bit stripped.
2095 /****d* IBA Base: Types/ib_gid_t
2103 #include <complib/cl_packon.h>
2104 typedef union _ib_gid {
2106 struct _ib_gid_unicast {
2107 ib_gid_prefix_t prefix;
2108 ib_net64_t interface_id;
2110 } PACK_SUFFIX unicast;
2112 struct _ib_gid_multicast {
2114 uint8_t raw_group_id[14];
2116 } PACK_SUFFIX multicast;
2118 } PACK_SUFFIX ib_gid_t;
2119 #include <complib/cl_packoff.h>
2123 * GID represented as an unformated byte array.
2126 * Typical unicast representation with subnet prefix and
2130 * Representation for multicast use.
2135 /****f* IBA Base: Types/ib_gid_is_multicast
2137 * ib_gid_is_multicast
2140 * Returns a boolean indicating whether a GID is a multicast GID.
2144 static inline boolean_t OSM_API ib_gid_is_multicast(IN const ib_gid_t * p_gid)
2146 return (p_gid->raw[0] == 0xFF);
2149 /****f* IBA Base: Types/ib_gid_get_scope
2154 * Returns scope of (assumed) multicast GID.
2158 static inline uint8_t OSM_API ib_mgid_get_scope(IN const ib_gid_t * p_gid)
2160 return (p_gid->raw[1] & 0x0F);
2163 /****f* IBA Base: Types/ib_gid_set_scope
2168 * Sets scope of (assumed) multicast GID.
2172 static inline void OSM_API
2173 ib_mgid_set_scope(IN ib_gid_t * const p_gid, IN const uint8_t scope)
2175 p_gid->raw[1] &= 0xF0;
2176 p_gid->raw[1] |= scope & 0x0F;
2179 /****f* IBA Base: Types/ib_gid_set_default
2181 * ib_gid_set_default
2184 * Sets a GID to the default value.
2188 static inline void OSM_API
2189 ib_gid_set_default(IN ib_gid_t * const p_gid, IN const ib_net64_t interface_id)
2191 p_gid->unicast.prefix = IB_DEFAULT_SUBNET_PREFIX;
2192 p_gid->unicast.interface_id = interface_id;
2198 * [in] Pointer to the GID object.
2201 * [in] Manufacturer assigned EUI64 value of a port.
2212 /****f* IBA Base: Types/ib_gid_get_subnet_prefix
2214 * ib_gid_get_subnet_prefix
2217 * Gets the subnet prefix from a GID.
2221 static inline ib_net64_t OSM_API
2222 ib_gid_get_subnet_prefix(IN const ib_gid_t * const p_gid)
2224 return (p_gid->unicast.prefix);
2230 * [in] Pointer to the GID object.
2233 * 64-bit subnet prefix value.
2241 /****f* IBA Base: Types/ib_gid_is_link_local
2243 * ib_gid_is_link_local
2246 * Returns TRUE if the unicast GID scoping indicates link local,
2251 static inline boolean_t OSM_API
2252 ib_gid_is_link_local(IN const ib_gid_t * const p_gid)
2254 return ((ib_gid_get_subnet_prefix(p_gid) &
2255 CL_HTON64(0xFFC0000000000000ULL)) == IB_DEFAULT_SUBNET_PREFIX);
2261 * [in] Pointer to the GID object.
2264 * Returns TRUE if the unicast GID scoping indicates link local,
2273 /****f* IBA Base: Types/ib_gid_is_site_local
2275 * ib_gid_is_site_local
2278 * Returns TRUE if the unicast GID scoping indicates site local,
2283 static inline boolean_t OSM_API
2284 ib_gid_is_site_local(IN const ib_gid_t * const p_gid)
2286 return ((ib_gid_get_subnet_prefix(p_gid) &
2287 CL_HTON64(0xFFFFFFFFFFFF0000ULL)) ==
2288 CL_HTON64(0xFEC0000000000000ULL));
2294 * [in] Pointer to the GID object.
2297 * Returns TRUE if the unicast GID scoping indicates site local,
2306 /****f* IBA Base: Types/ib_gid_get_guid
2311 * Gets the guid from a GID.
2315 static inline ib_net64_t OSM_API
2316 ib_gid_get_guid(IN const ib_gid_t * const p_gid)
2318 return (p_gid->unicast.interface_id);
2324 * [in] Pointer to the GID object.
2327 * 64-bit GUID value.
2335 /****s* IBA Base: Types/ib_path_rec_t
2340 * Path records encapsulate the properties of a given
2341 * route between two end-points on a subnet.
2345 #include <complib/cl_packon.h>
2346 typedef struct _ib_path_rec {
2347 ib_net64_t service_id;
2352 ib_net32_t hop_flow_raw;
2356 ib_net16_t qos_class_sl;
2363 } PACK_SUFFIX ib_path_rec_t;
2364 #include <complib/cl_packoff.h>
2368 * Service ID for QoS.
2371 * GID of destination port.
2374 * GID of source port.
2377 * LID of destination port.
2380 * LID of source port.
2383 * Global routing parameters: hop count, flow label and raw bit.
2386 * Another global routing parameter.
2389 * Reversible path - 1 bit to say if path is reversible.
2390 * num_path [6:0] In queries, maximum number of paths to return.
2391 * In responses, undefined.
2394 * Partition key (P_Key) to use on this path.
2397 * QoS class and service level to use on this path.
2400 * MTU and MTU selector fields to use on this path
2403 * Rate and rate selector fields to use on this path.
2409 * Indicates the relative merit of this path versus other path
2410 * records returned from the SA. Lower numbers are better.
2417 /* Path Record Component Masks */
2418 #define IB_PR_COMPMASK_SERVICEID_MSB (CL_HTON64(((uint64_t)1)<<0))
2419 #define IB_PR_COMPMASK_SERVICEID_LSB (CL_HTON64(((uint64_t)1)<<1))
2420 #define IB_PR_COMPMASK_DGID (CL_HTON64(((uint64_t)1)<<2))
2421 #define IB_PR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<3))
2422 #define IB_PR_COMPMASK_DLID (CL_HTON64(((uint64_t)1)<<4))
2423 #define IB_PR_COMPMASK_SLID (CL_HTON64(((uint64_t)1)<<5))
2424 #define IB_PR_COMPMASK_RAWTRAFFIC (CL_HTON64(((uint64_t)1)<<6))
2425 #define IB_PR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<7))
2426 #define IB_PR_COMPMASK_FLOWLABEL (CL_HTON64(((uint64_t)1)<<8))
2427 #define IB_PR_COMPMASK_HOPLIMIT (CL_HTON64(((uint64_t)1)<<9))
2428 #define IB_PR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<10))
2429 #define IB_PR_COMPMASK_REVERSIBLE (CL_HTON64(((uint64_t)1)<<11))
2430 #define IB_PR_COMPMASK_NUMBPATH (CL_HTON64(((uint64_t)1)<<12))
2431 #define IB_PR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<13))
2432 #define IB_PR_COMPMASK_QOS_CLASS (CL_HTON64(((uint64_t)1)<<14))
2433 #define IB_PR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<15))
2434 #define IB_PR_COMPMASK_MTUSELEC (CL_HTON64(((uint64_t)1)<<16))
2435 #define IB_PR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<17))
2436 #define IB_PR_COMPMASK_RATESELEC (CL_HTON64(((uint64_t)1)<<18))
2437 #define IB_PR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<19))
2438 #define IB_PR_COMPMASK_PKTLIFETIMESELEC (CL_HTON64(((uint64_t)1)<<20))
2439 #define IB_PR_COMPMASK_PKTLIFETIME (CL_HTON64(((uint64_t)1)<<21))
2441 /* Link Record Component Masks */
2442 #define IB_LR_COMPMASK_FROM_LID (CL_HTON64(((uint64_t)1)<<0))
2443 #define IB_LR_COMPMASK_FROM_PORT (CL_HTON64(((uint64_t)1)<<1))
2444 #define IB_LR_COMPMASK_TO_PORT (CL_HTON64(((uint64_t)1)<<2))
2445 #define IB_LR_COMPMASK_TO_LID (CL_HTON64(((uint64_t)1)<<3))
2447 /* VL Arbitration Record Masks */
2448 #define IB_VLA_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2449 #define IB_VLA_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<1))
2450 #define IB_VLA_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<2))
2452 /* SLtoVL Mapping Record Masks */
2453 #define IB_SLVL_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2454 #define IB_SLVL_COMPMASK_IN_PORT (CL_HTON64(((uint64_t)1)<<1))
2455 #define IB_SLVL_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<2))
2457 /* P_Key Table Record Masks */
2458 #define IB_PKEY_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2459 #define IB_PKEY_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1))
2460 #define IB_PKEY_COMPMASK_PORT (CL_HTON64(((uint64_t)1)<<2))
2462 /* Switch Info Record Masks */
2463 #define IB_SWIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2464 #define IB_SWIR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<1))
2466 /* LFT Record Masks */
2467 #define IB_LFTR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2468 #define IB_LFTR_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1))
2470 /* MFT Record Masks */
2471 #define IB_MFTR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2472 #define IB_MFTR_COMPMASK_POSITION (CL_HTON64(((uint64_t)1)<<1))
2473 #define IB_MFTR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<2))
2474 #define IB_MFTR_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<3))
2475 #define IB_MFTR_COMPMASK_RESERVED2 (CL_HTON64(((uint64_t)1)<<4))
2477 /* NodeInfo Record Masks */
2478 #define IB_NR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2479 #define IB_NR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<1))
2480 #define IB_NR_COMPMASK_BASEVERSION (CL_HTON64(((uint64_t)1)<<2))
2481 #define IB_NR_COMPMASK_CLASSVERSION (CL_HTON64(((uint64_t)1)<<3))
2482 #define IB_NR_COMPMASK_NODETYPE (CL_HTON64(((uint64_t)1)<<4))
2483 #define IB_NR_COMPMASK_NUMPORTS (CL_HTON64(((uint64_t)1)<<5))
2484 #define IB_NR_COMPMASK_SYSIMAGEGUID (CL_HTON64(((uint64_t)1)<<6))
2485 #define IB_NR_COMPMASK_NODEGUID (CL_HTON64(((uint64_t)1)<<7))
2486 #define IB_NR_COMPMASK_PORTGUID (CL_HTON64(((uint64_t)1)<<8))
2487 #define IB_NR_COMPMASK_PARTCAP (CL_HTON64(((uint64_t)1)<<9))
2488 #define IB_NR_COMPMASK_DEVID (CL_HTON64(((uint64_t)1)<<10))
2489 #define IB_NR_COMPMASK_REV (CL_HTON64(((uint64_t)1)<<11))
2490 #define IB_NR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<12))
2491 #define IB_NR_COMPMASK_VENDID (CL_HTON64(((uint64_t)1)<<13))
2492 #define IB_NR_COMPMASK_NODEDESC (CL_HTON64(((uint64_t)1)<<14))
2494 /* Service Record Component Masks Sec 15.2.5.14 Ver 1.1*/
2495 #define IB_SR_COMPMASK_SID (CL_HTON64(((uint64_t)1)<<0))
2496 #define IB_SR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<1))
2497 #define IB_SR_COMPMASK_SPKEY (CL_HTON64(((uint64_t)1)<<2))
2498 #define IB_SR_COMPMASK_RES1 (CL_HTON64(((uint64_t)1)<<3))
2499 #define IB_SR_COMPMASK_SLEASE (CL_HTON64(((uint64_t)1)<<4))
2500 #define IB_SR_COMPMASK_SKEY (CL_HTON64(((uint64_t)1)<<5))
2501 #define IB_SR_COMPMASK_SNAME (CL_HTON64(((uint64_t)1)<<6))
2502 #define IB_SR_COMPMASK_SDATA8_0 (CL_HTON64(((uint64_t)1)<<7))
2503 #define IB_SR_COMPMASK_SDATA8_1 (CL_HTON64(((uint64_t)1)<<8))
2504 #define IB_SR_COMPMASK_SDATA8_2 (CL_HTON64(((uint64_t)1)<<9))
2505 #define IB_SR_COMPMASK_SDATA8_3 (CL_HTON64(((uint64_t)1)<<10))
2506 #define IB_SR_COMPMASK_SDATA8_4 (CL_HTON64(((uint64_t)1)<<11))
2507 #define IB_SR_COMPMASK_SDATA8_5 (CL_HTON64(((uint64_t)1)<<12))
2508 #define IB_SR_COMPMASK_SDATA8_6 (CL_HTON64(((uint64_t)1)<<13))
2509 #define IB_SR_COMPMASK_SDATA8_7 (CL_HTON64(((uint64_t)1)<<14))
2510 #define IB_SR_COMPMASK_SDATA8_8 (CL_HTON64(((uint64_t)1)<<15))
2511 #define IB_SR_COMPMASK_SDATA8_9 (CL_HTON64(((uint64_t)1)<<16))
2512 #define IB_SR_COMPMASK_SDATA8_10 (CL_HTON64(((uint64_t)1)<<17))
2513 #define IB_SR_COMPMASK_SDATA8_11 (CL_HTON64(((uint64_t)1)<<18))
2514 #define IB_SR_COMPMASK_SDATA8_12 (CL_HTON64(((uint64_t)1)<<19))
2515 #define IB_SR_COMPMASK_SDATA8_13 (CL_HTON64(((uint64_t)1)<<20))
2516 #define IB_SR_COMPMASK_SDATA8_14 (CL_HTON64(((uint64_t)1)<<21))
2517 #define IB_SR_COMPMASK_SDATA8_15 (CL_HTON64(((uint64_t)1)<<22))
2518 #define IB_SR_COMPMASK_SDATA16_0 (CL_HTON64(((uint64_t)1)<<23))
2519 #define IB_SR_COMPMASK_SDATA16_1 (CL_HTON64(((uint64_t)1)<<24))
2520 #define IB_SR_COMPMASK_SDATA16_2 (CL_HTON64(((uint64_t)1)<<25))
2521 #define IB_SR_COMPMASK_SDATA16_3 (CL_HTON64(((uint64_t)1)<<26))
2522 #define IB_SR_COMPMASK_SDATA16_4 (CL_HTON64(((uint64_t)1)<<27))
2523 #define IB_SR_COMPMASK_SDATA16_5 (CL_HTON64(((uint64_t)1)<<28))
2524 #define IB_SR_COMPMASK_SDATA16_6 (CL_HTON64(((uint64_t)1)<<29))
2525 #define IB_SR_COMPMASK_SDATA16_7 (CL_HTON64(((uint64_t)1)<<30))
2526 #define IB_SR_COMPMASK_SDATA32_0 (CL_HTON64(((uint64_t)1)<<31))
2527 #define IB_SR_COMPMASK_SDATA32_1 (CL_HTON64(((uint64_t)1)<<32))
2528 #define IB_SR_COMPMASK_SDATA32_2 (CL_HTON64(((uint64_t)1)<<33))
2529 #define IB_SR_COMPMASK_SDATA32_3 (CL_HTON64(((uint64_t)1)<<34))
2530 #define IB_SR_COMPMASK_SDATA64_0 (CL_HTON64(((uint64_t)1)<<35))
2531 #define IB_SR_COMPMASK_SDATA64_1 (CL_HTON64(((uint64_t)1)<<36))
2533 /* Port Info Record Component Masks */
2534 #define IB_PIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2535 #define IB_PIR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<1))
2536 #define IB_PIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2))
2537 #define IB_PIR_COMPMASK_MKEY (CL_HTON64(((uint64_t)1)<<3))
2538 #define IB_PIR_COMPMASK_GIDPRE (CL_HTON64(((uint64_t)1)<<4))
2539 #define IB_PIR_COMPMASK_BASELID (CL_HTON64(((uint64_t)1)<<5))
2540 #define IB_PIR_COMPMASK_SMLID (CL_HTON64(((uint64_t)1)<<6))
2541 #define IB_PIR_COMPMASK_CAPMASK (CL_HTON64(((uint64_t)1)<<7))
2542 #define IB_PIR_COMPMASK_DIAGCODE (CL_HTON64(((uint64_t)1)<<8))
2543 #define IB_PIR_COMPMASK_MKEYLEASEPRD (CL_HTON64(((uint64_t)1)<<9))
2544 #define IB_PIR_COMPMASK_LOCALPORTNUM (CL_HTON64(((uint64_t)1)<<10))
2545 #define IB_PIR_COMPMASK_LINKWIDTHENABLED (CL_HTON64(((uint64_t)1)<<11))
2546 #define IB_PIR_COMPMASK_LNKWIDTHSUPPORT (CL_HTON64(((uint64_t)1)<<12))
2547 #define IB_PIR_COMPMASK_LNKWIDTHACTIVE (CL_HTON64(((uint64_t)1)<<13))
2548 #define IB_PIR_COMPMASK_LNKSPEEDSUPPORT (CL_HTON64(((uint64_t)1)<<14))
2549 #define IB_PIR_COMPMASK_PORTSTATE (CL_HTON64(((uint64_t)1)<<15))
2550 #define IB_PIR_COMPMASK_PORTPHYSTATE (CL_HTON64(((uint64_t)1)<<16))
2551 #define IB_PIR_COMPMASK_LINKDWNDFLTSTATE (CL_HTON64(((uint64_t)1)<<17))
2552 #define IB_PIR_COMPMASK_MKEYPROTBITS (CL_HTON64(((uint64_t)1)<<18))
2553 #define IB_PIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<19))
2554 #define IB_PIR_COMPMASK_LMC (CL_HTON64(((uint64_t)1)<<20))
2555 #define IB_PIR_COMPMASK_LINKSPEEDACTIVE (CL_HTON64(((uint64_t)1)<<21))
2556 #define IB_PIR_COMPMASK_LINKSPEEDENABLE (CL_HTON64(((uint64_t)1)<<22))
2557 #define IB_PIR_COMPMASK_NEIGHBORMTU (CL_HTON64(((uint64_t)1)<<23))
2558 #define IB_PIR_COMPMASK_MASTERSMSL (CL_HTON64(((uint64_t)1)<<24))
2559 #define IB_PIR_COMPMASK_VLCAP (CL_HTON64(((uint64_t)1)<<25))
2560 #define IB_PIR_COMPMASK_INITTYPE (CL_HTON64(((uint64_t)1)<<26))
2561 #define IB_PIR_COMPMASK_VLHIGHLIMIT (CL_HTON64(((uint64_t)1)<<27))
2562 #define IB_PIR_COMPMASK_VLARBHIGHCAP (CL_HTON64(((uint64_t)1)<<28))
2563 #define IB_PIR_COMPMASK_VLARBLOWCAP (CL_HTON64(((uint64_t)1)<<29))
2564 #define IB_PIR_COMPMASK_INITTYPEREPLY (CL_HTON64(((uint64_t)1)<<30))
2565 #define IB_PIR_COMPMASK_MTUCAP (CL_HTON64(((uint64_t)1)<<31))
2566 #define IB_PIR_COMPMASK_VLSTALLCNT (CL_HTON64(((uint64_t)1)<<32))
2567 #define IB_PIR_COMPMASK_HOQLIFE (CL_HTON64(((uint64_t)1)<<33))
2568 #define IB_PIR_COMPMASK_OPVLS (CL_HTON64(((uint64_t)1)<<34))
2569 #define IB_PIR_COMPMASK_PARENFIN (CL_HTON64(((uint64_t)1)<<35))
2570 #define IB_PIR_COMPMASK_PARENFOUT (CL_HTON64(((uint64_t)1)<<36))
2571 #define IB_PIR_COMPMASK_FILTERRAWIN (CL_HTON64(((uint64_t)1)<<37))
2572 #define IB_PIR_COMPMASK_FILTERRAWOUT (CL_HTON64(((uint64_t)1)<<38))
2573 #define IB_PIR_COMPMASK_MKEYVIO (CL_HTON64(((uint64_t)1)<<39))
2574 #define IB_PIR_COMPMASK_PKEYVIO (CL_HTON64(((uint64_t)1)<<40))
2575 #define IB_PIR_COMPMASK_QKEYVIO (CL_HTON64(((uint64_t)1)<<41))
2576 #define IB_PIR_COMPMASK_GUIDCAP (CL_HTON64(((uint64_t)1)<<42))
2577 #define IB_PIR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<43))
2578 #define IB_PIR_COMPMASK_SUBNTO (CL_HTON64(((uint64_t)1)<<44))
2579 #define IB_PIR_COMPMASK_RESV4 (CL_HTON64(((uint64_t)1)<<45))
2580 #define IB_PIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<46))
2581 #define IB_PIR_COMPMASK_LOCALPHYERR (CL_HTON64(((uint64_t)1)<<47))
2582 #define IB_PIR_COMPMASK_OVERRUNERR (CL_HTON64(((uint64_t)1)<<48))
2584 /* Multicast Member Record Component Masks */
2585 #define IB_MCR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<0))
2586 #define IB_MCR_COMPMASK_MGID (CL_HTON64(((uint64_t)1)<<0))
2587 #define IB_MCR_COMPMASK_PORT_GID (CL_HTON64(((uint64_t)1)<<1))
2588 #define IB_MCR_COMPMASK_QKEY (CL_HTON64(((uint64_t)1)<<2))
2589 #define IB_MCR_COMPMASK_MLID (CL_HTON64(((uint64_t)1)<<3))
2590 #define IB_MCR_COMPMASK_MTU_SEL (CL_HTON64(((uint64_t)1)<<4))
2591 #define IB_MCR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<5))
2592 #define IB_MCR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<6))
2593 #define IB_MCR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<7))
2594 #define IB_MCR_COMPMASK_RATE_SEL (CL_HTON64(((uint64_t)1)<<8))
2595 #define IB_MCR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<9))
2596 #define IB_MCR_COMPMASK_LIFE_SEL (CL_HTON64(((uint64_t)1)<<10))
2597 #define IB_MCR_COMPMASK_LIFE (CL_HTON64(((uint64_t)1)<<11))
2598 #define IB_MCR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<12))
2599 #define IB_MCR_COMPMASK_FLOW (CL_HTON64(((uint64_t)1)<<13))
2600 #define IB_MCR_COMPMASK_HOP (CL_HTON64(((uint64_t)1)<<14))
2601 #define IB_MCR_COMPMASK_SCOPE (CL_HTON64(((uint64_t)1)<<15))
2602 #define IB_MCR_COMPMASK_JOIN_STATE (CL_HTON64(((uint64_t)1)<<16))
2603 #define IB_MCR_COMPMASK_PROXY (CL_HTON64(((uint64_t)1)<<17))
2605 /* GUID Info Record Component Masks */
2606 #define IB_GIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2607 #define IB_GIR_COMPMASK_BLOCKNUM (CL_HTON64(((uint64_t)1)<<1))
2608 #define IB_GIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2))
2609 #define IB_GIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<3))
2610 #define IB_GIR_COMPMASK_GID0 (CL_HTON64(((uint64_t)1)<<4))
2611 #define IB_GIR_COMPMASK_GID1 (CL_HTON64(((uint64_t)1)<<5))
2612 #define IB_GIR_COMPMASK_GID2 (CL_HTON64(((uint64_t)1)<<6))
2613 #define IB_GIR_COMPMASK_GID3 (CL_HTON64(((uint64_t)1)<<7))
2614 #define IB_GIR_COMPMASK_GID4 (CL_HTON64(((uint64_t)1)<<8))
2615 #define IB_GIR_COMPMASK_GID5 (CL_HTON64(((uint64_t)1)<<9))
2616 #define IB_GIR_COMPMASK_GID6 (CL_HTON64(((uint64_t)1)<<10))
2617 #define IB_GIR_COMPMASK_GID7 (CL_HTON64(((uint64_t)1)<<11))
2619 /* MultiPath Record Component Masks */
2620 #define IB_MPR_COMPMASK_RAWTRAFFIC (CL_HTON64(((uint64_t)1)<<0))
2621 #define IB_MPR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<1))
2622 #define IB_MPR_COMPMASK_FLOWLABEL (CL_HTON64(((uint64_t)1)<<2))
2623 #define IB_MPR_COMPMASK_HOPLIMIT (CL_HTON64(((uint64_t)1)<<3))
2624 #define IB_MPR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<4))
2625 #define IB_MPR_COMPMASK_REVERSIBLE (CL_HTON64(((uint64_t)1)<<5))
2626 #define IB_MPR_COMPMASK_NUMBPATH (CL_HTON64(((uint64_t)1)<<6))
2627 #define IB_MPR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<7))
2628 #define IB_MPR_COMPMASK_QOS_CLASS (CL_HTON64(((uint64_t)1)<<8))
2629 #define IB_MPR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<9))
2630 #define IB_MPR_COMPMASK_MTUSELEC (CL_HTON64(((uint64_t)1)<<10))
2631 #define IB_MPR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<11))
2632 #define IB_MPR_COMPMASK_RATESELEC (CL_HTON64(((uint64_t)1)<<12))
2633 #define IB_MPR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<13))
2634 #define IB_MPR_COMPMASK_PKTLIFETIMESELEC (CL_HTON64(((uint64_t)1)<<14))
2635 #define IB_MPR_COMPMASK_PKTLIFETIME (CL_HTON64(((uint64_t)1)<<15))
2636 #define IB_MPR_COMPMASK_SERVICEID_MSB (CL_HTON64(((uint64_t)1)<<16))
2637 #define IB_MPR_COMPMASK_INDEPSELEC (CL_HTON64(((uint64_t)1)<<17))
2638 #define IB_MPR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<18))
2639 #define IB_MPR_COMPMASK_SGIDCOUNT (CL_HTON64(((uint64_t)1)<<19))
2640 #define IB_MPR_COMPMASK_DGIDCOUNT (CL_HTON64(((uint64_t)1)<<20))
2641 #define IB_MPR_COMPMASK_SERVICEID_LSB (CL_HTON64(((uint64_t)1)<<21))
2643 /* SMInfo Record Component Masks */
2644 #define IB_SMIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
2645 #define IB_SMIR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<1))
2646 #define IB_SMIR_COMPMASK_GUID (CL_HTON64(((uint64_t)1)<<2))
2647 #define IB_SMIR_COMPMASK_SMKEY (CL_HTON64(((uint64_t)1)<<3))
2648 #define IB_SMIR_COMPMASK_ACTCOUNT (CL_HTON64(((uint64_t)1)<<4))
2649 #define IB_SMIR_COMPMASK_PRIORITY (CL_HTON64(((uint64_t)1)<<5))
2650 #define IB_SMIR_COMPMASK_SMSTATE (CL_HTON64(((uint64_t)1)<<6))
2652 /* InformInfo Record Component Masks */
2653 #define IB_IIR_COMPMASK_SUBSCRIBERGID (CL_HTON64(((uint64_t)1)<<0))
2654 #define IB_IIR_COMPMASK_ENUM (CL_HTON64(((uint64_t)1)<<1))
2655 #define IB_IIR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<2))
2656 #define IB_IIR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<3))
2657 #define IB_IIR_COMPMASK_LIDRANGEBEGIN (CL_HTON64(((uint64_t)1)<<4))
2658 #define IB_IIR_COMPMASK_LIDRANGEEND (CL_HTON64(((uint64_t)1)<<5))
2659 #define IB_IIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<6))
2660 #define IB_IIR_COMPMASK_ISGENERIC (CL_HTON64(((uint64_t)1)<<7))
2661 #define IB_IIR_COMPMASK_SUBSCRIBE (CL_HTON64(((uint64_t)1)<<8))
2662 #define IB_IIR_COMPMASK_TYPE (CL_HTON64(((uint64_t)1)<<9))
2663 #define IB_IIR_COMPMASK_TRAPNUMB (CL_HTON64(((uint64_t)1)<<10))
2664 #define IB_IIR_COMPMASK_DEVICEID (CL_HTON64(((uint64_t)1)<<10))
2665 #define IB_IIR_COMPMASK_QPN (CL_HTON64(((uint64_t)1)<<11))
2666 #define IB_IIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<12))
2667 #define IB_IIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<13))
2668 #define IB_IIR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<14))
2669 #define IB_IIR_COMPMASK_PRODTYPE (CL_HTON64(((uint64_t)1)<<15))
2670 #define IB_IIR_COMPMASK_VENDID (CL_HTON64(((uint64_t)1)<<15))
2672 /****f* IBA Base: Types/ib_path_rec_init_local
2674 * ib_path_rec_init_local
2677 * Initializes a subnet local path record.
2681 static inline void OSM_API
2682 ib_path_rec_init_local(IN ib_path_rec_t * const p_rec,
2683 IN ib_gid_t * const p_dgid,
2684 IN ib_gid_t * const p_sgid,
2687 IN uint8_t num_path,
2690 IN uint16_t qos_class,
2691 IN uint8_t mtu_selector,
2693 IN uint8_t rate_selector,
2695 IN uint8_t pkt_life_selector,
2696 IN uint8_t pkt_life, IN uint8_t preference)
2698 p_rec->dgid = *p_dgid;
2699 p_rec->sgid = *p_sgid;
2702 p_rec->num_path = num_path;
2704 p_rec->qos_class_sl = cl_hton16((sl & IB_PATH_REC_SL_MASK) |
2706 p_rec->mtu = (uint8_t) ((mtu & IB_PATH_REC_BASE_MASK) |
2707 (uint8_t) (mtu_selector << 6));
2708 p_rec->rate = (uint8_t) ((rate & IB_PATH_REC_BASE_MASK) |
2709 (uint8_t) (rate_selector << 6));
2710 p_rec->pkt_life = (uint8_t) ((pkt_life & IB_PATH_REC_BASE_MASK) |
2711 (uint8_t) (pkt_life_selector << 6));
2712 p_rec->preference = preference;
2714 /* Clear global routing fields for local path records */
2715 p_rec->hop_flow_raw = 0;
2717 p_rec->service_id = 0;
2719 *((uint32_t *) p_rec->resv2) = 0;
2720 *((uint16_t *) p_rec->resv2 + 2) = 0;
2726 * [in] Pointer to the path record object.
2729 * [in] GID of destination port.
2732 * [in] GID of source port.
2735 * [in] LID of destination port.
2738 * [in] LID of source port.
2741 * [in] Reversible path - 1 bit to say if path is reversible.
2742 * num_path [6:0] In queries, maximum number of paths to return.
2743 * In responses, undefined.
2746 * [in] Partition key (P_Key) to use on this path.
2749 * [in] QoS class to use on this path. Lower 12-bits are valid.
2752 * [in] Service level to use on this path. Lower 4-bits are valid.
2755 * [in] Encoded MTU selector value to use on this path
2758 * [in] Encoded MTU to use on this path
2761 * [in] Encoded rate selector value to use on this path.
2764 * [in] Encoded rate to use on this path.
2767 * [in] Encoded Packet selector value lifetime for this path.
2770 * [in] Encoded Packet lifetime for this path.
2773 * [in] Indicates the relative merit of this path versus other path
2774 * records returned from the SA. Lower numbers are better.
2785 /****f* IBA Base: Types/ib_path_rec_num_path
2787 * ib_path_rec_num_path
2790 * Get max number of paths to return.
2794 static inline uint8_t OSM_API
2795 ib_path_rec_num_path(IN const ib_path_rec_t * const p_rec)
2797 return (p_rec->num_path & 0x7F);
2803 * [in] Pointer to the path record object.
2806 * Maximum number of paths to return for each unique SGID_DGID combination.
2814 /****f* IBA Base: Types/ib_path_rec_set_sl
2816 * ib_path_rec_set_sl
2819 * Set path service level.
2823 static inline void OSM_API
2824 ib_path_rec_set_sl(IN ib_path_rec_t * const p_rec, IN const uint8_t sl)
2826 p_rec->qos_class_sl =
2827 (p_rec->qos_class_sl & CL_HTON16(IB_PATH_REC_QOS_CLASS_MASK)) |
2828 cl_hton16(sl & IB_PATH_REC_SL_MASK);
2834 * [in] Pointer to the path record object.
2837 * [in] Service level to set.
2848 /****f* IBA Base: Types/ib_path_rec_sl
2853 * Get path service level.
2857 static inline uint8_t OSM_API
2858 ib_path_rec_sl(IN const ib_path_rec_t * const p_rec)
2860 return (uint8_t)(cl_ntoh16(p_rec->qos_class_sl) & IB_PATH_REC_SL_MASK);
2866 * [in] Pointer to the path record object.
2877 /****f* IBA Base: Types/ib_path_rec_set_qos_class
2879 * ib_path_rec_set_qos_class
2882 * Set path QoS class.
2886 static inline void OSM_API
2887 ib_path_rec_set_qos_class(IN ib_path_rec_t * const p_rec,
2888 IN const uint16_t qos_class)
2890 p_rec->qos_class_sl =
2891 (p_rec->qos_class_sl & CL_HTON16(IB_PATH_REC_SL_MASK)) |
2892 cl_hton16(qos_class << 4);
2898 * [in] Pointer to the path record object.
2901 * [in] QoS class to set.
2912 /****f* IBA Base: Types/ib_path_rec_qos_class
2914 * ib_path_rec_qos_class
2921 static inline uint16_t OSM_API
2922 ib_path_rec_qos_class(IN const ib_path_rec_t * const p_rec)
2924 return (cl_ntoh16(p_rec->qos_class_sl) >> 4);
2930 * [in] Pointer to the path record object.
2933 * QoS class of the path record.
2941 /****f* IBA Base: Types/ib_path_rec_mtu
2946 * Get encoded path MTU.
2950 static inline uint8_t OSM_API
2951 ib_path_rec_mtu(IN const ib_path_rec_t * const p_rec)
2953 return ((uint8_t) (p_rec->mtu & IB_PATH_REC_BASE_MASK));
2959 * [in] Pointer to the path record object.
2976 /****f* IBA Base: Types/ib_path_rec_mtu_sel
2978 * ib_path_rec_mtu_sel
2981 * Get encoded path MTU selector.
2985 static inline uint8_t OSM_API
2986 ib_path_rec_mtu_sel(IN const ib_path_rec_t * const p_rec)
2988 return ((uint8_t) ((p_rec->mtu & IB_PATH_REC_SELECTOR_MASK) >> 6));
2994 * [in] Pointer to the path record object.
2997 * Encoded path MTU selector value (for queries).
2998 * 0: greater than MTU specified
2999 * 1: less than MTU specified
3000 * 2: exactly the MTU specified
3001 * 3: largest MTU available
3009 /****f* IBA Base: Types/ib_path_rec_rate
3014 * Get encoded path rate.
3018 static inline uint8_t OSM_API
3019 ib_path_rec_rate(IN const ib_path_rec_t * const p_rec)
3021 return ((uint8_t) (p_rec->rate & IB_PATH_REC_BASE_MASK));
3027 * [in] Pointer to the path record object.
3030 * Encoded path rate.
3048 /****f* IBA Base: Types/ib_path_rec_rate_sel
3050 * ib_path_rec_rate_sel
3053 * Get encoded path rate selector.
3057 static inline uint8_t OSM_API
3058 ib_path_rec_rate_sel(IN const ib_path_rec_t * const p_rec)
3060 return ((uint8_t) ((p_rec->rate & IB_PATH_REC_SELECTOR_MASK) >> 6));
3066 * [in] Pointer to the path record object.
3069 * Encoded path rate selector value (for queries).
3070 * 0: greater than rate specified
3071 * 1: less than rate specified
3072 * 2: exactly the rate specified
3073 * 3: largest rate available
3081 /****f* IBA Base: Types/ib_path_rec_pkt_life
3083 * ib_path_rec_pkt_life
3086 * Get encoded path pkt_life.
3090 static inline uint8_t OSM_API
3091 ib_path_rec_pkt_life(IN const ib_path_rec_t * const p_rec)
3093 return ((uint8_t) (p_rec->pkt_life & IB_PATH_REC_BASE_MASK));
3099 * [in] Pointer to the path record object.
3102 * Encoded path pkt_life = 4.096 usec * 2 ** PacketLifeTime.
3110 /****f* IBA Base: Types/ib_path_rec_pkt_life_sel
3112 * ib_path_rec_pkt_life_sel
3115 * Get encoded path pkt_lifetime selector.
3119 static inline uint8_t OSM_API
3120 ib_path_rec_pkt_life_sel(IN const ib_path_rec_t * const p_rec)
3122 return ((uint8_t) ((p_rec->pkt_life & IB_PATH_REC_SELECTOR_MASK) >> 6));
3128 * [in] Pointer to the path record object.
3131 * Encoded path pkt_lifetime selector value (for queries).
3132 * 0: greater than rate specified
3133 * 1: less than rate specified
3134 * 2: exactly the rate specified
3135 * 3: smallest packet lifetime available
3143 /****f* IBA Base: Types/ib_path_rec_flow_lbl
3145 * ib_path_rec_flow_lbl
3152 static inline uint32_t OSM_API
3153 ib_path_rec_flow_lbl(IN const ib_path_rec_t * const p_rec)
3155 return (((cl_ntoh32(p_rec->hop_flow_raw) >> 8) & 0x000FFFFF));
3161 * [in] Pointer to the path record object.
3164 * Flow label of the path record.
3172 /****f* IBA Base: Types/ib_path_rec_hop_limit
3174 * ib_path_rec_hop_limit
3181 static inline uint8_t OSM_API
3182 ib_path_rec_hop_limit(IN const ib_path_rec_t * const p_rec)
3184 return ((uint8_t) (cl_ntoh32(p_rec->hop_flow_raw) & 0x000000FF));
3190 * [in] Pointer to the path record object.
3193 * Hop limit of the path record.
3201 /****s* IBA Base: Constants/IB_CLASS_CAP_TRAP
3206 * ClassPortInfo CapabilityMask bits. This bit will be set
3207 * if the class supports Trap() MADs (13.4.8.1).
3210 * ib_class_port_info_t, IB_CLASS_CAP_GETSET
3214 #define IB_CLASS_CAP_TRAP 0x0001
3217 /****s* IBA Base: Constants/IB_CLASS_CAP_GETSET
3219 * IB_CLASS_CAP_GETSET
3222 * ClassPortInfo CapabilityMask bits. This bit will be set
3223 * if the class supports Get(Notice) and Set(Notice) MADs (13.4.8.1).
3226 * ib_class_port_info_t, IB_CLASS_CAP_TRAP
3230 #define IB_CLASS_CAP_GETSET 0x0002
3233 /****s* IBA Base: Constants/IB_CLASS_RESP_TIME_MASK
3235 * IB_CLASS_RESP_TIME_MASK
3238 * Mask bits to extract the reponse time value from the
3239 * resp_time_val field of ib_class_port_info_t.
3242 * ib_class_port_info_t
3246 #define IB_CLASS_RESP_TIME_MASK 0x1F
3249 /****s* IBA Base: Types/ib_class_port_info_t
3251 * ib_class_port_info_t
3254 * IBA defined ClassPortInfo attribute (13.4.8.1)
3255 * route between two end-points on a subnet.
3259 #include <complib/cl_packon.h>
3260 typedef struct _ib_class_port_info {
3263 ib_net16_t cap_mask;
3264 ib_net32_t cap_mask2_resp_time;
3266 ib_net32_t redir_tc_sl_fl;
3267 ib_net16_t redir_lid;
3268 ib_net16_t redir_pkey;
3269 ib_net32_t redir_qp;
3270 ib_net32_t redir_qkey;
3272 ib_net32_t trap_tc_sl_fl;
3273 ib_net16_t trap_lid;
3274 ib_net16_t trap_pkey;
3275 ib_net32_t trap_hop_qp;
3276 ib_net32_t trap_qkey;
3278 } PACK_SUFFIX ib_class_port_info_t;
3279 #include <complib/cl_packoff.h>
3283 * Maximum supported MAD Base Version.
3286 * Maximum supported management class version.
3289 * Supported capabilities of this management class.
3291 * cap_mask2_resp_time
3292 * Maximum expected response time and additional
3293 * supported capabilities of this management class.
3296 * GID to use for redirection, or zero
3299 * Traffic class, service level and flow label the requester
3300 * should use if the service is redirected.
3303 * LID used for redirection, or zero
3306 * P_Key used for redirection
3309 * QP number used for redirection
3312 * Q_Key associated with the redirected QP. This shall be the
3313 * well known Q_Key value.
3316 * GID value used for trap messages from this service.
3319 * Traffic class, service level and flow label used for
3320 * trap messages originated by this service.
3323 * LID used for trap messages, or zero
3326 * P_Key used for trap messages
3329 * Hop limit (upper 8 bits) and QP number used for trap messages
3332 * Q_Key associated with the trap messages QP.
3335 * IB_CLASS_CAP_GETSET, IB_CLASS_CAP_TRAP
3339 /****f* IBA Base: Types/ib_class_set_resp_time_val
3341 * ib_class_set_resp_time_val
3344 * Set maximum expected response time.
3348 static inline void OSM_API
3349 ib_class_set_resp_time_val(IN ib_class_port_info_t * const p_cpi,
3350 IN const uint8_t val)
3352 p_cpi->cap_mask2_resp_time =
3353 (p_cpi->cap_mask2_resp_time & CL_HTON32(~IB_CLASS_RESP_TIME_MASK)) |
3354 cl_hton32(val & IB_CLASS_RESP_TIME_MASK);
3360 * [in] Pointer to the class port info object.
3363 * [in] Response time value to set.
3371 * ib_class_port_info_t
3374 /****f* IBA Base: Types/ib_class_resp_time_val
3376 * ib_class_resp_time_val
3379 * Get response time value.
3383 static inline uint8_t OSM_API
3384 ib_class_resp_time_val(IN ib_class_port_info_t * const p_cpi)
3386 return (uint8_t)(cl_ntoh32(p_cpi->cap_mask2_resp_time) &
3387 IB_CLASS_RESP_TIME_MASK);
3393 * [in] Pointer to the class port info object.
3396 * Response time value.
3401 * ib_class_port_info_t
3404 /****f* IBA Base: Types/ib_class_set_cap_mask2
3406 * ib_class_set_cap_mask2
3409 * Set ClassPortInfo:CapabilityMask2.
3413 static inline void OSM_API
3414 ib_class_set_cap_mask2(IN ib_class_port_info_t * const p_cpi,
3415 IN const uint32_t cap_mask2)
3417 p_cpi->cap_mask2_resp_time = (p_cpi->cap_mask2_resp_time &
3418 CL_HTON32(IB_CLASS_RESP_TIME_MASK)) |
3419 cl_hton32(cap_mask2 << 5);
3425 * [in] Pointer to the class port info object.
3428 * [in] CapabilityMask2 value to set.
3436 * ib_class_port_info_t
3439 /****f* IBA Base: Types/ib_class_cap_mask2
3441 * ib_class_cap_mask2
3444 * Get ClassPortInfo:CapabilityMask2.
3448 static inline uint32_t OSM_API
3449 ib_class_cap_mask2(IN const ib_class_port_info_t * const p_cpi)
3451 return (cl_ntoh32(p_cpi->cap_mask2_resp_time) >> 5);
3457 * [in] Pointer to the class port info object.
3460 * CapabilityMask2 of the ClassPortInfo.
3465 * ib_class_port_info_t
3468 /****s* IBA Base: Types/ib_sm_info_t
3473 * SMInfo structure (14.2.5.13).
3477 #include <complib/cl_packon.h>
3478 typedef struct _ib_sm_info {
3481 ib_net32_t act_count;
3484 } PACK_SUFFIX ib_sm_info_t;
3485 #include <complib/cl_packoff.h>
3489 * Port GUID for this SM.
3492 * SM_Key of this SM.
3495 * Activity counter used as a heartbeat.
3498 * Priority and State information
3503 /****f* IBA Base: Types/ib_sminfo_get_priority
3505 * ib_sminfo_get_priority
3508 * Returns the priority value.
3512 static inline uint8_t OSM_API
3513 ib_sminfo_get_priority(IN const ib_sm_info_t * const p_smi)
3515 return ((uint8_t) ((p_smi->pri_state & 0xF0) >> 4));
3521 * [in] Pointer to the SMInfo Attribute.
3524 * Returns the priority value.
3531 /****f* IBA Base: Types/ib_sminfo_get_state
3533 * ib_sminfo_get_state
3536 * Returns the state value.
3540 static inline uint8_t OSM_API
3541 ib_sminfo_get_state(IN const ib_sm_info_t * const p_smi)
3543 return ((uint8_t) (p_smi->pri_state & 0x0F));
3549 * [in] Pointer to the SMInfo Attribute.
3552 * Returns the state value.
3559 /****s* IBA Base: Types/ib_mad_t
3564 * IBA defined MAD header (13.4.3)
3568 #include <complib/cl_packon.h>
3569 typedef struct _ib_mad {
3575 ib_net16_t class_spec;
3576 ib_net64_t trans_id;
3579 ib_net32_t attr_mod;
3580 } PACK_SUFFIX ib_mad_t;
3581 #include <complib/cl_packoff.h>
3588 * Class of operation.
3591 * Version of MAD class-specific format.
3594 * Method to perform, including 'R' bit.
3597 * Status of operation.
3600 * Reserved for subnet management.
3612 * Attribute modifier.
3617 /****s* IBA Base: Types/ib_rmpp_mad_t
3622 * IBA defined MAD RMPP header (13.6.2.1)
3626 #include <complib/cl_packon.h>
3627 typedef struct _ib_rmpp_mad {
3628 ib_mad_t common_hdr;
3630 uint8_t rmpp_version;
3633 uint8_t rmpp_status;
3636 ib_net32_t paylen_newwin;
3638 } PACK_SUFFIX ib_rmpp_mad_t;
3639 #include <complib/cl_packoff.h>
3645 /****f* IBA Base: Types/ib_mad_init_new
3650 * Initializes a MAD common header.
3654 static inline void OSM_API
3655 ib_mad_init_new(IN ib_mad_t * const p_mad,
3656 IN const uint8_t mgmt_class,
3657 IN const uint8_t class_ver,
3658 IN const uint8_t method,
3659 IN const ib_net64_t trans_id,
3660 IN const ib_net16_t attr_id, IN const ib_net32_t attr_mod)
3663 p_mad->base_ver = 1;
3664 p_mad->mgmt_class = mgmt_class;
3665 p_mad->class_ver = class_ver;
3666 p_mad->method = method;
3668 p_mad->class_spec = 0;
3669 p_mad->trans_id = trans_id;
3670 p_mad->attr_id = attr_id;
3672 p_mad->attr_mod = attr_mod;
3678 * [in] Pointer to the MAD common header.
3681 * [in] Class of operation.
3684 * [in] Version of MAD class-specific format.
3687 * [in] Method to perform, including 'R' bit.
3690 * [in] Transaction ID.
3693 * [in] Attribute ID.
3696 * [in] Attribute modifier.
3707 /****f* IBA Base: Types/ib_mad_init_response
3709 * ib_mad_init_response
3712 * Initializes a MAD common header as a response.
3716 static inline void OSM_API
3717 ib_mad_init_response(IN const ib_mad_t * const p_req_mad,
3718 IN ib_mad_t * const p_mad, IN const ib_net16_t status)
3720 CL_ASSERT(p_req_mad);
3722 *p_mad = *p_req_mad;
3723 p_mad->status = status;
3724 if (p_mad->method == IB_MAD_METHOD_SET)
3725 p_mad->method = IB_MAD_METHOD_GET;
3726 p_mad->method |= IB_MAD_METHOD_RESP_MASK;
3732 * [in] Pointer to the MAD common header in the original request MAD.
3735 * [in] Pointer to the MAD common header to initialize.
3738 * [in] MAD Status value to return;
3744 * p_req_mad and p_mad may point to the same MAD.
3750 /****f* IBA Base: Types/ib_mad_is_response
3752 * ib_mad_is_response
3755 * Returns TRUE if the MAD is a response ('R' bit set),
3760 static inline boolean_t OSM_API
3761 ib_mad_is_response(IN const ib_mad_t * const p_mad)
3764 return ((p_mad->method & IB_MAD_METHOD_RESP_MASK) ==
3765 IB_MAD_METHOD_RESP_MASK);
3771 * [in] Pointer to the MAD.
3774 * Returns TRUE if the MAD is a response ('R' bit set),
3783 #define IB_RMPP_TYPE_DATA 1
3784 #define IB_RMPP_TYPE_ACK 2
3785 #define IB_RMPP_TYPE_STOP 3
3786 #define IB_RMPP_TYPE_ABORT 4
3788 #define IB_RMPP_NO_RESP_TIME 0x1F
3789 #define IB_RMPP_FLAG_ACTIVE 0x01
3790 #define IB_RMPP_FLAG_FIRST 0x02
3791 #define IB_RMPP_FLAG_LAST 0x04
3793 #define IB_RMPP_STATUS_SUCCESS 0
3794 #define IB_RMPP_STATUS_RESX 1 /* resources exhausted */
3795 #define IB_RMPP_STATUS_T2L 118 /* time too long */
3796 #define IB_RMPP_STATUS_BAD_LEN 119 /* incon. last and payload len */
3797 #define IB_RMPP_STATUS_BAD_SEG 120 /* incon. first and segment no */
3798 #define IB_RMPP_STATUS_BADT 121 /* bad rmpp type */
3799 #define IB_RMPP_STATUS_W2S 122 /* newwindowlast too small */
3800 #define IB_RMPP_STATUS_S2B 123 /* segment no too big */
3801 #define IB_RMPP_STATUS_BAD_STATUS 124 /* illegal status */
3802 #define IB_RMPP_STATUS_UNV 125 /* unsupported version */
3803 #define IB_RMPP_STATUS_TMR 126 /* too many retries */
3804 #define IB_RMPP_STATUS_UNSPEC 127 /* unspecified */
3806 /****f* IBA Base: Types/ib_rmpp_is_flag_set
3808 * ib_rmpp_is_flag_set
3811 * Returns TRUE if the MAD has the given RMPP flag set.
3815 static inline boolean_t OSM_API
3816 ib_rmpp_is_flag_set(IN const ib_rmpp_mad_t * const p_rmpp_mad,
3817 IN const uint8_t flag)
3819 CL_ASSERT(p_rmpp_mad);
3820 return ((p_rmpp_mad->rmpp_flags & flag) == flag);
3826 * [in] Pointer to a MAD with an RMPP header.
3829 * [in] The RMPP flag being examined.
3832 * Returns TRUE if the MAD has the given RMPP flag set.
3837 * ib_mad_t, ib_rmpp_mad_t
3840 static inline void OSM_API
3841 ib_rmpp_set_resp_time(IN ib_rmpp_mad_t * const p_rmpp_mad,
3842 IN const uint8_t resp_time)
3844 CL_ASSERT(p_rmpp_mad);
3845 p_rmpp_mad->rmpp_flags |= (resp_time << 3);
3848 static inline uint8_t OSM_API
3849 ib_rmpp_get_resp_time(IN const ib_rmpp_mad_t * const p_rmpp_mad)
3851 CL_ASSERT(p_rmpp_mad);
3852 return ((uint8_t) (p_rmpp_mad->rmpp_flags >> 3));
3855 /****d* IBA Base: Constants/IB_SMP_DIRECTION
3860 * The Direction bit for directed route SMPs.
3864 #define IB_SMP_DIRECTION_HO 0x8000
3865 #define IB_SMP_DIRECTION (CL_HTON16(IB_SMP_DIRECTION_HO))
3868 /****d* IBA Base: Constants/IB_SMP_STATUS_MASK
3870 * IB_SMP_STATUS_MASK
3873 * Mask value for extracting status from a directed route SMP.
3877 #define IB_SMP_STATUS_MASK_HO 0x7FFF
3878 #define IB_SMP_STATUS_MASK (CL_HTON16(IB_SMP_STATUS_MASK_HO))
3881 /****s* IBA Base: Types/ib_smp_t
3886 * IBA defined SMP. (14.2.1.2)
3890 #define IB_SMP_DATA_SIZE 64
3891 #include <complib/cl_packon.h>
3892 typedef struct _ib_smp {
3900 ib_net64_t trans_id;
3903 ib_net32_t attr_mod;
3908 uint8_t data[IB_SMP_DATA_SIZE];
3909 uint8_t initial_path[IB_SUBNET_PATH_HOPS_MAX];
3910 uint8_t return_path[IB_SUBNET_PATH_HOPS_MAX];
3912 } PACK_SUFFIX ib_smp_t;
3913 #include <complib/cl_packoff.h>
3920 * Class of operation.
3923 * Version of MAD class-specific format.
3926 * Method to perform, including 'R' bit.
3929 * Status of operation.
3932 * Hop pointer for directed route MADs.
3935 * Hop count for directed route MADs.
3947 * Attribute modifier.
3950 * Management key value.
3953 * Directed route source LID.
3956 * Directed route destination LID.
3959 * Reserved for 64 byte alignment.
3965 * Outbound port list.
3968 * Inbound port list.
3973 /****f* IBA Base: Types/ib_smp_get_status
3978 * Returns the SMP status value in network order.
3982 static inline ib_net16_t OSM_API
3983 ib_smp_get_status(IN const ib_smp_t * const p_smp)
3985 return ((ib_net16_t) (p_smp->status & IB_SMP_STATUS_MASK));
3991 * [in] Pointer to the SMP packet.
3994 * Returns the SMP status value in network order.
4002 /****f* IBA Base: Types/ib_smp_is_response
4004 * ib_smp_is_response
4007 * Returns TRUE if the SMP is a response MAD, FALSE otherwise.
4011 static inline boolean_t OSM_API
4012 ib_smp_is_response(IN const ib_smp_t * const p_smp)
4014 return (ib_mad_is_response((const ib_mad_t *)p_smp));
4020 * [in] Pointer to the SMP packet.
4023 * Returns TRUE if the SMP is a response MAD, FALSE otherwise.
4031 /****f* IBA Base: Types/ib_smp_is_d
4036 * Returns TRUE if the SMP 'D' (direction) bit is set.
4040 static inline boolean_t OSM_API ib_smp_is_d(IN const ib_smp_t * const p_smp)
4042 return ((p_smp->status & IB_SMP_DIRECTION) == IB_SMP_DIRECTION);
4048 * [in] Pointer to the SMP packet.
4051 * Returns TRUE if the SMP 'D' (direction) bit is set.
4059 /****f* IBA Base: Types/ib_smp_init_new
4064 * Initializes a MAD common header.
4067 * This is too big for inlining, but leave it here for now
4068 * since there is not yet another convient spot.
4072 static inline void OSM_API
4073 ib_smp_init_new(IN ib_smp_t * const p_smp,
4074 IN const uint8_t method,
4075 IN const ib_net64_t trans_id,
4076 IN const ib_net16_t attr_id,
4077 IN const ib_net32_t attr_mod,
4078 IN const uint8_t hop_count,
4079 IN const ib_net64_t m_key,
4080 IN const uint8_t * path_out,
4081 IN const ib_net16_t dr_slid, IN const ib_net16_t dr_dlid)
4084 CL_ASSERT(hop_count < IB_SUBNET_PATH_HOPS_MAX);
4085 p_smp->base_ver = 1;
4086 p_smp->mgmt_class = IB_MCLASS_SUBN_DIR;
4087 p_smp->class_ver = 1;
4088 p_smp->method = method;
4091 p_smp->hop_count = hop_count;
4092 p_smp->trans_id = trans_id;
4093 p_smp->attr_id = attr_id;
4095 p_smp->attr_mod = attr_mod;
4096 p_smp->m_key = m_key;
4097 p_smp->dr_slid = dr_slid;
4098 p_smp->dr_dlid = dr_dlid;
4100 memset(p_smp->resv1, 0,
4101 sizeof(p_smp->resv1) +
4102 sizeof(p_smp->data) +
4103 sizeof(p_smp->initial_path) + sizeof(p_smp->return_path));
4106 memcpy(&p_smp->initial_path, path_out, sizeof(p_smp->initial_path));
4112 * [in] Pointer to the SMP packet.
4115 * [in] Method to perform, including 'R' bit.
4118 * [in] Transaction ID.
4121 * [in] Attribute ID.
4124 * [in] Attribute modifier.
4127 * [in] Number of hops in the path.
4130 * [in] Management key for this SMP.
4133 * [in] Port array for outbound path.
4140 * Payload area is initialized to zero.
4147 /****f* IBA Base: Types/ib_smp_get_payload_ptr
4149 * ib_smp_get_payload_ptr
4152 * Gets a pointer to the SMP payload area.
4156 static inline void *OSM_API
4157 ib_smp_get_payload_ptr(IN const ib_smp_t * const p_smp)
4159 return ((void *)p_smp->data);
4165 * [in] Pointer to the SMP packet.
4168 * Pointer to SMP payload area.
4176 /****s* IBA Base: Types/ib_node_info_t
4181 * IBA defined NodeInfo. (14.2.5.3)
4185 #include <complib/cl_packon.h>
4186 typedef struct _ib_node_info {
4187 uint8_t base_version;
4188 uint8_t class_version;
4191 ib_net64_t sys_guid;
4192 ib_net64_t node_guid;
4193 ib_net64_t port_guid;
4194 ib_net16_t partition_cap;
4195 ib_net16_t device_id;
4196 ib_net32_t revision;
4197 ib_net32_t port_num_vendor_id;
4199 } PACK_SUFFIX ib_node_info_t;
4200 #include <complib/cl_packoff.h>
4203 /****s* IBA Base: Types/ib_sa_mad_t
4208 * IBA defined SA MAD format. (15.2.1)
4212 #define IB_SA_DATA_SIZE 200
4214 #include <complib/cl_packon.h>
4215 typedef struct _ib_sa_mad {
4222 ib_net64_t trans_id;
4225 ib_net32_t attr_mod;
4227 uint8_t rmpp_version;
4230 uint8_t rmpp_status;
4233 ib_net32_t paylen_newwin;
4237 ib_net16_t attr_offset;
4240 ib_net64_t comp_mask;
4242 uint8_t data[IB_SA_DATA_SIZE];
4243 } PACK_SUFFIX ib_sa_mad_t;
4244 #include <complib/cl_packoff.h>
4246 #define IB_SA_MAD_HDR_SIZE (sizeof(ib_sa_mad_t) - IB_SA_DATA_SIZE)
4248 static inline uint32_t OSM_API ib_get_attr_size(IN const ib_net16_t attr_offset)
4250 return (((uint32_t) cl_ntoh16(attr_offset)) << 3);
4253 static inline ib_net16_t OSM_API ib_get_attr_offset(IN const uint32_t attr_size)
4255 return (cl_hton16((uint16_t) (attr_size >> 3)));
4258 /****f* IBA Base: Types/ib_sa_mad_get_payload_ptr
4260 * ib_sa_mad_get_payload_ptr
4263 * Gets a pointer to the SA MAD's payload area.
4267 static inline void *OSM_API
4268 ib_sa_mad_get_payload_ptr(IN const ib_sa_mad_t * const p_sa_mad)
4270 return ((void *)p_sa_mad->data);
4276 * [in] Pointer to the SA MAD packet.
4279 * Pointer to SA MAD payload area.
4287 #define IB_NODE_INFO_PORT_NUM_MASK (CL_HTON32(0xFF000000))
4288 #define IB_NODE_INFO_VEND_ID_MASK (CL_HTON32(0x00FFFFFF))
4290 #define IB_NODE_INFO_PORT_NUM_SHIFT 0
4292 #define IB_NODE_INFO_PORT_NUM_SHIFT 24
4295 /****f* IBA Base: Types/ib_node_info_get_local_port_num
4297 * ib_node_info_get_local_port_num
4300 * Gets a the local port number from the NodeInfo attribute.
4304 static inline uint8_t OSM_API
4305 ib_node_info_get_local_port_num(IN const ib_node_info_t * const p_ni)
4307 return ((uint8_t) ((p_ni->port_num_vendor_id &
4308 IB_NODE_INFO_PORT_NUM_MASK)
4309 >> IB_NODE_INFO_PORT_NUM_SHIFT));
4315 * [in] Pointer to a NodeInfo attribute.
4318 * Local port number that returned the attribute.
4326 /****f* IBA Base: Types/ib_node_info_get_vendor_id
4328 * ib_node_info_get_vendor_id
4331 * Gets the VendorID from the NodeInfo attribute.
4335 static inline ib_net32_t OSM_API
4336 ib_node_info_get_vendor_id(IN const ib_node_info_t * const p_ni)
4338 return ((ib_net32_t) (p_ni->port_num_vendor_id &
4339 IB_NODE_INFO_VEND_ID_MASK));
4345 * [in] Pointer to a NodeInfo attribute.
4348 * VendorID that returned the attribute.
4356 #define IB_NODE_DESCRIPTION_SIZE 64
4358 #include <complib/cl_packon.h>
4359 typedef struct _ib_node_desc {
4360 // Node String is an array of UTF-8 character that
4361 // describes the node in text format
4362 // Note that this string is NOT NULL TERMINATED!
4363 uint8_t description[IB_NODE_DESCRIPTION_SIZE];
4365 } PACK_SUFFIX ib_node_desc_t;
4366 #include <complib/cl_packoff.h>
4368 #include <complib/cl_packon.h>
4369 typedef struct _ib_node_record_t {
4372 ib_node_info_t node_info;
4373 ib_node_desc_t node_desc;
4376 } PACK_SUFFIX ib_node_record_t;
4377 #include <complib/cl_packoff.h>
4379 /****s* IBA Base: Types/ib_port_info_t
4384 * IBA defined PortInfo. (14.2.5.6)
4388 #include <complib/cl_packon.h>
4389 typedef struct _ib_port_info {
4391 ib_net64_t subnet_prefix;
4392 ib_net16_t base_lid;
4393 ib_net16_t master_sm_base_lid;
4394 ib_net32_t capability_mask;
4395 ib_net16_t diag_code;
4396 ib_net16_t m_key_lease_period;
4397 uint8_t local_port_num;
4398 uint8_t link_width_enabled;
4399 uint8_t link_width_supported;
4400 uint8_t link_width_active;
4401 uint8_t state_info1; /* LinkSpeedSupported and PortState */
4402 uint8_t state_info2; /* PortPhysState and LinkDownDefaultState */
4404 uint8_t link_speed; /* LinkSpeedEnabled and LinkSpeedActive */
4406 uint8_t vl_cap; /* VLCap and InitType */
4407 uint8_t vl_high_limit;
4408 uint8_t vl_arb_high_cap;
4409 uint8_t vl_arb_low_cap;
4411 uint8_t vl_stall_life;
4413 ib_net16_t m_key_violations;
4414 ib_net16_t p_key_violations;
4415 ib_net16_t q_key_violations;
4417 uint8_t subnet_timeout; /* cli_rereg(1b), resrv(
4419 uint8_t resp_time_value;
4420 uint8_t error_threshold;
4422 } PACK_SUFFIX ib_port_info_t;
4423 #include <complib/cl_packoff.h>
4426 #define IB_PORT_STATE_MASK 0x0F
4427 #define IB_PORT_LMC_MASK 0x07
4428 #define IB_PORT_LMC_MAX 0x07
4429 #define IB_PORT_MPB_MASK 0xC0
4430 #define IB_PORT_MPB_SHIFT 6
4431 #define IB_PORT_LINK_SPEED_SHIFT 4
4432 #define IB_PORT_LINK_SPEED_SUPPORTED_MASK 0xF0
4433 #define IB_PORT_LINK_SPEED_ACTIVE_MASK 0xF0
4434 #define IB_PORT_LINK_SPEED_ENABLED_MASK 0x0F
4435 #define IB_PORT_PHYS_STATE_MASK 0xF0
4436 #define IB_PORT_PHYS_STATE_SHIFT 4
4437 #define IB_PORT_PHYS_STATE_NO_CHANGE 0
4438 #define IB_PORT_PHYS_STATE_SLEEP 1
4439 #define IB_PORT_PHYS_STATE_POLLING 2
4440 #define IB_PORT_PHYS_STATE_DISABLED 3
4441 #define IB_PORT_PHYS_STATE_PORTCONFTRAIN 4
4442 #define IB_PORT_PHYS_STATE_LINKUP 5
4443 #define IB_PORT_PHYS_STATE_LINKERRRECOVER 6
4444 #define IB_PORT_PHYS_STATE_PHYTEST 7
4445 #define IB_PORT_LNKDWNDFTSTATE_MASK 0x0F
4447 #define IB_PORT_CAP_RESV0 (CL_HTON32(0x00000001))
4448 #define IB_PORT_CAP_IS_SM (CL_HTON32(0x00000002))
4449 #define IB_PORT_CAP_HAS_NOTICE (CL_HTON32(0x00000004))
4450 #define IB_PORT_CAP_HAS_TRAP (CL_HTON32(0x00000008))
4451 #define IB_PORT_CAP_HAS_IPD (CL_HTON32(0x00000010))
4452 #define IB_PORT_CAP_HAS_AUTO_MIG (CL_HTON32(0x00000020))
4453 #define IB_PORT_CAP_HAS_SL_MAP (CL_HTON32(0x00000040))
4454 #define IB_PORT_CAP_HAS_NV_MKEY (CL_HTON32(0x00000080))
4455 #define IB_PORT_CAP_HAS_NV_PKEY (CL_HTON32(0x00000100))
4456 #define IB_PORT_CAP_HAS_LED_INFO (CL_HTON32(0x00000200))
4457 #define IB_PORT_CAP_SM_DISAB (CL_HTON32(0x00000400))
4458 #define IB_PORT_CAP_HAS_SYS_IMG_GUID (CL_HTON32(0x00000800))
4459 #define IB_PORT_CAP_HAS_PKEY_SW_EXT_PORT_TRAP (CL_HTON32(0x00001000))
4460 #define IB_PORT_CAP_RESV13 (CL_HTON32(0x00002000))
4461 #define IB_PORT_CAP_RESV14 (CL_HTON32(0x00004000))
4462 #define IB_PORT_CAP_RESV15 (CL_HTON32(0x00008000))
4463 #define IB_PORT_CAP_HAS_COM_MGT (CL_HTON32(0x00010000))
4464 #define IB_PORT_CAP_HAS_SNMP (CL_HTON32(0x00020000))
4465 #define IB_PORT_CAP_REINIT (CL_HTON32(0x00040000))
4466 #define IB_PORT_CAP_HAS_DEV_MGT (CL_HTON32(0x00080000))
4467 #define IB_PORT_CAP_HAS_VEND_CLS (CL_HTON32(0x00100000))
4468 #define IB_PORT_CAP_HAS_DR_NTC (CL_HTON32(0x00200000))
4469 #define IB_PORT_CAP_HAS_CAP_NTC (CL_HTON32(0x00400000))
4470 #define IB_PORT_CAP_HAS_BM (CL_HTON32(0x00800000))
4471 #define IB_PORT_CAP_HAS_LINK_RT_LATENCY (CL_HTON32(0x01000000))
4472 #define IB_PORT_CAP_HAS_CLIENT_REREG (CL_HTON32(0x02000000))
4473 #define IB_PORT_CAP_HAS_OTHER_LOCAL_CHANGES_NTC (CL_HTON32(0x04000000))
4474 #define IB_PORT_CAP_HAS_LINK_SPEED_WIDTH_PAIRS_TBL (CL_HTON32(0x08000000))
4475 #define IB_PORT_CAP_RESV28 (CL_HTON32(0x10000000))
4476 #define IB_PORT_CAP_RESV29 (CL_HTON32(0x20000000))
4477 #define IB_PORT_CAP_RESV30 (CL_HTON32(0x40000000))
4478 #define IB_PORT_CAP_RESV31 (CL_HTON32(0x80000000))
4480 /****f* IBA Base: Types/ib_port_info_get_port_state
4482 * ib_port_info_get_port_state
4485 * Returns the port state.
4489 static inline uint8_t OSM_API
4490 ib_port_info_get_port_state(IN const ib_port_info_t * const p_pi)
4492 return ((uint8_t) (p_pi->state_info1 & IB_PORT_STATE_MASK));
4498 * [in] Pointer to a PortInfo attribute.
4508 /****f* IBA Base: Types/ib_port_info_set_port_state
4510 * ib_port_info_set_port_state
4513 * Sets the port state.
4517 static inline void OSM_API
4518 ib_port_info_set_port_state(IN ib_port_info_t * const p_pi,
4519 IN const uint8_t port_state)
4521 p_pi->state_info1 = (uint8_t) ((p_pi->state_info1 & 0xF0) | port_state);
4527 * [in] Pointer to a PortInfo attribute.
4530 * [in] Port state value to set.
4540 /****f* IBA Base: Types/ib_port_info_get_vl_cap
4542 * ib_port_info_get_vl_cap
4545 * Gets the VL Capability of a port.
4549 static inline uint8_t OSM_API
4550 ib_port_info_get_vl_cap(IN const ib_port_info_t * const p_pi)
4552 return ((p_pi->vl_cap >> 4) & 0x0F);
4558 * [in] Pointer to a PortInfo attribute.
4568 /****f* IBA Base: Types/ib_port_info_get_init_type
4570 * ib_port_info_get_init_type
4573 * Gets the init type of a port.
4577 static inline uint8_t OSM_API
4578 ib_port_info_get_init_type(IN const ib_port_info_t * const p_pi)
4580 return (uint8_t) (p_pi->vl_cap & 0x0F);
4586 * [in] Pointer to a PortInfo attribute.
4596 /****f* IBA Base: Types/ib_port_info_get_op_vls
4598 * ib_port_info_get_op_vls
4601 * Gets the operational VLs on a port.
4605 static inline uint8_t OSM_API
4606 ib_port_info_get_op_vls(IN const ib_port_info_t * const p_pi)
4608 return ((p_pi->vl_enforce >> 4) & 0x0F);
4614 * [in] Pointer to a PortInfo attribute.
4624 /****f* IBA Base: Types/ib_port_info_set_op_vls
4626 * ib_port_info_set_op_vls
4629 * Sets the operational VLs on a port.
4633 static inline void OSM_API
4634 ib_port_info_set_op_vls(IN ib_port_info_t * const p_pi, IN const uint8_t op_vls)
4637 (uint8_t) ((p_pi->vl_enforce & 0x0F) | (op_vls << 4));
4643 * [in] Pointer to a PortInfo attribute.
4646 * [in] Encoded operation VLs value.
4656 /****f* IBA Base: Types/ib_port_info_set_state_no_change
4658 * ib_port_info_set_state_no_change
4661 * Sets the port state fields to the value for "no change".
4665 static inline void OSM_API
4666 ib_port_info_set_state_no_change(IN ib_port_info_t * const p_pi)
4668 ib_port_info_set_port_state(p_pi, IB_LINK_NO_CHANGE);
4669 p_pi->state_info2 = 0;
4675 * [in] Pointer to a PortInfo attribute.
4685 /****f* IBA Base: Types/ib_port_info_get_link_speed_sup
4687 * ib_port_info_get_link_speed_sup
4690 * Returns the encoded value for the link speed supported.
4694 static inline uint8_t OSM_API
4695 ib_port_info_get_link_speed_sup(IN const ib_port_info_t * const p_pi)
4697 return ((uint8_t) ((p_pi->state_info1 &
4698 IB_PORT_LINK_SPEED_SUPPORTED_MASK) >>
4699 IB_PORT_LINK_SPEED_SHIFT));
4705 * [in] Pointer to a PortInfo attribute.
4708 * Returns the encoded value for the link speed supported.
4715 /****f* IBA Base: Types/ib_port_info_set_link_speed_sup
4717 * ib_port_info_set_link_speed_sup
4720 * Given an integer of the supported link speed supported.
4721 * Set the appropriate bits in state_info1
4725 static inline void OSM_API
4726 ib_port_info_set_link_speed_sup(IN uint8_t const speed,
4727 IN ib_port_info_t * p_pi)
4730 (~IB_PORT_LINK_SPEED_SUPPORTED_MASK & p_pi->state_info1) |
4731 (IB_PORT_LINK_SPEED_SUPPORTED_MASK &
4732 (speed << IB_PORT_LINK_SPEED_SHIFT));
4738 * [in] Supported Speeds Code.
4741 * [in] Pointer to a PortInfo attribute.
4744 * This function does not return a value.
4751 /****f* IBA Base: Types/ib_port_info_get_port_phys_state
4753 * ib_port_info_get_port_phys_state
4756 * Returns the encoded value for the port physical state.
4760 static inline uint8_t OSM_API
4761 ib_port_info_get_port_phys_state(IN const ib_port_info_t * const p_pi)
4763 return ((uint8_t) ((p_pi->state_info2 &
4764 IB_PORT_PHYS_STATE_MASK) >>
4765 IB_PORT_PHYS_STATE_SHIFT));
4771 * [in] Pointer to a PortInfo attribute.
4774 * Returns the encoded value for the port physical state.
4781 /****f* IBA Base: Types/ib_port_info_set_port_phys_state
4783 * ib_port_info_set_port_phys_state
4786 * Given an integer of the port physical state,
4787 * Set the appropriate bits in state_info2
4791 static inline void OSM_API
4792 ib_port_info_set_port_phys_state(IN uint8_t const phys_state,
4793 IN ib_port_info_t * p_pi)
4796 (~IB_PORT_PHYS_STATE_MASK & p_pi->state_info2) |
4797 (IB_PORT_PHYS_STATE_MASK &
4798 (phys_state << IB_PORT_PHYS_STATE_SHIFT));
4804 * [in] port physical state.
4807 * [in] Pointer to a PortInfo attribute.
4810 * This function does not return a value.
4817 /****f* IBA Base: Types/ib_port_info_get_link_down_def_state
4819 * ib_port_info_get_link_down_def_state
4822 * Returns the link down default state.
4826 static inline uint8_t OSM_API
4827 ib_port_info_get_link_down_def_state(IN const ib_port_info_t * const p_pi)
4829 return ((uint8_t) (p_pi->state_info2 & IB_PORT_LNKDWNDFTSTATE_MASK));
4835 * [in] Pointer to a PortInfo attribute.
4838 * link down default state of the port.
4845 /****f* IBA Base: Types/ib_port_info_set_link_down_def_state
4847 * ib_port_info_set_link_down_def_state
4850 * Sets the link down default state of the port.
4854 static inline void OSM_API
4855 ib_port_info_set_link_down_def_state(IN ib_port_info_t * const p_pi,
4856 IN const uint8_t link_dwn_state)
4859 (uint8_t) ((p_pi->state_info2 & 0xF0) | link_dwn_state);
4865 * [in] Pointer to a PortInfo attribute.
4868 * [in] Link down default state of the port.
4878 /****f* IBA Base: Types/ib_port_info_get_link_speed_active
4880 * ib_port_info_get_link_speed_active
4883 * Returns the Link Speed Active value assigned to this port.
4887 static inline uint8_t OSM_API
4888 ib_port_info_get_link_speed_active(IN const ib_port_info_t * const p_pi)
4890 return ((uint8_t) ((p_pi->link_speed &
4891 IB_PORT_LINK_SPEED_ACTIVE_MASK) >>
4892 IB_PORT_LINK_SPEED_SHIFT));
4898 * [in] Pointer to a PortInfo attribute.
4901 * Returns the link speed active value assigned to this port.
4908 #define IB_LINK_WIDTH_ACTIVE_1X 1
4909 #define IB_LINK_WIDTH_ACTIVE_4X 2
4910 #define IB_LINK_WIDTH_ACTIVE_8X 4
4911 #define IB_LINK_WIDTH_ACTIVE_12X 8
4912 #define IB_LINK_SPEED_ACTIVE_2_5 1
4913 #define IB_LINK_SPEED_ACTIVE_5 2
4914 #define IB_LINK_SPEED_ACTIVE_10 4
4916 /* following v1 ver1.2 p901 */
4917 #define IB_PATH_RECORD_RATE_2_5_GBS 2
4918 #define IB_PATH_RECORD_RATE_10_GBS 3
4919 #define IB_PATH_RECORD_RATE_30_GBS 4
4920 #define IB_PATH_RECORD_RATE_5_GBS 5
4921 #define IB_PATH_RECORD_RATE_20_GBS 6
4922 #define IB_PATH_RECORD_RATE_40_GBS 7
4923 #define IB_PATH_RECORD_RATE_60_GBS 8
4924 #define IB_PATH_RECORD_RATE_80_GBS 9
4925 #define IB_PATH_RECORD_RATE_120_GBS 10
4927 #define IB_MIN_RATE IB_PATH_RECORD_RATE_2_5_GBS
4928 #define IB_MAX_RATE IB_PATH_RECORD_RATE_120_GBS
4930 /****f* IBA Base: Types/ib_port_info_compute_rate
4932 * ib_port_info_compute_rate
4935 * Returns the encoded value for the path rate.
4939 static inline uint8_t OSM_API
4940 ib_port_info_compute_rate(IN const ib_port_info_t * const p_pi)
4944 switch (ib_port_info_get_link_speed_active(p_pi)) {
4945 case IB_LINK_SPEED_ACTIVE_2_5:
4946 switch (p_pi->link_width_active) {
4947 case IB_LINK_WIDTH_ACTIVE_1X:
4948 rate = IB_PATH_RECORD_RATE_2_5_GBS;
4951 case IB_LINK_WIDTH_ACTIVE_4X:
4952 rate = IB_PATH_RECORD_RATE_10_GBS;
4955 case IB_LINK_WIDTH_ACTIVE_8X:
4956 rate = IB_PATH_RECORD_RATE_20_GBS;
4959 case IB_LINK_WIDTH_ACTIVE_12X:
4960 rate = IB_PATH_RECORD_RATE_30_GBS;
4964 rate = IB_PATH_RECORD_RATE_2_5_GBS;
4968 case IB_LINK_SPEED_ACTIVE_5:
4969 switch (p_pi->link_width_active) {
4970 case IB_LINK_WIDTH_ACTIVE_1X:
4971 rate = IB_PATH_RECORD_RATE_5_GBS;
4974 case IB_LINK_WIDTH_ACTIVE_4X:
4975 rate = IB_PATH_RECORD_RATE_20_GBS;
4978 case IB_LINK_WIDTH_ACTIVE_8X:
4979 rate = IB_PATH_RECORD_RATE_40_GBS;
4982 case IB_LINK_WIDTH_ACTIVE_12X:
4983 rate = IB_PATH_RECORD_RATE_60_GBS;
4987 rate = IB_PATH_RECORD_RATE_5_GBS;
4991 case IB_LINK_SPEED_ACTIVE_10:
4992 switch (p_pi->link_width_active) {
4993 case IB_LINK_WIDTH_ACTIVE_1X:
4994 rate = IB_PATH_RECORD_RATE_10_GBS;
4997 case IB_LINK_WIDTH_ACTIVE_4X:
4998 rate = IB_PATH_RECORD_RATE_40_GBS;
5001 case IB_LINK_WIDTH_ACTIVE_8X:
5002 rate = IB_PATH_RECORD_RATE_80_GBS;
5005 case IB_LINK_WIDTH_ACTIVE_12X:
5006 rate = IB_PATH_RECORD_RATE_120_GBS;
5010 rate = IB_PATH_RECORD_RATE_10_GBS;
5015 rate = IB_PATH_RECORD_RATE_2_5_GBS;
5025 * [in] Pointer to a PortInfo attribute.
5028 * Returns the encoded value for the link speed supported.
5035 /****f* IBA Base: Types/ib_path_get_ipd
5040 * Returns the encoded value for the inter packet delay.
5044 static inline uint8_t OSM_API
5045 ib_path_get_ipd(IN uint8_t local_link_width_supported, IN uint8_t path_rec_rate)
5049 switch (local_link_width_supported) {
5050 /* link_width_supported = 1: 1x */
5054 /* link_width_supported = 3: 1x or 4x */
5056 switch (path_rec_rate & 0x3F) {
5057 case IB_PATH_RECORD_RATE_2_5_GBS:
5065 /* link_width_supported = 11: 1x or 4x or 12x */
5067 switch (path_rec_rate & 0x3F) {
5068 case IB_PATH_RECORD_RATE_2_5_GBS:
5071 case IB_PATH_RECORD_RATE_10_GBS:
5088 * local_link_width_supported
5089 * [in] link with supported for this port
5092 * [in] rate field of the path record
5102 /****f* IBA Base: Types/ib_port_info_get_mtu_cap
5104 * ib_port_info_get_mtu_cap
5107 * Returns the encoded value for the maximum MTU supported by this port.
5111 static inline uint8_t OSM_API
5112 ib_port_info_get_mtu_cap(IN const ib_port_info_t * const p_pi)
5114 return ((uint8_t) (p_pi->mtu_cap & 0x0F));
5120 * [in] Pointer to a PortInfo attribute.
5123 * Returns the encooded value for the maximum MTU supported by this port.
5130 /****f* IBA Base: Types/ib_port_info_get_neighbor_mtu
5132 * ib_port_info_get_neighbor_mtu
5135 * Returns the encoded value for the neighbor MTU supported by this port.
5139 static inline uint8_t OSM_API
5140 ib_port_info_get_neighbor_mtu(IN const ib_port_info_t * const p_pi)
5142 return ((uint8_t) ((p_pi->mtu_smsl & 0xF0) >> 4));
5148 * [in] Pointer to a PortInfo attribute.
5151 * Returns the encoded value for the neighbor MTU at this port.
5158 /****f* IBA Base: Types/ib_port_info_set_neighbor_mtu
5160 * ib_port_info_set_neighbor_mtu
5163 * Sets the Neighbor MTU value in the PortInfo attribute.
5167 static inline void OSM_API
5168 ib_port_info_set_neighbor_mtu(IN ib_port_info_t * const p_pi,
5169 IN const uint8_t mtu)
5171 CL_ASSERT(mtu <= 5);
5172 CL_ASSERT(mtu != 0);
5173 p_pi->mtu_smsl = (uint8_t) ((p_pi->mtu_smsl & 0x0F) | (mtu << 4));
5179 * [in] Pointer to a PortInfo attribute.
5182 * [in] Encoded MTU value to set
5192 /****f* IBA Base: Types/ib_port_info_get_master_smsl
5194 * ib_port_info_get_master_smsl
5197 * Returns the encoded value for the Master SMSL at this port.
5201 static inline uint8_t OSM_API
5202 ib_port_info_get_master_smsl(IN const ib_port_info_t * const p_pi)
5204 return (uint8_t) (p_pi->mtu_smsl & 0x0F);
5210 * [in] Pointer to a PortInfo attribute.
5213 * Returns the encoded value for the Master SMSL at this port.
5220 /****f* IBA Base: Types/ib_port_info_set_master_smsl
5222 * ib_port_info_set_master_smsl
5225 * Sets the Master SMSL value in the PortInfo attribute.
5229 static inline void OSM_API
5230 ib_port_info_set_master_smsl(IN ib_port_info_t * const p_pi,
5231 IN const uint8_t smsl)
5233 p_pi->mtu_smsl = (uint8_t) ((p_pi->mtu_smsl & 0xF0) | smsl);
5239 * [in] Pointer to a PortInfo attribute.
5242 * [in] Encoded Master SMSL value to set
5252 /****f* IBA Base: Types/ib_port_info_set_timeout
5254 * ib_port_info_set_timeout
5257 * Sets the encoded subnet timeout value in the PortInfo attribute.
5261 static inline void OSM_API
5262 ib_port_info_set_timeout(IN ib_port_info_t * const p_pi,
5263 IN const uint8_t timeout)
5265 CL_ASSERT(timeout <= 0x1F);
5266 p_pi->subnet_timeout =
5267 (uint8_t) ((p_pi->subnet_timeout & 0x80) | (timeout & 0x1F));
5273 * [in] Pointer to a PortInfo attribute.
5276 * [in] Encoded timeout value to set
5286 /****f* IBA Base: Types/ib_port_info_set_client_rereg
5288 * ib_port_info_set_client_rereg
5291 * Sets the encoded client reregistration bit value in the PortInfo attribute.
5295 static inline void OSM_API
5296 ib_port_info_set_client_rereg(IN ib_port_info_t * const p_pi,
5297 IN const uint8_t client_rereg)
5299 CL_ASSERT(client_rereg <= 0x1);
5300 p_pi->subnet_timeout =
5302 subnet_timeout & 0x1F) | ((client_rereg << 7) & 0x80));
5308 * [in] Pointer to a PortInfo attribute.
5311 * [in] Client reregistration value to set (either 1 or 0).
5321 /****f* IBA Base: Types/ib_port_info_get_timeout
5323 * ib_port_info_get_timeout
5326 * Gets the encoded subnet timeout value in the PortInfo attribute.
5330 static inline uint8_t OSM_API
5331 ib_port_info_get_timeout(IN ib_port_info_t const *p_pi)
5333 return (p_pi->subnet_timeout & 0x1F);
5339 * [in] Pointer to a PortInfo attribute.
5342 * The encoded timeout value
5349 /****f* IBA Base: Types/ib_port_info_get_client_rereg
5351 * ib_port_info_get_client_rereg
5354 * Gets the encoded client reregistration bit value in the PortInfo attribute.
5358 static inline uint8_t OSM_API
5359 ib_port_info_get_client_rereg(IN ib_port_info_t const *p_pi)
5361 return ((p_pi->subnet_timeout & 0x80) >> 7);
5367 * [in] Pointer to a PortInfo attribute.
5370 * Client reregistration value (either 1 or 0).
5377 /****f* IBA Base: Types/ib_port_info_set_hoq_lifetime
5379 * ib_port_info_set_hoq_lifetime
5382 * Sets the Head of Queue Lifetime for which a packet can live in the head
5387 static inline void OSM_API
5388 ib_port_info_set_hoq_lifetime(IN ib_port_info_t * const p_pi,
5389 IN const uint8_t hoq_life)
5391 p_pi->vl_stall_life = (uint8_t) ((hoq_life & 0x1f) |
5392 (p_pi->vl_stall_life & 0xe0));
5398 * [in] Pointer to a PortInfo attribute.
5401 * [in] Encoded lifetime value to set
5411 /****f* IBA Base: Types/ib_port_info_get_hoq_lifetime
5413 * ib_port_info_get_hoq_lifetime
5416 * Gets the Head of Queue Lifetime for which a packet can live in the head
5421 static inline uint8_t OSM_API
5422 ib_port_info_get_hoq_lifetime(IN const ib_port_info_t * const p_pi)
5424 return ((uint8_t) (p_pi->vl_stall_life & 0x1f));
5430 * [in] Pointer to a PortInfo attribute.
5433 * Encoded lifetime value
5440 /****f* IBA Base: Types/ib_port_info_set_vl_stall_count
5442 * ib_port_info_set_vl_stall_count
5445 * Sets the VL Stall Count which define the number of contiguous
5446 * HLL (hoq) drops that will put the VL into stalled mode.
5450 static inline void OSM_API
5451 ib_port_info_set_vl_stall_count(IN ib_port_info_t * const p_pi,
5452 IN const uint8_t vl_stall_count)
5454 p_pi->vl_stall_life = (uint8_t) ((p_pi->vl_stall_life & 0x1f) |
5455 ((vl_stall_count << 5) & 0xe0));
5461 * [in] Pointer to a PortInfo attribute.
5474 /****f* IBA Base: Types/ib_port_info_get_vl_stall_count
5476 * ib_port_info_get_vl_stall_count
5479 * Gets the VL Stall Count which define the number of contiguous
5480 * HLL (hoq) drops that will put the VL into stalled mode
5484 static inline uint8_t OSM_API
5485 ib_port_info_get_vl_stall_count(IN const ib_port_info_t * const p_pi)
5487 return ((uint8_t) (p_pi->vl_stall_life & 0xe0) >> 5);
5493 * [in] Pointer to a PortInfo attribute.
5503 /****f* IBA Base: Types/ib_port_info_get_lmc
5505 * ib_port_info_get_lmc
5508 * Returns the LMC value assigned to this port.
5512 static inline uint8_t OSM_API
5513 ib_port_info_get_lmc(IN const ib_port_info_t * const p_pi)
5515 return ((uint8_t) (p_pi->mkey_lmc & IB_PORT_LMC_MASK));
5521 * [in] Pointer to a PortInfo attribute.
5524 * Returns the LMC value assigned to this port.
5531 /****f* IBA Base: Types/ib_port_info_set_lmc
5533 * ib_port_info_set_lmc
5536 * Sets the LMC value in the PortInfo attribute.
5540 static inline void OSM_API
5541 ib_port_info_set_lmc(IN ib_port_info_t * const p_pi, IN const uint8_t lmc)
5543 CL_ASSERT(lmc <= IB_PORT_LMC_MAX);
5544 p_pi->mkey_lmc = (uint8_t) ((p_pi->mkey_lmc & 0xF8) | lmc);
5550 * [in] Pointer to a PortInfo attribute.
5553 * [in] LMC value to set, must be less than 7.
5563 /****f* IBA Base: Types/ib_port_info_get_link_speed_enabled
5565 * ib_port_info_get_link_speed_enabled
5568 * Returns the link speed enabled value assigned to this port.
5572 static inline uint8_t OSM_API
5573 ib_port_info_get_link_speed_enabled(IN const ib_port_info_t * const p_pi)
5575 return ((uint8_t) (p_pi->link_speed & IB_PORT_LINK_SPEED_ENABLED_MASK));
5581 * [in] Pointer to a PortInfo attribute.
5591 /****f* IBA Base: Types/ib_port_info_set_link_speed_enabled
5593 * ib_port_info_set_link_speed_enabled
5596 * Sets the link speed enabled value in the PortInfo attribute.
5600 static inline void OSM_API
5601 ib_port_info_set_link_speed_enabled(IN ib_port_info_t * const p_pi,
5602 IN const uint8_t link_speed_enabled)
5605 (uint8_t) ((p_pi->link_speed & 0xF0) | link_speed_enabled);
5611 * [in] Pointer to a PortInfo attribute.
5613 * link_speed_enabled
5614 * [in] link speed enabled value to set.
5624 /****f* IBA Base: Types/ib_port_info_get_mpb
5626 * ib_port_info_get_mpb
5629 * Returns the M_Key protect bits assigned to this port.
5633 static inline uint8_t OSM_API
5634 ib_port_info_get_mpb(IN const ib_port_info_t * const p_pi)
5636 return ((uint8_t) ((p_pi->mkey_lmc & IB_PORT_MPB_MASK) >>
5637 IB_PORT_MPB_SHIFT));
5643 * [in] Pointer to a PortInfo attribute.
5646 * Returns the M_Key protect bits assigned to this port.
5653 /****f* IBA Base: Types/ib_port_info_set_mpb
5655 * ib_port_info_set_mpb
5658 * Set the M_Key protect bits of this port.
5662 static inline void OSM_API
5663 ib_port_info_set_mpb(IN ib_port_info_t * p_pi, IN uint8_t mpb)
5666 (~IB_PORT_MPB_MASK & p_pi->mkey_lmc) |
5667 (IB_PORT_MPB_MASK & (mpb << IB_PORT_MPB_SHIFT));
5673 * [in] M_Key protect bits
5675 * [in] Pointer to a PortInfo attribute.
5684 /****f* IBA Base: Types/ib_port_info_get_local_phy_err_thd
5686 * ib_port_info_get_local_phy_err_thd
5689 * Returns the Phy Link Threshold
5693 static inline uint8_t OSM_API
5694 ib_port_info_get_local_phy_err_thd(IN const ib_port_info_t * const p_pi)
5696 return (uint8_t) ((p_pi->error_threshold & 0xF0) >> 4);
5702 * [in] Pointer to a PortInfo attribute.
5705 * Returns the Phy Link error threshold assigned to this port.
5712 /****f* IBA Base: Types/ib_port_info_get_overrun_err_thd
5714 * ib_port_info_get_local_overrun_err_thd
5717 * Returns the Credits Overrun Errors Threshold
5721 static inline uint8_t OSM_API
5722 ib_port_info_get_overrun_err_thd(IN const ib_port_info_t * const p_pi)
5724 return (uint8_t) (p_pi->error_threshold & 0x0F);
5730 * [in] Pointer to a PortInfo attribute.
5733 * Returns the Credits Overrun errors threshold assigned to this port.
5740 /****f* IBA Base: Types/ib_port_info_set_phy_and_overrun_err_thd
5742 * ib_port_info_set_phy_and_overrun_err_thd
5745 * Sets the Phy Link and Credits Overrun Errors Threshold
5749 static inline void OSM_API
5750 ib_port_info_set_phy_and_overrun_err_thd(IN ib_port_info_t * const p_pi,
5751 IN uint8_t phy_threshold,
5752 IN uint8_t overrun_threshold)
5754 p_pi->error_threshold =
5755 (uint8_t) (((phy_threshold & 0x0F) << 4) |
5756 (overrun_threshold & 0x0F));
5762 * [in] Pointer to a PortInfo attribute.
5765 * [in] Physical Link Errors Threshold above which Trap 129 is generated
5768 * [in] Credits overrun Errors Threshold above which Trap 129 is generated
5778 typedef uint8_t ib_svc_name_t[64];
5780 #include <complib/cl_packon.h>
5781 typedef struct _ib_service_record {
5782 ib_net64_t service_id;
5783 ib_gid_t service_gid;
5784 ib_net16_t service_pkey;
5786 ib_net32_t service_lease;
5787 uint8_t service_key[16];
5788 ib_svc_name_t service_name;
5789 uint8_t service_data8[16];
5790 ib_net16_t service_data16[8];
5791 ib_net32_t service_data32[4];
5792 ib_net64_t service_data64[2];
5794 } PACK_SUFFIX ib_service_record_t;
5795 #include <complib/cl_packoff.h>
5797 #include <complib/cl_packon.h>
5798 typedef struct _ib_portinfo_record {
5802 ib_port_info_t port_info;
5805 } PACK_SUFFIX ib_portinfo_record_t;
5806 #include <complib/cl_packoff.h>
5808 #include <complib/cl_packon.h>
5809 typedef struct _ib_link_record {
5810 ib_net16_t from_lid;
5811 uint8_t from_port_num;
5812 uint8_t to_port_num;
5816 } PACK_SUFFIX ib_link_record_t;
5817 #include <complib/cl_packoff.h>
5819 #include <complib/cl_packon.h>
5820 typedef struct _ib_sminfo_record {
5823 ib_sm_info_t sm_info;
5826 } PACK_SUFFIX ib_sminfo_record_t;
5827 #include <complib/cl_packoff.h>
5829 /****s* IBA Base: Types/ib_lft_record_t
5834 * IBA defined LinearForwardingTableRecord (15.2.5.6)
5838 #include <complib/cl_packon.h>
5839 typedef struct _ib_lft_record {
5841 ib_net16_t block_num;
5844 } PACK_SUFFIX ib_lft_record_t;
5845 #include <complib/cl_packoff.h>
5848 /****s* IBA Base: Types/ib_mft_record_t
5853 * IBA defined MulticastForwardingTableRecord (15.2.5.8)
5857 #include <complib/cl_packon.h>
5858 typedef struct _ib_mft_record {
5860 ib_net16_t position_block_num;
5862 ib_net16_t mft[IB_MCAST_BLOCK_SIZE];
5863 } PACK_SUFFIX ib_mft_record_t;
5864 #include <complib/cl_packoff.h>
5867 /****s* IBA Base: Types/ib_switch_info_t
5872 * IBA defined SwitchInfo. (14.2.5.4)
5876 #include <complib/cl_packon.h>
5877 typedef struct _ib_switch_info {
5879 ib_net16_t rand_cap;
5880 ib_net16_t mcast_cap;
5883 uint8_t def_mcast_pri_port;
5884 uint8_t def_mcast_not_port;
5886 ib_net16_t lids_per_port;
5887 ib_net16_t enforce_cap;
5890 } PACK_SUFFIX ib_switch_info_t;
5891 #include <complib/cl_packoff.h>
5894 #include <complib/cl_packon.h>
5895 typedef struct _ib_switch_info_record {
5898 ib_switch_info_t switch_info;
5901 } PACK_SUFFIX ib_switch_info_record_t;
5902 #include <complib/cl_packoff.h>
5904 #define IB_SWITCH_PSC 0x04
5906 /****f* IBA Base: Types/ib_switch_info_get_state_change
5908 * ib_switch_info_get_state_change
5911 * Returns the value of the state change flag.
5915 static inline boolean_t OSM_API
5916 ib_switch_info_get_state_change(IN const ib_switch_info_t * const p_si)
5918 return ((p_si->life_state & IB_SWITCH_PSC) == IB_SWITCH_PSC);
5924 * [in] Pointer to a SwitchInfo attribute.
5927 * Returns the value of the state change flag.
5934 /****f* IBA Base: Types/ib_switch_info_clear_state_change
5936 * ib_switch_info_clear_state_change
5939 * Clears the switch's state change bit.
5943 static inline void OSM_API
5944 ib_switch_info_clear_state_change(IN ib_switch_info_t * const p_si)
5946 p_si->life_state = (uint8_t) (p_si->life_state & 0xFB);
5952 * [in] Pointer to a PortInfo attribute.
5955 * Returns the LMC value assigned to this port.
5962 /****f* IBA Base: Types/ib_switch_info_is_enhanced_port0
5964 * ib_switch_info_is_enhanced_port0
5967 * Returns TRUE if the enhancedPort0 bit is on (meaning the switch
5968 * port zero supports enhanced functions).
5969 * Returns FALSE otherwise.
5973 static inline boolean_t OSM_API
5974 ib_switch_info_is_enhanced_port0(IN const ib_switch_info_t * const p_si)
5976 return ((p_si->flags & 0x08) == 0x08);
5982 * [in] Pointer to a SwitchInfo attribute.
5985 * Returns TRUE if the switch supports enhanced port 0. FALSE otherwise.
5992 /****s* IBA Base: Types/ib_guid_info_t
5997 * IBA defined GuidInfo. (14.2.5.5)
6001 #define GUID_TABLE_MAX_ENTRIES 8
6003 #include <complib/cl_packon.h>
6004 typedef struct _ib_guid_info {
6005 ib_net64_t guid[GUID_TABLE_MAX_ENTRIES];
6007 } PACK_SUFFIX ib_guid_info_t;
6008 #include <complib/cl_packoff.h>
6011 #include <complib/cl_packon.h>
6012 typedef struct _ib_guidinfo_record {
6017 ib_guid_info_t guid_info;
6018 } PACK_SUFFIX ib_guidinfo_record_t;
6019 #include <complib/cl_packoff.h>
6021 #define IB_MULTIPATH_MAX_GIDS 11 /* Support max that can fit into first MAD (for now) */
6023 #include <complib/cl_packon.h>
6024 typedef struct _ib_multipath_rec_t {
6025 ib_net32_t hop_flow_raw;
6029 ib_net16_t qos_class_sl;
6033 uint8_t service_id_8msb;
6034 uint8_t independence; /* formerly resv2 */
6037 uint8_t service_id_56lsb[7];
6038 ib_gid_t gids[IB_MULTIPATH_MAX_GIDS];
6039 } PACK_SUFFIX ib_multipath_rec_t;
6040 #include <complib/cl_packoff.h>
6044 * Global routing parameters: hop count, flow label and raw bit.
6047 * Another global routing parameter.
6050 * Reversible path - 1 bit to say if path is reversible.
6051 * num_path [6:0] In queries, maximum number of paths to return.
6052 * In responses, undefined.
6055 * Partition key (P_Key) to use on this path.
6058 * QoS class and service level to use on this path.
6061 * MTU and MTU selector fields to use on this path
6063 * Rate and rate selector fields to use on this path.
6069 * 8 most significant bits of Service ID
6072 * 56 least significant bits of Service ID
6075 * Indicates the relative merit of this path versus other path
6076 * records returned from the SA. Lower numbers are better.
6081 /****f* IBA Base: Types/ib_multipath_rec_num_path
6083 * ib_multipath_rec_num_path
6086 * Get max number of paths to return.
6090 static inline uint8_t OSM_API
6091 ib_multipath_rec_num_path(IN const ib_multipath_rec_t * const p_rec)
6093 return (p_rec->num_path & 0x7F);
6099 * [in] Pointer to the multipath record object.
6102 * Maximum number of paths to return for each unique SGID_DGID combination.
6107 * ib_multipath_rec_t
6110 /****f* IBA Base: Types/ib_multipath_rec_set_sl
6112 * ib_multipath_rec_set_sl
6115 * Set path service level.
6119 static inline void OSM_API
6120 ib_multipath_rec_set_sl(
6121 IN ib_multipath_rec_t* const p_rec,
6122 IN const uint8_t sl )
6124 p_rec->qos_class_sl =
6125 (p_rec->qos_class_sl & CL_HTON16(IB_MULTIPATH_REC_QOS_CLASS_MASK)) |
6126 cl_hton16(sl & IB_MULTIPATH_REC_SL_MASK);
6131 * [in] Pointer to the MultiPath record object.
6134 * [in] Service level to set.
6142 * ib_multipath_rec_t
6145 /****f* IBA Base: Types/ib_multipath_rec_sl
6147 * ib_multipath_rec_sl
6150 * Get multipath service level.
6154 static inline uint8_t OSM_API
6155 ib_multipath_rec_sl(IN const ib_multipath_rec_t * const p_rec)
6157 return ((uint8_t) ((cl_ntoh16(p_rec->qos_class_sl)) & IB_MULTIPATH_REC_SL_MASK));
6163 * [in] Pointer to the multipath record object.
6171 * ib_multipath_rec_t
6174 /****f* IBA Base: Types/ib_multipath_rec_set_qos_class
6176 * ib_multipath_rec_set_qos_class
6179 * Set path QoS class.
6183 static inline void OSM_API
6184 ib_multipath_rec_set_qos_class(
6185 IN ib_multipath_rec_t* const p_rec,
6186 IN const uint16_t qos_class )
6188 p_rec->qos_class_sl =
6189 (p_rec->qos_class_sl & CL_HTON16(IB_MULTIPATH_REC_SL_MASK)) |
6190 cl_hton16(qos_class << 4);
6195 * [in] Pointer to the MultiPath record object.
6198 * [in] QoS class to set.
6206 * ib_multipath_rec_t
6209 /****f* IBA Base: Types/ib_multipath_rec_qos_class
6211 * ib_multipath_rec_qos_class
6218 static inline uint16_t OSM_API
6219 ib_multipath_rec_qos_class(
6220 IN const ib_multipath_rec_t* const p_rec )
6222 return (cl_ntoh16( p_rec->qos_class_sl ) >> 4);
6227 * [in] Pointer to the MultiPath record object.
6230 * QoS class of the MultiPath record.
6235 * ib_multipath_rec_t
6238 /****f* IBA Base: Types/ib_multipath_rec_mtu
6240 * ib_multipath_rec_mtu
6243 * Get encoded path MTU.
6247 static inline uint8_t OSM_API
6248 ib_multipath_rec_mtu(IN const ib_multipath_rec_t * const p_rec)
6250 return ((uint8_t) (p_rec->mtu & IB_MULTIPATH_REC_BASE_MASK));
6256 * [in] Pointer to the multipath record object.
6270 * ib_multipath_rec_t
6273 /****f* IBA Base: Types/ib_multipath_rec_mtu_sel
6275 * ib_multipath_rec_mtu_sel
6278 * Get encoded multipath MTU selector.
6282 static inline uint8_t OSM_API
6283 ib_multipath_rec_mtu_sel(IN const ib_multipath_rec_t * const p_rec)
6285 return ((uint8_t) ((p_rec->mtu & IB_MULTIPATH_REC_SELECTOR_MASK) >> 6));
6291 * [in] Pointer to the multipath record object.
6294 * Encoded path MTU selector value (for queries).
6295 * 0: greater than MTU specified
6296 * 1: less than MTU specified
6297 * 2: exactly the MTU specified
6298 * 3: largest MTU available
6303 * ib_multipath_rec_t
6306 /****f* IBA Base: Types/ib_multipath_rec_rate
6308 * ib_multipath_rec_rate
6311 * Get encoded multipath rate.
6315 static inline uint8_t OSM_API
6316 ib_multipath_rec_rate(IN const ib_multipath_rec_t * const p_rec)
6318 return ((uint8_t) (p_rec->rate & IB_MULTIPATH_REC_BASE_MASK));
6324 * [in] Pointer to the multipath record object.
6327 * Encoded multipath rate.
6336 * ib_multipath_rec_t
6339 /****f* IBA Base: Types/ib_multipath_rec_rate_sel
6341 * ib_multipath_rec_rate_sel
6344 * Get encoded multipath rate selector.
6348 static inline uint8_t OSM_API
6349 ib_multipath_rec_rate_sel(IN const ib_multipath_rec_t * const p_rec)
6352 ((p_rec->rate & IB_MULTIPATH_REC_SELECTOR_MASK) >> 6));
6358 * [in] Pointer to the multipath record object.
6361 * Encoded path rate selector value (for queries).
6362 * 0: greater than rate specified
6363 * 1: less than rate specified
6364 * 2: exactly the rate specified
6365 * 3: largest rate available
6370 * ib_multipath_rec_t
6373 /****f* IBA Base: Types/ib_multipath_rec_pkt_life
6375 * ib_multipath_rec_pkt_life
6378 * Get encoded multipath pkt_life.
6382 static inline uint8_t OSM_API
6383 ib_multipath_rec_pkt_life(IN const ib_multipath_rec_t * const p_rec)
6385 return ((uint8_t) (p_rec->pkt_life & IB_MULTIPATH_REC_BASE_MASK));
6391 * [in] Pointer to the multipath record object.
6394 * Encoded multipath pkt_life = 4.096 usec * 2 ** PacketLifeTime.
6399 * ib_multipath_rec_t
6402 /****f* IBA Base: Types/ib_multipath_rec_pkt_life_sel
6404 * ib_multipath_rec_pkt_life_sel
6407 * Get encoded multipath pkt_lifetime selector.
6411 static inline uint8_t OSM_API
6412 ib_multipath_rec_pkt_life_sel(IN const ib_multipath_rec_t * const p_rec)
6415 ((p_rec->pkt_life & IB_MULTIPATH_REC_SELECTOR_MASK) >> 6));
6421 * [in] Pointer to the multipath record object.
6424 * Encoded path pkt_lifetime selector value (for queries).
6425 * 0: greater than rate specified
6426 * 1: less than rate specified
6427 * 2: exactly the rate specified
6428 * 3: smallest packet lifetime available
6433 * ib_multipath_rec_t
6436 /****f* IBA Base: Types/ib_multipath_rec_service_id
6438 * ib_multipath_rec_service_id
6441 * Get multipath service id.
6445 static inline ib_net64_t OSM_API
6446 ib_multipath_rec_service_id(IN const ib_multipath_rec_t * const p_rec)
6452 sid_union.sid_arr[0] = p_rec->service_id_8msb;
6453 memcpy(&sid_union.sid_arr[1], p_rec->service_id_56lsb, 7);
6454 return sid_union.sid;
6460 * [in] Pointer to the multipath record object.
6468 * ib_multipath_rec_t
6471 #define IB_NUM_PKEY_ELEMENTS_IN_BLOCK 32
6472 /****s* IBA Base: Types/ib_pkey_table_t
6477 * IBA defined PKey table. (14.2.5.7)
6482 #include <complib/cl_packon.h>
6483 typedef struct _ib_pkey_table {
6484 ib_net16_t pkey_entry[IB_NUM_PKEY_ELEMENTS_IN_BLOCK];
6486 } PACK_SUFFIX ib_pkey_table_t;
6487 #include <complib/cl_packoff.h>
6490 /****s* IBA Base: Types/ib_pkey_table_record_t
6492 * ib_pkey_table_record_t
6495 * IBA defined P_Key Table Record for SA Query. (15.2.5.11)
6499 #include <complib/cl_packon.h>
6500 typedef struct _ib_pkey_table_record {
6501 ib_net16_t lid; // for CA: lid of port, for switch lid of port 0
6503 uint8_t port_num; // for switch: port number, for CA: reserved
6506 ib_pkey_table_t pkey_tbl;
6508 } PACK_SUFFIX ib_pkey_table_record_t;
6509 #include <complib/cl_packoff.h>
6512 #define IB_DROP_VL 15
6513 #define IB_MAX_NUM_VLS 16
6514 /****s* IBA Base: Types/ib_slvl_table_t
6519 * IBA defined SL2VL Mapping Table Attribute. (14.2.5.8)
6523 #include <complib/cl_packon.h>
6524 typedef struct _ib_slvl_table {
6525 uint8_t raw_vl_by_sl[IB_MAX_NUM_VLS / 2];
6526 } PACK_SUFFIX ib_slvl_table_t;
6527 #include <complib/cl_packoff.h>
6530 /****s* IBA Base: Types/ib_slvl_table_record_t
6532 * ib_slvl_table_record_t
6535 * IBA defined SL to VL Mapping Table Record for SA Query. (15.2.5.4)
6539 #include <complib/cl_packon.h>
6540 typedef struct _ib_slvl_table_record {
6541 ib_net16_t lid; // for CA: lid of port, for switch lid of port 0
6542 uint8_t in_port_num; // reserved for CAs
6543 uint8_t out_port_num; // reserved for CAs
6545 ib_slvl_table_t slvl_tbl;
6547 } PACK_SUFFIX ib_slvl_table_record_t;
6548 #include <complib/cl_packoff.h>
6551 /****f* IBA Base: Types/ib_slvl_table_set
6556 * Set slvl table entry.
6560 static inline void OSM_API
6561 ib_slvl_table_set(IN ib_slvl_table_t * p_slvl_tbl,
6562 IN uint8_t sl_index, IN uint8_t vl)
6564 uint8_t idx = sl_index / 2;
6565 CL_ASSERT(vl <= 15);
6566 CL_ASSERT(sl_index <= 15);
6569 /* this is an odd sl. Need to update the ls bits */
6570 p_slvl_tbl->raw_vl_by_sl[idx] =
6571 (p_slvl_tbl->raw_vl_by_sl[idx] & 0xF0) | vl;
6573 /* this is an even sl. Need to update the ms bits */
6574 p_slvl_tbl->raw_vl_by_sl[idx] =
6575 (vl << 4) | (p_slvl_tbl->raw_vl_by_sl[idx] & 0x0F);
6582 * [in] pointer to ib_slvl_table_t object.
6585 * [in] the sl index in the table to be updated.
6588 * [in] the vl value to update for that sl.
6599 /****f* IBA Base: Types/ib_slvl_table_get
6604 * Get slvl table entry.
6608 static inline uint8_t OSM_API
6609 ib_slvl_table_get(IN const ib_slvl_table_t * p_slvl_tbl, IN uint8_t sl_index)
6611 uint8_t idx = sl_index / 2;
6612 CL_ASSERT(sl_index <= 15);
6615 /* this is an odd sl. Need to return the ls bits. */
6616 return (p_slvl_tbl->raw_vl_by_sl[idx] & 0x0F);
6618 /* this is an even sl. Need to return the ms bits. */
6619 return ((p_slvl_tbl->raw_vl_by_sl[idx] & 0xF0) >> 4);
6626 * [in] pointer to ib_slvl_table_t object.
6629 * [in] the sl index in the table whose value should be returned.
6632 * vl for the requested sl_index.
6640 /****s* IBA Base: Types/ib_vl_arb_element_t
6642 * ib_vl_arb_element_t
6645 * IBA defined VL Arbitration Table Element. (14.2.5.9)
6649 #include <complib/cl_packon.h>
6650 typedef struct _ib_vl_arb_element {
6653 } PACK_SUFFIX ib_vl_arb_element_t;
6654 #include <complib/cl_packoff.h>
6657 #define IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK 32
6659 /****s* IBA Base: Types/ib_vl_arb_table_t
6664 * IBA defined VL Arbitration Table. (14.2.5.9)
6668 #include <complib/cl_packon.h>
6669 typedef struct _ib_vl_arb_table {
6670 ib_vl_arb_element_t vl_entry[IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK];
6671 } PACK_SUFFIX ib_vl_arb_table_t;
6672 #include <complib/cl_packoff.h>
6675 /****s* IBA Base: Types/ib_vl_arb_table_record_t
6677 * ib_vl_arb_table_record_t
6680 * IBA defined VL Arbitration Table Record for SA Query. (15.2.5.9)
6684 #include <complib/cl_packon.h>
6685 typedef struct _ib_vl_arb_table_record {
6686 ib_net16_t lid; // for CA: lid of port, for switch lid of port 0
6690 ib_vl_arb_table_t vl_arb_tbl;
6691 } PACK_SUFFIX ib_vl_arb_table_record_t;
6692 #include <complib/cl_packoff.h>
6696 * Global route header information received with unreliable datagram messages
6698 #include <complib/cl_packon.h>
6699 typedef struct _ib_grh {
6700 ib_net32_t ver_class_flow;
6706 } PACK_SUFFIX ib_grh_t;
6707 #include <complib/cl_packoff.h>
6709 /****f* IBA Base: Types/ib_grh_get_ver_class_flow
6711 * ib_grh_get_ver_class_flow
6714 * Get encoded version, traffic class and flow label in grh
6718 static inline void OSM_API
6719 ib_grh_get_ver_class_flow(IN const ib_net32_t ver_class_flow,
6720 OUT uint8_t * const p_ver,
6721 OUT uint8_t * const p_tclass,
6722 OUT uint32_t * const p_flow_lbl)
6724 ib_net32_t tmp_ver_class_flow;
6727 *p_ver = (uint8_t) (ver_class_flow & 0x0f);
6729 tmp_ver_class_flow = ver_class_flow >> 4;
6732 *p_tclass = (uint8_t) (tmp_ver_class_flow & 0xff);
6734 tmp_ver_class_flow = tmp_ver_class_flow >> 8;
6737 *p_flow_lbl = tmp_ver_class_flow & 0xfffff;
6743 * [in] the version, traffic class and flow label info.
6747 * [out] pointer to the version info.
6750 * [out] pointer to the traffic class info.
6753 * [out] pointer to the flow label info
6761 /****f* IBA Base: Types/ib_grh_set_ver_class_flow
6763 * ib_grh_set_ver_class_flow
6766 * Set encoded version, traffic class and flow label in grh
6770 static inline ib_net32_t OSM_API
6771 ib_grh_set_ver_class_flow(IN const uint8_t ver,
6772 IN const uint8_t tclass, IN const uint32_t flow_lbl)
6774 ib_net32_t ver_class_flow;
6776 ver_class_flow = flow_lbl;
6777 ver_class_flow = ver_class_flow << 8;
6778 ver_class_flow = ver_class_flow | tclass;
6779 ver_class_flow = ver_class_flow << 4;
6780 ver_class_flow = ver_class_flow | ver;
6781 return (ver_class_flow);
6787 * [in] the version info.
6790 * [in] the traffic class info.
6793 * [in] the flow label info
6797 * [out] the version, traffic class and flow label info.
6805 /****s* IBA Base: Types/ib_member_rec_t
6810 * Multicast member record, used to create, join, and leave multicast
6815 #include <complib/cl_packon.h>
6816 typedef struct _ib_member_rec {
6826 ib_net32_t sl_flow_hop;
6827 uint8_t scope_state;
6828 uint8_t proxy_join:1;
6829 uint8_t reserved[2];
6832 } PACK_SUFFIX ib_member_rec_t;
6833 #include <complib/cl_packoff.h>
6837 * Multicast GID address for this multicast group.
6840 * Valid GID of the endpoint joining this multicast group.
6843 * Q_Key to be sued by this multicast group.
6846 * Multicast LID for this multicast group.
6849 * MTU and MTU selector fields to use on this path
6852 * Another global routing parameter.
6855 * Partition key (P_Key) to use for this member.
6858 * Rate and rate selector fields to use on this path.
6864 * Global routing parameters: service level, hop count, and flow label.
6867 * MGID scope and JoinState of multicast request.
6870 * Enables others in the Partition to proxy add/remove from the group
6875 /****f* IBA Base: Types/ib_member_get_sl_flow_hop
6877 * ib_member_get_sl_flow_hop
6880 * Get encoded sl, flow label, and hop limit
6884 static inline void OSM_API
6885 ib_member_get_sl_flow_hop(IN const ib_net32_t sl_flow_hop,
6886 OUT uint8_t * const p_sl,
6887 OUT uint32_t * const p_flow_lbl,
6888 OUT uint8_t * const p_hop)
6892 tmp = cl_ntoh32(sl_flow_hop);
6894 *p_hop = (uint8_t) tmp;
6898 *p_flow_lbl = (uint32_t) (tmp & 0xfffff);
6902 *p_sl = (uint8_t) tmp;
6908 * [in] the sl, flow label, and hop limit of MC Group
6912 * [out] pointer to the service level
6915 * [out] pointer to the flow label info
6918 * [out] pointer to the hop count limit.
6926 /****f* IBA Base: Types/ib_member_set_sl_flow_hop
6928 * ib_member_set_sl_flow_hop
6931 * Set encoded sl, flow label, and hop limit
6935 static inline ib_net32_t OSM_API
6936 ib_member_set_sl_flow_hop(IN const uint8_t sl,
6937 IN const uint32_t flow_label,
6938 IN const uint8_t hop_limit)
6942 tmp = (sl << 28) | ((flow_label & 0xfffff) << 8) | hop_limit;
6943 return cl_hton32(tmp);
6949 * [in] the service level.
6952 * [in] the flow label info
6955 * [in] the hop limit.
6959 * [out] the encoded sl, flow label, and hop limit
6967 /****f* IBA Base: Types/ib_member_get_scope_state
6969 * ib_member_get_scope_state
6972 * Get encoded MGID scope and JoinState
6976 static inline void OSM_API
6977 ib_member_get_scope_state(IN const uint8_t scope_state,
6978 OUT uint8_t * const p_scope,
6979 OUT uint8_t * const p_state)
6981 uint8_t tmp_scope_state;
6984 *p_state = (uint8_t) (scope_state & 0x0f);
6986 tmp_scope_state = scope_state >> 4;
6989 *p_scope = (uint8_t) (tmp_scope_state & 0x0f);
6996 * [in] the scope and state
7000 * [out] pointer to the MGID scope
7003 * [out] pointer to the join state
7011 /****f* IBA Base: Types/ib_member_set_scope_state
7013 * ib_member_set_scope_state
7016 * Set encoded version, MGID scope and JoinState
7020 static inline uint8_t OSM_API
7021 ib_member_set_scope_state(IN const uint8_t scope, IN const uint8_t state)
7023 uint8_t scope_state;
7025 scope_state = scope;
7026 scope_state = scope_state << 4;
7027 scope_state = scope_state | state;
7028 return (scope_state);
7034 * [in] the MGID scope
7037 * [in] the JoinState
7041 * [out] the encoded one
7049 /****f* IBA Base: Types/ib_member_set_join_state
7051 * ib_member_set_join_state
7058 static inline void OSM_API
7059 ib_member_set_join_state(IN OUT ib_member_rec_t * p_mc_rec,
7060 IN const uint8_t state)
7062 /* keep the scope as it is */
7063 p_mc_rec->scope_state = (p_mc_rec->scope_state & 0xF0) | (0x0f & state);
7069 * [in] pointer to the member record
7072 * [in] the JoinState
7086 #define IB_MC_REC_STATE_FULL_MEMBER 0x01
7087 #define IB_MC_REC_STATE_NON_MEMBER 0x02
7088 #define IB_MC_REC_STATE_SEND_ONLY_NON_MEMBER 0x04
7091 * Generic MAD notice types
7093 #define IB_NOTICE_TYPE_FATAL 0x00
7094 #define IB_NOTICE_TYPE_URGENT 0x01
7095 #define IB_NOTICE_TYPE_SECURITY 0x02
7096 #define IB_NOTICE_TYPE_SUBN_MGMT 0x03
7097 #define IB_NOTICE_TYPE_INFO 0x04
7098 #define IB_NOTICE_TYPE_EMPTY 0x7F
7100 #include <complib/cl_packon.h>
7101 typedef struct _ib_mad_notice_attr // Total Size calc Accumulated
7103 uint8_t generic_type; // 1 1
7105 union _notice_g_or_v {
7106 struct _notice_generic // 5 6
7108 uint8_t prod_type_msb;
7109 ib_net16_t prod_type_lsb;
7110 ib_net16_t trap_num;
7111 } PACK_SUFFIX generic;
7113 struct _notice_vend {
7114 uint8_t vend_id_msb;
7115 ib_net16_t vend_id_lsb;
7120 ib_net16_t issuer_lid; // 2 8
7121 ib_net16_t toggle_count; // 2 10
7123 union _data_details // 54 64
7126 uint8_t details[54];
7127 } PACK_SUFFIX raw_data;
7131 ib_gid_t gid; // the Node or Multicast Group that came in/out
7132 } PACK_SUFFIX ntc_64_67;
7135 ib_net16_t sw_lid; // the sw lid of which link state changed
7136 } PACK_SUFFIX ntc_128;
7138 struct _ntc_129_131 {
7140 ib_net16_t lid; // lid and port number of the violation
7142 } PACK_SUFFIX ntc_129_131;
7146 ib_net16_t lid; // lid where change occured
7147 uint8_t pad2; // reserved
7148 uint8_t local_changes; // 7b reserved 1b local changes
7149 ib_net32_t new_cap_mask; // new capability mask
7150 ib_net16_t change_flgs; // 13b reserved 3b change flags
7151 } PACK_SUFFIX ntc_144;
7155 ib_net16_t lid; // lid where sys guid changed
7157 ib_net64_t new_sys_guid; // new system image guid
7158 } PACK_SUFFIX ntc_145;
7160 struct _ntc_256 { // total: 54
7161 ib_net16_t pad1; // 2
7162 ib_net16_t lid; // 2
7163 ib_net16_t dr_slid; // 2
7164 uint8_t method; // 1
7166 ib_net16_t attr_id; // 2
7167 ib_net32_t attr_mod; // 4
7168 ib_net64_t mkey; // 8
7170 uint8_t dr_trunc_hop; // 1
7171 uint8_t dr_rtn_path[30]; // 30
7172 } PACK_SUFFIX ntc_256;
7174 struct _ntc_257_258 // violation of p/q_key // 49
7176 ib_net16_t pad1; // 2
7177 ib_net16_t lid1; // 2
7178 ib_net16_t lid2; // 2
7179 ib_net32_t key; // 2
7181 ib_net32_t qp1; // 4
7182 ib_net32_t qp2; // 4
7183 ib_gid_t gid1; // 16
7184 ib_gid_t gid2; // 16
7185 } PACK_SUFFIX ntc_257_258;
7187 struct _ntc_259 // pkey violation from switch 51
7189 ib_net16_t data_valid; // 2
7190 ib_net16_t lid1; // 2
7191 ib_net16_t lid2; // 2
7192 ib_net16_t pkey; // 2
7193 ib_net32_t sl_qp1; // 4b sl, 4b pad, 24b qp1
7194 ib_net32_t qp2; // 8b pad, 24b qp2
7195 ib_gid_t gid1; // 16
7196 ib_gid_t gid2; // 16
7197 ib_net16_t sw_lid; // 2
7198 uint8_t port_no; // 1
7199 } PACK_SUFFIX ntc_259;
7203 ib_gid_t issuer_gid; // 16 80
7205 } PACK_SUFFIX ib_mad_notice_attr_t;
7206 #include <complib/cl_packoff.h>
7211 #define TRAP_259_MASK_SL (CL_HTON32(0xF0000000))
7212 #define TRAP_259_MASK_QP (CL_HTON32(0x00FFFFFF))
7217 #define TRAP_144_MASK_OTHER_LOCAL_CHANGES 0x01
7218 #define TRAP_144_MASK_SM_PRIORITY_CHANGE (CL_HTON16(0x0008))
7219 #define TRAP_144_MASK_LINK_SPEED_ENABLE_CHANGE (CL_HTON16(0x0004))
7220 #define TRAP_144_MASK_LINK_WIDTH_ENABLE_CHANGE (CL_HTON16(0x0002))
7221 #define TRAP_144_MASK_NODE_DESCRIPTION_CHANGE (CL_HTON16(0x0001))
7223 /****f* IBA Base: Types/ib_notice_is_generic
7225 * ib_notice_is_generic
7228 * Check if the notice is generic
7232 static inline boolean_t OSM_API
7233 ib_notice_is_generic(IN const ib_mad_notice_attr_t * p_ntc)
7235 return (p_ntc->generic_type & 0x80);
7241 * [in] Pointer to the notice MAD attribute
7244 * TRUE if mad is generic
7247 * ib_mad_notice_attr_t
7250 /****f* IBA Base: Types/ib_notice_get_type
7252 * ib_notice_get_type
7255 * Get the notice type
7259 static inline uint8_t OSM_API
7260 ib_notice_get_type(IN const ib_mad_notice_attr_t * p_ntc)
7262 return p_ntc->generic_type & 0x7f;
7268 * [in] Pointer to the notice MAD attribute
7271 * TRUE if mad is generic
7274 * ib_mad_notice_attr_t
7277 /****f* IBA Base: Types/ib_notice_get_prod_type
7279 * ib_notice_get_prod_type
7282 * Get the notice Producer Type of Generic Notice
7286 static inline ib_net32_t OSM_API
7287 ib_notice_get_prod_type(IN const ib_mad_notice_attr_t * p_ntc)
7291 pt = cl_ntoh16(p_ntc->g_or_v.generic.prod_type_lsb) |
7292 (p_ntc->g_or_v.generic.prod_type_msb << 16);
7293 return cl_hton32(pt);
7299 * [in] Pointer to the notice MAD attribute
7305 * ib_mad_notice_attr_t
7308 /****f* IBA Base: Types/ib_notice_set_prod_type
7310 * ib_notice_set_prod_type
7313 * Set the notice Producer Type of Generic Notice
7317 static inline void OSM_API
7318 ib_notice_set_prod_type(IN ib_mad_notice_attr_t * p_ntc,
7319 IN ib_net32_t prod_type_val)
7321 uint32_t ptv = cl_ntoh32(prod_type_val);
7322 p_ntc->g_or_v.generic.prod_type_lsb =
7323 cl_hton16((uint16_t) (ptv & 0x0000ffff));
7324 p_ntc->g_or_v.generic.prod_type_msb =
7325 (uint8_t) ((ptv & 0x00ff0000) >> 16);
7331 * [in] Pointer to the notice MAD attribute
7334 * [in] The producer Type code
7340 * ib_mad_notice_attr_t
7343 /****f* IBA Base: Types/ib_notice_set_prod_type_ho
7345 * ib_notice_set_prod_type_ho
7348 * Set the notice Producer Type of Generic Notice given Host Order
7352 static inline void OSM_API
7353 ib_notice_set_prod_type_ho(IN ib_mad_notice_attr_t * p_ntc,
7354 IN uint32_t prod_type_val_ho)
7356 p_ntc->g_or_v.generic.prod_type_lsb =
7357 cl_hton16((uint16_t) (prod_type_val_ho & 0x0000ffff));
7358 p_ntc->g_or_v.generic.prod_type_msb =
7359 (uint8_t) ((prod_type_val_ho & 0x00ff0000) >> 16);
7365 * [in] Pointer to the notice MAD attribute
7368 * [in] The producer Type code in host order
7374 * ib_mad_notice_attr_t
7377 /****f* IBA Base: Types/ib_notice_get_vend_id
7379 * ib_notice_get_vend_id
7382 * Get the Vendor Id of Vendor type Notice
7386 static inline ib_net32_t OSM_API
7387 ib_notice_get_vend_id(IN const ib_mad_notice_attr_t * p_ntc)
7391 vi = cl_ntoh16(p_ntc->g_or_v.vend.vend_id_lsb) |
7392 (p_ntc->g_or_v.vend.vend_id_msb << 16);
7393 return cl_hton32(vi);
7399 * [in] Pointer to the notice MAD attribute
7402 * The Vendor Id of Vendor type Notice
7405 * ib_mad_notice_attr_t
7408 /****f* IBA Base: Types/ib_notice_set_vend_id
7410 * ib_notice_set_vend_id
7413 * Set the notice Producer Type of Generic Notice
7417 static inline void OSM_API
7418 ib_notice_set_vend_id(IN ib_mad_notice_attr_t * p_ntc, IN ib_net32_t vend_id)
7420 uint32_t vi = cl_ntoh32(vend_id);
7421 p_ntc->g_or_v.vend.vend_id_lsb =
7422 cl_hton16((uint16_t) (vi & 0x0000ffff));
7423 p_ntc->g_or_v.vend.vend_id_msb = (uint8_t) ((vi & 0x00ff0000) >> 16);
7429 * [in] Pointer to the notice MAD attribute
7432 * [in] The producer Type code
7438 * ib_mad_notice_attr_t
7441 /****f* IBA Base: Types/ib_notice_set_vend_id_ho
7443 * ib_notice_set_vend_id_ho
7446 * Set the notice Producer Type of Generic Notice given a host order value
7450 static inline void OSM_API
7451 ib_notice_set_vend_id_ho(IN ib_mad_notice_attr_t * p_ntc,
7452 IN uint32_t vend_id_ho)
7454 p_ntc->g_or_v.vend.vend_id_lsb =
7455 cl_hton16((uint16_t) (vend_id_ho & 0x0000ffff));
7456 p_ntc->g_or_v.vend.vend_id_msb =
7457 (uint8_t) ((vend_id_ho & 0x00ff0000) >> 16);
7463 * [in] Pointer to the notice MAD attribute
7466 * [in] The producer Type code in host order
7472 * ib_mad_notice_attr_t
7475 #include <complib/cl_packon.h>
7476 typedef struct _ib_inform_info {
7478 ib_net16_t lid_range_begin;
7479 ib_net16_t lid_range_end;
7480 ib_net16_t reserved1;
7483 ib_net16_t trap_type;
7484 union _inform_g_or_v {
7485 struct _inform_generic {
7486 ib_net16_t trap_num;
7487 ib_net32_t qpn_resp_time_val;
7489 uint8_t node_type_msb;
7490 ib_net16_t node_type_lsb;
7491 } PACK_SUFFIX generic;
7493 struct _inform_vend {
7495 ib_net32_t qpn_resp_time_val;
7497 uint8_t vendor_id_msb;
7498 ib_net16_t vendor_id_lsb;
7501 } PACK_SUFFIX g_or_v;
7503 } PACK_SUFFIX ib_inform_info_t;
7504 #include <complib/cl_packoff.h>
7506 /****f* IBA Base: Types/ib_inform_info_get_qpn_resp_time
7508 * ib_inform_info_get_qpn_resp_time
7511 * Get QPN of the inform info
7515 static inline void OSM_API
7516 ib_inform_info_get_qpn_resp_time(IN const ib_net32_t qpn_resp_time_val,
7517 OUT ib_net32_t * const p_qpn,
7518 OUT uint8_t * const p_resp_time_val)
7520 uint32_t tmp = cl_ntoh32(qpn_resp_time_val);
7523 *p_qpn = cl_hton32((tmp & 0xffffff00) >> 8);
7525 if (p_resp_time_val)
7526 *p_resp_time_val = (uint8_t) (tmp & 0x0000001f);
7532 * [in] the qpn and resp time val from the mad
7536 * [out] pointer to the qpn
7539 * [out] pointer to the resp time val
7547 /****f* IBA Base: Types/ib_inform_info_set_qpn
7549 * ib_inform_info_set_qpn
7552 * Set the QPN of the inform info
7556 static inline void OSM_API
7557 ib_inform_info_set_qpn(IN ib_inform_info_t * p_ii, IN ib_net32_t const qpn)
7559 uint32_t tmp = cl_ntoh32(p_ii->g_or_v.generic.qpn_resp_time_val);
7561 p_ii->g_or_v.generic.qpn_resp_time_val =
7562 cl_hton32((tmp & 0x000000ff) | ((cl_ntoh32(qpn) << 8) & 0xffffff00)
7575 /****f* IBA Base: Types/ib_inform_info_get_prod_type
7577 * ib_inform_info_get_prod_type
7580 * Get Producer Type of the Inform Info
7581 * 13.4.8.3 InformInfo
7585 static inline ib_net32_t OSM_API
7586 ib_inform_info_get_prod_type(IN const ib_inform_info_t * p_inf)
7590 nt = cl_ntoh16(p_inf->g_or_v.generic.node_type_lsb) |
7591 (p_inf->g_or_v.generic.node_type_msb << 16);
7592 return cl_hton32(nt);
7598 * [in] pointer to an inform info
7609 /****f* IBA Base: Types/ib_inform_info_get_vend_id
7611 * ib_inform_info_get_vend_id
7614 * Get Node Type of the Inform Info
7618 static inline ib_net32_t OSM_API
7619 ib_inform_info_get_vend_id(IN const ib_inform_info_t * p_inf)
7623 vi = cl_ntoh16(p_inf->g_or_v.vend.vendor_id_lsb) |
7624 (p_inf->g_or_v.vend.vendor_id_msb << 16);
7625 return cl_hton32(vi);
7631 * [in] pointer to an inform info
7642 /****s* IBA Base: Types/ib_inform_info_record_t
7644 * ib_inform_info_record_t
7647 * IBA defined InformInfo Record. (15.2.5.12)
7651 #include <complib/cl_packon.h>
7652 typedef struct _ib_inform_info_record {
7653 ib_gid_t subscriber_gid;
7654 ib_net16_t subscriber_enum;
7655 uint8_t reserved[6];
7656 ib_inform_info_t inform_info;
7658 } PACK_SUFFIX ib_inform_info_record_t;
7659 #include <complib/cl_packoff.h>
7661 /****s* IBA Base: Types/ib_perfmgt_mad_t
7666 * IBA defined Perf Management MAD (16.3.1)
7670 #include <complib/cl_packon.h>
7671 typedef struct _ib_perfmgt_mad {
7675 #define IB_PM_DATA_SIZE 192
7676 uint8_t data[IB_PM_DATA_SIZE];
7678 } PACK_SUFFIX ib_perfmgt_mad_t;
7679 #include <complib/cl_packoff.h>
7683 * Common MAD header.
7689 * Performance Management payload. The structure and content of this field
7690 * depends upon the method, attr_id, and attr_mod fields in the header.
7696 /****s* IBA Base: Types/ib_port_counters
7698 * ib_port_counters_t
7701 * IBA defined PortCounters Attribute. (16.1.3.5)
7705 #include <complib/cl_packon.h>
7706 typedef struct _ib_port_counters {
7708 uint8_t port_select;
7709 ib_net16_t counter_select;
7710 ib_net16_t symbol_err_cnt;
7711 uint8_t link_err_recover;
7712 uint8_t link_downed;
7714 ib_net16_t rcv_rem_phys_err;
7715 ib_net16_t rcv_switch_relay_err;
7716 ib_net16_t xmit_discards;
7717 uint8_t xmit_constraint_err;
7718 uint8_t rcv_constraint_err;
7720 uint8_t link_int_buffer_overrun;
7722 ib_net16_t vl15_dropped;
7723 ib_net32_t xmit_data;
7724 ib_net32_t rcv_data;
7725 ib_net32_t xmit_pkts;
7726 ib_net32_t rcv_pkts;
7727 } PACK_SUFFIX ib_port_counters_t;
7728 #include <complib/cl_packoff.h>
7730 #define PC_LINK_INT(integ_buf_over) ((integ_buf_over & 0xF0) >> 4)
7731 #define PC_BUF_OVERRUN(integ_buf_over) (integ_buf_over & 0x0F)
7733 /****s* IBA Base: Types/ib_port_counters_ext
7735 * ib_port_counters_ext_t
7738 * IBA defined PortCounters Extended Attribute. (16.1.4.11)
7742 #include <complib/cl_packon.h>
7743 typedef struct _ib_port_counters_ext {
7745 uint8_t port_select;
7746 ib_net16_t counter_select;
7747 ib_net32_t reserved2;
7748 ib_net64_t xmit_data;
7749 ib_net64_t rcv_data;
7750 ib_net64_t xmit_pkts;
7751 ib_net64_t rcv_pkts;
7752 ib_net64_t unicast_xmit_pkts;
7753 ib_net64_t unicast_rcv_pkts;
7754 ib_net64_t multicast_xmit_pkts;
7755 ib_net64_t multicast_rcv_pkts;
7756 } PACK_SUFFIX ib_port_counters_ext_t;
7757 #include <complib/cl_packoff.h>
7759 /****s* IBA Base: Types/ib_port_samples_control
7761 * ib_port_samples_control_t
7764 * IBA defined PortSamplesControl Attribute. (16.1.3.2)
7768 #include <complib/cl_packon.h>
7769 typedef struct _ib_port_samples_control {
7771 uint8_t port_select;
7773 uint8_t counter_width; /* 5 bits res : 3bits counter_width */
7774 ib_net32_t counter_mask; /* 2 bits res : 3 bits counter_mask : 27 bits counter_masks_1to9 */
7775 ib_net16_t counter_mask_10to14; /* 1 bits res : 15 bits counter_masks_10to14 */
7776 uint8_t sample_mech;
7777 uint8_t sample_status; /* 6 bits res : 2 bits sample_status */
7778 ib_net64_t option_mask;
7779 ib_net64_t vendor_mask;
7780 ib_net32_t sample_start;
7781 ib_net32_t sample_interval;
7783 ib_net16_t counter_select0;
7784 ib_net16_t counter_select1;
7785 ib_net16_t counter_select2;
7786 ib_net16_t counter_select3;
7787 ib_net16_t counter_select4;
7788 ib_net16_t counter_select5;
7789 ib_net16_t counter_select6;
7790 ib_net16_t counter_select7;
7791 ib_net16_t counter_select8;
7792 ib_net16_t counter_select9;
7793 ib_net16_t counter_select10;
7794 ib_net16_t counter_select11;
7795 ib_net16_t counter_select12;
7796 ib_net16_t counter_select13;
7797 ib_net16_t counter_select14;
7798 } PACK_SUFFIX ib_port_samples_control_t;
7799 #include <complib/cl_packoff.h>
7801 /****d* IBA Base: Types/CounterSelect values
7803 * Counter select values
7806 * Mandatory counter select values (16.1.3.3)
7810 #define IB_CS_PORT_XMIT_DATA (CL_HTON16(0x0001))
7811 #define IB_CS_PORT_RCV_DATA (CL_HTON16(0x0002))
7812 #define IB_CS_PORT_XMIT_PKTS (CL_HTON16(0x0003))
7813 #define IB_CS_PORT_RCV_PKTS (CL_HTON16(0x0004))
7814 #define IB_CS_PORT_XMIT_WAIT (CL_HTON16(0x0005))
7816 /****s* IBA Base: Types/ib_port_samples_result
7818 * ib_port_samples_result_t
7821 * IBA defined PortSamplesControl Attribute. (16.1.3.2)
7825 #include <complib/cl_packon.h>
7826 typedef struct _ib_port_samples_result {
7828 ib_net16_t sample_status; /* 14 bits res : 2 bits sample_status */
7829 ib_net32_t counter0;
7830 ib_net32_t counter1;
7831 ib_net32_t counter2;
7832 ib_net32_t counter3;
7833 ib_net32_t counter4;
7834 ib_net32_t counter5;
7835 ib_net32_t counter6;
7836 ib_net32_t counter7;
7837 ib_net32_t counter8;
7838 ib_net32_t counter9;
7839 ib_net32_t counter10;
7840 ib_net32_t counter11;
7841 ib_net32_t counter12;
7842 ib_net32_t counter13;
7843 ib_net32_t counter14;
7844 } PACK_SUFFIX ib_port_samples_result_t;
7845 #include <complib/cl_packoff.h>
7847 /****d* IBA Base: Types/DM_SVC_NAME
7852 * IBA defined Device Management service name (16.3)
7856 #define DM_SVC_NAME "DeviceManager.IBTA"
7861 /****s* IBA Base: Types/ib_dm_mad_t
7866 * IBA defined Device Management MAD (16.3.1)
7870 #include <complib/cl_packon.h>
7871 typedef struct _ib_dm_mad {
7875 #define IB_DM_DATA_SIZE 192
7876 uint8_t data[IB_DM_DATA_SIZE];
7878 } PACK_SUFFIX ib_dm_mad_t;
7879 #include <complib/cl_packoff.h>
7883 * Common MAD header.
7889 * Device Management payload. The structure and content of this field
7890 * depend upon the method, attr_id, and attr_mod fields in the header.
7896 /****s* IBA Base: Types/ib_iou_info_t
7901 * IBA defined IO Unit information structure (16.3.3.3)
7905 #include <complib/cl_packon.h>
7906 typedef struct _ib_iou_info {
7907 ib_net16_t change_id;
7908 uint8_t max_controllers;
7911 #define IB_DM_CTRL_LIST_SIZE 128
7913 uint8_t controller_list[IB_DM_CTRL_LIST_SIZE];
7914 #define IOC_NOT_INSTALLED 0x0
7915 #define IOC_INSTALLED 0x1
7916 // Reserved values 0x02-0xE
7917 #define SLOT_DOES_NOT_EXIST 0xF
7919 } PACK_SUFFIX ib_iou_info_t;
7920 #include <complib/cl_packoff.h>
7924 * Value incremented, with rollover, by any change to the controller_list.
7927 * Number of slots in controller_list.
7930 * A byte containing two fields: DiagDeviceID and OptionROM.
7931 * These fields may be read using the ib_iou_info_diag_dev_id
7932 * and ib_iou_info_option_rom functions.
7935 * A series of 4-bit nibbles, with each nibble representing a slot
7936 * in the IO Unit. Individual nibbles may be read using the
7937 * ioc_at_slot function.
7940 * ib_dm_mad_t, ib_iou_info_diag_dev_id, ib_iou_info_option_rom, ioc_at_slot
7943 /****f* IBA Base: Types/ib_iou_info_diag_dev_id
7945 * ib_iou_info_diag_dev_id
7948 * Returns the DiagDeviceID.
7952 static inline uint8_t OSM_API
7953 ib_iou_info_diag_dev_id(IN const ib_iou_info_t * const p_iou_info)
7955 return ((uint8_t) (p_iou_info->diag_rom >> 6 & 1));
7961 * [in] Pointer to the IO Unit information structure.
7964 * DiagDeviceID field of the IO Unit information.
7972 /****f* IBA Base: Types/ib_iou_info_option_rom
7974 * ib_iou_info_option_rom
7977 * Returns the OptionROM.
7981 static inline uint8_t OSM_API
7982 ib_iou_info_option_rom(IN const ib_iou_info_t * const p_iou_info)
7984 return ((uint8_t) (p_iou_info->diag_rom >> 7));
7990 * [in] Pointer to the IO Unit information structure.
7993 * OptionROM field of the IO Unit information.
8001 /****f* IBA Base: Types/ioc_at_slot
8006 * Returns the IOC value at the specified slot.
8010 static inline uint8_t OSM_API
8011 ioc_at_slot(IN const ib_iou_info_t * const p_iou_info, IN uint8_t slot)
8013 if (slot >= IB_DM_CTRL_LIST_SIZE)
8014 return SLOT_DOES_NOT_EXIST;
8018 ((p_iou_info->controller_list[slot / 2] & 0xf0) >> 4) :
8019 (p_iou_info->controller_list[slot / 2] & 0x0f));
8025 * [in] Pointer to the IO Unit information structure.
8028 * [in] Pointer to the IO Unit information structure.
8031 * OptionROM field of the IO Unit information.
8039 /****s* IBA Base: Types/ib_ioc_profile_t
8044 * IBA defined IO Controller profile structure (16.3.3.4)
8048 #include <complib/cl_packon.h>
8049 typedef struct _ib_ioc_profile {
8050 ib_net64_t ioc_guid;
8058 ib_net32_t subsys_vend_id;
8059 ib_net32_t subsys_id;
8061 ib_net16_t io_class;
8062 ib_net16_t io_subclass;
8063 ib_net16_t protocol;
8064 ib_net16_t protocol_ver;
8067 ib_net16_t send_msg_depth;
8069 uint8_t rdma_read_depth;
8070 ib_net32_t send_msg_size;
8071 ib_net32_t rdma_size;
8073 uint8_t ctrl_ops_cap;
8074 #define CTRL_OPS_CAP_ST 0x01
8075 #define CTRL_OPS_CAP_SF 0x02
8076 #define CTRL_OPS_CAP_RT 0x04
8077 #define CTRL_OPS_CAP_RF 0x08
8078 #define CTRL_OPS_CAP_WT 0x10
8079 #define CTRL_OPS_CAP_WF 0x20
8080 #define CTRL_OPS_CAP_AT 0x40
8081 #define CTRL_OPS_CAP_AF 0x80
8085 uint8_t num_svc_entries;
8086 #define MAX_NUM_SVC_ENTRIES 0xff
8090 #define CTRL_ID_STRING_LEN 64
8091 char id_string[CTRL_ID_STRING_LEN];
8093 } PACK_SUFFIX ib_ioc_profile_t;
8094 #include <complib/cl_packoff.h>
8098 * An EUI-64 GUID used to uniquely identify the IO controller.
8101 * IO controller vendor ID, IEEE format.
8104 * A number assigned by the vendor to identify the type of controller.
8107 * A number assigned by the vendor to identify the divice version.
8110 * ID of the vendor of the enclosure, if any, in which the IO controller
8111 * resides in IEEE format; otherwise zero.
8114 * A number identifying the subsystem where the controller resides.
8117 * 0x0000 - 0xfffe = reserved for IO classes encompased by InfiniBand
8118 * Architecture. 0xffff = Vendor specific.
8121 * 0x0000 - 0xfffe = reserved for IO subclasses encompased by InfiniBand
8122 * Architecture. 0xffff = Vendor specific. This shall be set to 0xfff
8123 * if the io_class component is 0xffff.
8126 * 0x0000 - 0xfffe = reserved for IO subclasses encompased by InfiniBand
8127 * Architecture. 0xffff = Vendor specific. This shall be set to 0xfff
8128 * if the io_class component is 0xffff.
8131 * Protocol specific.
8134 * Maximum depth of the send message queue.
8137 * Maximum depth of the per-channel RDMA read queue.
8140 * Maximum size of send messages.
8143 * Supported operation types of this IO controller. A bit set to one
8144 * for affirmation of supported capability.
8147 * Number of entries in the service entries table.
8150 * UTF-8 encoded string for identifying the controller to an operator.
8156 static inline uint32_t OSM_API
8157 ib_ioc_profile_get_vend_id(IN const ib_ioc_profile_t * const p_ioc_profile)
8159 return (cl_ntoh32(p_ioc_profile->vend_id) >> 8);
8162 static inline void OSM_API
8163 ib_ioc_profile_set_vend_id(IN ib_ioc_profile_t * const p_ioc_profile,
8164 IN const uint32_t vend_id)
8166 p_ioc_profile->vend_id = (cl_hton32(vend_id) << 8);
8169 /****s* IBA Base: Types/ib_svc_entry_t
8174 * IBA defined IO Controller service entry structure (16.3.3.5)
8178 #include <complib/cl_packon.h>
8179 typedef struct _ib_svc_entry {
8180 #define MAX_SVC_ENTRY_NAME_LEN 40
8181 char name[MAX_SVC_ENTRY_NAME_LEN];
8185 } PACK_SUFFIX ib_svc_entry_t;
8186 #include <complib/cl_packoff.h>
8190 * UTF-8 encoded, null-terminated name of the service.
8193 * An identifier of the associated Service.
8199 /****s* IBA Base: Types/ib_svc_entries_t
8204 * IBA defined IO Controller service entry array (16.3.3.5)
8208 #include <complib/cl_packon.h>
8209 typedef struct _ib_svc_entries {
8210 #define SVC_ENTRY_COUNT 4
8211 ib_svc_entry_t service_entry[SVC_ENTRY_COUNT];
8213 } PACK_SUFFIX ib_svc_entries_t;
8214 #include <complib/cl_packoff.h>
8218 * An array of IO controller service entries.
8221 * ib_dm_mad_t, ib_svc_entry_t
8224 static inline void OSM_API
8225 ib_dm_get_slot_lo_hi(IN const ib_net32_t slot_lo_hi,
8226 OUT uint8_t * const p_slot,
8227 OUT uint8_t * const p_lo, OUT uint8_t * const p_hi)
8229 ib_net32_t tmp_slot_lo_hi = CL_NTOH32(slot_lo_hi);
8232 *p_slot = (uint8_t) ((tmp_slot_lo_hi >> 16) & 0x0f);
8235 *p_hi = (uint8_t) ((tmp_slot_lo_hi >> 8) & 0xff);
8238 *p_lo = (uint8_t) ((tmp_slot_lo_hi >> 0) & 0xff);
8242 * IBA defined information describing an I/O controller
8244 #include <complib/cl_packon.h>
8245 typedef struct _ib_ioc_info {
8246 ib_net64_t module_guid;
8247 ib_net64_t iou_guid;
8248 ib_ioc_profile_t ioc_profile;
8249 ib_net64_t access_key;
8250 uint16_t initiators_conf;
8253 } PACK_SUFFIX ib_ioc_info_t;
8254 #include <complib/cl_packoff.h>
8257 * The following definitions are shared between the Access Layer and VPD
8259 typedef struct _ib_ca *__ptr64 ib_ca_handle_t;
8260 typedef struct _ib_pd *__ptr64 ib_pd_handle_t;
8261 typedef struct _ib_rdd *__ptr64 ib_rdd_handle_t;
8262 typedef struct _ib_mr *__ptr64 ib_mr_handle_t;
8263 typedef struct _ib_mw *__ptr64 ib_mw_handle_t;
8264 typedef struct _ib_qp *__ptr64 ib_qp_handle_t;
8265 typedef struct _ib_eec *__ptr64 ib_eec_handle_t;
8266 typedef struct _ib_cq *__ptr64 ib_cq_handle_t;
8267 typedef struct _ib_av *__ptr64 ib_av_handle_t;
8268 typedef struct _ib_mcast *__ptr64 ib_mcast_handle_t;
8270 /* Currently for windows branch, use the extended version of ib special verbs struct
8271 in order to be compliant with Infinicon ib_types; later we'll change it to support
8272 OpenSM ib_types.h */
8275 /****d* Access Layer/ib_api_status_t
8280 * Function return codes indicating the success or failure of an API call.
8281 * Note that success is indicated by the return value IB_SUCCESS, which
8285 * IB_VERBS_PROCESSING_DONE is used by UVP library to terminate a verbs call
8286 * in the pre-ioctl step itself.
8290 typedef enum _ib_api_status_t {
8292 IB_INSUFFICIENT_RESOURCES,
8293 IB_INSUFFICIENT_MEMORY,
8294 IB_INVALID_PARAMETER,
8300 IB_INVALID_PERMISSION,
8303 IB_MAX_MCAST_QPS_REACHED,
8304 IB_INVALID_QP_STATE,
8305 IB_INVALID_EEC_STATE,
8306 IB_INVALID_APM_STATE,
8307 IB_INVALID_PORT_STATE,
8316 IB_INVALID_SERVICE_TYPE,
8320 IB_INVALID_CA_HANDLE,
8321 IB_INVALID_AV_HANDLE,
8322 IB_INVALID_CQ_HANDLE,
8323 IB_INVALID_EEC_HANDLE,
8324 IB_INVALID_QP_HANDLE,
8325 IB_INVALID_PD_HANDLE,
8326 IB_INVALID_MR_HANDLE,
8327 IB_INVALID_MW_HANDLE,
8328 IB_INVALID_RDD_HANDLE,
8329 IB_INVALID_MCAST_HANDLE,
8330 IB_INVALID_CALLBACK,
8331 IB_INVALID_AL_HANDLE, /* InfiniBand Access Layer */
8332 IB_INVALID_HANDLE, /* InfiniBand Access Layer */
8333 IB_ERROR, /* InfiniBand Access Layer */
8334 IB_REMOTE_ERROR, /* Infiniband Access Layer */
8335 IB_VERBS_PROCESSING_DONE, /* See Notes above */
8341 IB_UNKNOWN_ERROR /* ALWAYS LAST ENUM VALUE! */
8345 OSM_EXPORT const char *ib_error_str[];
8347 /****f* IBA Base: Types/ib_get_err_str
8352 * Returns a string for the specified status value.
8356 static inline const char *OSM_API ib_get_err_str(IN ib_api_status_t status)
8358 if (status > IB_UNKNOWN_ERROR)
8359 status = IB_UNKNOWN_ERROR;
8360 return (ib_error_str[status]);
8369 * Pointer to the status description string.
8376 /****d* Verbs/ib_async_event_t
8378 * ib_async_event_t -- Async event types
8381 * This type indicates the reason the async callback was called.
8382 * The context in the ib_event_rec_t indicates the resource context
8383 * that associated with the callback. For example, for IB_AE_CQ_ERROR
8384 * the context provided during the ib_create_cq is returned in the event.
8388 typedef enum _ib_async_event_t {
8404 IB_AE_SYSIMG_GUID_TRAP,
8406 IB_AE_LINK_INTEGRITY,
8407 IB_AE_FLOW_CTRL_ERROR,
8410 IB_AE_EEC_APM_ERROR,
8412 IB_AE_WQ_ACCESS_ERROR,
8415 IB_AE_UNKNOWN /* ALWAYS LAST ENUM VALUE */
8420 * An error occurred when accessing the send queue of the QP or EEC.
8421 * This event is optional.
8424 * The send queue of the specified QP has completed the outstanding
8425 * messages in progress when the state change was requested and, if
8426 * applicable, has received all acknowledgements for those messages.
8429 * An error occurred when accessing the receive queue of the QP or EEC.
8430 * This event is optional.
8433 * An error occurred when writing an entry to the CQ.
8436 * A catastrophic error occurred while accessing or processing the
8437 * work queue that prevents reporting of completions.
8440 * The first packet has arrived for the receive work queue where the
8441 * QP is still in the RTR state.
8444 * If alternate path migration is supported, this event indicates that
8445 * the QP connection has migrated to the alternate path.
8448 * If reliable datagram service is supported, this event indicates that
8449 * a catastrophic error occurred while accessing or processing the EEC
8450 * that prevents reporting of completions.
8453 * If reliable datagram service is supported, this event indicates that
8454 * the first packet has arrived for the receive work queue where the
8455 * EEC is still in the RTR state.
8458 * If reliable datagram service and alternate path migration is supported,
8459 * this event indicates that the EEC connection has migrated to the
8463 * A catastrophic HCA error occurred which cannot be attributed to any
8464 * resource; behavior is indeterminate.
8467 * A PKEY violation was detected. This event is optional.
8470 * A QKEY violation was detected. This event is optional.
8473 * An MKEY violation was detected. This event is optional.
8476 * A port capability change was detected. This event is optional.
8478 * IB_AE_SYSIMG_GUID_TRAP
8479 * If the system image GUID is supported, this event indicates that the
8480 * system image GUID of this HCA has been changed. This event is
8484 * The number of consecutive flow control update periods with at least
8485 * one overrun error in each period has exceeded the threshold specified
8486 * in the port info attributes. This event is optional.
8488 * IB_AE_LINK_INTEGRITY
8489 * The detection of excessively frequent local physical errors has
8490 * exceeded the threshold specified in the port info attributes. This
8491 * event is optional.
8493 * IB_AE_FLOW_CTRL_ERROR
8494 * An HCA watchdog timer monitoring the arrival of flow control updates
8495 * has expired without receiving an update. This event is optional.
8498 * An BKEY violation was detected. This event is optional.
8500 * IB_AE_QP_APM_ERROR
8501 * If alternate path migration is supported, this event indicates that
8502 * an incoming path migration request to this QP was not accepted.
8504 * IB_AE_EEC_APM_ERROR
8505 * If reliable datagram service and alternate path migration is supported,
8506 * this event indicates that an incoming path migration request to this
8507 * EEC was not accepted.
8509 * IB_AE_WQ_REQ_ERROR
8510 * An OpCode violation was detected at the responder.
8512 * IB_AE_WQ_ACCESS_ERROR
8513 * An access violation was detected at the responder.
8516 * If the port active event is supported, this event is generated
8517 * when the link becomes active: IB_LINK_ACTIVE.
8520 * The link is declared unavailable: IB_LINK_INIT, IB_LINK_ARMED,
8524 * An unknown error occurred which cannot be attributed to any
8525 * resource; behavior is indeterminate.
8529 OSM_EXPORT const char *ib_async_event_str[];
8531 /****f* IBA Base: Types/ib_get_async_event_str
8533 * ib_get_async_event_str
8536 * Returns a string for the specified asynchronous event.
8540 static inline const char *OSM_API
8541 ib_get_async_event_str(IN ib_async_event_t event)
8543 if (event > IB_AE_UNKNOWN)
8544 event = IB_AE_UNKNOWN;
8545 return (ib_async_event_str[event]);
8554 * Pointer to the asynchronous event description string.
8561 /****s* Verbs/ib_event_rec_t
8563 * ib_event_rec_t -- Async event notification record
8566 * When an async event callback is made, this structure is passed to indicate
8567 * the type of event, the source of event that caused it, and the context
8568 * associated with this event.
8570 * context -- Context of the resource that caused the event.
8571 * -- ca_context if this is a port/adapter event.
8572 * -- qp_context if the source is a QP event
8573 * -- cq_context if the source is a CQ event.
8574 * -- ee_context if the source is an EE event.
8578 typedef struct _ib_event_rec {
8580 ib_async_event_t type;
8582 /* HCA vendor specific event information. */
8583 uint64_t vendor_specific;
8585 /* The following structures are valid only for trap types. */
8589 ib_net64_t port_guid;
8593 * The following structure is valid only for
8594 * P_KEY, Q_KEY, and M_KEY violation traps.
8614 ib_net64_t sysimg_guid;
8621 /****d* Access Layer/ib_atomic_t
8626 * Indicates atomicity levels supported by an adapter.
8630 typedef enum _ib_atomic_t {
8638 * Atomic operations not supported.
8641 * Atomic operations guaranteed between QPs of a single CA.
8644 * Atomic operations are guaranteed between CA and any other entity
8648 /****s* Access Layer/ib_port_cap_t
8653 * Indicates which management agents are currently available on the specified
8658 typedef struct _ib_port_cap {
8664 boolean_t sm_disable;
8671 boolean_t pkey_nvram;
8672 boolean_t mkey_nvram;
8674 boolean_t dr_notice;
8675 boolean_t boot_mgmt;
8676 boolean_t capm_notice;
8679 boolean_t port_active;
8684 /****d* Access Layer/ib_init_type_t
8689 * If supported by the HCA, the type of initialization requested by
8690 * this port before SM moves it to the active or armed state. If the
8691 * SM implements reinitialization, it shall set these bits to indicate
8692 * the type of initialization performed prior to activating the port.
8693 * Otherwise, these bits shall be set to 0.
8697 typedef uint8_t ib_init_type_t;
8698 #define IB_INIT_TYPE_NO_LOAD 0x01
8699 #define IB_INIT_TYPE_PRESERVE_CONTENT 0x02
8700 #define IB_INIT_TYPE_PRESERVE_PRESENCE 0x04
8701 #define IB_INIT_TYPE_DO_NOT_RESUSCITATE 0x08
8704 /****s* Access Layer/ib_port_attr_mod_t
8706 * ib_port_attr_mod_t
8709 * Port attributes that may be modified.
8713 typedef struct _ib_port_attr_mod {
8718 ib_init_type_t init_type;
8719 ib_net64_t system_image_guid;
8721 } ib_port_attr_mod_t;
8727 /****s* Access Layer/ib_port_attr_t
8732 * Information about a port on a given channel adapter.
8736 typedef struct _ib_port_attr {
8737 ib_net64_t port_guid;
8740 uint64_t max_msg_size;
8745 * LinkWidthSupported as defined in PortInfo. Required to calculate
8746 * inter-packet delay (a.k.a. static rate).
8748 uint8_t link_width_supported;
8756 ib_init_type_t init_type_reply; /* Optional */
8760 * The maximum expected subnet propagation delay to reach any port on
8761 * the subnet. This value also determines the rate at which traps can
8762 * be generated from this node.
8764 * timeout = 4.096 microseconds * 2^subnet_timeout
8766 uint8_t subnet_timeout;
8775 * Pointers at the end of the structure to allow doing a simple
8776 * memory comparison of contents up to the first pointer.
8778 ib_gid_t *p_gid_table;
8779 ib_net16_t *p_pkey_table;
8784 * uint8_t, ib_port_cap_t, ib_link_states_t
8787 /****s* Access Layer/ib_ca_attr_t
8792 * Information about a channel adapter.
8796 typedef struct _ib_ca_attr {
8805 * Total size of the ca attributes in bytes
8812 uint32_t max_rd_sges;
8819 uint32_t init_regions;
8820 uint64_t init_region_size;
8822 uint32_t init_windows;
8823 uint32_t max_addr_handles;
8825 uint32_t max_partitions;
8827 ib_atomic_t atomicity;
8829 uint8_t max_qp_resp_res;
8830 uint8_t max_eec_resp_res;
8831 uint8_t max_resp_res;
8833 uint8_t max_qp_init_depth;
8834 uint8_t max_eec_init_depth;
8839 uint32_t max_ipv6_qps;
8840 uint32_t max_ether_qps;
8842 uint32_t max_mcast_grps;
8843 uint32_t max_mcast_qps;
8844 uint32_t max_qps_per_mcast_grp;
8846 uint32_t max_map_per_fmr;
8850 * Specifies the maximum time interval between the local CA receiving
8851 * a message and the transmission of the associated ACK or NAK.
8853 * timeout = 4.096 microseconds * 2^local_ack_delay
8855 uint8_t local_ack_delay;
8857 boolean_t bad_pkey_ctr_support;
8858 boolean_t bad_qkey_ctr_support;
8859 boolean_t raw_mcast_support;
8860 boolean_t apm_support;
8861 boolean_t av_port_check;
8862 boolean_t change_primary_port;
8863 boolean_t modify_wr_depth;
8864 boolean_t current_qp_state_support;
8865 boolean_t shutdown_port_capability;
8866 boolean_t init_type_support;
8867 boolean_t port_active_event_support;
8868 boolean_t system_image_guid_support;
8869 boolean_t hw_agents;
8871 ib_net64_t system_image_guid;
8873 uint32_t num_page_sizes;
8876 uint32_t *p_page_size;
8877 ib_port_attr_t *p_port_attr;
8883 * GUID for this adapter.
8886 * IEEE vendor ID for this adapter
8889 * Device ID of this adapter. (typically from PCI device ID)
8892 * Revision ID of this adapter
8895 * Device Firmware version.
8898 * Total size in bytes for the HCA attributes. This size includes total
8899 * size required for all the variable members of the structure. If a
8900 * vendor requires to pass vendor specific fields beyond this structure,
8901 * the HCA vendor can choose to report a larger size. If a vendor is
8902 * reporting extended vendor specific features, they should also provide
8903 * appropriate access functions to aid with the required interpretation.
8906 * Maximum number of QP's supported by this HCA.
8909 * Maximum number of work requests supported by this HCA.
8912 * Maximum number of scatter gather elements supported per work request.
8915 * Maximum number of scatter gather elements supported for READ work
8916 * requests for a Reliable Datagram QP. This value must be zero if RD
8917 * service is not supported.
8920 * Maximum number of Completion Queues supported.
8923 * Maximum number of CQ elements supported per CQ.
8926 * Maximum number of protection domains supported.
8929 * Initial number of memory regions supported. These are only informative
8930 * values. HCA vendors can extended and grow these limits on demand.
8933 * Initial limit on the size of the registered memory region.
8936 * Initial number of window entries supported.
8939 * Maximum number of address handles supported.
8942 * Maximum number of partitions supported.
8945 * Indicates level of atomic operations supported by this HCA.
8949 * Maximum limit on number of responder resources for incoming RDMA
8950 * operations, on QPs and EEC's respectively.
8953 * Maximum number of responder resources per HCA, with this HCA used as
8957 * max_eec_init_depth
8958 * Maximimum initiator depth per QP or EEC for initiating RDMA reads and
8959 * atomic operations.
8962 * Maximimum number of EEC's supported by the HCA.
8965 * Maximum number of Reliable datagram domains supported.
8969 * Maximum number of IPV6 and raw ether QP's supported by this HCA.
8972 * Maximum number of multicast groups supported.
8975 * Maximum number of QP's that can support multicast operations.
8977 * max_qps_per_mcast_grp
8978 * Maximum number of multicast QP's per multicast group.
8981 * Specifies the maximum time interval between the local CA receiving
8982 * a message and the transmission of the associated ACK or NAK.
8983 * timeout = 4.096 microseconds * 2^local_ack_delay
8985 * bad_pkey_ctr_support
8986 * bad_qkey_ctr_support
8987 * Indicates support for the bad pkey and qkey counters.
8990 * Indicates support for raw packet multicast.
8993 * Indicates support for Automatic Path Migration.
8996 * Indicates ability to check port number in address handles.
8998 * change_primary_port
8999 * Indicates ability to change primary port for a QP or EEC during a
9000 * SQD->RTS transition.
9003 * Indicates ability to modify QP depth during a modify QP operation.
9004 * Check the verb specification for permitted states.
9006 * current_qp_state_support
9007 * Indicates ability of the HCA to support the current QP state modifier
9008 * during a modify QP operation.
9010 * shutdown_port_capability
9011 * Shutdown port capability support indicator.
9014 * Indicates init_type_reply and ability to set init_type is supported.
9016 * port_active_event_support
9017 * Port active event support indicator.
9019 * system_image_guid_support
9020 * System image GUID support indicator.
9023 * Indicates SMA is implemented in HW.
9026 * Optional system image GUID. This field is valid only if the
9027 * system_image_guid_support flag is set.
9030 * Indicates support for different page sizes supported by the HCA.
9031 * The variable size array can be obtained from p_page_size.
9034 * Number of physical ports supported on this HCA.
9037 * Array holding different page size supported.
9040 * Array holding port attributes.
9043 * This structure contains the attributes of a channel adapter. Users must
9044 * call ib_copy_ca_attr to copy the contents of this structure to a new
9048 * ib_port_attr_t, ib_atomic_t, ib_copy_ca_attr
9051 /****f* Access layer/ib_copy_ca_attr
9056 * Copies CA attributes.
9060 ib_ca_attr_t *ib_copy_ca_attr(IN ib_ca_attr_t * const p_dest,
9061 IN const ib_ca_attr_t * const p_src);
9065 * Pointer to the buffer that is the destination of the copy.
9068 * Pointer to the CA attributes to copy.
9071 * Pointer to the copied CA attributes.
9074 * The buffer pointed to by the p_dest parameter must be at least the size
9075 * specified in the size field of the buffer pointed to by p_src.
9078 * ib_ca_attr_t, ib_dup_ca_attr, ib_free_ca_attr
9081 /****s* Access Layer/ib_av_attr_t
9086 * IBA address vector.
9090 typedef struct _ib_av_attr {
9096 boolean_t grh_valid;
9098 uint8_t static_rate;
9103 uint8_t local_ack_timeout;
9104 uint8_t seq_err_retry_cnt;
9105 uint8_t rnr_retry_cnt;
9115 /****d* Access Layer/ib_qp_type_t
9120 * Indicates the type of queue pair being created.
9124 typedef enum _ib_qp_type {
9125 IB_QPT_RELIABLE_CONN = 0, /* Matches CM REQ transport type */
9126 IB_QPT_UNRELIABLE_CONN = 1, /* Matches CM REQ transport type */
9127 IB_QPT_RELIABLE_DGRM = 2, /* Matches CM REQ transport type */
9128 IB_QPT_UNRELIABLE_DGRM,
9133 IB_QPT_MAD, /* InfiniBand Access Layer */
9134 IB_QPT_QP0_ALIAS, /* InfiniBand Access Layer */
9135 IB_QPT_QP1_ALIAS /* InfiniBand Access Layer */
9139 * IB_QPT_RELIABLE_CONN
9140 * Reliable, connected queue pair.
9142 * IB_QPT_UNRELIABLE_CONN
9143 * Unreliable, connected queue pair.
9145 * IB_QPT_RELIABLE_DGRM
9146 * Reliable, datagram queue pair.
9148 * IB_QPT_UNRELIABLE_DGRM
9149 * Unreliable, datagram queue pair.
9158 * Raw datagram queue pair.
9161 * Raw IP version 6 queue pair.
9164 * Raw Ethernet queue pair.
9167 * Unreliable, datagram queue pair that will send and receive management
9168 * datagrams with assistance from the access layer.
9171 * Alias to queue pair 0. Aliased QPs can only be created on an aliased
9172 * protection domain.
9175 * Alias to queue pair 1. Aliased QPs can only be created on an aliased
9176 * protection domain.
9179 /****d* Access Layer/ib_access_t
9184 * Indicates the type of access is permitted on resources such as QPs,
9185 * memory regions and memory windows.
9189 typedef uint32_t ib_access_t;
9190 #define IB_AC_RDMA_READ 0x00000001
9191 #define IB_AC_RDMA_WRITE 0x00000002
9192 #define IB_AC_ATOMIC 0x00000004
9193 #define IB_AC_LOCAL_WRITE 0x00000008
9194 #define IB_AC_MW_BIND 0x00000010
9197 * Users may combine access rights using a bit-wise or operation to specify
9198 * additional access. For example: IB_AC_RDMA_READ | IB_AC_RDMA_WRITE grants
9199 * RDMA read and write access.
9202 /****d* Access Layer/ib_qp_state_t
9207 * Indicates or sets the state of a queue pair. The current state of a queue
9208 * pair is returned through the ib_qp_query call and set via the
9209 * ib_qp_modify call.
9213 typedef uint32_t ib_qp_state_t;
9214 #define IB_QPS_RESET 0x00000001
9215 #define IB_QPS_INIT 0x00000002
9216 #define IB_QPS_RTR 0x00000004
9217 #define IB_QPS_RTS 0x00000008
9218 #define IB_QPS_SQD 0x00000010
9219 #define IB_QPS_SQD_DRAINING 0x00000030
9220 #define IB_QPS_SQD_DRAINED 0x00000050
9221 #define IB_QPS_SQERR 0x00000080
9222 #define IB_QPS_ERROR 0x00000100
9223 #define IB_QPS_TIME_WAIT 0xDEAD0000 /* InfiniBand Access Layer */
9226 /****d* Access Layer/ib_apm_state_t
9231 * The current automatic path migration state of a queue pair
9235 typedef enum _ib_apm_state {
9236 IB_APM_MIGRATED = 1,
9242 /****s* Access Layer/ib_qp_create_t
9247 * Attributes used to initialize a queue pair at creation time.
9251 typedef struct _ib_qp_create {
9252 ib_qp_type_t qp_type;
9254 ib_rdd_handle_t h_rdd;
9261 ib_cq_handle_t h_sq_cq;
9262 ib_cq_handle_t h_rq_cq;
9264 boolean_t sq_signaled;
9270 * Specifies the type of queue pair to create.
9273 * A handle to a reliable datagram domain to associate with the queue
9274 * pair. This field is ignored if the queue pair is not a reliable
9275 * datagram type queue pair.
9278 * Indicates the requested maximum number of work requests that may be
9279 * outstanding on the queue pair's send queue. This value must be less
9280 * than or equal to the maximum reported by the channel adapter associated
9281 * with the queue pair.
9284 * Indicates the requested maximum number of work requests that may be
9285 * outstanding on the queue pair's receive queue. This value must be less
9286 * than or equal to the maximum reported by the channel adapter associated
9287 * with the queue pair.
9290 * Indicates the maximum number scatter-gather elements that may be
9291 * given in a send work request. This value must be less
9292 * than or equal to the maximum reported by the channel adapter associated
9293 * with the queue pair.
9296 * Indicates the maximum number scatter-gather elements that may be
9297 * given in a receive work request. This value must be less
9298 * than or equal to the maximum reported by the channel adapter associated
9299 * with the queue pair.
9302 * A handle to the completion queue that will be used to report send work
9303 * request completions. This handle must be NULL if the type is
9304 * IB_QPT_MAD, IB_QPT_QP0_ALIAS, or IB_QPT_QP1_ALIAS.
9307 * A handle to the completion queue that will be used to report receive
9308 * work request completions. This handle must be NULL if the type is
9309 * IB_QPT_MAD, IB_QPT_QP0_ALIAS, or IB_QPT_QP1_ALIAS.
9312 * A flag that is used to indicate whether the queue pair will signal
9313 * an event upon completion of a send work request. If set to
9314 * TRUE, send work requests will always generate a completion
9315 * event. If set to FALSE, a completion event will only be
9316 * generated if the send_opt field of the send work request has the
9317 * IB_SEND_OPT_SIGNALED flag set.
9320 * ib_qp_type_t, ib_qp_attr_t
9323 /****s* Access Layer/ib_qp_attr_t
9328 * Queue pair attributes returned through ib_query_qp.
9332 typedef struct _ib_qp_attr {
9333 ib_pd_handle_t h_pd;
9334 ib_qp_type_t qp_type;
9335 ib_access_t access_ctrl;
9336 uint16_t pkey_index;
9345 ib_cq_handle_t h_sq_cq;
9346 ib_cq_handle_t h_rq_cq;
9347 ib_rdd_handle_t h_rdd;
9349 boolean_t sq_signaled;
9351 ib_qp_state_t state;
9353 ib_net32_t dest_num;
9359 uint8_t primary_port;
9360 uint8_t alternate_port;
9361 ib_av_attr_t primary_av;
9362 ib_av_attr_t alternate_av;
9363 ib_apm_state_t apm_state;
9369 * This is a handle to a protection domain associated with the queue
9370 * pair, or NULL if the queue pair is type IB_QPT_RELIABLE_DGRM.
9373 * Other fields are defined by the Infiniband specification.
9376 * ib_qp_type_t, ib_access_t, ib_qp_state_t, ib_av_attr_t, ib_apm_state_t
9379 /****d* Access Layer/ib_qp_opts_t
9384 * Optional fields supplied in the modify QP operation.
9388 typedef uint32_t ib_qp_opts_t;
9389 #define IB_MOD_QP_ALTERNATE_AV 0x00000001
9390 #define IB_MOD_QP_PKEY 0x00000002
9391 #define IB_MOD_QP_APM_STATE 0x00000004
9392 #define IB_MOD_QP_PRIMARY_AV 0x00000008
9393 #define IB_MOD_QP_RNR_NAK_TIMEOUT 0x00000010
9394 #define IB_MOD_QP_RESP_RES 0x00000020
9395 #define IB_MOD_QP_INIT_DEPTH 0x00000040
9396 #define IB_MOD_QP_PRIMARY_PORT 0x00000080
9397 #define IB_MOD_QP_ACCESS_CTRL 0x00000100
9398 #define IB_MOD_QP_QKEY 0x00000200
9399 #define IB_MOD_QP_SQ_DEPTH 0x00000400
9400 #define IB_MOD_QP_RQ_DEPTH 0x00000800
9401 #define IB_MOD_QP_CURRENT_STATE 0x00001000
9402 #define IB_MOD_QP_RETRY_CNT 0x00002000
9403 #define IB_MOD_QP_LOCAL_ACK_TIMEOUT 0x00004000
9404 #define IB_MOD_QP_RNR_RETRY_CNT 0x00008000
9410 /****s* Access Layer/ib_qp_mod_t
9415 * Information needed to change the state of a queue pair through the
9416 * ib_modify_qp call.
9420 typedef struct _ib_qp_mod {
9421 ib_qp_state_t req_state;
9426 * Time, in milliseconds, that the QP needs to spend in
9427 * the time wait state before being reused.
9435 uint8_t primary_port;
9437 uint16_t pkey_index;
9438 ib_access_t access_ctrl;
9445 ib_av_attr_t primary_av;
9449 ib_av_attr_t alternate_av;
9451 uint16_t pkey_index;
9452 ib_access_t access_ctrl;
9455 uint8_t rnr_nak_timeout;
9462 uint8_t rnr_retry_cnt;
9463 uint8_t rnr_nak_timeout;
9464 uint8_t local_ack_timeout;
9468 ib_qp_state_t current_state;
9470 ib_access_t access_ctrl;
9473 ib_av_attr_t primary_av;
9474 ib_av_attr_t alternate_av;
9479 ib_apm_state_t apm_state;
9480 uint8_t primary_port;
9481 uint16_t pkey_index;
9486 boolean_t sqd_event;
9495 * ib_qp_state_t, ib_access_t, ib_av_attr_t, ib_apm_state_t
9498 /****s* Access Layer/ib_eec_attr_t
9503 * Information about an end-to-end context.
9507 typedef struct _ib_eec_attr {
9508 ib_qp_state_t state;
9509 ib_rdd_handle_t h_rdd;
9510 ib_net32_t local_eecn;
9514 uint8_t primary_port;
9515 uint16_t pkey_index;
9517 ib_net32_t remote_eecn;
9518 uint32_t init_depth;
9519 uint32_t dest_num; // ??? What is this?
9520 ib_av_attr_t primary_av;
9521 ib_av_attr_t alternate_av;
9522 ib_apm_state_t apm_state;
9527 * ib_qp_state_t, ib_av_attr_t, ib_apm_state_t
9530 /****d* Access Layer/ib_eec_opts_t
9535 * Optional fields supplied in the modify EEC operation.
9539 typedef uint32_t ib_eec_opts_t;
9540 #define IB_MOD_EEC_ALTERNATE_AV 0x00000001
9541 #define IB_MOD_EEC_PKEY 0x00000002
9542 #define IB_MOD_EEC_APM_STATE 0x00000004
9543 #define IB_MOD_EEC_PRIMARY_AV 0x00000008
9544 #define IB_MOD_EEC_RNR 0x00000010
9545 #define IB_MOD_EEC_RESP_RES 0x00000020
9546 #define IB_MOD_EEC_OUTSTANDING 0x00000040
9547 #define IB_MOD_EEC_PRIMARY_PORT 0x00000080
9554 /****s* Access Layer/ib_eec_mod_t
9559 * Information needed to change the state of an end-to-end context through
9560 * the ib_modify_eec function.
9564 typedef struct _ib_eec_mod {
9565 ib_qp_state_t req_state;
9569 uint8_t primary_port;
9570 uint16_t pkey_index;
9576 ib_net32_t remote_eecn;
9577 ib_av_attr_t primary_av;
9581 ib_av_attr_t alternate_av;
9582 uint16_t pkey_index;
9589 uint8_t rnr_retry_cnt;
9590 uint8_t local_ack_timeout;
9594 ib_av_attr_t alternate_av;
9595 ib_apm_state_t apm_state;
9597 ib_av_attr_t primary_av;
9598 uint16_t pkey_index;
9599 uint8_t primary_port;
9604 boolean_t sqd_event;
9613 * ib_qp_state_t, ib_av_attr_t, ib_apm_state_t
9616 /****d* Access Layer/ib_wr_type_t
9621 * Identifies the type of work request posted to a queue pair.
9625 typedef enum _ib_wr_type_t {
9634 /****s* Access Layer/ib_local_ds_t
9639 * Local data segment information referenced by send and receive work
9640 * requests. This is used to specify local data buffers used as part of a
9645 typedef struct _ib_local_ds {
9653 /****d* Access Layer/ib_send_opt_t
9658 * Optional flags used when posting send work requests. These flags
9659 * indicate specific processing for the send operation.
9663 typedef uint32_t ib_send_opt_t;
9664 #define IB_SEND_OPT_IMMEDIATE 0x00000001
9665 #define IB_SEND_OPT_FENCE 0x00000002
9666 #define IB_SEND_OPT_SIGNALED 0x00000004
9667 #define IB_SEND_OPT_SOLICITED 0x00000008
9668 #define IB_SEND_OPT_INLINE 0x00000010
9669 #define IB_SEND_OPT_LOCAL 0x00000020
9670 #define IB_SEND_OPT_VEND_MASK 0xFFFF0000
9673 * The following flags determine the behavior of a work request when
9674 * posted to the send side.
9676 * IB_SEND_OPT_IMMEDIATE
9677 * Send immediate data with the given request.
9680 * The operation is fenced. Complete all pending send operations
9681 * before processing this request.
9683 * IB_SEND_OPT_SIGNALED
9684 * If the queue pair is configured for signaled completion, then
9685 * generate a completion queue entry when this request completes.
9687 * IB_SEND_OPT_SOLICITED
9688 * Set the solicited bit on the last packet of this request.
9690 * IB_SEND_OPT_INLINE
9691 * Indicates that the requested send data should be copied into a VPD
9692 * owned data buffer. This flag permits the user to issue send operations
9693 * without first needing to register the buffer(s) associated with the
9694 * send operation. Verb providers that support this operation may place
9695 * vendor specific restrictions on the size of send operation that may
9696 * be performed as inline.
9700 * Indicates that a sent MAD request should be given to the local VPD for
9701 * processing. MADs sent using this option are not placed on the wire.
9702 * This send option is only valid for MAD send operations.
9705 * IB_SEND_OPT_VEND_MASK
9706 * This mask indicates bits reserved in the send options that may be used
9707 * by the verbs provider to indicate vendor specific options. Bits set
9708 * in this area of the send options are ignored by the Access Layer, but
9709 * may have specific meaning to the underlying VPD.
9713 /****s* Access Layer/ib_send_wr_t
9718 * Information used to submit a work request to the send queue of a queue
9723 typedef struct _ib_send_wr {
9724 struct _ib_send_wr *p_next;
9726 ib_wr_type_t wr_type;
9727 ib_send_opt_t send_opt;
9729 ib_local_ds_t *ds_array;
9730 ib_net32_t immediate_data;
9734 ib_net32_t remote_qp;
9735 ib_net32_t remote_qkey;
9736 ib_av_handle_t h_av;
9741 ib_net32_t remote_qp;
9742 ib_net32_t remote_qkey;
9747 struct _send_raw_ether {
9748 ib_net16_t dest_lid;
9751 uint8_t max_static_rate;
9752 ib_net16_t ether_type;
9756 struct _send_raw_ipv6 {
9757 ib_net16_t dest_lid;
9760 uint8_t max_static_rate;
9766 struct _send_remote_ops {
9779 * A pointer used to chain work requests together. This permits multiple
9780 * work requests to be posted to a queue pair through a single function
9781 * call. This value is set to NULL to mark the end of the chain.
9784 * A 64-bit work request identifier that is returned to the consumer
9785 * as part of the work completion.
9788 * The type of work request being submitted to the send queue.
9791 * Optional send control parameters.
9794 * Number of local data segments specified by this work request.
9797 * A reference to an array of local data segments used by the send
9801 * 32-bit field sent as part of a message send or RDMA write operation.
9802 * This field is only valid if the send_opt flag IB_SEND_OPT_IMMEDIATE
9806 * Identifies the destination queue pair of an unreliable datagram send
9809 * dgrm.ud.remote_qkey
9810 * The qkey for the destination queue pair.
9813 * An address vector that specifies the path information used to route
9814 * the outbound datagram to the destination queue pair.
9817 * Identifies the destination queue pair of a reliable datagram send
9820 * dgrm.rd.remote_qkey
9821 * The qkey for the destination queue pair.
9824 * The local end-to-end context number to use with the reliable datagram
9827 * dgrm.raw_ether.dest_lid
9828 * The destination LID that will receive this raw ether send.
9830 * dgrm.raw_ether.path_bits
9836 * dgrm.raw_ether.max_static_rate
9839 * dgrm.raw_ether.ether_type
9842 * dgrm.raw_ipv6.dest_lid
9843 * The destination LID that will receive this raw ether send.
9845 * dgrm.raw_ipv6.path_bits
9851 * dgrm.raw_ipv6.max_static_rate
9855 * The registered virtual memory address of the remote memory to access
9856 * with an RDMA or atomic operation.
9859 * The rkey associated with the specified remote vaddr. This data must
9860 * be presented exactly as obtained from the remote node. No swapping
9861 * of data must be performed.
9864 * The first operand for an atomic operation.
9867 * The second operand for an atomic operation.
9870 * The format of data sent over the fabric is user-defined and is considered
9871 * opaque to the access layer. The sole exception to this are MADs posted
9872 * to a MAD QP service. MADs are expected to match the format defined by
9873 * the Infiniband specification and must be in network-byte order when posted
9874 * to the MAD QP service.
9877 * ib_wr_type_t, ib_local_ds_t, ib_send_opt_t
9880 /****s* Access Layer/ib_recv_wr_t
9885 * Information used to submit a work request to the receive queue of a queue
9890 typedef struct _ib_recv_wr {
9891 struct _ib_recv_wr *p_next;
9894 ib_local_ds_t *ds_array;
9899 * A pointer used to chain work requests together. This permits multiple
9900 * work requests to be posted to a queue pair through a single function
9901 * call. This value is set to NULL to mark the end of the chain.
9904 * A 64-bit work request identifier that is returned to the consumer
9905 * as part of the work completion.
9908 * Number of local data segments specified by this work request.
9911 * A reference to an array of local data segments used by the send
9918 /****s* Access Layer/ib_bind_wr_t
9923 * Information used to submit a memory window bind work request to the send
9924 * queue of a queue pair.
9928 typedef struct _ib_bind_wr {
9930 ib_send_opt_t send_opt;
9932 ib_mr_handle_t h_mr;
9933 ib_access_t access_ctrl;
9934 uint32_t current_rkey;
9936 ib_local_ds_t local_ds;
9942 * A 64-bit work request identifier that is returned to the consumer
9943 * as part of the work completion.
9946 * Optional send control parameters.
9949 * Handle to the memory region to which this window is being bound.
9952 * Access rights for this memory window.
9955 * The current rkey assigned to this window for remote access.
9958 * A reference to a local data segment used by the bind operation.
9961 * ib_send_opt_t, ib_access_t, ib_local_ds_t
9964 /****d* Access Layer/ib_wc_status_t
9969 * Indicates the status of a completed work request. These VALUES are
9970 * returned to the user when retrieving completions. Note that success is
9971 * identified as IB_WCS_SUCCESS, which is always zero.
9975 typedef enum _ib_wc_status_t {
9977 IB_WCS_LOCAL_LEN_ERR,
9978 IB_WCS_LOCAL_OP_ERR,
9979 IB_WCS_LOCAL_EEC_OP_ERR,
9980 IB_WCS_LOCAL_PROTECTION_ERR,
9981 IB_WCS_WR_FLUSHED_ERR,
9982 IB_WCS_MEM_WINDOW_BIND_ERR,
9983 IB_WCS_REM_ACCESS_ERR,
9985 IB_WCS_RNR_RETRY_ERR,
9986 IB_WCS_TIMEOUT_RETRY_ERR,
9987 IB_WCS_REM_INVALID_REQ_ERR,
9988 IB_WCS_REM_INVALID_RD_REQ_ERR,
9989 IB_WCS_INVALID_EECN,
9990 IB_WCS_INVALID_EEC_STATE,
9991 IB_WCS_UNMATCHED_RESPONSE, /* InfiniBand Access Layer */
9992 IB_WCS_CANCELED, /* InfiniBand Access Layer */
9993 IB_WCS_UNKNOWN /* Must be last. */
9998 * Work request completed successfully.
10001 * The completed work request was associated with a managmenet datagram
10002 * that requires post processing. The MAD will be returned to the user
10003 * through a callback once all post processing has completed.
10005 * IB_WCS_LOCAL_LEN_ERR
10006 * Generated for a work request posted to the send queue when the
10007 * total of the data segment lengths exceeds the message length of the
10008 * channel. Generated for a work request posted to the receive queue when
10009 * the total of the data segment lengths is too small for a
10010 * valid incoming message.
10012 * IB_WCS_LOCAL_OP_ERR
10013 * An internal QP consistency error was generated while processing this
10014 * work request. This may indicate that the QP was in an incorrect state
10015 * for the requested operation.
10017 * IB_WCS_LOCAL_EEC_OP_ERR
10018 * An internal EEC consistency error was generated while processing
10019 * this work request. This may indicate that the EEC was in an incorrect
10020 * state for the requested operation.
10022 * IB_WCS_LOCAL_PROTECTION_ERR
10023 * The data segments of the locally posted work request did not refer to
10024 * a valid memory region. The memory may not have been properly
10025 * registered for the requested operation.
10027 * IB_WCS_WR_FLUSHED_ERR
10028 * The work request was flushed from the QP before being completed.
10030 * IB_WCS_MEM_WINDOW_BIND_ERR
10031 * A memory window bind operation failed due to insufficient access
10034 * IB_WCS_REM_ACCESS_ERR,
10035 * A protection error was detected at the remote node for a RDMA or atomic
10038 * IB_WCS_REM_OP_ERR,
10039 * The operation could not be successfully completed at the remote node.
10040 * This may indicate that the remote QP was in an invalid state or
10041 * contained an invalid work request.
10043 * IB_WCS_RNR_RETRY_ERR,
10044 * The RNR retry count was exceeded while trying to send this message.
10046 * IB_WCS_TIMEOUT_RETRY_ERR
10047 * The local transport timeout counter expired while trying to send this
10050 * IB_WCS_REM_INVALID_REQ_ERR,
10051 * The remote node detected an invalid message on the channel. This error
10052 * is usually a result of one of the following:
10053 * - The operation was not supported on receive queue.
10054 * - There was insufficient buffers to receive a new RDMA request.
10055 * - There was insufficient buffers to receive a new atomic operation.
10056 * - An RDMA request was larger than 2^31 bytes.
10058 * IB_WCS_REM_INVALID_RD_REQ_ERR,
10059 * Responder detected an invalid RD message. This may be the result of an
10060 * invalid qkey or an RDD mismatch.
10062 * IB_WCS_INVALID_EECN
10063 * An invalid EE context number was detected.
10065 * IB_WCS_INVALID_EEC_STATE
10066 * The EEC was in an invalid state for the specified request.
10068 * IB_WCS_UNMATCHED_RESPONSE
10069 * A response MAD was received for which there was no matching send. The
10070 * send operation may have been canceled by the user or may have timed
10074 * The completed work request was canceled by the user.
10077 OSM_EXPORT const char *ib_wc_status_str[];
10079 /****f* IBA Base: Types/ib_get_wc_status_str
10081 * ib_get_wc_status_str
10084 * Returns a string for the specified work completion status.
10088 static inline const char *OSM_API
10089 ib_get_wc_status_str(IN ib_wc_status_t wc_status)
10091 if (wc_status > IB_WCS_UNKNOWN)
10092 wc_status = IB_WCS_UNKNOWN;
10093 return (ib_wc_status_str[wc_status]);
10099 * [in] work completion status value
10102 * Pointer to the work completion status description string.
10109 /****d* Access Layer/ib_wc_type_t
10114 * Indicates the type of work completion.
10118 typedef enum _ib_wc_type_t {
10125 IB_WC_COMPARE_SWAP,
10126 IB_WC_RECV_RDMA_WRITE
10130 /****d* Access Layer/ib_recv_opt_t
10135 * Indicates optional fields valid in a receive work completion.
10139 typedef uint32_t ib_recv_opt_t;
10140 #define IB_RECV_OPT_IMMEDIATE 0x00000001
10141 #define IB_RECV_OPT_FORWARD 0x00000002
10142 #define IB_RECV_OPT_GRH_VALID 0x00000004
10143 #define IB_RECV_OPT_VEND_MASK 0xFFFF0000
10146 * IB_RECV_OPT_IMMEDIATE
10147 * Indicates that immediate data is valid for this work completion.
10149 * IB_RECV_OPT_FORWARD
10150 * Indicates that the received trap should be forwarded to the SM.
10152 * IB_RECV_OPT_GRH_VALID
10153 * Indicates presence of the global route header. When set, the
10154 * first 40 bytes received are the GRH.
10156 * IB_RECV_OPT_VEND_MASK
10157 * This mask indicates bits reserved in the receive options that may be
10158 * used by the verbs provider to indicate vendor specific options. Bits
10159 * set in this area of the receive options are ignored by the Access Layer,
10160 * but may have specific meaning to the underlying VPD.
10163 /****s* Access Layer/ib_wc_t
10168 * Work completion information.
10172 typedef struct _ib_wc {
10173 struct _ib_wc *p_next;
10175 ib_wc_type_t wc_type;
10178 ib_wc_status_t status;
10179 uint64_t vendor_specific;
10183 ib_recv_opt_t recv_opt;
10184 ib_net32_t immediate_data;
10189 ib_recv_opt_t recv_opt;
10190 ib_net32_t immediate_data;
10191 ib_net32_t remote_qp;
10192 uint16_t pkey_index;
10193 ib_net16_t remote_lid;
10200 ib_net32_t remote_eecn;
10201 ib_net32_t remote_qp;
10202 ib_net16_t remote_lid;
10208 struct _wc_raw_ipv6 {
10209 ib_net16_t remote_lid;
10215 struct _wc_raw_ether {
10216 ib_net16_t remote_lid;
10219 ib_net16_t ether_type;
10229 * A pointer used to chain work completions. This permits multiple
10230 * work completions to be retrieved from a completion queue through a
10231 * single function call. This value is set to NULL to mark the end of
10235 * The 64-bit work request identifier that was specified when posting the
10239 * Indicates the type of work completion.
10243 * The total length of the data sent or received with the work request.
10246 * The result of the work request.
10249 * HCA vendor specific information returned as part of the completion.
10251 * recv.conn.recv_opt
10252 * Indicates optional fields valid as part of a work request that
10253 * completed on a connected (reliable or unreliable) queue pair.
10255 * recv.conn.immediate_data
10256 * 32-bit field received as part of an inbound message on a connected
10257 * queue pair. This field is only valid if the recv_opt flag
10258 * IB_RECV_OPT_IMMEDIATE has been set.
10261 * Indicates optional fields valid as part of a work request that
10262 * completed on an unreliable datagram queue pair.
10264 * recv.ud.immediate_data
10265 * 32-bit field received as part of an inbound message on a unreliable
10266 * datagram queue pair. This field is only valid if the recv_opt flag
10267 * IB_RECV_OPT_IMMEDIATE has been set.
10269 * recv.ud.remote_qp
10270 * Identifies the source queue pair of a received datagram.
10272 * recv.ud.pkey_index
10273 * The pkey index for the source queue pair. This is valid only for
10276 * recv.ud.remote_lid
10277 * The source LID of the received datagram.
10279 * recv.ud.remote_sl
10280 * The service level used by the source of the received datagram.
10282 * recv.ud.path_bits
10285 * recv.rd.remote_eecn
10286 * The remote end-to-end context number that sent the received message.
10288 * recv.rd.remote_qp
10289 * Identifies the source queue pair of a received message.
10291 * recv.rd.remote_lid
10292 * The source LID of the received message.
10294 * recv.rd.remote_sl
10295 * The service level used by the source of the received message.
10298 * The number of available entries in the completion queue. Reliable
10299 * datagrams may complete out of order, so this field may be used to
10300 * determine the number of additional completions that may occur.
10302 * recv.raw_ipv6.remote_lid
10303 * The source LID of the received message.
10305 * recv.raw_ipv6.remote_sl
10306 * The service level used by the source of the received message.
10308 * recv.raw_ipv6.path_bits
10311 * recv.raw_ether.remote_lid
10312 * The source LID of the received message.
10314 * recv.raw_ether.remote_sl
10315 * The service level used by the source of the received message.
10317 * recv.raw_ether.path_bits
10320 * recv.raw_ether.ether_type
10323 * When the work request completes with error, the only values that the
10324 * consumer can depend on are the wr_id field, and the status of the
10327 * If the consumer is using the same CQ for completions from more than
10328 * one type of QP (i.e Reliable Connected, Datagram etc), then the consumer
10329 * must have additional information to decide what fields of the union are
10332 * ib_wc_type_t, ib_qp_type_t, ib_wc_status_t, ib_recv_opt_t
10335 /****s* Access Layer/ib_mr_create_t
10340 * Information required to create a registered memory region.
10344 typedef struct _ib_mr_create {
10347 ib_access_t access_ctrl;
10352 * Starting virtual address of the region being registered.
10355 * Length of the buffer to register.
10358 * Access rights of the registered region.
10364 /****s* Access Layer/ib_phys_create_t
10369 * Information required to create a physical memory region.
10373 typedef struct _ib_phys_create {
10376 uint64_t *buf_array;
10377 uint32_t buf_offset;
10378 uint32_t page_size;
10379 ib_access_t access_ctrl;
10380 } ib_phys_create_t;
10383 * The length of the memory region in bytes.
10386 * Number of buffers listed in the specified buffer array.
10389 * An array of physical buffers to be registered as a single memory
10393 * The offset into the first physical page of the specified memory
10394 * region to start the virtual address.
10397 * The physical page size of the memory being registered.
10400 * Access rights of the registered region.
10406 /****s* Access Layer/ib_mr_attr_t
10411 * Attributes of a registered memory region.
10415 typedef struct _ib_mr_attr {
10416 ib_pd_handle_t h_pd;
10421 ib_access_t access_ctrl;
10428 * Handle to the protection domain for this memory region.
10431 * The virtual address of the lower bound of protection for local
10435 * The virtual address of the upper bound of protection for local
10439 * The virtual address of the lower bound of protection for remote
10443 * The virtual address of the upper bound of protection for remote
10447 * Access rights for the specified memory region.
10450 * The lkey associated with this memory region.
10453 * The rkey associated with this memory region.
10456 * The remote_lb, remote_ub, and rkey are only valid if remote memory access
10457 * is enabled for this memory region.
10463 /****d* Access Layer/ib_ca_mod_t
10465 * ib_ca_mod_t -- Modify port attributes and error counters
10468 * Specifies modifications to the port attributes of a channel adapter.
10472 typedef uint32_t ib_ca_mod_t;
10473 #define IB_CA_MOD_IS_CM_SUPPORTED 0x00000001
10474 #define IB_CA_MOD_IS_SNMP_SUPPORTED 0x00000002
10475 #define IB_CA_MOD_IS_DEV_MGMT_SUPPORTED 0x00000004
10476 #define IB_CA_MOD_IS_VEND_SUPPORTED 0x00000008
10477 #define IB_CA_MOD_IS_SM 0x00000010
10478 #define IB_CA_MOD_IS_SM_DISABLED 0x00000020
10479 #define IB_CA_MOD_QKEY_CTR 0x00000040
10480 #define IB_CA_MOD_PKEY_CTR 0x00000080
10481 #define IB_CA_MOD_IS_NOTICE_SUPPORTED 0x00000100
10482 #define IB_CA_MOD_IS_TRAP_SUPPORTED 0x00000200
10483 #define IB_CA_MOD_IS_APM_SUPPORTED 0x00000400
10484 #define IB_CA_MOD_IS_SLMAP_SUPPORTED 0x00000800
10485 #define IB_CA_MOD_IS_PKEY_NVRAM_SUPPORTED 0x00001000
10486 #define IB_CA_MOD_IS_MKEY_NVRAM_SUPPORTED 0x00002000
10487 #define IB_CA_MOD_IS_SYSGUID_SUPPORTED 0x00004000
10488 #define IB_CA_MOD_IS_DR_NOTICE_SUPPORTED 0x00008000
10489 #define IB_CA_MOD_IS_BOOT_MGMT_SUPPORTED 0x00010000
10490 #define IB_CA_MOD_IS_CAPM_NOTICE_SUPPORTED 0x00020000
10491 #define IB_CA_MOD_IS_REINIT_SUPORTED 0x00040000
10492 #define IB_CA_MOD_IS_LEDINFO_SUPPORTED 0x00080000
10493 #define IB_CA_MOD_SHUTDOWN_PORT 0x00100000
10494 #define IB_CA_MOD_INIT_TYPE_VALUE 0x00200000
10495 #define IB_CA_MOD_SYSTEM_IMAGE_GUID 0x00400000
10498 * IB_CA_MOD_IS_CM_SUPPORTED
10499 * Indicates if there is a communication manager accessible through
10502 * IB_CA_MOD_IS_SNMP_SUPPORTED
10503 * Indicates if there is an SNMP agent accessible through the port.
10505 * IB_CA_MOD_IS_DEV_MGMT_SUPPORTED
10506 * Indicates if there is a device management agent accessible
10507 * through the port.
10509 * IB_CA_MOD_IS_VEND_SUPPORTED
10510 * Indicates if there is a vendor supported agent accessible
10511 * through the port.
10514 * Indicates if there is a subnet manager accessible through
10517 * IB_CA_MOD_IS_SM_DISABLED
10518 * Indicates if the port has been disabled for configuration by the
10521 * IB_CA_MOD_QKEY_CTR
10522 * Used to reset the qkey violation counter associated with the
10525 * IB_CA_MOD_PKEY_CTR
10526 * Used to reset the pkey violation counter associated with the
10529 * IB_CA_MOD_IS_NOTICE_SUPPORTED
10530 * Indicates that this CA supports ability to generate Notices for
10531 * Port State changes. (only applicable to switches)
10533 * IB_CA_MOD_IS_TRAP_SUPPORTED
10534 * Indicates that this management port supports ability to generate
10535 * trap messages. (only applicable to switches)
10537 * IB_CA_MOD_IS_APM_SUPPORTED
10538 * Indicates that this port is capable of performing Automatic
10541 * IB_CA_MOD_IS_SLMAP_SUPPORTED
10542 * Indicates this port supports SLMAP capability.
10544 * IB_CA_MOD_IS_PKEY_NVRAM_SUPPORTED
10545 * Indicates that PKEY is supported in NVRAM
10547 * IB_CA_MOD_IS_MKEY_NVRAM_SUPPORTED
10548 * Indicates that MKEY is supported in NVRAM
10550 * IB_CA_MOD_IS_SYSGUID_SUPPORTED
10551 * Indicates System Image GUID support.
10553 * IB_CA_MOD_IS_DR_NOTICE_SUPPORTED
10554 * Indicate support for generating Direct Routed Notices
10556 * IB_CA_MOD_IS_BOOT_MGMT_SUPPORTED
10557 * Indicates support for Boot Management
10559 * IB_CA_MOD_IS_CAPM_NOTICE_SUPPORTED
10560 * Indicates capability to generate notices for changes to CAPMASK
10562 * IB_CA_MOD_IS_REINIT_SUPORTED
10563 * Indicates type of node init supported. Refer to Chapter 14 for
10564 * Initialization actions.
10566 * IB_CA_MOD_IS_LEDINFO_SUPPORTED
10567 * Indicates support for LED info.
10569 * IB_CA_MOD_SHUTDOWN_PORT
10570 * Used to modify the port active indicator.
10572 * IB_CA_MOD_INIT_TYPE_VALUE
10573 * Used to modify the init_type value for the port.
10575 * IB_CA_MOD_SYSTEM_IMAGE_GUID
10576 * Used to modify the system image GUID for the port.
10579 /****d* Access Layer/ib_mr_mod_t
10584 * Mask used to specify which attributes of a registered memory region are
10589 typedef uint32_t ib_mr_mod_t;
10590 #define IB_MR_MOD_ADDR 0x00000001
10591 #define IB_MR_MOD_PD 0x00000002
10592 #define IB_MR_MOD_ACCESS 0x00000004
10596 * The address of the memory region is being modified.
10599 * The protection domain associated with the memory region is being
10602 * IB_MEM_MOD_ACCESS
10603 * The access rights the memory region are being modified.
10606 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_HANDOVER
10608 * IB_SMINFO_ATTR_MOD_HANDOVER
10611 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
10615 #define IB_SMINFO_ATTR_MOD_HANDOVER (CL_HTON32(0x000001))
10618 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_ACKNOWLEDGE
10620 * IB_SMINFO_ATTR_MOD_ACKNOWLEDGE
10623 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
10627 #define IB_SMINFO_ATTR_MOD_ACKNOWLEDGE (CL_HTON32(0x000002))
10630 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_DISABLE
10632 * IB_SMINFO_ATTR_MOD_DISABLE
10635 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
10639 #define IB_SMINFO_ATTR_MOD_DISABLE (CL_HTON32(0x000003))
10642 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_STANDBY
10644 * IB_SMINFO_ATTR_MOD_STANDBY
10647 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
10651 #define IB_SMINFO_ATTR_MOD_STANDBY (CL_HTON32(0x000004))
10654 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_DISCOVER
10656 * IB_SMINFO_ATTR_MOD_DISCOVER
10659 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
10663 #define IB_SMINFO_ATTR_MOD_DISCOVER (CL_HTON32(0x000005))
10666 /****s* Access Layer/ib_ci_op_t
10671 * A structure used for vendor specific CA interface communication.
10675 typedef struct _ib_ci_op {
10676 IN uint32_t command;
10677 IN OUT void *p_buf OPTIONAL;
10678 IN uint32_t buf_size;
10679 IN OUT uint32_t num_bytes_ret;
10680 IN OUT int32_t status;
10686 * A command code that is understood by the verbs provider.
10689 * A reference to a buffer containing vendor specific data. The verbs
10690 * provider must not access pointers in the p_buf between user-mode and
10691 * kernel-mode. Any pointers embedded in the p_buf are invalidated by
10692 * the user-mode/kernel-mode transition.
10695 * The size of the buffer in bytes.
10698 * The size in bytes of the vendor specific data returned in the buffer.
10699 * This field is set by the verbs provider. The verbs provider should
10700 * verify that the buffer size is sufficient to hold the data being
10704 * The completion status from the verbs provider. This field should be
10705 * initialize to indicate an error to allow detection and cleanup in
10706 * case a communication error occurs between user-mode and kernel-mode.
10709 * This structure is provided to allow the exchange of vendor specific
10710 * data between the originator and the verbs provider. Users of this
10711 * structure are expected to know the format of data in the p_buf based
10712 * on the structure command field or the usage context.
10716 #endif /* ndef WIN32 */
10717 #if defined( __WIN__ )
10718 #include <iba/ib_types_extended.h>
10720 #endif /* __IB_TYPES_H__ */