Blame include/opensm/osm_subnet.h

Packit 13e616
/*
Packit 13e616
 * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
Packit 13e616
 * Copyright (c) 2002-2015 Mellanox Technologies LTD. All rights reserved.
Packit 13e616
 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
Packit 13e616
 * Copyright (c) 2008 Xsigo Systems Inc.  All rights reserved.
Packit 13e616
 * Copyright (c) 2009 System Fabric Works, Inc. All rights reserved.
Packit 13e616
 * Copyright (c) 2009 HNR Consulting. All rights reserved.
Packit 13e616
 * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
Packit 13e616
 * Copyright (c) 2009-2015 ZIH, TU Dresden, Federal Republic of Germany. All rights reserved.
Packit 13e616
 * Copyright (C) 2012-2017 Tokyo Institute of Technology. All rights reserved.
Packit 13e616
 *
Packit 13e616
 * This software is available to you under a choice of one of two
Packit 13e616
 * licenses.  You may choose to be licensed under the terms of the GNU
Packit 13e616
 * General Public License (GPL) Version 2, available from the file
Packit 13e616
 * COPYING in the main directory of this source tree, or the
Packit 13e616
 * OpenIB.org BSD license below:
Packit 13e616
 *
Packit 13e616
 *     Redistribution and use in source and binary forms, with or
Packit 13e616
 *     without modification, are permitted provided that the following
Packit 13e616
 *     conditions are met:
Packit 13e616
 *
Packit 13e616
 *      - Redistributions of source code must retain the above
Packit 13e616
 *        copyright notice, this list of conditions and the following
Packit 13e616
 *        disclaimer.
Packit 13e616
 *
Packit 13e616
 *      - Redistributions in binary form must reproduce the above
Packit 13e616
 *        copyright notice, this list of conditions and the following
Packit 13e616
 *        disclaimer in the documentation and/or other materials
Packit 13e616
 *        provided with the distribution.
Packit 13e616
 *
Packit 13e616
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit 13e616
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 13e616
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Packit 13e616
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
Packit 13e616
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
Packit 13e616
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit 13e616
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit 13e616
 * SOFTWARE.
Packit 13e616
 *
Packit 13e616
 */
Packit 13e616
Packit 13e616
/*
Packit 13e616
 * Abstract:
Packit 13e616
 *	Declaration of osm_subn_t.
Packit 13e616
 *	This object represents an IBA subnet.
Packit 13e616
 *	This object is part of the OpenSM family of objects.
Packit 13e616
 */
