/usr/include/infiniband/opensm/osm_multicast.h is in libopensm2-dev 3.2.6-20090317-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | /*
* Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
/*
* Abstract:
* Declaration of osm_mgrp_t.
* This object represents an IBA Multicast Group.
* This object is part of the OpenSM family of objects.
*/
#ifndef _OSM_MULTICAST_H_
#define _OSM_MULTICAST_H_
#include <iba/ib_types.h>
#include <complib/cl_qmap.h>
#include <complib/cl_qlist.h>
#include <complib/cl_spinlock.h>
#include <opensm/osm_base.h>
#include <opensm/osm_mtree.h>
#include <opensm/osm_mcm_port.h>
#include <opensm/osm_subnet.h>
#include <opensm/osm_log.h>
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
#endif /* __cplusplus */
BEGIN_C_DECLS
/****h* OpenSM/Multicast Group
* NAME
* Multicast Group
*
* DESCRIPTION
* The Multicast Group encapsulates the information needed by the
* OpenSM to manage Multicast Groups. The OpenSM allocates one
* Multicast Group object per Multicast Group in the IBA subnet.
*
* The Multicast Group is not thread safe, thus callers must provide
* serialization.
*
* This object should be treated as opaque and should be
* manipulated only through the provided functions.
*
* AUTHOR
* Steve King, Intel
*
*********/
/****s* OpenSM: Multicast Group/osm_mcast_mgr_ctxt_t
* NAME
* osm_mcast_mgr_ctxt_t
*
* DESCRIPTION
* Struct for passing context arguments to the multicast manager.
*
* The osm_mcast_mgr_ctxt_t object should be treated as opaque and should
* be manipulated only through the provided functions.
*
* SYNOPSIS
*/
typedef struct osm_mcast_mgr_ctxt {
cl_list_item_t list_item;
ib_net16_t mlid;
osm_mcast_req_type_t req_type;
ib_net64_t port_guid;
} osm_mcast_mgr_ctxt_t;
/*
* FIELDS
*
* mlid
* The network ordered LID of this Multicast Group
* (must be >= 0xC000).
*
* req_type
* The type of the request that caused this call
* (multicast create/join/leave).
*
* port_guid
* The port guid of the port that is being added/removed from
* the multicast group due to this call.
*
* SEE ALSO
*********/
/****s* OpenSM: Multicast Group/osm_mgrp_t
* NAME
* osm_mgrp_t
*
* DESCRIPTION
* Multicast Group structure.
*
* The osm_mgrp_t object should be treated as opaque and should
* be manipulated only through the provided functions.
*
* SYNOPSIS
*/
typedef struct osm_mgrp {
cl_map_item_t map_item;
ib_net16_t mlid;
osm_mtree_node_t *p_root;
cl_qmap_t mcm_port_tbl;
ib_member_rec_t mcmember_rec;
boolean_t well_known;
boolean_t to_be_deleted;
uint32_t last_change_id;
uint32_t last_tree_id;
unsigned full_members;
} osm_mgrp_t;
/*
* FIELDS
* map_item
* Map Item for qmap linkage. Must be first element!!
*
* mlid
* The network ordered LID of this Multicast Group (must be
* >= 0xC000).
*
* p_root
* Pointer to the root "tree node" in the single spanning tree
* for this multicast group. The nodes of the tree represent
* switches. Member ports are not represented in the tree.
*
* mcm_port_tbl
* Table (sorted by port GUID) of osm_mcm_port_t objects
* representing the member ports of this multicast group.
*
* mcmember_rec
* Holds the parameters of the Multicast Group.
*
* well_known
* Indicates that this is the wellknown multicast group which
* is created during the initialization of SM/SA and will be
* present even if there are no ports for this group
*
* to_be_deleted
* Since groups are deleted only after re-route we need to
* track the fact the group is about to be deleted so we can
* track the fact a new join is actually a create request.
*
* last_change_id
* a counter for the number of changes applied to the group.
* This counter shuold be incremented on any modification
* to the group: joining or leaving of ports.
*
* last_tree_id
* the last change id used for building the current tree.
*
* SEE ALSO
*********/
/****f* OpenSM: Vendor API/osm_mgrp_func_t
* NAME
* osm_mgrp_func_t
*
* DESCRIPTION
* Callback for the osm_mgrp_apply_func function.
* The callback function must not modify the tree linkage.
*
* SYNOPSIS
*/
typedef void (*osm_mgrp_func_t) (IN const osm_mgrp_t * const p_mgrp,
IN const osm_mtree_node_t * const p_mtn,
IN void *context);
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to the multicast group object.
*
* p_mtn
* [in] Pointer to the multicast tree node.
*
* context
* [in] User context.
*
* RETURN VALUES
* None.
*
* NOTES
*
* SEE ALSO
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_new
* NAME
* osm_mgrp_new
*
* DESCRIPTION
* Allocates and initializes a Multicast Group for use.
*
* SYNOPSIS
*/
osm_mgrp_t *osm_mgrp_new(IN const ib_net16_t mlid);
/*
* PARAMETERS
* mlid
* [in] Multicast LID for this multicast group.
*
* RETURN VALUES
* IB_SUCCESS if initialization was successful.
*
* NOTES
* Allows calling other Multicast Group methods.
*
* SEE ALSO
* Multicast Group, osm_mgrp_delete
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_delete
* NAME
* osm_mgrp_delete
*
* DESCRIPTION
* Destroys and deallocates a Multicast Group.
*
* SYNOPSIS
*/
void osm_mgrp_delete(IN osm_mgrp_t * const p_mgrp);
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* RETURN VALUES
* None.
*
* NOTES
*
* SEE ALSO
* Multicast Group, osm_mgrp_new
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_is_guid
* NAME
* osm_mgrp_is_guid
*
* DESCRIPTION
* Indicates if the specified port GUID is a member of the Multicast Group.
*
* SYNOPSIS
*/
static inline boolean_t
osm_mgrp_is_guid(IN const osm_mgrp_t * const p_mgrp,
IN const ib_net64_t port_guid)
{
return (cl_qmap_get(&p_mgrp->mcm_port_tbl, port_guid) !=
cl_qmap_end(&p_mgrp->mcm_port_tbl));
}
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* port_guid
* [in] Port GUID.
*
* RETURN VALUES
* TRUE if the port GUID is a member of the group,
* FALSE otherwise.
*
* NOTES
*
* SEE ALSO
* Multicast Group
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_is_empty
* NAME
* osm_mgrp_is_empty
*
* DESCRIPTION
* Indicates if the multicast group has any member ports.
*
* SYNOPSIS
*/
static inline boolean_t osm_mgrp_is_empty(IN const osm_mgrp_t * const p_mgrp)
{
return (cl_qmap_count(&p_mgrp->mcm_port_tbl) == 0);
}
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* RETURN VALUES
* TRUE if there are no ports in the multicast group.
* FALSE otherwise.
*
* NOTES
*
* SEE ALSO
* Multicast Group
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_get_mlid
* NAME
* osm_mgrp_get_mlid
*
* DESCRIPTION
* The osm_mgrp_get_mlid function returns the multicast LID of this group.
*
* SYNOPSIS
*/
static inline ib_net16_t osm_mgrp_get_mlid(IN const osm_mgrp_t * const p_mgrp)
{
return (p_mgrp->mlid);
}
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* RETURN VALUES
* MLID of the Multicast Group.
*
* NOTES
*
* SEE ALSO
* Multicast Group
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_add_port
* NAME
* osm_mgrp_add_port
*
* DESCRIPTION
* Adds a port to the multicast group.
*
* SYNOPSIS
*/
osm_mcm_port_t *osm_mgrp_add_port(osm_subn_t *subn, osm_log_t *log,
IN osm_mgrp_t * const p_mgrp,
IN const ib_gid_t * const p_port_gid,
IN const uint8_t join_state,
IN boolean_t proxy_join);
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object to initialize.
*
* p_port_gid
* [in] Pointer to the GID of the port to add to the multicast group.
*
* join_state
* [in] The join state for this port in the group.
*
* RETURN VALUES
* IB_SUCCESS
* IB_INSUFFICIENT_MEMORY
*
* NOTES
*
* SEE ALSO
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_is_port_present
* NAME
* osm_mgrp_is_port_present
*
* DESCRIPTION
* checks a port from the multicast group.
*
* SYNOPSIS
*/
boolean_t
osm_mgrp_is_port_present(IN const osm_mgrp_t * const p_mgrp,
IN const ib_net64_t port_guid,
OUT osm_mcm_port_t ** const pp_mcm_port);
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* port_guid
* [in] Port guid of the departing port.
*
* pp_mcm_port
* [out] Pointer to a pointer to osm_mcm_port_t
* Updated to the member on success or NULLed
*
* RETURN VALUES
* TRUE if port present
* FALSE if port is not present.
*
* NOTES
*
* SEE ALSO
*********/
/****f* OpenSM: Multicast Group/osm_mgrp_remove_port
* NAME
* osm_mgrp_remove_port
*
* DESCRIPTION
* Removes a port from the multicast group.
*
* SYNOPSIS
*/
void
osm_mgrp_delete_port(IN osm_subn_t * const p_subn,
IN osm_log_t * const p_log,
IN osm_mgrp_t * const p_mgrp,
IN const ib_net64_t port_guid);
/*
* PARAMETERS
*
* p_subn
* [in] Pointer to the subnet object
*
* p_log
* [in] The log object pointer
*
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* port_guid
* [in] Port guid of the departing port.
*
* RETURN VALUES
* None.
*
* NOTES
*
* SEE ALSO
*********/
int osm_mgrp_remove_port(osm_subn_t *subn, osm_log_t *log, osm_mgrp_t *mgrp,
osm_mcm_port_t *mcm, uint8_t join_state);
/****f* OpenSM: Multicast Group/osm_mgrp_apply_func
* NAME
* osm_mgrp_apply_func
*
* DESCRIPTION
* Calls the specified function for each element in the tree.
* Elements are passed to the callback function in no particular order.
*
* SYNOPSIS
*/
void
osm_mgrp_apply_func(const osm_mgrp_t * const p_mgrp,
osm_mgrp_func_t p_func, void *context);
/*
* PARAMETERS
* p_mgrp
* [in] Pointer to an osm_mgrp_t object.
*
* p_func
* [in] Pointer to the users callback function.
*
* context
* [in] User context passed to the callback function.
*
*
* RETURN VALUES
* None.
*
* NOTES
*
* SEE ALSO
* Multicast Group
*********/
END_C_DECLS
#endif /* _OSM_MULTICAST_H_ */
|