1 /*
2  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
3  * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
4  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5  * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
6  *
7  * This software is available to you under a choice of one of two
8  * licenses.  You may choose to be licensed under the terms of the GNU
9  * General Public License (GPL) Version 2, available from the file
10  * COPYING in the main directory of this source tree, or the
11  * OpenIB.org BSD license below:
12  *
13  *     Redistribution and use in source and binary forms, with or
14  *     without modification, are permitted provided that the following
15  *     conditions are met:
16  *
17  *      - Redistributions of source code must retain the above
18  *        copyright notice, this list of conditions and the following
19  *        disclaimer.
20  *
21  *      - Redistributions in binary form must reproduce the above
22  *        copyright notice, this list of conditions and the following
23  *        disclaimer in the documentation and/or other materials
24  *        provided with the distribution.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33  * SOFTWARE.
34  *
35  */
36 
37 /*
38  * Abstract:
39  * 	Basic OpenSM definitions and structures.
40  *	This object represents an OpenSM "base class".
41  *	This object is part of the OpenSM family of objects.
42  */
43 
44 #ifndef _OSM_BASE_H_
45 #define _OSM_BASE_H_
46 
47 #if HAVE_CONFIG_H
48 #  include <config.h>
49 #endif				/* HAVE_CONFIG_H */
50 
51 #ifdef __WIN__
52 #include <vendor/winosm_common.h>
53 #endif
54 
55 #include <complib/cl_types.h>
56 #include <iba/ib_types.h>
57 
58 #ifdef __cplusplus
59 #  define BEGIN_C_DECLS extern "C" {
60 #  define END_C_DECLS   }
61 #else				/* !__cplusplus */
62 #  define BEGIN_C_DECLS
63 #  define END_C_DECLS
64 #endif				/* __cplusplus */
65 
66 BEGIN_C_DECLS
67 /****h* OpenSM/Constants
68 * NAME
69 *	Constants
70 *
71 * DESCRIPTION
72 *	The following constants are used throughout the OpenSM.
73 *
74 * AUTHOR
75 *	Steve King, Intel
76 *
77 *********/
78 /****h* OpenSM/Base
79 * NAME
80 *	Base
81 *
82 * DESCRIPTION
83 *	The Base object encapsulates basic information needed by the
84 *	OpenSM to manage objects.  Each OpenSM object includes the
85 *	Base object as the first member.
86 *
87 *	This object should be treated as opaque and should be
88 *	manipulated only through the provided functions.
89 *
90 * AUTHOR
91 *	Steve King, Intel
92 *
93 *********/
94 /****s* OpenSM: Base/OSM_DEFAULT_M_KEY
95 * NAME
96 *	OSM_DEFAULT_M_KEY
97 *
98 * DESCRIPTION
99 *	Managment key value used by the OpenSM.
100 *
101 * SYNOPSIS
102 */
103 #define OSM_DEFAULT_M_KEY 0
104 /********/
105 /****s* OpenSM: Base/OSM_DEFAULT_SM_KEY
106 * NAME
107 *	OSM_DEFAULT_SM_KEY
108 *
109 * DESCRIPTION
110 *	Subnet Manager key value used by the OpenSM.
111 *
112 * SYNOPSIS
113 */
114 #define OSM_DEFAULT_SM_KEY CL_HTON64(1)
115 /********/
116 /****s* OpenSM: Base/OSM_DEFAULT_SA_KEY
117 * NAME
118 *	OSM_DEFAULT_SA_KEY
119 *
120 * DESCRIPTION
121 *	Subnet Adminstration key value.
122 *
123 * SYNOPSIS
124 */
125 #define OSM_DEFAULT_SA_KEY OSM_DEFAULT_SM_KEY
126 /********/
127 /****s* OpenSM: Base/OSM_DEFAULT_LMC
128 * NAME
129 *	OSM_DEFAULT_LMC
130 *
131 * DESCRIPTION
132 *	Default LMC value used by the OpenSM.
133 *
134 * SYNOPSIS
135 */
136 #define OSM_DEFAULT_LMC 0
137 /********/
138 /****s* OpenSM: Base/OSM_DEFAULT_MAX_OP_VLS
139 * NAME
140 *	OSM_DEFAULT_MAX_OP_VLS
141 *
142 * DESCRIPTION
143 *	Default Maximal Operational VLs to be initialized on
144 *  the link ports PortInfo by the OpenSM.
145 *  Default value provides backward compatibility.
146 *
147 * SYNOPSIS
148 */
149 #define OSM_DEFAULT_MAX_OP_VLS 5
150 /********/
151 /****s* OpenSM: Base/OSM_DEFAULT_SL
152 * NAME
153 *	OSM_DEFAULT_SL
154 *
155 * DESCRIPTION
156 *	Default SL value used by the OpenSM.
157 *
158 * SYNOPSIS
159 */
160 #define OSM_DEFAULT_SL 0
161 /********/
162 /****s* OpenSM: Base/OSM_DEFAULT_SCATTER_PORTS
163 * NAME
164 *	OSM_DEFAULT_SCATTER_PORTS
165 *
166 * DESCRIPTION
167 *	Default Scatter Ports value used by OpenSM.
168 *
169 * SYNOPSIS
170 */
171 #define OSM_DEFAULT_SCATTER_PORTS 0
172 /********/
173 /****s* OpenSM: Base/OSM_DEFAULT_SM_PRIORITY
174 * NAME
175 *	OSM_DEFAULT_SM_PRIORITY
176 *
177 * DESCRIPTION
178 *	Default SM priority value used by the OpenSM,
179 *	as defined in the SMInfo attribute.  0 is the lowest priority.
180 *
181 * SYNOPSIS
182 */
183 #define OSM_DEFAULT_SM_PRIORITY 0
184 /********/
185 /****d* OpenSM: Base/OSM_DEFAULT_TMP_DIR
186 * NAME
187 *	OSM_DEFAULT_TMP_DIR
188 *
189 * DESCRIPTION
190 *	Specifies the default temporary directory for the log file,
191 *  osm-subnet.lst, and other log files.
192 *
193 * SYNOPSIS
194 */
195 #ifdef __WIN__
196 #define OSM_DEFAULT_TMP_DIR "%TEMP%\\"
197 #else
198 #define OSM_DEFAULT_TMP_DIR "/var/log/"
199 #endif
200 /***********/
201 /****d* OpenSM: Base/OSM_DEFAULT_CACHE_DIR
202 * NAME
203 *	OSM_DEFAULT_CACHE_DIR
204 *
205 * DESCRIPTION
206 *	Specifies the default cache directory for the db files.
207 *
208 * SYNOPSIS
209 */
210 #ifdef __WIN__
211 #define OSM_DEFAULT_CACHE_DIR "%TEMP%"
212 #else
213 #define OSM_DEFAULT_CACHE_DIR "/var/cache/opensm"
214 #endif
215 /***********/
216 /****d* OpenSM: Base/OSM_DEFAULT_LOG_FILE
217 * NAME
218 *	OSM_DEFAULT_LOG_FILE
219 *
220 * DESCRIPTION
221 *	Specifies the default log file name
222 *
223 * SYNOPSIS
224 */
225 #ifdef __WIN__
226 #define OSM_DEFAULT_LOG_FILE OSM_DEFAULT_TMP_DIR "osm.log"
227 #else
228 #define OSM_DEFAULT_LOG_FILE "/var/log/opensm.log"
229 #endif
230 /***********/
231 
232 /****d* OpenSM: Base/OSM_DEFAULT_CONFIG_FILE
233 * NAME
234 *	OSM_DEFAULT_CONFIG_FILE
235 *
236 * DESCRIPTION
237 *	Specifies the default OpenSM config file name
238 *
239 * SYNOPSIS
240 */
241 #if defined(HAVE_DEFAULT_OPENSM_CONFIG_FILE)
242 #define OSM_DEFAULT_CONFIG_FILE HAVE_DEFAULT_OPENSM_CONFIG_FILE
243 #elif defined (OPENSM_CONFIG_DIR)
244 #define OSM_DEFAULT_CONFIG_FILE OPENSM_CONFIG_DIR "/opensm.conf"
245 #else
246 #define OSM_DEFAULT_CONFIG_FILE "/etc/opensm/opensm.conf"
247 #endif
248 /***********/
249 
250 /****d* OpenSM: Base/OSM_DEFAULT_PARTITION_CONFIG_FILE
251 * NAME
252 *	OSM_DEFAULT_PARTITION_CONFIG_FILE
253 *
254 * DESCRIPTION
255 *	Specifies the default partition config file name
256 *
257 * SYNOPSIS
258 */
259 #if defined(HAVE_DEFAULT_PARTITION_CONFIG_FILE)
260 #define OSM_DEFAULT_PARTITION_CONFIG_FILE HAVE_DEFAULT_PARTITION_CONFIG_FILE
261 #elif defined(OPENSM_CONFIG_DIR)
262 #define OSM_DEFAULT_PARTITION_CONFIG_FILE OPENSM_CONFIG_DIR "/partitions.conf"
263 #else
264 #define OSM_DEFAULT_PARTITION_CONFIG_FILE "/etc/opensm/partitions.conf"
265 #endif
266 /***********/
267 
268 /****d* OpenSM: Base/OSM_DEFAULT_QOS_POLICY_FILE
269 * NAME
270 *	OSM_DEFAULT_QOS_POLICY_FILE
271 *
272 * DESCRIPTION
273 *	Specifies the default QoS policy file name
274 *
275 * SYNOPSIS
276 */
277 #if defined(HAVE_DEFAULT_QOS_POLICY_FILE)
278 #define OSM_DEFAULT_QOS_POLICY_FILE HAVE_DEFAULT_QOS_POLICY_FILE
279 #elif defined(OPENSM_CONFIG_DIR)
280 #define OSM_DEFAULT_QOS_POLICY_FILE OPENSM_CONFIG_DIR "/qos-policy.conf"
281 #else
282 #define OSM_DEFAULT_QOS_POLICY_FILE "/etc/opensm/qos-policy.conf"
283 #endif
284 /***********/
285 
286 /****d* OpenSM: Base/OSM_DEFAULT_TORUS_CONF_FILE
287 * NAME
288 *	OSM_DEFAULT_TORUS_CONF_FILE
289 *
290 * DESCRIPTION
291 *	Specifies the default file name for extra torus-2QoS configuration
292 *
293 * SYNOPSIS
294 */
295 #ifdef __WIN__
296 #define OSM_DEFAULT_TORUS_CONF_FILE strcat(GetOsmCachePath(), "osm-torus-2QoS.conf")
297 #elif defined(OPENSM_CONFIG_DIR)
298 #define OSM_DEFAULT_TORUS_CONF_FILE OPENSM_CONFIG_DIR "/torus-2QoS.conf"
299 #else
300 #define OSM_DEFAULT_TORUS_CONF_FILE "/etc/opensm/torus-2QoS.conf"
301 #endif /* __WIN__ */
302 /***********/
303 
304 /****d* OpenSM: Base/OSM_DEFAULT_PREFIX_ROUTES_FILE
305 * NAME
306 *	OSM_DEFAULT_PREFIX_ROUTES_FILE
307 *
308 * DESCRIPTION
309 *	Specifies the default prefix routes file name
310 *
311 * SYNOPSIS
312 */
313 #if defined(HAVE_DEFAULT_PREFIX_ROUTES_FILE)
314 #define OSM_DEFAULT_PREFIX_ROUTES_FILE HAVE_DEFAULT_PREFIX_ROUTES_FILE
315 #elif defined(OPENSM_CONFIG_DIR)
316 #define OSM_DEFAULT_PREFIX_ROUTES_FILE OPENSM_CONFIG_DIR "/prefix-routes.conf"
317 #else
318 #define OSM_DEFAULT_PREFIX_ROUTES_FILE "/etc/opensm/prefix-routes.conf"
319 #endif
320 /***********/
321 
322 /****d* OpenSM: Base/OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE
323 * NAME
324 *	OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE
325 *
326 * DESCRIPTION
327 *	Specifies the default file name for per module logging configuration
328 *
329 * SYNOPSIS
330 */
331 #ifdef __WIN__
332 #define OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE strcat(GetOsmCachePath(), "per-module-logging.conf")
333 #elif defined(OPENSM_CONFIG_DIR)
334 #define OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE OPENSM_CONFIG_DIR "/per-module-logging.conf"
335 #else
336 #define OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE "/etc/opensm/per-module-logging.conf"
337 #endif /* __WIN__ */
338 /***********/
339 
340 /****d* OpenSM: Base/OSM_DEFAULT_SWEEP_INTERVAL_SECS
341 * NAME
342 *	OSM_DEFAULT_SWEEP_INTERVAL_SECS
343 *
344 * DESCRIPTION
345 *	Specifies the default number of seconds between subnet sweeps.
346 *
347 * SYNOPSIS
348 */
349 #define OSM_DEFAULT_SWEEP_INTERVAL_SECS 10
350 /***********/
351 /****d* OpenSM: Base/OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
352 * NAME
353 *	OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
354 *
355 * DESCRIPTION
356 *	Specifies the default transaction timeout in milliseconds.
357 *
358 * SYNOPSIS
359 */
360 #define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200
361 /***********/
362 /****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT
363 * NAME
364 *	OSM_DEFAULT_SUBNET_TIMEOUT
365 *
366 * DESCRIPTION
367 *	Specifies the default subnet timeout.
368 *	timeout time = 4us * 2^timeout.
369 *  We use here ~1sec.
370 *
371 * SYNOPSIS
372 */
373 #define OSM_DEFAULT_SUBNET_TIMEOUT 0x12
374 /***********/
375 /****d* OpenSM: Base/OSM_DEFAULT_SWITCH_PACKET_LIFE
376 * NAME
377 *	OSM_DEFAULT_SWITCH_PACKET_LIFE
378 *
379 * DESCRIPTION
380 *	Specifies the default max life time for a pcket on the switch.
381 *	timeout time = 4us * 2^timeout.
382 *  We use here the value of ~1sec
383 *  A Value > 19dec disables this mechanism.
384 *
385 * SYNOPSIS
386 */
387 #define OSM_DEFAULT_SWITCH_PACKET_LIFE 0x12
388 /***********/
389 /****d* OpenSM: Base/OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
390 * NAME
391 *	OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
392 *
393 * DESCRIPTION
394 *	Sets the time a packet can live in the head of the VL Queue
395 *  We use here the value of ~1sec
396 *  A Value > 19dec disables this mechanism.
397 *
398 * SYNOPSIS
399 */
400 #define OSM_DEFAULT_HEAD_OF_QUEUE_LIFE 0x12
401 /***********/
402 /****d* OpenSM: Base/OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
403 * NAME
404 *	OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
405 *
406 * DESCRIPTION
407 *	Sets the time a packet can live in the head of the VL Queue
408 *  of a port that drives a CA port.
409 *  We use here the value of ~256msec
410 *
411 * SYNOPSIS
412 */
413 #define OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE 0x10
414 /***********/
415 /****d* OpenSM: Base/OSM_DEFAULT_VL_STALL_COUNT
416 * NAME
417 *	OSM_DEFAULT_LEAF_VL_COUNT
418 *
419 * DESCRIPTION
420 *	Sets the number of consecutive head of queue life time drops that
421 *  puts the VL into stalled state. In stalled state, the port is supposed
422 *  to drop everything for 8*(head of queue lifetime)
423 *
424 * SYNOPSIS
425 */
426 #define OSM_DEFAULT_VL_STALL_COUNT 0x7
427 /***********/
428 /****d* OpenSM: Base/OSM_DEFAULT_LEAF_VL_STALL_COUNT
429 * NAME
430 *	OSM_DEFAULT_LEAF_VL_STALL_COUNT
431 *
432 * DESCRIPTION
433 *	Sets the number of consecutive head of queue life time drops that
434 *  puts the VL into stalled state. In stalled state, the port is supposed
435 *  to drop everything for 8*(head of queue lifetime). This value is for
436 *  switch ports driving a CA port.
437 *
438 * SYNOPSIS
439 */
440 #define OSM_DEFAULT_LEAF_VL_STALL_COUNT 0x7
441 /***********/
442 /****d* OpenSM: Base/OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
443 * NAME
444 *	OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
445 *
446 * DESCRIPTION
447 *	Specifies the default timeout for ignoring same trap.
448 *	timeout time = 5000000us
449 *  We use here ~5sec.
450 *
451 * SYNOPSIS
452 */
453 #define OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT 5000000
454 /***********/
455 /****d* OpenSM: Base/OSM_DEFAULT_UNHEALTHY_TIMEOUT
456 * NAME
457 *	OSM_DEFAULT_UNHEALTHY_TIMEOUT
458 *
459 * DESCRIPTION
460 *	Specifies the default timeout for setting port as unhealthy.
461 *	timeout time = 60000000us
462 *  We use here ~60sec.
463 *
464 * SYNOPSIS
465 */
466 #define OSM_DEFAULT_UNHEALTHY_TIMEOUT 60000000
467 /***********/
468 /****d* OpenSM: Base/OSM_DEFAULT_ERROR_THRESHOLD
469 * NAME
470 *	OSM_DEFAULT_ERROR_THRESHOLD
471 *
472 * DESCRIPTION
473 *	Specifies default link error threshold to be set by SubnSet(PortInfo).
474 *
475 * SYNOPSIS
476 */
477 #define OSM_DEFAULT_ERROR_THRESHOLD 0x08
478 /***********/
479 /****d* OpenSM: Base/OSM_DEFAULT_SMP_MAX_ON_WIRE
480 * NAME
481 *	OSM_DEFAULT_SMP_MAX_ON_WIRE
482 *
483 * DESCRIPTION
484 *	Specifies the default number of VL15 SMP MADs allowed on
485 *	the wire at any one time.
486 *
487 * SYNOPSIS
488 */
489 #define OSM_DEFAULT_SMP_MAX_ON_WIRE 4
490 /***********/
491 /****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_RCV_SIZE
492 * NAME
493 *	OSM_SM_DEFAULT_QP0_RCV_SIZE
494 *
495 * DESCRIPTION
496 *	Specifies the default size (in MADs) of the QP0 receive queue
497 *
498 * SYNOPSIS
499 */
500 #define OSM_SM_DEFAULT_QP0_RCV_SIZE 256
501 /***********/
502 /****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_SEND_SIZE
503 * NAME
504 *	OSM_SM_DEFAULT_QP0_SEND_SIZE
505 *
506 * DESCRIPTION
507 *	Specifies the default size (in MADs) of the QP0 send queue
508 *
509 * SYNOPSIS
510 */
511 #define OSM_SM_DEFAULT_QP0_SEND_SIZE 256
512 /***********/
513 /****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_RCV_SIZE
514 * NAME
515 *   OSM_SM_DEFAULT_QP1_RCV_SIZE
516 *
517 * DESCRIPTION
518 *   Specifies the default size (in MADs) of the QP1 receive queue
519 *
520 * SYNOPSIS
521 */
522 #define OSM_SM_DEFAULT_QP1_RCV_SIZE 256
523 /***********/
524 /****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_SEND_SIZE
525 * NAME
526 *   OSM_SM_DEFAULT_QP1_SEND_SIZE
527 *
528 * DESCRIPTION
529 *   Specifies the default size (in MADs) of the QP1 send queue
530 *
531 * SYNOPSIS
532 */
533 #define OSM_SM_DEFAULT_QP1_SEND_SIZE 256
534 /****d* OpenSM: Base/OSM_PM_DEFAULT_QP1_RCV_SIZE
535 * NAME
536 *   OSM_PM_DEFAULT_QP1_RCV_SIZE
537 *
538 * DESCRIPTION
539 *   Specifies the default size (in MADs) of the QP1 receive queue
540 *
541 * SYNOPSIS
542 */
543 #define OSM_PM_DEFAULT_QP1_RCV_SIZE 256
544 /***********/
545 /****d* OpenSM: Base/OSM_PM_DEFAULT_QP1_SEND_SIZE
546 * NAME
547 *   OSM_PM_DEFAULT_QP1_SEND_SIZE
548 *
549 * DESCRIPTION
550 *   Specifies the default size (in MADs) of the QP1 send queue
551 *
552 * SYNOPSIS
553 */
554 #define OSM_PM_DEFAULT_QP1_SEND_SIZE 256
555 /****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
556 * NAME
557 *   OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
558 *
559 * DESCRIPTION
560 *   Specifies the polling timeout (in miliseconds) - the timeout
561 *   between one poll to another.
562 *
563 * SYNOPSIS
564 */
565 #define OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS 10000
566 /**********/
567 /****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
568 * NAME
569 *   OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
570 *
571 * DESCRIPTION
572 *   Specifies the number of polling retries before the SM goes back
573 *   to DISCOVERY stage. So the default total time for handoff is 40 sec.
574 *
575 * SYNOPSIS
576 */
577 #define OSM_SM_DEFAULT_POLLING_RETRY_NUMBER 4
578 /**********/
579 /****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_MTU
580 * Name
581 *	OSM_DEFAULT_MGRP_MTU
582 *
583 * DESCRIPTION
584 *	Default MTU used for new MGRP creation (2048 bytes)
585 *  Note it includes the MTUSelector which is set to "Greater Than"
586 *
587 * SYNOPSIS
588 */
589 #define OSM_DEFAULT_MGRP_MTU 0x04
590 /***********/
591 /****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_RATE
592 * Name
593 *	OSM_DEFAULT_MGRP_RATE
594 *
595 * DESCRIPTION
596 *	Default RATE used for new MGRP creation (10Gb/sec)
597 *  Note it includes the RateSelector which is set to "Greater Than"
598 *
599 * SYNOPSIS
600 */
601 #define OSM_DEFAULT_MGRP_RATE 0x03
602 /***********/
603 /****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_SCOPE
604 * Name
605 *	OSM_DEFAULT_MGRP_SCOPE
606 *
607 * DESCRIPTION
608 *	Default SCOPE used for new MGRP creation (link local)
609 *
610 * SYNOPSIS
611 */
612 #define OSM_DEFAULT_MGRP_SCOPE IB_MC_SCOPE_LINK_LOCAL
613 /***********/
614 /****d* OpenSM: Base/OSM_DEFAULT_QOS_MAX_VLS
615  * Name
616  *       OSM_DEFAULT_QOS_MAX_VLS
617  *
618  * DESCRIPTION
619  *       Default Maximum VLs used by the OpenSM.
620  *
621  * SYNOPSIS
622  */
623 #define OSM_DEFAULT_QOS_MAX_VLS 15
624 /***********/
625 /****d* OpenSM: Base/OSM_DEFAULT_QOS_HIGH_LIMIT
626  * Name
627  *       OSM_DEFAULT_QOS_HIGH_LIMIT
628  *
629  * DESCRIPTION
630  *       Default Limit of High Priority in VL Arbitration used by OpenSM.
631  *
632  * SYNOPSIS
633  */
634 #define OSM_DEFAULT_QOS_HIGH_LIMIT 0
635 /***********/
636 /****d* OpenSM: Base/OSM_DEFAULT_QOS_VLARB_HIGH
637  * Name
638  *       OSM_DEFAULT_QOS_VLARB_HIGH
639  *
640  * DESCRIPTION
641  *       Default High Priority VL Arbitration table used by the OpenSM.
642  *
643  * SYNOPSIS
644  */
645 #define OSM_DEFAULT_QOS_VLARB_HIGH "0:4,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0"
646 /***********/
647 /****d* OpenSM: Base/OSM_DEFAULT_QOS_VLARB_LOW
648  * Name
649  *       OSM_DEFAULT_QOS_VLARB_LOW
650  *
651  * DESCRIPTION
652  *       Default Low Priority VL Arbitration table used by the OpenSM.
653  *
654  * SYNOPSIS
655  */
656 #define OSM_DEFAULT_QOS_VLARB_LOW "0:0,1:4,2:4,3:4,4:4,5:4,6:4,7:4,8:4,9:4,10:4,11:4,12:4,13:4,14:4"
657 /***********/
658 /****d* OpenSM: Base/OSM_DEFAULT_QOS_SL2VL
659  * Name
660  *       OSM_DEFAULT_QOS_SL2VL
661  *
662  * DESCRIPTION
663  *       Default QoS SL2VL Mapping Table used by the OpenSM.
664  *
665  * SYNOPSIS
666  */
667 #define OSM_DEFAULT_QOS_SL2VL "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,7"
668 /***********/
669 /****d* OpenSM: Base/OSM_NO_PATH
670 * NAME
671 *	OSM_NO_PATH
672 *
673 * DESCRIPTION
674 *	Value indicating there is no path to the given LID.
675 *
676 * SYNOPSIS
677 */
678 #define OSM_NO_PATH			0xFF
679 /**********/
680 /****d* OpenSM: Base/OSM_NODE_DESC_UNKNOWN
681 * NAME
682 *	OSM_NODE_DESC_UNKNOWN
683 *
684 * DESCRIPTION
685 *	Value indicating the Node Description is not set and is "unknown"
686 *
687 * SYNOPSIS
688 */
689 #define OSM_NODE_DESC_UNKNOWN "<unknown>"
690 /**********/
691 /****d* OpenSM: Base/osm_thread_state_t
692 * NAME
693 *	osm_thread_state_t
694 *
695 * DESCRIPTION
696 *	Enumerates the possible states of worker threads, such
697 *	as the subnet sweeper.
698 *
699 * SYNOPSIS
700 */
701 typedef enum _osm_thread_state {
702 	OSM_THREAD_STATE_NONE = 0,
703 	OSM_THREAD_STATE_INIT,
704 	OSM_THREAD_STATE_RUN,
705 	OSM_THREAD_STATE_EXIT
706 } osm_thread_state_t;
707 /***********/
708 
709 /*
710  * OSM_CAP are from IBA 1.2.1 Table 117 and Table 188
711  */
712 
713 /****d* OpenSM: Base/OSM_CAP_IS_TRAP_SUP
714 * Name
715 *	OSM_CAP_IS_SUBN_TRAP_SUP
716 *
717 * DESCRIPTION
718 *	Management class generates Trap() MADs
719 *
720 * SYNOPSIS
721 */
722 #define OSM_CAP_IS_SUBN_TRAP_SUP (1 << 0)
723 /***********/
724 
725 /****d* OpenSM: Base/OSM_CAP_IS_GET_SET_NOTICE_SUP
726 * Name
727 *	OSM_CAP_IS_GET_SET_NOTICE_SUP
728 *
729 * DESCRIPTION
730 *       Management class supports Get/Set(Notice)
731 *
732 * SYNOPSIS
733 */
734 #define OSM_CAP_IS_SUBN_GET_SET_NOTICE_SUP (1 << 1)
735 /***********/
736 
737 /****d* OpenSM: Base/OSM_CAP_IS_SUBN_OPT_RECS_SUP
738 * Name
739 *	OSM_CAP_IS_SUBN_OPT_RECS_SUP
740 *
741 * DESCRIPTION
742 *	Support all optional attributes except:
743 *  MCMemberRecord, TraceRecord, MultiPathRecord
744 *
745 * SYNOPSIS
746 */
747 #define OSM_CAP_IS_SUBN_OPT_RECS_SUP (1 << 8)
748 /***********/
749 
750 /****d* OpenSM: Base/OSM_CAP_IS_UD_MCAST_SUP
751 * Name
752 *	OSM_CAP_IS_UD_MCAST_SUP
753 *
754 * DESCRIPTION
755 *	Multicast is supported
756 *
757 * SYNOPSIS
758 */
759 #define OSM_CAP_IS_UD_MCAST_SUP (1 << 9)
760 /***********/
761 
762 /****d* OpenSM: Base/OSM_CAP_IS_MULTIPATH_SUP
763 * Name
764 *	OSM_CAP_IS_MULTIPATH_SUP
765 *
766 * DESCRIPTION
767 *	MultiPathRecord and TraceRecord are supported
768 *
769 * SYNOPSIS
770 */
771 #define OSM_CAP_IS_MULTIPATH_SUP (1 << 10)
772 /***********/
773 
774 /****d* OpenSM: Base/OSM_CAP_IS_REINIT_SUP
775 * Name
776 *	OSM_CAP_IS_REINIT_SUP
777 *
778 * DESCRIPTION
779 *	SM/SA supports re-initialization supported
780 *
781 * SYNOPSIS
782 */
783 #define OSM_CAP_IS_REINIT_SUP (1 << 11)
784 /***********/
785 
786 /****d* OpenSM: Base/OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
787 * Name
788 *	OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
789 *
790 * DESCRIPTION
791 *	SM/SA supports enhanced SA PortInfoRecord searches per 1.2 Errata:
792 *  ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported is 1,
793 *  then the AttributeModifier of the SubnAdmGet() and SubnAdmGetTable()
794 *  methods affects the matching behavior on the PortInfo:CapabilityMask
795 *  component. If the high-order bit (bit 31) of the AttributeModifier
796 *  is set to 1, matching on the CapabilityMask component will not be an
797 *  exact bitwise match as described in <ref to 15.4.4>.  Instead,
798 *  matching will only be performed on those bits which are set to 1 in
799 *  the PortInfo:CapabilityMask embedded in the query.
800 *
801 * SYNOPSIS
802 */
803 #define OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED (1 << 13)
804 /***********/
805 
806 /****d* OpenSM: Base/OSM_CAP2_IS_QOS_SUPPORTED
807 * Name
808 *	OSM_CAP2_IS_QOS_SUPPORTED
809 *
810 * DESCRIPTION
811 *	QoS is supported
812 *
813 * SYNOPSIS
814 */
815 #define OSM_CAP2_IS_QOS_SUPPORTED (1 << 1)
816 /***********/
817 
818 /****d* OpenSM: Base/OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED
819 * Name
820 *	OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED
821 *
822 * DESCRIPTION
823 *	Reverse path PKeys indicate in PathRecord responses
824 *
825 * SYNOPSIS
826 */
827 #define OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED (1 << 2)
828 /***********/
829 
830 /****d* OpenSM: Base/OSM_CAP2_IS_MCAST_TOP_SUPPORTED
831 * Name
832 *	OSM_CAP2_IS_MCAST_TOP_SUPPORTED
833 *
834 * DESCRIPTION
835 *       SwitchInfo.MulticastFDBTop is supported
836 *
837 * SYNOPSIS
838 */
839 #define OSM_CAP2_IS_MCAST_TOP_SUPPORTED (1 << 3)
840 /***********/
841 
842 /****d* OpenSM: Base/OSM_CAP2_IS_HIERARCHY_SUPPORTED
843 * Name
844 *
845 * DESCRIPTION
846 *	Hierarchy info supported
847 *
848 * SYNOPSIS
849 */
850 #define OSM_CAP2_IS_HIERARCHY_SUPPORTED (1 << 4)
851 /***********/
852 
853 /****d* OpenSM: Base/OSM_CAP2_IS_ALIAS_GUIDS_SUPPORTED
854 * Name
855 *
856 * DESCRIPTION
857 *	Alias GUIDs supported
858 *
859 * SYNOPSIS
860 */
861 #define OSM_CAP2_IS_ALIAS_GUIDS_SUPPORTED (1 << 5)
862 /***********/
863 
864 /****d* OpenSM: Base/OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED
865 * Name
866 *	OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED
867 *
868 * DESCRIPTION
869 *	Full PortInfoRecords supported
870 *
871 * SYNOPSIS
872 */
873 #define OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED (1 << 6)
874 /***********/
875 
876 /****d* OpenSM: Base/OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED
877 * Name
878 *	OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED
879 *
880 * DESCRIPTION
881 *	Extended Link Speeds supported
882 *
883 * SYNOPSIS
884 */
885 #define OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED (1 << 7)
886 /***********/
887 
888 /****d* OpenSM: Base/OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED
889  * Name
890  *	OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED
891  *
892  * DESCRIPTION
893  *	Multicast Service Records supported
894  *
895  * SYNOPSIS
896  */
897 #define OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED (1 << 8)
898 
899 /****d* OpenSM: Base/OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED
900  * Name
901  *	OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED
902  *
903  * DESCRIPTION
904  *	CapMask2 matching for PortInfoRecord supported
905  *
906  * SYNOPSIS
907  */
908 #define OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED (1 << 10)
909 
910 /****d* OpenSM: Base/OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED
911  * Name
912  *	OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED
913  *
914  * DESCRIPTION
915  *	2x link widths supported
916  *
917  * SYNOPSIS
918  */
919 #define OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED (1 << 13)
920 
921 /****d* OpenSM: Base/osm_signal_t
922 * NAME
923 *	osm_signal_t
924 *
925 * DESCRIPTION
926 *	Enumerates the possible signal codes used by the OSM managers
927 *	This cannot be an enum type, since conversion to and from
928 *	integral types is necessary when passing signals through
929 *	the dispatcher.
930 *
931 * SYNOPSIS
932 */
933 #define OSM_SIGNAL_NONE				0
934 #define OSM_SIGNAL_SWEEP			1
935 #define OSM_SIGNAL_IDLE_TIME_PROCESS_REQUEST	2
936 #define OSM_SIGNAL_PERFMGR_SWEEP		3
937 #define OSM_SIGNAL_GUID_PROCESS_REQUEST		4
938 #define OSM_SIGNAL_MAX				5
939 
940 typedef unsigned int osm_signal_t;
941 /***********/
942 
943 /****d* OpenSM: Base/osm_sm_signal_t
944 * NAME
945 *	osm_sm_signal_t
946 *
947 * DESCRIPTION
948 *	Enumerates the possible signals used by the OSM_SM_MGR
949 *
950 * SYNOPSIS
951 */
952 typedef enum _osm_sm_signal {
953 	OSM_SM_SIGNAL_NONE = 0,
954 	OSM_SM_SIGNAL_DISCOVERY_COMPLETED,
955 	OSM_SM_SIGNAL_POLLING_TIMEOUT,
956 	OSM_SM_SIGNAL_DISCOVER,
957 	OSM_SM_SIGNAL_DISABLE,
958 	OSM_SM_SIGNAL_HANDOVER,
959 	OSM_SM_SIGNAL_HANDOVER_SENT,
960 	OSM_SM_SIGNAL_ACKNOWLEDGE,
961 	OSM_SM_SIGNAL_STANDBY,
962 	OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED,
963 	OSM_SM_SIGNAL_WAIT_FOR_HANDOVER,
964 	OSM_SM_SIGNAL_MAX
965 } osm_sm_signal_t;
966 /***********/
967 
968 /****s* OpenSM: Base/MAX_GUID_FILE_LINE_LENGTH
969 * NAME
970 *	MAX_GUID_FILE_LINE_LENGTH
971 *
972 * DESCRIPTION
973 *	The maximum line number when reading guid file
974 *
975 * SYNOPSIS
976 */
977 #define MAX_GUID_FILE_LINE_LENGTH 120
978 /**********/
979 
980 /****s* OpenSM: Base/VendorOUIs
981 * NAME
982 *	VendorOUIs
983 *
984 * DESCRIPTION
985 *	Known device vendor ID and GUID OUIs
986 *
987 * SYNOPSIS
988 */
989 #define OSM_VENDOR_ID_INTEL         0x00D0B7
990 #define OSM_VENDOR_ID_MELLANOX      0x0002C9
991 #define OSM_VENDOR_ID_REDSWITCH     0x000617
992 #define OSM_VENDOR_ID_SILVERSTORM   0x00066A
993 #define OSM_VENDOR_ID_TOPSPIN       0x0005AD
994 #define OSM_VENDOR_ID_FUJITSU       0x00E000
995 #define OSM_VENDOR_ID_FUJITSU2      0x000B5D
996 #define OSM_VENDOR_ID_VOLTAIRE      0x0008F1
997 #define OSM_VENDOR_ID_YOTTAYOTTA    0x000453
998 #define OSM_VENDOR_ID_PATHSCALE     0x001175
999 #define OSM_VENDOR_ID_IBM           0x000255
1000 #define OSM_VENDOR_ID_DIVERGENET    0x00084E
1001 #define OSM_VENDOR_ID_FLEXTRONICS   0x000B8C
1002 #define OSM_VENDOR_ID_AGILENT       0x0030D3
1003 #define OSM_VENDOR_ID_OBSIDIAN      0x001777
1004 #define OSM_VENDOR_ID_BAYMICRO      0x000BC1
1005 #define OSM_VENDOR_ID_LSILOGIC      0x00A0B8
1006 #define OSM_VENDOR_ID_DDN           0x0001FF
1007 #define OSM_VENDOR_ID_PANTA         0x001393
1008 #define OSM_VENDOR_ID_HP            0x001708
1009 #define OSM_VENDOR_ID_RIOWORKS      0x005045
1010 #define OSM_VENDOR_ID_SUN           0x0003BA
1011 #define OSM_VENDOR_ID_SUN2          0x002128
1012 #define OSM_VENDOR_ID_3LEAFNTWKS    0x0016A1
1013 #define OSM_VENDOR_ID_XSIGO         0x001397
1014 #define OSM_VENDOR_ID_HP2           0x0018FE
1015 #define OSM_VENDOR_ID_DELL          0x00188B
1016 #define OSM_VENDOR_ID_SUPERMICRO    0x003048
1017 #define OSM_VENDOR_ID_HP3           0x0019BB
1018 #define OSM_VENDOR_ID_HP4           0x00237D
1019 #define OSM_VENDOR_ID_OPENIB        0x001405
1020 #define OSM_VENDOR_ID_IBM2	    0x5CF3FC
1021 #define OSM_VENDOR_ID_MELLANOX2     0xF45214
1022 #define OSM_VENDOR_ID_MELLANOX3     0x00258B
1023 #define OSM_VENDOR_ID_MELLANOX4     0xE41D2D
1024 #define OSM_VENDOR_ID_MELLANOX5     0x7CFE90
1025 #define OSM_VENDOR_ID_BULL          0x080038
1026 
1027 /* IPoIB Broadcast Defaults */
1028 #define OSM_IPOIB_BROADCAST_MGRP_QKEY 0x0b1b
1029 extern const ib_gid_t osm_ipoib_broadcast_mgid;
1030 
1031 /**********/
1032 
1033 END_C_DECLS
1034 #endif				/* _OSM_BASE_H_ */
1035