Packit 13e616
Packit 13e616
#ifndef _OSM_SUBNET_H_
Packit 13e616
#define _OSM_SUBNET_H_
Packit 13e616
Packit 13e616
#include <iba/ib_types.h>
Packit 13e616
#include <complib/cl_qmap.h>
Packit 13e616
#include <complib/cl_fleximap.h>
Packit 13e616
#include <complib/cl_map.h>
Packit 13e616
#include <complib/cl_ptr_vector.h>
Packit 13e616
#include <complib/cl_list.h>
Packit 13e616
#include <opensm/osm_base.h>
Packit 13e616
#include <opensm/osm_prefix_route.h>
Packit 13e616
#include <opensm/osm_db.h>
Packit 13e616
#include <stdio.h>
Packit 13e616
Packit 13e616
#ifdef __cplusplus
Packit 13e616
#  define BEGIN_C_DECLS extern "C" {
Packit 13e616
#  define END_C_DECLS   }
Packit 13e616
#else				/* !__cplusplus */
Packit 13e616
#  define BEGIN_C_DECLS
Packit 13e616
#  define END_C_DECLS
Packit 13e616
#endif				/* __cplusplus */
Packit 13e616
Packit 13e616
BEGIN_C_DECLS
Packit 13e616
#define OSM_SUBNET_VECTOR_MIN_SIZE			0
Packit 13e616
#define OSM_SUBNET_VECTOR_GROW_SIZE			1
Packit 13e616
#define OSM_SUBNET_VECTOR_CAPACITY			256
Packit 13e616
Packit 13e616
#define OSM_PARTITION_ENFORCE_BOTH			"both"
Packit 13e616
#define OSM_PARTITION_ENFORCE_IN			"in"
Packit 13e616
#define OSM_PARTITION_ENFORCE_OUT			"out"
Packit 13e616
#define OSM_PARTITION_ENFORCE_OFF			"off"
Packit 13e616
Packit 13e616
typedef enum _osm_partition_enforce_type_enum {
Packit 13e616
	OSM_PARTITION_ENFORCE_TYPE_BOTH,
Packit 13e616
	OSM_PARTITION_ENFORCE_TYPE_IN,
Packit 13e616
	OSM_PARTITION_ENFORCE_TYPE_OUT,
Packit 13e616
	OSM_PARTITION_ENFORCE_TYPE_OFF
Packit 13e616
} osm_partition_enforce_type_enum;
Packit 13e616
Packit 13e616
/* XXX: not actual max, max we're currently going to support */
Packit 13e616
#define OSM_CCT_ENTRY_MAX        128
Packit 13e616
#define OSM_CCT_ENTRY_MAD_BLOCKS (OSM_CCT_ENTRY_MAX/64)
Packit 13e616
Packit 13e616
struct osm_opensm;
Packit 13e616
struct osm_qos_policy;
Packit 13e616
Packit 13e616
/****h* OpenSM/Subnet
Packit 13e616
* NAME
Packit 13e616
*	Subnet
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The Subnet object encapsulates the information needed by the
Packit 13e616
*	OpenSM to manage a subnet.  The OpenSM allocates one Subnet object
Packit 13e616
*	per IBA subnet.
Packit 13e616
*
Packit 13e616
*	The Subnet object is not thread safe, thus callers must provide
Packit 13e616
*	serialization.
Packit 13e616
*
Packit 13e616
*	This object is essentially a container for the various components
Packit 13e616
*	of a subnet.  Callers may directly access the member variables.
Packit 13e616
*
Packit 13e616
* AUTHOR
Packit 13e616
*	Steve King, Intel
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_qos_options_t
Packit 13e616
* NAME
Packit 13e616
*	osm_qos_options_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Subnet QoS options structure.  This structure contains the various
Packit 13e616
*	QoS specific configuration parameters for the subnet.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_qos_options {
Packit 13e616
	unsigned max_vls;
Packit 13e616
	int high_limit;
Packit 13e616
	char *vlarb_high;
Packit 13e616
	char *vlarb_low;
Packit 13e616
	char *sl2vl;
Packit 13e616
} osm_qos_options_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*
Packit 13e616
*	max_vls
Packit 13e616
*		The number of maximum VLs on the Subnet (0 == use default)
Packit 13e616
*
Packit 13e616
*	high_limit
Packit 13e616
*		The limit of High Priority component of VL Arbitration
Packit 13e616
*		table (IBA 7.6.9) (-1 == use default)
Packit 13e616
*
Packit 13e616
*	vlarb_high
Packit 13e616
*		High priority VL Arbitration table template. (NULL == use default)
Packit 13e616
*
Packit 13e616
*	vlarb_low
Packit 13e616
*		Low priority VL Arbitration table template. (NULL == use default)
Packit 13e616
*
Packit 13e616
*	sl2vl
Packit 13e616
*		SL2VL Mapping table (IBA 7.6.6) template. (NULL == use default)
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_cct_entry_t
Packit 13e616
* NAME
Packit 13e616
*	osm_cct_entry_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Subnet Congestion Control Table entry.  See A10.2.2.1.1 for format details.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_cct_entry {
Packit 13e616
	uint8_t shift; //Alex: shift 2 bits
Packit 13e616
	uint16_t multiplier; //Alex multiplier 14 bits
Packit 13e616
} osm_cct_entry_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*
Packit 13e616
*	shift
Packit 13e616
*		shift field in CCT entry.  See A10.2.2.1.1.
Packit 13e616
*
Packit 13e616
*	multiplier
Packit 13e616
*		multiplier field in CCT entry.  See A10.2.2.1.1.
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_cacongestion_entry_t
Packit 13e616
* NAME
Packit 13e616
*	osm_cacongestion_entry_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Subnet CA Congestion entry.  See A10.4.3.8.4 for format details.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_cacongestion_entry {
Packit 13e616
	ib_net16_t ccti_timer; //Alex: ccti_timer and ccti_increase should be replaced
Packit 13e616
	uint8_t ccti_increase;
Packit 13e616
	uint8_t trigger_threshold;
Packit 13e616
	uint8_t ccti_min;
Packit 13e616
} osm_cacongestion_entry_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*
Packit 13e616
*	ccti_timer
Packit 13e616
*		CCTI Timer
Packit 13e616
*
Packit 13e616
*	ccti_increase
Packit 13e616
*		CCTI Increase
Packit 13e616
*
Packit 13e616
*	trigger_threshold
Packit 13e616
*		CCTI trigger for log message
Packit 13e616
*
Packit 13e616
*	ccti_min
Packit 13e616
*		CCTI Minimum
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_cct_t
Packit 13e616
* NAME
Packit 13e616
*	osm_cct_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Subnet CongestionControlTable.  See A10.4.3.9 for format details.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_cct {
Packit 13e616
	osm_cct_entry_t entries[OSM_CCT_ENTRY_MAX];
Packit 13e616
	unsigned int entries_len;
Packit 13e616
	char *input_str;
Packit 13e616
} osm_cct_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*
Packit 13e616
*	entries
Packit 13e616
*		Entries in CCT
Packit 13e616
*
Packit 13e616
*	entries_len
Packit 13e616
*		Length of entries
Packit 13e616
*
Packit 13e616
*	input_str
Packit 13e616
*		Original str input
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_subn_opt_t
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_opt_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Subnet options structure.  This structure contains the various
Packit 13e616
*	site specific configuration parameters for the subnet.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_subn_opt {
Packit 13e616
	const char *config_file;
Packit 13e616
	ib_net64_t guid;
Packit 13e616
	ib_net64_t m_key;
Packit 13e616
	ib_net64_t sm_key;
Packit 13e616
	ib_net64_t sa_key;
Packit 13e616
	ib_net64_t subnet_prefix;
Packit 13e616
	ib_net16_t m_key_lease_period;
Packit 13e616
	uint8_t m_key_protect_bits;
Packit 13e616
	boolean_t m_key_lookup;
Packit 13e616
	uint32_t sweep_interval;
Packit 13e616
	uint32_t max_wire_smps;
Packit 13e616
	uint32_t max_wire_smps2;
Packit 13e616
	uint32_t max_smps_timeout;
Packit 13e616
	uint32_t transaction_timeout;
Packit 13e616
	uint32_t transaction_retries;
Packit 13e616
	uint32_t long_transaction_timeout;
Packit 13e616
	uint8_t sm_priority;
Packit 13e616
	uint8_t lmc;
Packit 13e616
	boolean_t lmc_esp0;
Packit 13e616
	uint8_t max_op_vls;
Packit 13e616
	uint8_t force_link_speed;
Packit 13e616
	uint8_t force_link_speed_ext;
Packit 13e616
	uint8_t force_link_width;
Packit 13e616
	uint8_t fdr10;
Packit 13e616
	boolean_t reassign_lids;
Packit 13e616
	boolean_t ignore_other_sm;
Packit 13e616
	boolean_t single_thread;
Packit 13e616
	boolean_t disable_multicast;
Packit 13e616
	boolean_t force_log_flush;
Packit 13e616
	uint8_t subnet_timeout;
Packit 13e616
	uint8_t packet_life_time;
Packit 13e616
	uint8_t vl_stall_count;
Packit 13e616
	uint8_t leaf_vl_stall_count;
Packit 13e616
	uint8_t head_of_queue_lifetime;
Packit 13e616
	uint8_t leaf_head_of_queue_lifetime;
Packit 13e616
	uint8_t local_phy_errors_threshold;
Packit 13e616
	uint8_t overrun_errors_threshold;
Packit 13e616
	boolean_t use_mfttop;
Packit 13e616
	uint32_t sminfo_polling_timeout;
Packit 13e616
	uint32_t polling_retry_number;
Packit 13e616
	uint32_t max_msg_fifo_timeout;
Packit 13e616
	boolean_t force_heavy_sweep;
Packit 13e616
	uint8_t log_flags;
Packit 13e616
	char *dump_files_dir;
Packit 13e616
	char *log_file;
Packit 13e616
	uint32_t log_max_size;
Packit 13e616
	char *partition_config_file;
Packit 13e616
	boolean_t no_partition_enforcement;
Packit 13e616
	char *part_enforce;
Packit 13e616
	osm_partition_enforce_type_enum part_enforce_enum;
Packit 13e616
	boolean_t allow_both_pkeys;
Packit 13e616
	boolean_t keep_pkey_indexes;
Packit 13e616
	uint8_t sm_assigned_guid;
Packit 13e616
	boolean_t qos;
Packit 13e616
	char *qos_policy_file;
Packit 13e616
	boolean_t suppress_sl2vl_mad_status_errors;
Packit 13e616
	boolean_t accum_log_file;
Packit 13e616
	char *console;
Packit 13e616
	uint16_t console_port;
Packit 13e616
	char *port_prof_ignore_file;
Packit 13e616
	char *hop_weights_file;
Packit 13e616
	char *port_search_ordering_file;
Packit 13e616
	boolean_t port_profile_switch_nodes;
Packit 13e616
	boolean_t sweep_on_trap;
Packit 13e616
	char *routing_engine_names;
Packit 13e616
	boolean_t avoid_throttled_links;
Packit 13e616
	boolean_t use_ucast_cache;
Packit 13e616
	boolean_t connect_roots;
Packit 13e616
	char *lid_matrix_dump_file;
Packit 13e616
	char *lfts_file;
Packit 13e616
	char *root_guid_file;
Packit 13e616
	char *cn_guid_file;
Packit 13e616
	char *io_guid_file;
Packit 13e616
	boolean_t port_shifting;
Packit 13e616
	uint32_t scatter_ports;
Packit 13e616
	uint16_t max_reverse_hops;
Packit 13e616
	char *ids_guid_file;
Packit 13e616
	char *guid_routing_order_file;
Packit 13e616
	boolean_t guid_routing_order_no_scatter;
Packit 13e616
	char *sa_db_file;
Packit 13e616
	boolean_t sa_db_dump;
Packit 13e616
	char *torus_conf_file;
Packit 13e616
	boolean_t do_mesh_analysis;
Packit 13e616
	boolean_t exit_on_fatal;
Packit 13e616
	boolean_t honor_guid2lid_file;
Packit 13e616
	boolean_t daemon;
Packit 13e616
	boolean_t sm_inactive;
Packit 13e616
	boolean_t babbling_port_policy;
Packit 13e616
	boolean_t drop_event_subscriptions;
Packit 13e616
	boolean_t ipoib_mcgroup_creation_validation;
Packit 13e616
	boolean_t mcgroup_join_validation;
Packit 13e616
	boolean_t use_original_extended_sa_rates_only;
Packit 13e616
	boolean_t use_optimized_slvl;
Packit 13e616
	boolean_t fsync_high_avail_files;
Packit 13e616
	osm_qos_options_t qos_options;
Packit 13e616
	osm_qos_options_t qos_ca_options;
Packit 13e616
	osm_qos_options_t qos_sw0_options;
Packit 13e616
	osm_qos_options_t qos_swe_options;
Packit 13e616
	osm_qos_options_t qos_rtr_options;
Packit 13e616
	boolean_t congestion_control;
Packit 13e616
	ib_net64_t cc_key;
Packit 13e616
	uint32_t cc_max_outstanding_mads;
Packit 13e616
	ib_net32_t cc_sw_cong_setting_control_map;
Packit 13e616
	uint8_t cc_sw_cong_setting_victim_mask[IB_CC_PORT_MASK_DATA_SIZE];
Packit 13e616
	uint8_t cc_sw_cong_setting_credit_mask[IB_CC_PORT_MASK_DATA_SIZE];
Packit 13e616
	uint8_t cc_sw_cong_setting_threshold;
Packit 13e616
	uint8_t cc_sw_cong_setting_packet_size;
Packit 13e616
	uint8_t cc_sw_cong_setting_credit_starvation_threshold;
Packit 13e616
	osm_cct_entry_t cc_sw_cong_setting_credit_starvation_return_delay;
Packit 13e616
	ib_net16_t cc_sw_cong_setting_marking_rate;
Packit 13e616
	ib_net16_t cc_ca_cong_setting_port_control;
Packit 13e616
	ib_net16_t cc_ca_cong_setting_control_map;
Packit 13e616
	osm_cacongestion_entry_t cc_ca_cong_entries[IB_CA_CONG_ENTRY_DATA_SIZE];
Packit 13e616
	osm_cct_t cc_cct;
Packit 13e616
	boolean_t enable_quirks;
Packit 13e616
	boolean_t no_clients_rereg;
Packit 13e616
#ifdef ENABLE_OSM_PERF_MGR
Packit 13e616
	boolean_t perfmgr;
Packit 13e616
	boolean_t perfmgr_redir;
Packit 13e616
	uint16_t perfmgr_sweep_time_s;
Packit 13e616
	uint32_t perfmgr_max_outstanding_queries;
Packit 13e616
	boolean_t perfmgr_ignore_cas;
Packit 13e616
	char *event_db_dump_file;
Packit 13e616
	int perfmgr_rm_nodes;
Packit 13e616
	boolean_t perfmgr_log_errors;
Packit 13e616
	boolean_t perfmgr_query_cpi;
Packit 13e616
	boolean_t perfmgr_xmit_wait_log;
Packit 13e616
	uint32_t perfmgr_xmit_wait_threshold;
Packit 13e616
#endif				/* ENABLE_OSM_PERF_MGR */
Packit 13e616
	char *event_plugin_name;
