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.
5 * Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.
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:
13 * Redistribution and use in source and binary forms, with or
14 * without modification, are permitted provided that the following
17 * - Redistributions of source code must retain the above
18 * copyright notice, this list of conditions and the following
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.
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
39 * Declaration of Switch/osm_port_profile_t.
40 * This object represents a port profile for an IBA switch.
41 * This object is part of the OpenSM family of objects.
44 #ifndef _OSM_PORT_PROFILE_H_
45 #define _OSM_PORT_PROFILE_H_
48 #include <iba/ib_types.h>
49 #include <opensm/osm_base.h>
50 #include <opensm/osm_madw.h>
51 #include <opensm/osm_subnet.h>
52 #include <opensm/osm_node.h>
53 #include <opensm/osm_port.h>
54 #include <opensm/osm_mcast_tbl.h>
57 # define BEGIN_C_DECLS extern "C" {
58 # define END_C_DECLS }
59 #else /* !__cplusplus */
60 # define BEGIN_C_DECLS
62 #endif /* __cplusplus */
65 /****h* OpenSM/Port Profile
70 * The Port Profile object contains profiling information for
71 * each Physical Port on a switch. The profile information
72 * may be used to optimize path selection.
78 /****s* OpenSM: Switch/osm_port_profile_t
83 * The Port Profile object contains profiling information for
84 * each Physical Port on the switch. The profile information
85 * may be used to optimize path selection.
87 * This object should be treated as opaque and should be
88 * be manipulated only through the provided functions.
92 typedef struct osm_port_profile {
98 * The number of paths using this port.
103 /****s* OpenSM: Switch/osm_port_mask_t
108 * The Port Mask object contains a port numbered bit mask
109 * for whether the port should be ignored by the link load
110 * equalization algorithm.
114 typedef long osm_port_mask_t[32 / sizeof(long)];
118 * Bit mask by port number
123 /****f* OpenSM: Port Profile/osm_port_prof_construct
125 * osm_port_prof_construct
132 static inline void osm_port_prof_construct(IN osm_port_profile_t * const p_prof)
135 memset(p_prof, 0, sizeof(*p_prof));
140 * [in] Pointer to the Port Profile object to construct.
150 /****f* OpenSM: Port Profile/osm_port_prof_path_count_inc
152 * osm_port_prof_path_count_inc
155 * Increments the count of the number of paths going through this port.
161 osm_port_prof_path_count_inc(IN osm_port_profile_t * const p_prof)
169 * [in] Pointer to the Port Profile object.
179 /****f* OpenSM: Port Profile/osm_port_prof_path_count_get
181 * osm_port_prof_path_count_get
184 * Returns the count of the number of paths going through this port.
188 static inline uint32_t
189 osm_port_prof_path_count_get(IN const osm_port_profile_t * const p_prof)
191 return (p_prof->num_paths);
196 * [in] Pointer to the Port Profile object.
207 #endif /* _OSM_PORT_PROFILE_H_ */