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
38 * Declaration of port related objects.
39 * These objects comprise an IBA port.
40 * These objects are part of the OpenSM family of objects.
46 #include <complib/cl_qmap.h>
47 #include <iba/ib_types.h>
48 #include <opensm/osm_base.h>
49 #include <opensm/osm_subnet.h>
50 #include <opensm/osm_madw.h>
51 #include <opensm/osm_path.h>
52 #include <opensm/osm_pkey.h>
55 # define BEGIN_C_DECLS extern "C" {
56 # define END_C_DECLS }
57 #else /* !__cplusplus */
58 # define BEGIN_C_DECLS
60 #endif /* __cplusplus */
69 /****h* OpenSM/Physical Port
74 * The Physical Port object encapsulates the information needed by the
75 * OpenSM to manage physical ports. The OpenSM allocates one Physical Port
76 * per physical port in the IBA subnet.
78 * In a switch, one multiple Physical Port objects share the same port GUID.
79 * In an end-point, Physical Ports do not share GUID values.
81 * The Physical Port is not thread safe, thus callers must provide
84 * These objects should be treated as opaque and should be
85 * manipulated only through the provided functions.
92 /****s* OpenSM: Physical Port/osm_physp_t
97 * This object represents a physical port on a switch, router or end-point.
99 * The osm_physp_t object should be treated as opaque and should
100 * be manipulated only through the provided functions.
104 typedef struct osm_physp {
105 ib_port_info_t port_info;
106 ib_net64_t port_guid;
108 struct osm_node *p_node;
109 struct osm_physp *p_remote_physp;
111 uint8_t vl_high_limit;
112 unsigned need_update;
113 unsigned is_prof_ignored;
114 osm_dr_path_t dr_path;
115 osm_pkey_tbl_t pkeys;
116 ib_vl_arb_table_t vl_arb[4];
117 cl_ptr_vector_t slvl_by_port;
122 * The IBA defined PortInfo data for this port.
125 * Port GUID value of this port. For switches,
126 * all ports share the same GUID value.
129 * The port number of this port. The PortInfo also
130 * contains a port_number, but that number is not
131 * the port number of this port, but rather the number
132 * of the port that received the SMP during discovery.
133 * Therefore, we must keep a separate record for this
134 * port's port number.
137 * Pointer to the parent Node object of this Physical Port.
140 * Pointer to the Physical Port on the other side of the wire.
141 * If this pointer is NULL no link exists at this port.
144 * Tracks the health of the port. Normally should be TRUE but
145 * might change as a result of incoming traps indicating the port
146 * healthy is questionable.
149 * PortInfo:VLHighLimit value which installed by QoS manager
150 * and should be uploaded to port's PortInfo
153 * When set indicates that port was probably reset and port
154 * related tables (PKey, SL2VL, VLArb) require refreshing.
157 * When set indicates that switch port will be ignored by
158 * the link load equalization algorithm.
161 * The directed route path to this port.
164 * osm_pkey_tbl_t object holding the port PKeys.
167 * Each Physical Port has 4 sections of VL Arbitration table.
170 * A vector of pointers to the sl2vl tables (ordered by input port).
171 * Switches have an entry for every other input port (inc SMA=0).
172 * On CAs only one per port.
178 /****f* OpenSM: Physical Port/osm_physp_construct
180 * osm_physp_construct
183 * Constructs a Physical Port.
187 void osm_physp_construct(IN osm_physp_t * const p_physp);
191 * [in] Pointer to an osm_physp_t object to initialize.
194 * This function does not return a value.
199 * Port, Physical Port
202 /****f* OpenSM: Physical Port/osm_physp_init
207 * Initializes a Physical Port for use.
212 osm_physp_init(IN osm_physp_t * const p_physp,
213 IN const ib_net64_t port_guid,
214 IN const uint8_t port_num,
215 IN const struct osm_node *const p_node,
216 IN const osm_bind_handle_t h_bind,
217 IN const uint8_t hop_count,
218 IN const uint8_t * const p_initial_path);
222 * [in] Pointer to an osm_physp_t object to initialize.
225 * [in] GUID value of this port. Switch ports all share
227 * Caller should use 0 if the guid is unknown.
230 * [in] The port number of this port.
233 * [in] Pointer to the parent Node object of this Physical Port.
236 * [in] Bind handle on which this port is accessed.
237 * Caller should use OSM_INVALID_BIND_HANDLE if the bind
238 * handle to this port is unknown.
241 * [in] Directed route hop count to reach this port.
242 * Caller should use 0 if the hop count is unknown.
245 * [in] Pointer to the directed route path to reach this node.
246 * Caller should use NULL if the path is unknown.
249 * This function does not return a value.
254 * Port, Physical Port
257 /****f* OpenSM: Port/void osm_physp_destroy
262 * This function destroys a Port object.
266 void osm_physp_destroy(IN osm_physp_t * const p_physp);
270 * [in] Pointer to a PhysPort object to destroy.
273 * This function does not return a value.
276 * Performs any necessary cleanup of the specified PhysPort object.
277 * Further operations should not be attempted on the destroyed object.
278 * This function should only be called after a call to osm_physp_construct or
285 /****f* OpenSM: Physical Port/osm_physp_is_valid
290 * Returns TRUE if the Physical Port has been successfully initialized.
295 static inline boolean_t osm_physp_is_valid(IN const osm_physp_t * const p_physp)
298 return (p_physp->port_guid != 0);
304 * [in] Pointer to an osm_physp_t object.
307 * Returns TRUE if the Physical Port has been successfully initialized.
313 * Port, Physical Port
316 /****f* OpenSM: Physical Port/osm_physp_is_healthy
318 * osm_physp_is_healthy
321 * Returns TRUE if the Physical Port has been maked as healthy
326 static inline boolean_t
327 osm_physp_is_healthy(IN const osm_physp_t * const p_physp)
330 return (p_physp->healthy);
336 * [in] Pointer to an osm_physp_t object.
339 * Returns TRUE if the Physical Port has been maked as healthy
341 * All physical ports are initialized as "healthy" but may be marked
342 * otherwise if a received trap claims otherwise.
347 * Port, Physical Port
350 /****f* OpenSM: Physical Port/osm_link_is_healthy
352 * osm_link_is_healthy
355 * Returns TRUE if the link given by the physical port is health,
356 * and FALSE otherwise. Link is healthy if both its physical ports are
361 boolean_t osm_link_is_healthy(IN const osm_physp_t * const p_physp);
365 * [in] Pointer to an osm_physp_t object.
368 * TRUE if both physical ports on the link are healthy, and FALSE otherwise.
369 * All physical ports are initialized as "healthy" but may be marked
370 * otherwise if a received trap claiming otherwise.
375 * Port, Physical Port
378 /****f* OpenSM: Physical Port/osm_physp_set_health
380 * osm_physp_set_health
383 * Sets the port health flag. TRUE means the port is healthy and
384 * should be used for packet routing. FALSE means it should be avoided.
389 osm_physp_set_health(IN osm_physp_t * const p_physp, IN boolean_t is_healthy)
392 p_physp->healthy = is_healthy;
398 * [in] Pointer to an osm_physp_t object.
401 * [in] The health value to be assigned to the port.
402 * TRUE if the Physical Port should been maked as healthy
411 * Port, Physical Port
414 /****f* OpenSM: Physical Port/osm_physp_set_port_info
416 * osm_physp_set_port_info
419 * Copies the PortInfo attribute into the Physical Port object
420 * based on the PortState.
425 osm_physp_set_port_info(IN osm_physp_t * const p_physp,
426 IN const ib_port_info_t * const p_pi)
429 CL_ASSERT(osm_physp_is_valid(p_physp));
431 if (ib_port_info_get_port_state(p_pi) == IB_LINK_DOWN) {
432 /* If PortState is down, only copy PortState */
433 /* and PortPhysicalState per C14-24-2.1 */
434 ib_port_info_set_port_state(&p_physp->port_info, IB_LINK_DOWN);
435 ib_port_info_set_port_phys_state
436 (ib_port_info_get_port_phys_state(p_pi),
437 &p_physp->port_info);
439 p_physp->port_info = *p_pi;
446 * [in] Pointer to an osm_physp_t object.
449 * [in] Pointer to the IBA defined PortInfo at this port number.
452 * This function does not return a value.
457 * Port, Physical Port
460 /****f* OpenSM: Physical Port/osm_physp_set_pkey_tbl
462 * osm_physp_set_pkey_tbl
465 * Copies the P_Key table into the Physical Port object.
470 osm_physp_set_pkey_tbl(IN osm_log_t * p_log,
471 IN const osm_subn_t * p_subn,
472 IN osm_physp_t * const p_physp,
473 IN ib_pkey_table_t * p_pkey_tbl, IN uint16_t block_num);
477 * [in] Pointer to a log object.
480 * [in] Pointer to the subnet data structure.
483 * [in] Pointer to an osm_physp_t object.
486 * [in] Pointer to the IBA defined P_Key table for this port
490 * [in] The part of the P_Key table as defined in the IBA
491 * (valid values 0-2047, and is further limited by the
495 * This function does not return a value.
500 * Port, Physical Port
503 /****f* OpenSM: Physical Port/osm_physp_get_pkey_tbl
505 * osm_physp_get_pkey_tbl
508 * Returns a pointer to the P_Key table object of the Physical Port object.
512 static inline const osm_pkey_tbl_t *osm_physp_get_pkey_tbl(IN const osm_physp_t
515 CL_ASSERT(osm_physp_is_valid(p_physp));
517 (14.2.5.7) - the block number valid values are 0-2047, and are
518 further limited by the size of the P_Key table specified by the
519 PartitionCap on the node.
521 return (&p_physp->pkeys);
527 * [in] Pointer to an osm_physp_t object.
530 * The pointer to the P_Key table object.
535 * Port, Physical Port
538 /****f* OpenSM: Physical Port/osm_physp_set_slvl_tbl
540 * osm_physp_set_slvl_tbl
543 * Copies the SLtoVL attribute into the Physical Port object.
548 osm_physp_set_slvl_tbl(IN osm_physp_t * const p_physp,
549 IN ib_slvl_table_t * p_slvl_tbl, IN uint8_t in_port_num)
551 ib_slvl_table_t *p_tbl;
553 CL_ASSERT(p_slvl_tbl);
554 CL_ASSERT(osm_physp_is_valid(p_physp));
555 p_tbl = cl_ptr_vector_get(&p_physp->slvl_by_port, in_port_num);
556 *p_tbl = *p_slvl_tbl;
562 * [in] Pointer to an osm_physp_t object.
565 * [in] Pointer to the IBA defined SLtoVL map table for this
569 * [in] Input Port Number for this SLtoVL.
572 * This function does not return a value.
577 * Port, Physical Port
580 /****f* OpenSM: Physical Port/osm_physp_get_slvl_tbl
582 * osm_physp_get_slvl_tbl
585 * Returns a pointer to the SLtoVL attribute of the Physical Port object.
589 static inline ib_slvl_table_t *osm_physp_get_slvl_tbl(IN const osm_physp_t *
591 IN uint8_t in_port_num)
593 ib_slvl_table_t *p_tbl;
595 CL_ASSERT(osm_physp_is_valid(p_physp));
596 p_tbl = cl_ptr_vector_get(&p_physp->slvl_by_port, in_port_num);
603 * [in] Pointer to an osm_physp_t object.
606 * [in] Input Port Number for this SLtoVL.
609 * The pointer to the slvl table
614 * Port, Physical Port
617 /****f* OpenSM: Physical Port/osm_physp_set_vla_tbl
619 * osm_physp_set_vla_tbl
622 * Copies the VL Arbitration attribute into the Physical Port object.
627 osm_physp_set_vla_tbl(IN osm_physp_t * const p_physp,
628 IN ib_vl_arb_table_t * p_vla_tbl, IN uint8_t block_num)
630 CL_ASSERT(p_vla_tbl);
631 CL_ASSERT(osm_physp_is_valid(p_physp));
632 CL_ASSERT((1 <= block_num) && (block_num <= 4));
633 p_physp->vl_arb[block_num - 1] = *p_vla_tbl;
639 * [in] Pointer to an osm_physp_t object.
642 * [in] Pointer to the IBA defined VL Arbitration table for this
646 * [in] The part of the VL arbitration as defined in the IBA
650 * This function does not return a value.
655 * Port, Physical Port
658 /****f* OpenSM: Physical Port/osm_physp_get_vla_tbl
660 * osm_physp_get_vla_tbl
663 * Returns a pointer to the VL Arbitration table of the Physical Port object.
667 static inline ib_vl_arb_table_t *osm_physp_get_vla_tbl(IN osm_physp_t *
669 IN uint8_t block_num)
671 CL_ASSERT(osm_physp_is_valid(p_physp));
672 CL_ASSERT((1 <= block_num) && (block_num <= 4));
673 return (&(p_physp->vl_arb[block_num - 1]));
679 * [in] Pointer to an osm_physp_t object.
682 * [in] The part of the VL arbitration as defined in the IBA
686 * The pointer to the VL Arbitration table
691 * Port, Physical Port
694 /****f* OpenSM: Physical Port/osm_physp_get_remote
696 * osm_physp_get_remote
699 * Returns a pointer to the Physical Port on the other side the wire.
703 static inline osm_physp_t *osm_physp_get_remote(IN const osm_physp_t *
706 CL_ASSERT(osm_physp_is_valid(p_physp));
707 return (p_physp->p_remote_physp);
713 * [in] Pointer to an osm_physp_t object.
716 * Returns a pointer to the Physical Port on the other side of
717 * the wire. A return value of NULL means there is no link at this port.
722 * Port, Physical Port
725 /****f* OpenSM: Physical Port/osm_physp_get_port_guid
727 * osm_physp_get_port_guid
730 * Returns the port guid of this physical port.
734 static inline ib_net64_t
735 osm_physp_get_port_guid(IN const osm_physp_t * const p_physp)
737 CL_ASSERT(osm_physp_is_valid(p_physp));
738 return (p_physp->port_guid);
744 * [in] Pointer to an osm_physp_t object.
747 * Returns the port guid of this physical port.
752 * Port, Physical Port
755 /****f* OpenSM: Physical Port/osm_physp_get_subnet_prefix
757 * osm_physp_get_subnet_prefix
760 * Returns the subnet prefix for this physical port.
764 static inline ib_net64_t
765 osm_physp_get_subnet_prefix(IN const osm_physp_t * const p_physp)
767 CL_ASSERT(osm_physp_is_valid(p_physp));
768 return (p_physp->port_info.subnet_prefix);
774 * [in] Pointer to an osm_physp_t object.
777 * Returns the subnet prefix for this physical port.
782 * Port, Physical Port
785 /****f* OpenSM: Physical Port/osm_physp_link_exists
787 * osm_physp_link_exists
790 * Returns TRUE if the Physical Port has a link to the specified port.
795 static inline boolean_t
796 osm_physp_link_exists(IN const osm_physp_t * const p_physp,
797 IN const osm_physp_t * const p_remote_physp)
800 CL_ASSERT(osm_physp_is_valid(p_physp));
801 CL_ASSERT(p_remote_physp);
802 CL_ASSERT(osm_physp_is_valid(p_remote_physp));
803 return ((p_physp->p_remote_physp == p_remote_physp) &&
804 (p_remote_physp->p_remote_physp == p_physp));
810 * [in] Pointer to an osm_physp_t object.
813 * [in] Pointer to an osm_physp_t object.
816 * Returns TRUE if the Physical Port has a link to another port.
822 * Port, Physical Port
825 /****f* OpenSM: Physical Port/osm_physp_link
830 * Sets the pointers to the Physical Ports on the other side the wire.
835 osm_physp_link(IN osm_physp_t * const p_physp,
836 IN osm_physp_t * const p_remote_physp)
839 CL_ASSERT(p_remote_physp);
840 p_physp->p_remote_physp = p_remote_physp;
841 p_remote_physp->p_remote_physp = p_physp;
847 * [in] Pointer to an osm_physp_t object to link.
850 * [in] Pointer to the adjacent osm_physp_t object to link.
858 * Port, Physical Port
861 /****f* OpenSM: Physical Port/osm_physp_unlink
866 * Clears the pointers to the Physical Port on the other side the wire.
871 osm_physp_unlink(IN osm_physp_t * const p_physp,
872 IN osm_physp_t * const p_remote_physp)
875 CL_ASSERT(p_remote_physp);
876 CL_ASSERT(osm_physp_link_exists(p_physp, p_remote_physp));
877 p_physp->p_remote_physp = NULL;
878 p_remote_physp->p_remote_physp = NULL;
884 * [in] Pointer to an osm_physp_t object to link.
887 * [in] Pointer to the adjacent osm_physp_t object to link.
895 * Port, Physical Port
898 /****f* OpenSM: Physical Port/osm_physp_has_any_link
900 * osm_physp_has_any_link
903 * Returns TRUE if the Physical Port has a link to another port.
908 static inline boolean_t
909 osm_physp_has_any_link(IN const osm_physp_t * const p_physp)
912 if (osm_physp_is_valid(p_physp))
913 return (p_physp->p_remote_physp != NULL);
921 * [in] Pointer to an osm_physp_t object.
924 * Returns TRUE if the Physical Port has a link to another port.
930 * Port, Physical Port
933 /****f* OpenSM: Physical Port/osm_physp_get_port_num
935 * osm_physp_get_port_num
938 * Returns the local port number of this Physical Port.
942 static inline uint8_t
943 osm_physp_get_port_num(IN const osm_physp_t * const p_physp)
946 CL_ASSERT(osm_physp_is_valid(p_physp));
947 return (p_physp->port_num);
953 * [in] Pointer to an osm_physp_t object.
956 * Returns the local port number of this Physical Port.
963 /****f* OpenSM: Physical Port/osm_physp_get_node_ptr
965 * osm_physp_get_node_ptr
968 * Returns a pointer to the parent Node object for this port.
972 static inline struct osm_node *osm_physp_get_node_ptr(IN const osm_physp_t *
976 CL_ASSERT(osm_physp_is_valid(p_physp));
977 return ((struct osm_node *)p_physp->p_node);
983 * [in] Pointer to an osm_physp_t object.
986 * Returns a pointer to the parent Node object for this port.
993 /****f* OpenSM: Physical Port/osm_physp_get_port_state
995 * osm_physp_get_port_state
998 * Returns the port state of this Physical Port.
1002 static inline uint8_t
1003 osm_physp_get_port_state(IN const osm_physp_t * const p_physp)
1006 CL_ASSERT(osm_physp_is_valid(p_physp));
1007 return (ib_port_info_get_port_state(&p_physp->port_info));
1013 * [in] Pointer to an osm_physp_t object.
1016 * Returns the local port number of this Physical Port.
1023 /****f* OpenSM: Physical Port/osm_physp_get_base_lid
1025 * osm_physp_get_base_lid
1028 * Returns the base lid of this Physical Port.
1032 static inline ib_net16_t
1033 osm_physp_get_base_lid(IN const osm_physp_t * const p_physp)
1036 CL_ASSERT(osm_physp_is_valid(p_physp));
1037 return (p_physp->port_info.base_lid);
1043 * [in] Pointer to an osm_physp_t object.
1046 * Returns the base lid of this Physical Port.
1053 /****f* OpenSM: Physical Port/osm_physp_get_lmc
1058 * Returns the LMC value of this Physical Port.
1062 static inline uint8_t osm_physp_get_lmc(IN const osm_physp_t * const p_physp)
1065 CL_ASSERT(osm_physp_is_valid(p_physp));
1066 return (ib_port_info_get_lmc(&p_physp->port_info));
1072 * [in] Pointer to an osm_physp_t object.
1075 * Returns the LMC value of this Physical Port.
1082 /****f* OpenSM: Physical Port/osm_physp_get_dr_path_ptr
1084 * osm_physp_get_dr_path_ptr
1087 * Returns a pointer to the directed route path for this port.
1091 static inline osm_dr_path_t *osm_physp_get_dr_path_ptr(IN const osm_physp_t *
1095 CL_ASSERT(osm_physp_is_valid(p_physp));
1096 return ((osm_dr_path_t *) & p_physp->dr_path);
1102 * [in] Pointer to a Physical Port object.
1105 * Returns a pointer to the directed route path for this port.
1110 * Physical Port object
1118 * The Port object encapsulates the information needed by the
1119 * OpenSM to manage ports. The OpenSM allocates one Port object
1120 * per port in the IBA subnet.
1122 * Each Port object is associated with a single port GUID. A Port object
1123 * contains 1 or more Physical Port objects. An end point node has
1124 * one Physical Port per Port. A switch node has more than
1125 * one Physical Port per Port.
1127 * The Port object is not thread safe, thus callers must provide
1130 * These objects should be treated as opaque and should be
1131 * manipulated only through the provided functions.
1138 /****s* OpenSM: Port/osm_port_t
1143 * This object represents a logical port on a switch, router or end-point.
1145 * The osm_port_t object should be treated as opaque and should
1146 * be manipulated only through the provided functions.
1150 typedef struct osm_port {
1151 cl_map_item_t map_item;
1152 cl_list_item_t list_item;
1153 struct osm_node *p_node;
1155 uint32_t discovery_count;
1157 osm_physp_t *p_physp;
1158 cl_qlist_t mcm_list;
1165 * Linkage structure for cl_qmap. MUST BE FIRST MEMBER!
1168 * Linkage structure for cl_qlist. Used by ucast mgr during LFT calculation.
1171 * Points to the Node object that owns this port.
1174 * Manufacturer assigned GUID for this port.
1177 * The number of times this port has been discovered
1178 * during the current fabric sweep. This number is reset
1179 * to zero at the start of a sweep.
1182 * The pointer to physical port used when physical
1183 * characteristics contained in the Physical Port are needed.
1186 * Multicast member list
1189 * Utility flag for port management
1192 * Port, Physical Port, Physical Port Table
1195 /****f* OpenSM: Port/osm_port_delete
1200 * This function destroys and deallocates a Port object.
1204 void osm_port_delete(IN OUT osm_port_t ** const pp_port);
1208 * [in][out] Pointer to a pointer to a Port object to delete.
1209 * On return, this pointer is NULL.
1212 * This function does not return a value.
1215 * Performs any necessary cleanup of the specified Port object.
1221 /****f* OpenSM: Port/osm_port_new
1226 * This function allocates and initializes a Port object.
1230 osm_port_t *osm_port_new(IN const ib_node_info_t * p_ni,
1231 IN struct osm_node *const p_parent_node);
1235 * [in] Pointer to the NodeInfo attribute relavent for this port.
1238 * [in] Pointer to the initialized parent osm_node_t object
1239 * that owns this port.
1242 * Pointer to the initialize Port object.
1245 * Allows calling other port methods.
1251 /****f* OpenSM: Port/osm_port_get_base_lid
1253 * osm_port_get_base_lid
1256 * Gets the base LID of a port.
1260 static inline ib_net16_t
1261 osm_port_get_base_lid(IN const osm_port_t * const p_port)
1263 CL_ASSERT(p_port->p_physp && osm_physp_is_valid(p_port->p_physp));
1264 return (osm_physp_get_base_lid(p_port->p_physp));
1270 * [in] Pointer to a Port object.
1273 * Base LID of the port.
1274 * If the return value is 0, then this port has no assigned LID.
1282 /****f* OpenSM: Port/osm_port_get_lmc
1287 * Gets the LMC value of a port.
1291 static inline uint8_t osm_port_get_lmc(IN const osm_port_t * const p_port)
1293 CL_ASSERT(p_port->p_physp && osm_physp_is_valid(p_port->p_physp));
1294 return (osm_physp_get_lmc(p_port->p_physp));
1300 * [in] Pointer to a Port object.
1303 * Gets the LMC value of a port.
1311 /****f* OpenSM: Port/osm_port_get_guid
1316 * Gets the GUID of a port.
1320 static inline ib_net64_t osm_port_get_guid(IN const osm_port_t * const p_port)
1322 return (p_port->guid);
1328 * [in] Pointer to a Port object.
1331 * Manufacturer assigned GUID of the port.
1339 /****f* OpenSM: Port/osm_port_get_lid_range_ho
1341 * osm_port_get_lid_range_ho
1344 * Returns the HOST ORDER lid min and max values for this port,
1345 * based on the lmc value.
1350 osm_port_get_lid_range_ho(IN const osm_port_t * const p_port,
1351 OUT uint16_t * const p_min_lid,
1352 OUT uint16_t * const p_max_lid);
1356 * [in] Pointer to a Port object.
1359 * [out] Pointer to the minimum LID value occupied by this port.
1362 * [out] Pointer to the maximum LID value occupied by this port.
1373 /****f* OpenSM: Port/osm_get_port_by_base_lid
1375 * osm_get_port_by_base_lid
1378 * Returns a status on whether a Port was able to be
1379 * determined based on the LID supplied and if so, return the Port.
1384 osm_get_port_by_base_lid(IN const osm_subn_t * const p_subn,
1385 IN const ib_net16_t lid,
1386 IN OUT const osm_port_t ** const pp_port);
1390 * [in] Pointer to the subnet data structure.
1393 * [in] LID requested.
1396 * [in][out] Pointer to pointer to Port object.
1408 /****f* OpenSM: Port/osm_port_add_mgrp
1413 * Logically connects a port to a multicast group.
1418 osm_port_add_mgrp(IN osm_port_t * const p_port, IN const ib_net16_t mlid);
1422 * [in] Pointer to an osm_port_t object.
1425 * [in] MLID of the multicast group.
1429 * IB_INSUFFICIENT_MEMORY
1437 /****f* OpenSM: Port/osm_port_remove_mgrp
1439 * osm_port_remove_mgrp
1442 * Logically disconnects a port from a multicast group.
1447 osm_port_remove_mgrp(IN osm_port_t * const p_port, IN const ib_net16_t mlid);
1451 * [in] Pointer to an osm_port_t object.
1454 * [in] MLID of the multicast group.
1465 /****f* OpenSM: Port/osm_port_remove_all_mgrp
1467 * osm_port_remove_all_mgrp
1470 * Logically disconnects a port from all its multicast groups.
1474 void osm_port_remove_all_mgrp(IN osm_port_t * const p_port);
1478 * [in] Pointer to an osm_port_t object.
1489 /****f* OpenSM: Physical Port/osm_physp_calc_link_mtu
1491 * osm_physp_calc_link_mtu
1494 * Calculate the Port MTU based on current and remote
1495 * physical ports MTU CAP values.
1500 osm_physp_calc_link_mtu(IN osm_log_t * p_log, IN const osm_physp_t * p_physp);
1504 * [in] Pointer to a log object.
1507 * [in] Pointer to an osm_physp_t object.
1510 * The MTU of the link to be used.
1518 /****f* OpenSM: Physical Port/osm_physp_calc_link_op_vls
1520 * osm_physp_calc_link_op_vls
1523 * Calculate the Port OP_VLS based on current and remote
1524 * physical ports VL CAP values. Allowing user option for a max limit.
1529 osm_physp_calc_link_op_vls(IN osm_log_t * p_log,
1530 IN const osm_subn_t * p_subn,
1531 IN const osm_physp_t * p_physp);
1535 * [in] Pointer to a log object.
1538 * [in] Pointer to the subnet object for accessing of the options.
1541 * [in] Pointer to an osm_physp_t object.
1544 * The OP_VLS of the link to be used.
1552 /****f* OpenSM: Physical Port/osm_physp_replace_dr_path_with_alternate_dr_path
1554 * osm_physp_replace_dr_path_with_alternate_dr_path
1557 * Replace the direct route path for the given phys port with an
1558 * alternate path going through forien set of phys port.
1563 osm_physp_replace_dr_path_with_alternate_dr_path(IN osm_log_t * p_log,
1564 IN osm_subn_t const *p_subn,
1565 IN osm_physp_t const *p_physp,
1566 IN osm_bind_handle_t * h_bind);
1570 * [in] Pointer to a log object.
1573 * [in] Pointer to the subnet object for accessing of the options.
1576 * [in] Pointer to an osm_physp_t object.
1579 * [in] Pointer to osm_bind_handle_t object.
1591 #endif /* _OSM_PORT_H_ */