Packit 13e616
	char *event_plugin_options;
Packit 13e616
	char *node_name_map_name;
Packit 13e616
	char *prefix_routes_file;
Packit 13e616
	char *log_prefix;
Packit 13e616
	boolean_t consolidate_ipv6_snm_req;
Packit 13e616
	struct osm_subn_opt *file_opts; /* used for update */
Packit 13e616
	uint8_t lash_start_vl;			/* starting vl to use in lash */
Packit 13e616
	uint8_t sm_sl;			/* which SL to use for SM/SA communication */
Packit 13e616
	uint8_t nue_max_num_vls;	/* maximum #VLs to use in nue */
Packit 13e616
	boolean_t nue_include_switches;	/* control how nue treats switches */
Packit 13e616
	char *per_module_logging_file;
Packit 13e616
	boolean_t quasi_ftree_indexing;
Packit 13e616
} osm_subn_opt_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*
Packit 13e616
*	config_file
Packit 13e616
*		The name of the config file.
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		The port guid that the SM is binding to.
Packit 13e616
*
Packit 13e616
*	m_key
Packit 13e616
*		M_Key value sent to all ports qualifying all Set(PortInfo).
Packit 13e616
*
Packit 13e616
*	sm_key
Packit 13e616
*		SM_Key value of the SM used for SM authentication.
Packit 13e616
*
Packit 13e616
*	sa_key
Packit 13e616
*		SM_Key value to qualify rcv SA queries as "trusted".
Packit 13e616
*
Packit 13e616
*	subnet_prefix
Packit 13e616
*		Subnet prefix used on this subnet.
Packit 13e616
*
Packit 13e616
*	m_key_lease_period
Packit 13e616
*		The lease period used for the M_Key on this subnet.
Packit 13e616
*
Packit 13e616
*	sweep_interval
Packit 13e616
*		The number of seconds between subnet sweeps.  A value of 0
Packit 13e616
*		disables sweeping.
Packit 13e616
*
Packit 13e616
*	max_wire_smps
Packit 13e616
*		The maximum number of SMPs sent in parallel.  Default is 4.
Packit 13e616
*
Packit 13e616
*	max_wire_smps2
Packit 13e616
*		The maximum number of timeout SMPs allowed to be outstanding.
Packit 13e616
*		Default is same as max_wire_smps which disables the timeout
Packit 13e616
*		mechanism.
Packit 13e616
*
Packit 13e616
*	max_smps_timeout
Packit 13e616
*		The wait time in usec for timeout based SMPs.  Default is
Packit 13e616
*		timeout * retries.
Packit 13e616
*
Packit 13e616
*	transaction_timeout
Packit 13e616
*		The maximum time in milliseconds allowed for a transaction
Packit 13e616
*		to complete.  Default is 200.
Packit 13e616
*
Packit 13e616
*	transaction_retries
Packit 13e616
*		The number of retries for a transaction. Default is 3.
Packit 13e616
*
Packit 13e616
*	long_transaction_timeout
Packit 13e616
*		The maximum time in milliseconds allowed for "long" transaction
Packit 13e616
*		to complete.  Default is 500.
Packit 13e616
*
Packit 13e616
*	sm_priority
Packit 13e616
*		The priority of this SM as specified by the user.  This
Packit 13e616
*		value is made available in the SMInfo attribute.
Packit 13e616
*
Packit 13e616
*	lmc
Packit 13e616
*		The LMC value used on this subnet.
Packit 13e616
*
Packit 13e616
*	lmc_esp0
Packit 13e616
*		Whether LMC value used on subnet should be used for
Packit 13e616
*		enhanced switch port 0 or not.  If TRUE, it is used.
Packit 13e616
*		Otherwise (the default), LMC is set to 0 for ESP0.
Packit 13e616
*
Packit 13e616
*	max_op_vls
Packit 13e616
*		Limit the maximal operational VLs. default is 1.
Packit 13e616
*
Packit 13e616
*	reassign_lids
Packit 13e616
*		If TRUE cause all lids to be re-assigend.
Packit 13e616
*		Otherwise (the default),
Packit 13e616
*		OpenSM always tries to preserve as LIDs as much as possible.
Packit 13e616
*
Packit 13e616
*	ignore_other_sm_option
Packit 13e616
*		This flag is TRUE if other SMs on the subnet should be ignored.
Packit 13e616
*
Packit 13e616
*	disable_multicast
Packit 13e616
*		This flag is TRUE if OpenSM should disable multicast support.
Packit 13e616
*
Packit 13e616
*	max_msg_fifo_timeout
Packit 13e616
*		The maximal time a message can stay in the incoming message
Packit 13e616
*		queue. If there is more than one message in the queue and the
Packit 13e616
*		last message stayed in the queue more than this value the SA
Packit 13e616
*		request will be immediately returned with a BUSY status.
Packit 13e616
*
Packit 13e616
*	subnet_timeout
Packit 13e616
*		The subnet_timeout that will be set for all the ports in the
Packit 13e616
*		design SubnSet(PortInfo.vl_stall_life))
Packit 13e616
*
Packit 13e616
*	vl_stall_count
Packit 13e616
*		The number of sequential packets dropped that cause the port
Packit 13e616
*		to enter the VLStalled state.
Packit 13e616
*
Packit 13e616
*	leaf_vl_stall_count
Packit 13e616
*		The number of sequential packets dropped that cause the port
Packit 13e616
*		to enter the VLStalled state. This is for switch ports driving
Packit 13e616
*		a CA or router port.
Packit 13e616
*
Packit 13e616
*	head_of_queue_lifetime
Packit 13e616
*		The maximal time a packet can live at the head of a VL queue
Packit 13e616
*		on any port not driving a CA or router port.
Packit 13e616
*
Packit 13e616
*	leaf_head_of_queue_lifetime
Packit 13e616
*		The maximal time a packet can live at the head of a VL queue
Packit 13e616
*		on switch ports driving a CA or router.
Packit 13e616
*
Packit 13e616
*	local_phy_errors_threshold
Packit 13e616
*		Threshold of local phy errors for sending Trap 129
Packit 13e616
*
Packit 13e616
*	overrun_errors_threshold
Packit 13e616
*		Threshold of credits overrun errors for sending Trap 129
Packit 13e616
*
Packit 13e616
*	sminfo_polling_timeout
Packit 13e616
*		Specifies the polling timeout (in milliseconds) - the timeout
Packit 13e616
*		between one poll to another.
Packit 13e616
*
Packit 13e616
*	packet_life_time
Packit 13e616
*		The maximal time a packet can stay in a switch.
Packit 13e616
*		The value is send to all switches as
Packit 13e616
*		SubnSet(SwitchInfo.life_state)
Packit 13e616
*
Packit 13e616
*	dump_files_dir
Packit 13e616
*		The directory to be used for opensm-subnet.lst, opensm.fdbs,
Packit 13e616
*		opensm.mcfdbs, and default log file (the latter for Windows,
Packit 13e616
*		not Linux).
Packit 13e616
*
Packit 13e616
*	log_file
Packit 13e616
*		Name of the log file (or NULL) for stdout.
Packit 13e616
*
Packit 13e616
*	log_max_size
Packit 13e616
*		This option defines maximal log file size in MB. When
Packit 13e616
*		specified the log file will be truncated upon reaching
Packit 13e616
*		this limit.
Packit 13e616
*
Packit 13e616
*	qos
Packit 13e616
*		Boolean that specifies whether the OpenSM QoS functionality
Packit 13e616
*		should be off or on.
Packit 13e616
*
Packit 13e616
*	qos_policy_file
Packit 13e616
*		Name of the QoS policy file.
Packit 13e616
*
Packit 13e616
*	accum_log_file
Packit 13e616
*		If TRUE (default) - the log file will be accumulated.
Packit 13e616
*		If FALSE - the log file will be erased before starting
Packit 13e616
*		current opensm run.
Packit 13e616
*
Packit 13e616
*	port_prof_ignore_file
Packit 13e616
*		Name of file with port guids to be ignored by port profiling.
Packit 13e616
*
Packit 13e616
*	port_profile_switch_nodes
Packit 13e616
*		If TRUE will count the number of switch nodes routed through
Packit 13e616
*		the link. If FALSE - only CA/RT nodes are counted.
Packit 13e616
*
Packit 13e616
*	sweep_on_trap
Packit 13e616
*		Received traps will initiate a new sweep.
Packit 13e616
*
Packit 13e616
*	routing_engine_names
Packit 13e616
*		Name of routing engine(s) to use.
Packit 13e616
*
Packit 13e616
*	avoid_throttled_links
Packit 13e616
*		This option will enforce that throttled switch-to-switch links
Packit 13e616
*		in the fabric are treated as 'broken' by the routing engines
Packit 13e616
*		(if they support it), and hence no path is assigned to these
Packit 13e616
*		underperforming links and a warning is logged instead.
Packit 13e616
*
Packit 13e616
*	connect_roots
Packit 13e616
*		The option which will enforce root to root connectivity with
Packit 13e616
*		up/down and fat-tree routing engines (even if this violates
Packit 13e616
*		"pure" deadlock free up/down or fat-tree algorithm)
Packit 13e616
*
Packit 13e616
*	use_ucast_cache
Packit 13e616
*		When TRUE enables unicast routing cache.
Packit 13e616
*
Packit 13e616
*	lid_matrix_dump_file
Packit 13e616
*		Name of the lid matrix dump file from where switch
Packit 13e616
*		lid matrices (min hops tables) will be loaded
Packit 13e616
*
Packit 13e616
*	lfts_file
Packit 13e616
*		Name of the unicast LFTs routing file from where switch
Packit 13e616
*		forwarding tables will be loaded
Packit 13e616
*
Packit 13e616
*	root_guid_file
Packit 13e616
*		Name of the file that contains list of root guids that
Packit 13e616
*		will be used by fat-tree or up/dn routing (provided by User)
Packit 13e616
*
Packit 13e616
*	cn_guid_file
Packit 13e616
*		Name of the file that contains list of compute node guids that
Packit 13e616
*		will be used by fat-tree routing (provided by User)
Packit 13e616
*
Packit 13e616
*	io_guid_file
Packit 13e616
*		Name of the file that contains list of I/O node guids that
Packit 13e616
*		will be used by fat-tree routing (provided by User)
Packit 13e616
*
Packit 13e616
*	port_shifting
Packit 13e616
*		This option will turn on port_shifting in routing.
Packit 13e616
*
Packit 13e616
*	ids_guid_file
Packit 13e616
*		Name of the file that contains list of ids which should be
Packit 13e616
*		used by Up/Down algorithm instead of node GUIDs
Packit 13e616
*
Packit 13e616
*	guid_routing_order_file
Packit 13e616
*		Name of the file that contains list of guids for routing order
Packit 13e616
*		that will be used by minhop and up/dn routing (provided by User).
Packit 13e616
*
Packit 13e616
*	sa_db_file
Packit 13e616
*		Name of the SA database file.
Packit 13e616
*
Packit 13e616
*	sa_db_dump
Packit 13e616
*		When TRUE causes OpenSM to dump SA DB at the end of every
Packit 13e616
*		light sweep regardless the current verbosity level.
Packit 13e616
*
Packit 13e616
*	torus_conf_file
Packit 13e616
*		Name of the file with extra configuration info for torus-2QoS
Packit 13e616
*		routing engine.
Packit 13e616
*
Packit 13e616
*	exit_on_fatal
Packit 13e616
*		If TRUE (default) - SM will exit on fatal subnet initialization
Packit 13e616
*		issues.
Packit 13e616
*		If FALSE - SM will not exit.
Packit 13e616
*		Fatal initialization issues:
Packit 13e616
*		a. SM recognizes 2 different nodes with the same guid, or
Packit 13e616
*		   12x link with lane reversal badly configured.
Packit 13e616
*
Packit 13e616
*	honor_guid2lid_file
Packit 13e616
*		Always honor the guid2lid file if it exists and is valid. This
Packit 13e616
*		means that the file will be honored when SM is coming out of
Packit 13e616
*		STANDBY. By default this is FALSE.
Packit 13e616
*
Packit 13e616
*	daemon
Packit 13e616
*		OpenSM will run in daemon mode.
Packit 13e616
*
Packit 13e616
*	sm_inactive
Packit 13e616
*		OpenSM will start with SM in not active state.
Packit 13e616
*
Packit 13e616
*	babbling_port_policy
Packit 13e616
*		OpenSM will enforce its "babbling" port policy.
Packit 13e616
*
Packit 13e616
*	drop_event_subscriptions
Packit 13e616
*		OpenSM will drop event subscriptions if the port goes away.
Packit 13e616
*
Packit 13e616
*	ipoib_mcgroup_creation_validation
Packit 13e616
*		OpenSM will validate IPoIB non-broadcast group parameters
Packit 13e616
*		against IPoIB broadcast group.
Packit 13e616
*
Packit 13e616
*	mcgroup_join_validation
Packit 13e616
*		OpenSM will validate multicast join parameters against
Packit 13e616
*		multicast group parameters when MC group already exists.
Packit 13e616
*
Packit 13e616
*	use_original_extended_sa_rates_only
Packit 13e616
*		Use only original extended SA rates (up through 300 Gbps
Packit 13e616
*		for 12x EDR). Option is needed for subnets with
Packit 13e616
*		old kernels/drivers that don't understand the
Packit 13e616
*		new SA rates for 2x link width and/or HDR link speed (19-22).
Packit 13e616
*
Packit 13e616
*	use_optimized_slvl
Packit 13e616
*		Use optimized SLtoVLMappingTable programming if
Packit 13e616
*		device indicates it supports this.
Packit 13e616
*
Packit 13e616
*	fsync_high_avail_files
Packit 13e616
*		Synchronize high availability in memory files
Packit 13e616
*		with storage.
Packit 13e616
*
Packit 13e616
*	perfmgr
Packit 13e616
*		Enable or disable the performance manager
Packit 13e616
*
Packit 13e616
*	perfmgr_redir
Packit 13e616
*		Enable or disable the saving of redirection by PerfMgr
Packit 13e616
*
Packit 13e616
*	perfmgr_sweep_time_s
Packit 13e616
*		Define the period (in seconds) of PerfMgr sweeps
Packit 13e616
*
Packit 13e616
*       event_db_dump_file
Packit 13e616
*               File to dump the event database to
Packit 13e616
*
Packit 13e616
*       event_plugin_name
Packit 13e616
*               Specify the name(s) of the event plugin(s)
Packit 13e616
*
Packit 13e616
*       event_plugin_options
Packit 13e616
*               Options string that would be passed to the plugin(s)
Packit 13e616
*
Packit 13e616
*	qos_options
Packit 13e616
*		Default set of QoS options
Packit 13e616
*
Packit 13e616
*	qos_ca_options
Packit 13e616
*		QoS options for CA ports
Packit 13e616
*
Packit 13e616
*	qos_sw0_options
Packit 13e616
*		QoS options for switches' port 0
Packit 13e616
*
Packit 13e616
*	qos_swe_options
Packit 13e616
*		QoS options for switches' external ports
Packit 13e616
*
Packit 13e616
*	qos_rtr_options
Packit 13e616
*		QoS options for router ports
Packit 13e616
*
Packit 13e616
*	congestion_control
Packit 13e616
*		Boolean that specifies whether OpenSM congestion control configuration
Packit 13e616
*		should be off or no.
Packit 13e616
*
Packit 13e616
*	cc_key
Packit 13e616
*		CCkey to use when configuring congestion control.
Packit 13e616
*
Packit 13e616
*	cc_max_outstanding_mads
Packit 13e616
*		Max number of outstanding CC mads that can be on the wire.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_control_map
Packit 13e616
*		Congestion Control Switch Congestion Setting Control Map
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_victim_mask
Packit 13e616
*		Congestion Control Switch Congestion Setting Victim Mask
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_credit_mask
Packit 13e616
*		Congestion Control Switch Congestion Setting Credit Mask
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_threshold
Packit 13e616
*		Congestion Control Switch Congestion Setting Threshold
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_packet_size
Packit 13e616
*		Congestion Control Switch Congestion Setting Packet Size
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_credit_starvation_threshold
Packit 13e616
*		Congestion Control Switch Congestion Setting Credit Starvation Threshold
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_credit_starvation_return_delay
Packit 13e616
*		Congestion Control Switch Congestion Setting Credit Starvation Return Delay
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_sw_cong_setting_marking_rate
Packit 13e616
*		Congestion Control Switch Congestion Setting Marking Rate
Packit 13e616
*		configuration setting.
Packit 13e616
*
Packit 13e616
*	cc_ca_cong_setting_port_control
Packit 13e616
*		Congestion Control CA Congestion Setting Port Control
Packit 13e616
*
Packit 13e616
*	cc_ca_cong_setting_control_map
Packit 13e616
*		Congestion Control CA Congestion Setting Control Map
Packit 13e616
Packit 13e616
*	cc_ca_cong_entries
Packit 13e616
*		Congestion Control CA Congestion Setting Entries
Packit 13e616
*
Packit 13e616
*	cc_cct
Packit 13e616
*		Congestion Control Table array of entries
Packit 13e616
*
Packit 13e616
*	enable_quirks
Packit 13e616
*		Enable high risk new features and not fully qualified
Packit 13e616
*		hardware specific work arounds
Packit 13e616
*
Packit 13e616
*	no_clients_rereg
Packit 13e616
*		When TRUE disables clients reregistration request
Packit 13e616
*
Packit 13e616
*	scatter_ports
Packit 13e616
*		When not zero, randomize best possible ports chosen
Packit 13e616
*		for a route. The value is used as a random key seed.
Packit 13e616
*
Packit 13e616
*	per_module_logging_file
Packit 13e616
*		File name of per module logging configuration.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_subn_t
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Subnet structure.  Callers may directly access member components,
Packit 13e616
*	after grabbing a lock.
Packit 13e616
*
Packit 13e616
* TO DO
Packit 13e616
*	This structure should probably be volatile.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_subn {
Packit 13e616
	struct osm_opensm *p_osm;
Packit 13e616
	cl_qmap_t sw_guid_tbl;
Packit 13e616
	cl_qmap_t node_guid_tbl;
Packit 13e616
	cl_qmap_t port_guid_tbl;
Packit 13e616
	cl_qmap_t alias_port_guid_tbl;
Packit 13e616
	cl_qmap_t assigned_guids_tbl;
Packit 13e616
	cl_qmap_t rtr_guid_tbl;
Packit 13e616
	cl_qlist_t prefix_routes_list;
Packit 13e616
	cl_qmap_t prtn_pkey_tbl;
Packit 13e616
	cl_qmap_t sm_guid_tbl;
Packit 13e616
	cl_qlist_t sa_sr_list;
Packit 13e616
	cl_qlist_t sa_infr_list;
Packit 13e616
	cl_qlist_t alias_guid_list;
Packit 13e616
	cl_ptr_vector_t port_lid_tbl;
Packit 13e616
	ib_net16_t master_sm_base_lid;
Packit 13e616
	ib_net16_t sm_base_lid;
Packit 13e616
	ib_net64_t sm_port_guid;
Packit 13e616
	uint8_t last_sm_port_state;
Packit 13e616
	uint8_t sm_state;
Packit 13e616
	osm_subn_opt_t opt;
Packit 13e616
	struct osm_qos_policy *p_qos_policy;
Packit 13e616
	uint16_t max_ucast_lid_ho;
Packit 13e616
	uint16_t max_mcast_lid_ho;
Packit 13e616
	uint8_t min_ca_mtu;
Packit 13e616
	uint8_t min_ca_rate;
Packit 13e616
	uint8_t min_data_vls;
Packit 13e616
	uint8_t min_sw_data_vls;
Packit 13e616
	boolean_t ignore_existing_lfts;
Packit 13e616
	boolean_t subnet_initialization_error;
Packit 13e616
	boolean_t force_heavy_sweep;
Packit 13e616
	boolean_t force_reroute;
Packit 13e616
	boolean_t in_sweep_hop_0;
Packit 13e616
	boolean_t force_first_time_master_sweep;
Packit 13e616
	boolean_t first_time_master_sweep;
Packit 13e616
	boolean_t coming_out_of_standby;
Packit 13e616
	boolean_t sweeping_enabled;
Packit 13e616
	unsigned need_update;
Packit 13e616
	cl_fmap_t mgrp_mgid_tbl;
Packit 13e616
	osm_db_domain_t *p_g2m;
Packit 13e616
	osm_db_domain_t *p_neighbor;
Packit 13e616
	void *mboxes[IB_LID_MCAST_END_HO - IB_LID_MCAST_START_HO + 1];
Packit 13e616
} osm_subn_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	sw_guid_tbl
Packit 13e616
*		Container of pointers to all Switch objects in the subnet.
Packit 13e616
*		Indexed by node GUID.
Packit 13e616
*
Packit 13e616
*	node_guid_tbl
Packit 13e616
*		Container of pointers to all Node objects in the subnet.
Packit 13e616
*		Indexed by node GUID.
Packit 13e616
*
Packit 13e616
*	port_guid_tbl
Packit 13e616
*		Container of pointers to all Port objects in the subnet.
Packit 13e616
*		Indexed by port GUID.
Packit 13e616
*
Packit 13e616
*	rtr_guid_tbl
Packit 13e616
*		Container of pointers to all Router objects in the subnet.
Packit 13e616
*		Indexed by node GUID.
Packit 13e616
*
Packit 13e616
*	prtn_pkey_tbl
Packit 13e616
*		Container of pointers to all Partition objects in the subnet.
Packit 13e616
*		Indexed by P_KEY.
Packit 13e616
*
Packit 13e616
*	sm_guid_tbl
Packit 13e616
*		Container of pointers to SM objects representing other SMs
Packit 13e616
*		on the subnet.
Packit 13e616
*
Packit 13e616
*	port_lid_tbl
Packit 13e616
*		Container of pointers to all Port objects in the subnet.
Packit 13e616
*		Indexed by port LID.
Packit 13e616
*
Packit 13e616
*	master_sm_base_lid
Packit 13e616
*		The base LID owned by the subnet's master SM.
Packit 13e616
*
Packit 13e616
*	sm_base_lid
Packit 13e616
*		The base LID of the local port where the SM is.
Packit 13e616
*
Packit 13e616
*	sm_port_guid
Packit 13e616
*		This SM's own port GUID.
Packit 13e616
*
Packit 13e616
*	last_sm_port_state
Packit 13e616
*		Last state of this SM's port.
Packit 13e616
*		0 is down and 1 is up.
Packit 13e616
*
Packit 13e616
*	sm_state
Packit 13e616
*		The high-level state of the SM.  This value is made available
Packit 13e616
*		in the SMInfo attribute.
Packit 13e616
*
Packit 13e616
*	opt
Packit 13e616
*		Subnet options structure contains site specific configuration.
Packit 13e616
*
Packit 13e616
*	p_qos_policy
Packit 13e616
*		Subnet QoS policy structure.
Packit 13e616
*
Packit 13e616
*	max_ucast_lid_ho
Packit 13e616
*		The minimal max unicast lid reported by all switches
Packit 13e616
*
Packit 13e616
*	max_mcast_lid_ho
Packit 13e616
*		The minimal max multicast lid reported by all switches
Packit 13e616
*
Packit 13e616
*	min_ca_mtu
Packit 13e616
*		The minimal MTU reported by all CAs ports on the subnet
Packit 13e616
*
Packit 13e616
*	min_ca_rate
Packit 13e616
*		The minimal rate reported by all CA ports on the subnet
Packit 13e616
*
Packit 13e616
*	ignore_existing_lfts
Packit 13e616
*		This flag is a dynamic flag to instruct the LFT assignment to
Packit 13e616
*		ignore existing legal LFT settings.
Packit 13e616
*		The value will be set according to :
Packit 13e616
*		- Any change to the list of switches will set it to high
Packit 13e616
*		- Coming out of STANDBY it will be cleared (other SM worked)
Packit 13e616
*		- Set to FALSE upon end of all lft assignments.
Packit 13e616
*
Packit 13e616
*	subnet_initalization_error
Packit 13e616
*		Similar to the force_heavy_sweep flag. If TRUE - means that
Packit 13e616
*		we had errors during initialization (due to SubnSet requests
Packit 13e616
*		that failed). We want to declare the subnet as unhealthy, and
Packit 13e616
*		force another heavy sweep.
Packit 13e616
*
Packit 13e616
*	force_heavy_sweep
Packit 13e616
*		If TRUE - we want to force a heavy sweep. This can be done
Packit 13e616
*		either due to receiving of trap - meaning there is some change
Packit 13e616
*		on the subnet, or we received a handover from a remote sm.
Packit 13e616
*		In this case we want to sweep and reconfigure the entire
Packit 13e616
*		subnet. This will cause another heavy sweep to occure when
Packit 13e616
*		the current sweep is done.
Packit 13e616
*
Packit 13e616
*	force_reroute
Packit 13e616
*		If TRUE - we want to force switches in the fabric to be
Packit 13e616
*		rerouted.
Packit 13e616
*
Packit 13e616
*	in_sweep_hop_0
Packit 13e616
*		When in_sweep_hop_0 flag is set to TRUE - this means we are
Packit 13e616
*		in sweep_hop_0 - meaning we do not want to continue beyond
Packit 13e616
*		the current node.
Packit 13e616
*		This is relevant for the case of SM on switch, since in the
Packit 13e616
*		switch info we need to signal somehow not to continue
Packit 13e616
*		the sweeping.
Packit 13e616
*
Packit 13e616
*	force_first_time_master_sweep
Packit 13e616
*		This flag is used to avoid race condition when Master SM being
Packit 13e616
*		in the middle of very long configuration stage of the heavy sweep,
Packit 13e616
*		receives HANDOVER from another MASTER SM. When the current heavy sweep
Packit 13e616
*		is finished, new heavy sweep will be started immediately.
Packit 13e616
*		At the beginning of the sweep, opensm will set first_time_master_sweep,
Packit 13e616
*		force_heavy_sweep and coming_out_of_standby flags in order to allow full
Packit 13e616
*		reconfiguration of the fabric. This is required as another MASTER SM could
Packit 13e616
*		change configuration of the fabric before sending HANDOVER to MASTER SM.
Packit 13e616
*
Packit 13e616
*	first_time_master_sweep
Packit 13e616
*		This flag is used for the PortInfo setting. On the first
Packit 13e616
*		sweep as master (meaning after moving from Standby|Discovering
Packit 13e616
*		state), the SM must send a PortInfoSet to all ports. After
Packit 13e616
*		that - we want to minimize the number of PortInfoSet requests
Packit 13e616
*		sent, and to send only requests that change the value from
Packit 13e616
*		what is updated in the port (or send a first request if this
Packit 13e616
*		is a new port). We will set this flag to TRUE when entering
Packit 13e616
*		the master state, and set it back to FALSE at the end of the
Packit 13e616
*		drop manager. This is done since at the end of the drop manager
Packit 13e616
*		we have updated all the ports that are reachable, and from now
Packit 13e616
*		on these are the only ports we have data of. We don't want
Packit 13e616
*		to send extra set requests to these ports anymore.
Packit 13e616
*
Packit 13e616
*	coming_out_of_standby
Packit 13e616
*		TRUE on the first sweep after the SM was in standby.
Packit 13e616
*		Used for nulling any cache of LID and Routing.
Packit 13e616
*		The flag is set true if the SM state was standby and now
Packit 13e616
*		changed to MASTER it is reset at the end of the sweep.
Packit 13e616
*
Packit 13e616
*	sweeping_enabled
Packit 13e616
*		FALSE - sweeping is administratively disabled, all
Packit 13e616
*		sweeping is inhibited, TRUE - sweeping is done
Packit 13e616
*		normally
Packit 13e616
*
Packit 13e616
*	need_update
Packit 13e616
*		This flag should be on during first non-master heavy
Packit 13e616
*		(including pre-master discovery stage)
Packit 13e616
*
Packit 13e616
*	mgrp_mgid_tbl
Packit 13e616
*		Container of pointers to all Multicast group objects in
Packit 13e616
*		the subnet. Indexed by MGID.
Packit 13e616
*
Packit 13e616
*	mboxes
Packit 13e616
*		Array of pointers to all Multicast MLID box objects in the
Packit 13e616
*		subnet. Indexed by MLID offset from base MLID.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Subnet/osm_assigned_guids_t
Packit 13e616
* NAME
Packit 13e616
*	osm_assigned_guids_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	SA assigned GUIDs structure.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_assigned_guids {
Packit 13e616
	cl_map_item_t map_item;
Packit 13e616
	ib_net64_t port_guid;
Packit 13e616
	ib_net64_t assigned_guid[1];
Packit 13e616
} osm_assigned_guids_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	map_item
Packit 13e616
*		Linkage structure for cl_qmap.  MUST BE FIRST MEMBER!
Packit 13e616
*
Packit 13e616
*	port_guid
Packit 13e616
*		Base port GUID.
Packit 13e616
*
Packit 13e616
*	assigned_guids
Packit 13e616
*		Table of persistent SA assigned GUIDs.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_construct
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_construct
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function constructs a Subnet object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_subn_construct(IN osm_subn_t * p_subn);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to a Subnet object to construct.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Allows calling osm_subn_init, and osm_subn_destroy.
Packit 13e616
*
Packit 13e616
*	Calling osm_subn_construct is a prerequisite to calling any other
Packit 13e616
*	method except osm_subn_init.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_init, osm_subn_destroy
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_destroy
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_destroy
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_subn_destroy function destroys a subnet, releasing
Packit 13e616
*	all resources.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_subn_destroy(IN osm_subn_t * p_subn);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to a Subnet object to destroy.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Performs any necessary cleanup of the specified Subnet object.
Packit 13e616
*	Further operations should not be attempted on the destroyed object.
Packit 13e616
*	This function should only be called after a call to osm_subn_construct
Packit 13e616
*	or osm_subn_init.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_init
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_init
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_init
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_subn_init function initializes a Subnet object for use.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn,
Packit 13e616
			      IN struct osm_opensm *p_osm,
Packit 13e616
			      IN const osm_subn_opt_t * p_opt);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object to initialize.
Packit 13e616
*
Packit 13e616
*	p_opt
Packit 13e616
*		[in] Pointer to the subnet options structure.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	IB_SUCCESS if the Subnet object was initialized successfully.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Allows calling other Subnet methods.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/*
Packit 13e616
  Forward references.
Packit 13e616
*/
Packit 13e616
struct osm_mad_addr;
Packit 13e616
struct osm_log;
Packit 13e616
struct osm_switch;
Packit 13e616
struct osm_physp;
Packit 13e616
struct osm_port;
Packit 13e616
struct osm_mgrp;
Packit 13e616
Packit 13e616
/****f* OpenSM: Helper/osm_get_gid_by_mad_addr
Packit 13e616
* NAME
Packit 13e616
*	osm_get_gid_by_mad_addr
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Looks for the requester gid in the mad address.
Packit 13e616
*
Packit 13e616
* Note: This code is not thread safe. Need to grab the lock before
Packit 13e616
* calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
ib_api_status_t osm_get_gid_by_mad_addr(IN struct osm_log *p_log,
Packit 13e616
					IN const osm_subn_t * p_subn,
Packit 13e616
					IN struct osm_mad_addr *p_mad_addr,
Packit 13e616
					OUT ib_gid_t * p_gid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to subnet object.
Packit 13e616
*
Packit 13e616
*	p_mad_addr
Packit 13e616
*		[in] Pointer to mad address object.
Packit 13e616
*
Packit 13e616
*	p_gid
Packit 13e616
*		[out] Pointer to the GID structure to fill in.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*     IB_SUCCESS if able to find the GID by address given.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Helper/osm_get_physp_by_mad_addr
Packit 13e616
* NAME
Packit 13e616
*	osm_get_physp_by_mad_addr
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Looks for the requester physical port in the mad address.
Packit 13e616
*
Packit 13e616
* Note: This code is not thread safe. Need to grab the lock before
Packit 13e616
* calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_physp *osm_get_physp_by_mad_addr(IN struct osm_log *p_log,
Packit 13e616
					     IN const osm_subn_t * p_subn,
Packit 13e616
					     IN struct osm_mad_addr
Packit 13e616
					     *p_mad_addr);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to subnet object.
Packit 13e616
*
Packit 13e616
*	p_mad_addr
Packit 13e616
*		[in] Pointer to mad address object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Pointer to requester physical port object if found. Null otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Helper/osm_get_port_by_mad_addr
Packit 13e616
* NAME
Packit 13e616
*	osm_get_port_by_mad_addr
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Looks for the requester port in the mad address.
Packit 13e616
*
Packit 13e616
* Note: This code is not thread safe. Need to grab the lock before
Packit 13e616
* calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_port *osm_get_port_by_mad_addr(IN struct osm_log *p_log,
Packit 13e616
					   IN const osm_subn_t * p_subn,
Packit 13e616
					   IN struct osm_mad_addr *p_mad_addr);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to subnet object.
Packit 13e616
*
Packit 13e616
*	p_mad_addr
Packit 13e616
*		[in] Pointer to mad address object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Pointer to requester port object if found. Null otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_switch_by_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_switch_by_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Looks for the given switch guid in the subnet table of switches by guid.
Packit 13e616
*  NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*  calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_switch *osm_get_switch_by_guid(IN const osm_subn_t * p_subn,
Packit 13e616
					  IN ib_net64_t guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		[in] The node guid in network byte order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The switch structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy,
Packit 13e616
*	osm_switch_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_node_by_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_node_by_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given node guid in the subnet table of nodes by guid.
Packit 13e616
*  NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*  calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_node *osm_get_node_by_guid(IN osm_subn_t const *p_subn,
Packit 13e616
				      IN ib_net64_t guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		[in] The node guid in network byte order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The node structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy,
Packit 13e616
*	osm_node_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_port_by_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_port_by_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given port guid in the subnet table of ports by guid.
Packit 13e616
*  NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*  calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_port *osm_get_port_by_guid(IN osm_subn_t const *p_subn,
Packit 13e616
				      IN ib_net64_t guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		[in] The port guid in network order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The port structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy,
Packit 13e616
*	osm_port_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_get_port_by_lid_ho
Packit 13e616
* NAME
Packit 13e616
*	osm_get_port_by_lid_ho
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer of the port object for given lid value.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_port *osm_get_port_by_lid_ho(const osm_subn_t * subn, uint16_t lid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	subn
Packit 13e616
*		[in] Pointer to the subnet data structure.
Packit 13e616
*
Packit 13e616
*	lid
Packit 13e616
*		[in] LID requested in host byte order.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The port structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*       Subnet object, osm_port_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_alias_guid_by_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_alias_guid_by_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given port guid in the subnet table of ports by
Packit 13e616
*	alias guid.
Packit 13e616
*  NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*  calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_alias_guid *osm_get_alias_guid_by_guid(IN osm_subn_t const *p_subn,
Packit 13e616
						  IN ib_net64_t guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		[in] The alias port guid in network order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The alias guid structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy,
Packit 13e616
*	osm_alias_guid_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_port_by_alias_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_port_by_alias_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given port guid in the subnet table of ports by
Packit 13e616
*	alias guid.
Packit 13e616
*  NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*  calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_port *osm_get_port_by_alias_guid(IN osm_subn_t const *p_subn,
Packit 13e616
					    IN ib_net64_t guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		[in] The alias port guid in network order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The port structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy,
Packit 13e616
*	osm_port_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_assigned_guids_new
Packit 13e616
* NAME
Packit 13e616
*	osm_assigned_guids_new
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function allocates and initializes an assigned guids object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_assigned_guids_t *osm_assigned_guids_new(IN const ib_net64_t port_guid,
Packit 13e616
					     IN const uint32_t num_guids);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*       port_guid
Packit 13e616
*               [in] Base port GUID in network order
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*       Pointer to the initialized assigned alias guid object.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_assigned_guids_t, osm_assigned_guids_delete,
Packit 13e616
*	osm_get_assigned_guids_by_guid
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_assigned_guids_delete
Packit 13e616
* NAME
Packit 13e616
*	osm_assigned_guids_delete
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function destroys and deallocates an assigned guids object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_assigned_guids_delete(IN OUT osm_assigned_guids_t ** pp_assigned_guids);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*       pp_assigned_guids
Packit 13e616
*		[in][out] Pointer to a pointer to an assigned guids object to delete.
Packit 13e616
*		On return, this pointer is NULL.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Performs any necessary cleanup of the specified assigned guids object.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_assigned_guids_new, osm_get_assigned_guids_by_guid
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_assigned_guids_by_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_assigned_guids_by_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given port guid and returns a pointer
Packit 13e616
*	to the guid table of SA assigned alias guids for that port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_assigned_guids_t *osm_get_assigned_guids_by_guid(IN osm_subn_t const *p_subn,
Packit 13e616
						     IN ib_net64_t port_guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	port_guid
Packit 13e616
*		[in] The base port guid in network order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The osm_assigned_guids structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_assigned_guids_new, osm_assigned_guids_delete,
Packit 13e616
*	osm_assigned_guids_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_get_port_by_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_port_by_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer of the port object for given lid value.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline struct osm_port *osm_get_port_by_lid(IN osm_subn_t const * subn,
Packit 13e616
						   IN ib_net16_t lid)
Packit 13e616
{
Packit 13e616
	return osm_get_port_by_lid_ho(subn, cl_ntoh16(lid));
Packit 13e616
}
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	subn
Packit 13e616
*		[in] Pointer to the subnet data structure.
Packit 13e616
*
Packit 13e616
*	lid
Packit 13e616
*		[in] LID requested in network byte order.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The port structure pointer if found. NULL otherwise.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*       Subnet object, osm_port_t
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_mgrp_by_mgid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_mgrp_by_mgid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given multicast group in the subnet table by mgid.
Packit 13e616
*	NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*	calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
struct osm_mgrp *osm_get_mgrp_by_mgid(IN osm_subn_t * subn, IN ib_gid_t * mgid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	mgid
Packit 13e616
*		[in] The multicast group MGID value
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The multicast group structure pointer if found. NULL otherwise.
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_get_mbox_by_mlid
Packit 13e616
* NAME
Packit 13e616
*	osm_get_mbox_by_mlid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This looks for the given multicast group in the subnet table by mlid.
Packit 13e616
*	NOTE: this code is not thread safe. Need to grab the lock before
Packit 13e616
*	calling it.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline struct osm_mgrp_box *osm_get_mbox_by_mlid(osm_subn_t const *p_subn, ib_net16_t mlid)
Packit 13e616
{
Packit 13e616
	return (struct osm_mgrp_box *)p_subn->mboxes[cl_ntoh16(mlid) - IB_LID_MCAST_START_HO];
Packit 13e616
}
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to an osm_subn_t object
Packit 13e616
*
Packit 13e616
*	mlid
Packit 13e616
*		[in] The multicast group mlid in network order
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The multicast group structure pointer if found. NULL otherwise.
Packit 13e616
*********/
Packit 13e616
Packit 13e616
int is_mlnx_ext_port_info_supported(ib_net32_t vendid, ib_net16_t devid);
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_set_default_opt
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_set_default_opt
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_subn_set_default_opt function sets the default options.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*
Packit 13e616
*	p_opt
Packit 13e616
*		[in] Pointer to the subnet options structure.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	None
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Subnet object, osm_subn_construct, osm_subn_destroy
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_parse_conf_file
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_parse_conf_file
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_subn_parse_conf_file function parses the configuration file
Packit 13e616
*	and sets the defaults accordingly.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
int osm_subn_parse_conf_file(const char *conf_file, osm_subn_opt_t * p_opt);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*
Packit 13e616
*	p_opt
Packit 13e616
*		[in] Pointer to the subnet options structure.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	0 on success, positive value if file doesn't exist,
Packit 13e616
*	negative value otherwise
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_rescan_conf_files
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_rescan_conf_files
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_subn_rescan_conf_files function parses the configuration
Packit 13e616
*	files and update selected subnet options
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
int osm_subn_rescan_conf_files(IN osm_subn_t * p_subn);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to the subnet structure.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	0 on success, positive value if file doesn't exist,
Packit 13e616
*	negative value otherwise
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_output_conf
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_output_conf
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Output configuration info
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opt);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*
Packit 13e616
*	out
Packit 13e616
*		[in] File stream to output to.
Packit 13e616
*
Packit 13e616
*	p_opt
Packit 13e616
*		[in] Pointer to the subnet options structure.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	This method does not return a value
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Subnet/osm_subn_write_conf_file
Packit 13e616
* NAME
Packit 13e616
*	osm_subn_write_conf_file
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Write the configuration file into the cache
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
int osm_subn_write_conf_file(char *file_name, IN osm_subn_opt_t * p_opt);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*
Packit 13e616
*	p_opt
Packit 13e616
*		[in] Pointer to the subnet options structure.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	0 on success, negative value otherwise
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Assumes the conf file is part of the cache dir which defaults to
Packit 13e616
*	OSM_DEFAULT_CACHE_DIR or OSM_CACHE_DIR the name is opensm.opts
Packit 13e616
*********/
Packit 13e616
int osm_subn_verify_config(osm_subn_opt_t * p_opt);
Packit 13e616
Packit 13e616
END_C_DECLS
Packit 13e616
#endif				/* _OSM_SUBNET_H_ */