-OpenSM for Windows: last updated [12-07-09]\r
+OpenSM for Windows: last updated [6-21-10]\r
--------------------------------------------------\r
\r
OpenSM provides a user-mode implementation for an InfiniBand Subnet Manager and\r
Administrator. Such a software entity is required to run in order to\r
-initialize the InfiniBand hardware (at least one per each InfiniBand subnet).\r
+initialize the InfiniBand hardware (at least one SM per each InfiniBand subnet).\r
\r
The full list of OpenSM features is described in the user manual\r
-provided in the doc sub directory.\r
+provided in the doc/ directory.\r
\r
The installation of OpenSM includes:\r
\r
-%ProgramFiles%\Winof\\r
+%ProgramFiles%\OFED\\r
opensm.exe - the SM/SA executable\r
osmtest.exe - a test program for the SM/SA\r
\r
-The standard WinOF installation creates an OpenSM Windows Service which is\r
+The standard OFED installation creates an OpenSM Windows Service which is\r
inactive by default. If one chooses the install feature 'Startup OpenSM' then\r
the OpenSM Windows Service is reset to start automatically at System boot.\r
-Multiple OpenSM instances within a fabric are supported; the 1st OpenSM instance\r
-will be the MASTER opensm, while others will be in STANDBY mode awaiting\r
-the demise of the MASTER opensm instance.\r
+Multiple OpenSM instances within a fabric are supported; the last OpenSM\r
+invocation will be the MASTER opensm, while others will be in STANDBY mode\r
+awaiting the demise of the MASTER opensm instance.\r
\r
\r
-Building opensm.exe, osmtest.exe from the SVN tree with MSFT WDK 7600+\r
-----------------------------------------------------------------------\r
+Building opensm.exe, osmtest.exe from the SVN tree with MSFT WDK 7600.16385.1 \r
+-----------------------------------------------------------------------------\r
cd trunk\ulp\opensm\r
build /wg\r
\r
+Note the file trunk\ulp\opensm\mad-vendor.inc controls which vendor\r
+(IBAL or UMAD) is built with. Currently both vendors have been tested and\r
+pass all osm tests (osmtest, saquery PR) along with configuring a 52 node\r
+Windows HPC Edition cluster. \r
+The preferred vendor is UMAD as this is the vendor which is utilized by the\r
+OFED for Linux opensm build; therefore the UMAD vendor has seen the largest\r
+number of nodes and operational hours.\r
\r
-OpenSM 3.3.3 status\r
+\r
+OpenSM 3.3.6 status\r
-------------\r
\r
-openSM 3.3.3 configured a 53 node HPC fabric runing Intel MPI regression tests.\r
-The openSM as a service is functioning well; log file resides in\r
+openSM 3.3.6 [vendor-IBAL] configured a 53 node HPC fabric runing Intel MPI regression tests.\r
+All osmtests pass successfully; see 'opensm\user\scripts\osm-regress.bat'.\r
+\r
+The openSM as a service is functioning correctly; the OpenSM log file resides in\r
%TEMP\osm.log which translates to %windir%\temp\osm.log when run as a service.\r
+Additionally %TEMP\osm.syslog or '%windir%\temp\osm.syslog', when run as a service, exists\r
+as a high level record of OpenSM events; where osm.log contains more detailed information\r
+which controlled by opensm.exe -V and/or -D command line switches.\r
\r
The log path is now static in definition as the usage output changed which no\r
-longer allowed calls to GetTempPath(). In order to work around this I used\r
-strdup_expand() in places where the static paths were dup()'ed. strdup_expand()\r
-will expand environment vars encountered during the string dup operation; a\r
-solution although likely not the final solution, as when the static paths\r
-printf() the '%' char of the environment vars are incorrectly treated as a\r
-printf() control char...sigh.\r
-\r
-The osm vendor is 'IBAL' until UMAD QP1/SA read() interface is working.\r
-The include files vendor.* define which osm vendor is being built.\r
+longer allowed calls to GetTempPath(). In order to work around this fopen()\r
+is actually a macro which redirects to Fopen(). The difference being Fopen()\r
+will strdup_expand() the filename argument and then call the Windows version\r
+of fopen(). This approach allows filenames like '%TEMP%\osm.log' to be properly\r
+expanded and opened without excessive code changes to filenames.\r
+\r
+The osm vendor is 'IBAL' until UMAD QP1/SA interfaces are debugged.\r
+The include file user\mad-vendor.inc define which osm vendor is being built/used.\r
Make sure all SOURCES files are using the same vendor!\r
-nmake/build pre-processing leaves much to be desired... :-(\r
\r
\r
\r
OpenSM Code Base\r
----------------\r
\r
-OpenSM src is based on the OFED management\opensm sources for 3.3.3 release.\r
+OpenSM src is based on the OFED management\opensm sources for the 3.3.6 release.\r
+\r
+Based-on implies the following build processes:\r
+\r
+ If you use the [ANNOUNCE]'d management (OpenSM and infiniband diagnostics) \r
+ tarballs, the lex/yacc and config files are already constructed:\r
+ see http://www.openfabrics.org/downloads/management/\r
+ (listed in http://www.openfabrics.org/downloads/management/latest.txt)\r
\r
-Based-on implies the following process:\r
+ otherwise\r
\r
From the OFED management maintainers git repository on a Linux system\r
1) git clone git://git.openfabrics.org/~sashak/management\r
\r
10) Carefully apply/reject changes.\r
There are a few (<30) differing files which the OFED community\r
- declined to accept due to Windows orientation; an onogin story...sigh.\r
+ declined to accept due to Windows orientation; an ongoing story...sigh.\r
The bigger change blocks are found in the following files:\r
opensm\main.c OpenSM as a Windows service support.\r
opensm\console.c Windows console support without poll().\r
cl_spinlock_release(&p_disp->lock);\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
void cl_disp_construct(IN cl_dispatcher_t * const p_disp)\r
{\r
CL_ASSERT(p_disp);\r
cl_qpool_construct(&p_disp->msg_pool);\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
void cl_disp_shutdown(IN cl_dispatcher_t * const p_disp)\r
{\r
CL_ASSERT(p_disp);\r
free(cl_qlist_remove_head(&p_disp->reg_list));\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
void cl_disp_destroy(IN cl_dispatcher_t * const p_disp)\r
{\r
CL_ASSERT(p_disp);\r
cl_ptr_vector_destroy(&p_disp->reg_vec);\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
cl_status_t cl_disp_init(IN cl_dispatcher_t * const p_disp,\r
IN const uint32_t thread_count,\r
IN const char *const name)\r
return (status);\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
cl_disp_reg_handle_t cl_disp_register(IN cl_dispatcher_t * const p_disp,\r
IN const cl_disp_msgid_t msg_id,\r
IN cl_pfn_msgrcv_cb_t pfn_callback\r
return (p_reg);\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
void cl_disp_unregister(IN const cl_disp_reg_handle_t handle)\r
{\r
cl_disp_reg_info_t *p_reg;\r
cl_spinlock_release(&p_disp->lock);\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
cl_status_t cl_disp_post(IN const cl_disp_reg_handle_t handle,\r
IN const cl_disp_msgid_t msg_id,\r
IN const void *const p_data,\r
\r
Version: OpenSM 3.3.x\r
Repo: git://git.openfabrics.org/~sashak/management.git\r
-Date: Nov 2009\r
+Date: Dec 2009\r
\r
1 Overview\r
----------\r
This document describes the contents of the OpenSM 3.3 release.\r
OpenSM is an InfiniBand compliant Subnet Manager and Administration,\r
and runs on top of OpenIB. The OpenSM version for this release\r
-is opensm-3.3.3.\r
+is opensm-3.3.6.\r
\r
This document includes the following sections:\r
1 This Overview section (describing new features and software\r
around to improve connectivity. I/O nodes list is provided using file\r
and --io_guid_file command line option.\r
\r
+* MGID to MLID compression - infrastructure for many MGIDs to single MLID\r
+ compression. This becomes helpful when number of multicast groups\r
+ exceeds subnet's MLID routing capability (normally 1024 groups). In such\r
+ cases many multicast groups (MGID) can be routed using same MLID value.\r
+\r
* Many code improvements, optimizations and cleanups.\r
\r
-* Windows support (very early stage yet).\r
+* Windows support (early stage).\r
\r
1.2 Minor New Features:\r
\r
1d7dd18 opensm/osm_ucast_ftree.c: Enhanced Fat-Tree algorithm\r
e07a2f1 Add LMC support to DOR routing\r
1acfe8a opensm: Add SuperMicro to list of recognized vendors\r
+f02f40e opensm: implement 'connect_roots' option in fat-tree routing\r
+748d41e opensm SA DB dump/restore: added option to dump SA DB on every sweep\r
+b03a95e complib/cl_fleximap: add cl_fmap_match() function\r
+b7a8a87 opensm/include/iba/ib_types.h: adding Congestion Control definitions\r
+fa356f8 opensm: Add support for optimized SLtoVLMappingTable programming\r
+8aaae91 Dimension port order file support\r
+7662eec opensm: Add option to specify prefix to syslog messages\r
+2382cf3 opensm: Add update_desc command to opensm console\r
\r
1.3 Library API Changes\r
\r
39b241f opensm/lid_mgr: fix duplicated lid assignment\r
b44c398 opensm: invalidate routing cache when entering master state\r
595f2e3 opensm: update LFTs when entering master\r
+8406c65 opensm: fix port chooser\r
+fa90512 opensm/osm_vendor_*_sa: fix incompatibility with QLogic SM\r
+7ec9f7c opensm: discard multicast SA PR with wildcard DGID\r
+5cdb53f opensm/osm_sa_node_record.c use comp mask to match by LID or GUID\r
+55f9772 opensm: Return single PathRecord for SubnAdmGet with DGID/SGID wild\r
+ carded\r
+5ec0b5f opensm: compress IPV6 SNM groups to use a single MLID\r
+26e7e83 opensm/osm_lid_mgr: fix couple of duplicate LIDs bugs\r
+fedc419 opensm: Multicast root switch calculation\r
\r
4.2 Other Bug Fixes\r
\r
83bf6c5 opensm/osm_subnet.c fix parse functions for big endian machines\r
6b9a1e9 opensm/PerfMgr: Primarily fix enhanced switch port 0 perf manager\r
operation\r
-8406c65 opensm: fix port chooser\r
4f79a17 opensm/osm_perfmgr.c: In osm_perfmgr_init, eliminate memory leak\r
on error\r
22da81f opensm/osm_ucast_ftree.c: fix full topology dump\r
67f4c07 opensm/lash: simplify some memory allocations\r
3e6bcdb opensm/lash: fix memory leaks\r
3ff97b9 opensm/vendor: save some stack memory\r
-fa90512 opensm/osm_vendor_*_sa: fix incompatibility with QLogic SM\r
ccc7621 opensm/osm_ucast_ftree.c: fixing errors in comments\r
1a802b3 Corrected incoherency in __osm_ftree_fabric_route_to_non_cns comments\r
85a7e54 opensm/osm_sm.c: fix MC group creation in race condition\r
-\r
aad1af2 opensm/osm_trap_rcv.c: Improvements in log_trap_info()\r
f619d67 opensm/osm_trap_rcv.c: Minor reorganization of trap_rcv_process_request\r
084335b opensm/link_mgr: verify port's lid\r
-d525931 opensm/osm_vendor_ibumad: Use OSM_UMAD_MAX_AGENTS rather than UMAD_CA_MAX_AGENTS\r
+d525931 opensm/osm_vendor_ibumad: Use OSM_UMAD_MAX_AGENTS rather than\r
+ UMAD_CA_MAX_AGENTS\r
f342c62 opensm/osm_sa.c: don't ignore failure in osm_mgrp_add_port()\r
587fda4 osmtest/osmt_multicast.c: fix strict aliasing breakage warning\r
6931f3e opensm: make subnet's max mlid update implementation independent\r
e8ee292 opensm/opensm/osm_subnet.c: adjust buffer to ensure a '\n' is printed\r
84d9830 opensm/osm_ucast_updn.c: Reduce temporary allocation of cas_per_sw\r
347ad64 opensm/ib_types.h: Mask off client rereg bit in set_client_rereg\r
-\r
c2ab189 opensm/osm_state_mgr.c: in cleanup_switch() check only relevant\r
LFT part\r
40c93d3 use transportable constant attributes\r
180b335 update functions to match .h prototypes\r
9240ef4 opensm/osm_ucast_lash: fix use after free bug\r
6f1a21a opensm: osm_get_port_by_lid() helper\r
-7ec9f7c opensm: discard multicast SA PR with wildcard DGID\r
c9e2818 opensm/osm_sa_path_record.c: validate multicast membership\r
225dcf5 opensm/osm_mesh.c: Remove edges in lash matrix\r
4dd928b opensm/osm_sa_mcmember_record.c: clean uninitialized variable use\r
6ad8d78 opensm/libvendor/osm_vendor_(ibumad mlx)_sa.c: Handle malloc\r
failure in __osmv_send_sa_req\r
cf97ebf opensm/osm_ucast_lash.(h c): Replace memory allocation by array\r
-5cdb53f opensm/osm_sa_node_record.c use comp mask to match by LID or GUID\r
957461c opensm/osm_sa.c add attribute and component mask to error message\r
5d339a1 osm_dump.c dump port if lft is set up\r
518083d osm_port.c: check if op_vls = 0 before max_op_vls comparison\r
condition by #else\r
9f8bd4a management: Fixed custom_release in SPEC files\r
c0b8207 opensm/PerfMgr: Change redir_tbl_size to num_ports for better clarity\r
+596bb08 opensm/osm_sa.c: check for SA DB file only if requested\r
+2f2bd4e opensm SA DB dump/restore: load SA DB only once\r
+4abcbf2 opensm: Added print_desc to various log messages\r
+5e3d235 opensm/osm_vendor_ibumad.c: Move error info into single message\r
+8e5ca10 opensm/libvendor//osm_vendor_ibumad_sa.c: uninitialized fields\r
+d13c2b6 opensm/osm_sm_mad_ctrl.c Changes to some error messages\r
+f79d315 opensm/osm_sm_mad_ctrl.c: Add missing call to return mad to mad pool\r
+150a9b1 opensm/osm_sa_mcmember_record.c: print mcast join/create failures in\r
+ VERBOSE instead of DEBUG level\r
+9b7882a opensm/osm_vendor_ibumad.c: Change LID format to decimal in log message\r
+5256c43 opensm/osm_vendor_mlx: fix compilation error\r
+93db10d opensm/osm_vendor_mlx_txn.c: eliminate bunch of compilation warnings\r
+156fdc1 opensm/osm_helper.c Log format changes\r
+7a55434 opensm/osm_ucast_ftree.c Changed log level\r
+a1694de opensm/osm_state_mgr.c Added more info to some error messages\r
+fdec20a opensm/osm_trap_rcv.c: Eliminate heavy sweep on receipt of trap 145\r
+13a32a7 opensm - standardize on a single Windows #define - take #2\r
+b236a10 opensm/osm_db_files.c: kill useless malloc() castings\r
+4ba0c26 opensm/osm_db_files.c: add '/' path delimited\r
+e3b98a5 opensm/osm_sm_mad_ctrl.c: Fix qp0_mads_accounting\r
+dbbe5b3 opensm/osm_subnet.c: fixing bug in dumping options file\r
+f22856a opensm/osm_ucast_mgr.c: fix memory leak\r
+0d5f0b6 opensm: osm_get_mgrp_by_mgid() helper\r
+e3c044a osm_sa_mcmember_record.c: pass MCM Record data to mlid allocator\r
+3dda2dc opensm/osm_sa_member_record.c: mlid independent MGID generator\r
+1f95a3c opensm/osm_sa_mcmember_record.c: move mgid allocation code\r
+b78add1 complib: replace intn_t types by C99 intptr_t\r
+a864fd3 osmtest/osmt_mtl_regular_qp.c: cleaning uintn_t use\r
+9e01318 opensm/osm_console.c: make const functions\r
+f8c4c3e opensm/osm_mgrp_new(): add subnet db insertion\r
+80da047 complib/fleximap: make compar callback to return int\r
+bf7fe2d opensm: cleanup intn_t uses\r
+0862bba opensm/main.c: opensm cannot be killed while asking for port guid\r
+2b70193 opensm/complib: bug in cl_list_insert_array_head/tail functions\r
+4764199 opensm - use C99 transportable data type for pointer storage\r
+a9c326c opensm/osm_state_mgr.c: do not probe remote side of port 0\r
+4945706 opensm/osm_mcast_mgr.c: fix return value on alloc_mfts() failures\r
+8312a24 OpenSM: Fix unused variable compiler warning.\r
+ab8f0a3 opensm/partition: keep multicast group pointer\r
+a817430 opensm: Only clear SMP beyond end of PortInfo attribute\r
+52fb6f2 opensm/osm_switch.h: Remove dead osm_switch_get_physp_ptr routine\r
+aa6d932 opensm/osm_mcast_tbl.c: In osm_mcast_tbl_clear_mlid, use memset to\r
+ clear port mask entry\r
+2ad846b opensm/osm_trap_rcv.c: use source_lid and port_num for logging\r
+b9d7756 opensm/osm_mcast_tbl: Fix size of port mask table array\r
+11c0a9b opensm/main.c: Use strtoul rather than strtol for parsing transaction\r
+ timeout\r
+0608af9 opensm/osm_sm_mad_ctrl.c: In sm_mad_ctrl_send_err_cb, revert setting\r
+ of init failure on QoS initialization failures\r
+c6b4d4a opensm/osm_vendor_ibumad.c: Add transaction ID to osm_vendor_send\r
+ log message\r
+520af84 opensm/osm_sa_path_record.c: don't set dgid pointer for local subnet\r
+4a878fb opensm/osm_mcast_mgr.c: fix osm_mcast_mgr_compute_max_hops for\r
+ managed switch\r
\r
* Other less critical or visible bugs were also fixed.\r
\r
Stack | Version\r
-----------------------------------------|--------------------------\r
The main stream Linux kernel | 2.6.x\r
+OFED | 1.5,1.5.x\r
OFED | 1.4\r
OFED | 1.3\r
OFED | 1.2\r
}
Exit:
- // sleep(3);
OSM_LOG_EXIT( p_log );
return(status);
}
*\r
* DESCRIPTION\r
* Specifies the default cache directory for the db files.\r
-* Note that the directory must appear with "/" ("\\" for windows) at the end.\r
*\r
* SYNOPSIS\r
*/\r
#ifdef __WIN__\r
-#define OSM_DEFAULT_CACHE_DIR "%ProgramFiles%\\OFED\\OpenSM\\"\r
+#define OSM_DEFAULT_CACHE_DIR OPENSM_CONFIG_DIR\r
#else\r
-#define OSM_DEFAULT_CACHE_DIR "/var/cache/opensm/"\r
+#define OSM_DEFAULT_CACHE_DIR "/var/cache/opensm"\r
#endif\r
/***********/\r
/****d* OpenSM: Base/OSM_DEFAULT_LOG_FILE\r
* SYNOPSIS\r
*/\r
#ifdef __WIN__\r
-#define OSM_DEFAULT_LOG_FILE "%TEMP%\\osm.log"\r
+#define OSM_DEFAULT_LOG_FILE OSM_DEFAULT_TMP_DIR "osm.log"\r
#else\r
#define OSM_DEFAULT_LOG_FILE "/var/log/opensm.log"\r
#endif\r
*\r
* SYNOPSIS\r
*/\r
-#ifdef __WIN__\r
-#define OSM_DEFAULT_CONFIG_FILE "%ProgramFiles%\\OFED\\OpenSM\\opensm.conf"\r
-#elif defined(HAVE_DEFAULT_OPENSM_CONFIG_FILE)\r
+#if defined(HAVE_DEFAULT_OPENSM_CONFIG_FILE)\r
#define OSM_DEFAULT_CONFIG_FILE HAVE_DEFAULT_OPENSM_CONFIG_FILE\r
#elif defined (OPENSM_CONFIG_DIR)\r
#define OSM_DEFAULT_CONFIG_FILE OPENSM_CONFIG_DIR "/opensm.conf"\r
#else\r
#define OSM_DEFAULT_CONFIG_FILE "/etc/opensm/opensm.conf"\r
-#endif /* __WIN__ */\r
+#endif\r
/***********/\r
\r
/****d* OpenSM: Base/OSM_DEFAULT_PARTITION_CONFIG_FILE\r
*\r
* SYNOPSIS\r
*/\r
-#ifdef __WIN__\r
-#define OSM_DEFAULT_PARTITION_CONFIG_FILE "%ProgramFiles%\\OFED\\OpenSM\\osm-partitions.conf"\r
-#elif defined(HAVE_DEFAULT_PARTITION_CONFIG_FILE)\r
+#if defined(HAVE_DEFAULT_PARTITION_CONFIG_FILE)\r
#define OSM_DEFAULT_PARTITION_CONFIG_FILE HAVE_DEFAULT_PARTITION_CONFIG_FILE\r
#elif defined(OPENSM_CONFIG_DIR)\r
#define OSM_DEFAULT_PARTITION_CONFIG_FILE OPENSM_CONFIG_DIR "/partitions.conf"\r
#else\r
#define OSM_DEFAULT_PARTITION_CONFIG_FILE "/etc/opensm/partitions.conf"\r
-#endif /* __WIN__ */\r
+#endif\r
/***********/\r
\r
/****d* OpenSM: Base/OSM_DEFAULT_QOS_POLICY_FILE\r
*\r
* SYNOPSIS\r
*/\r
-#ifdef __WIN__\r
-#define OSM_DEFAULT_QOS_POLICY_FILE "%ProgramFiles%\\OFED\\OpenSM\\osm-qos-policy.conf"\r
-#elif defined(HAVE_DEFAULT_QOS_POLICY_FILE)\r
+#if defined(HAVE_DEFAULT_QOS_POLICY_FILE)\r
#define OSM_DEFAULT_QOS_POLICY_FILE HAVE_DEFAULT_QOS_POLICY_FILE\r
#elif defined(OPENSM_CONFIG_DIR)\r
#define OSM_DEFAULT_QOS_POLICY_FILE OPENSM_CONFIG_DIR "/qos-policy.conf"\r
#else\r
#define OSM_DEFAULT_QOS_POLICY_FILE "/etc/opensm/qos-policy.conf"\r
-#endif /* __WIN__ */\r
+#endif\r
/***********/\r
\r
/****d* OpenSM: Base/OSM_DEFAULT_PREFIX_ROUTES_FILE\r
*\r
* SYNOPSIS\r
*/\r
-#ifdef __WIN__\r
-#define OSM_DEFAULT_PREFIX_ROUTES_FILE "%ProgramFiles%\\OFED\\OpenSM\\osm-prefix-routes.conf"\r
-#elif defined(HAVE_DEFAULT_PREFIX_ROUTES_FILE)\r
+#if defined(HAVE_DEFAULT_PREFIX_ROUTES_FILE)\r
#define OSM_DEFAULT_PREFIX_ROUTES_FILE HAVE_DEFAULT_PREFIX_ROUTES_FILE\r
#elif defined(OPENSM_CONFIG_DIR)\r
#define OSM_DEFAULT_PREFIX_ROUTES_FILE OPENSM_CONFIG_DIR "/prefix-routes.conf"\r
*\r
* SYNOPSIS\r
*/\r
+#ifdef __WIN__\r
+#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 3000\r
+#else\r
#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200\r
+#endif\r
/***********/\r
/****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT\r
* NAME\r
/***********/\r
\r
/*\r
- * OSM_CAP are from Table 117 and C15-0.1.7 Table 186\r
+ * OSM_CAP are from IBA 1.2.1 Table 117 and Table 188\r
*/\r
\r
/****d* OpenSM: Base/OSM_CAP_IS_TRAP_SUP\r
/* Define as 1 if you want to enable the performance manager profiling code */\r
/* #undef ENABLE_OSM_PERF_MGR_PROFILE */\r
\r
+/* Define OpenSM config directory */\r
+#define OPENSM_CONFIG_DIR "%ProgramFiles%\\OFED\\OpenSM"\r
+\r
/* Define a default node name map file */\r
-#define HAVE_DEFAULT_NODENAME_MAP "%ProgramFiles%\\OFED\\OpenSM\\ib-node-name-map.conf"\r
+#define HAVE_DEFAULT_NODENAME_MAP OPENSM_CONFIG_DIR "\\ib-node-name-map"\r
\r
/* Define a default OpenSM config file */\r
-#undef HAVE_DEFAULT_OPENSM_CONFIG_FILE\r
+#define HAVE_DEFAULT_OPENSM_CONFIG_FILE OPENSM_CONFIG_DIR "\\opensm.conf"\r
\r
/* Define a Partition config file */\r
-#undef HAVE_DEFAULT_PARTITION_CONFIG_FILE\r
+#define HAVE_DEFAULT_PARTITION_CONFIG_FILE OPENSM_CONFIG_DIR "\\partitions.conf"\r
\r
/* Define a Prefix Routes config file */\r
-#undef HAVE_DEFAULT_PREFIX_ROUTES_FILE\r
+#define HAVE_DEFAULT_PREFIX_ROUTES_FILE OPENSM_CONFIG_DIR "\\prefix-routes.conf"\r
\r
/* Define a QOS policy config file */\r
-#undef HAVE_DEFAULT_QOS_POLICY_FILE\r
-\r
-/* Define OpenSM config directory */\r
-#undef OPENSM_CONFIG_DIR\r
+#define HAVE_DEFAULT_QOS_POLICY_FILE OPENSM_CONFIG_DIR "\\qos-policy.conf"\r
\r
/* Define as 1 for vapi vendor */\r
/* #undef OSM_VENDOR_INTF_MTL */\r
const char *osm_version;\r
void *(*create) (struct osm_opensm *osm);\r
void (*delete) (void *plugin_data);\r
- void (*report) (void *plugin_data,\r
- osm_epi_event_id_t event_id, void *event_data);\r
+ void (*report) (void *plugin_data, osm_epi_event_id_t event_id,\r
+ void *event_data);\r
} osm_event_plugin_t;\r
\r
/** =========================================================================\r
#endif /* __cplusplus */\r
\r
BEGIN_C_DECLS\r
+#ifdef __WIN__\r
+#define LOG_ENTRY_SIZE_MAX 2048\r
+#else\r
#define LOG_ENTRY_SIZE_MAX 4096\r
+#endif\r
#define BUF_SIZE LOG_ENTRY_SIZE_MAX\r
#define __func__ __FUNCTION__\r
#define OSM_LOG_ENTER( OSM_LOG_PTR ) \\r
boolean_t accum_log_file;\r
boolean_t daemon;\r
char *log_file_name;\r
+ char *log_prefix;\r
} osm_log_t;\r
/*********/\r
\r
uint16_t num_entries;\r
uint16_t max_mlid_ho;\r
uint16_t mft_depth;\r
- uint16_t(*p_mask_tbl)[][IB_MCAST_POSITION_MAX];\r
+ uint16_t(*p_mask_tbl)[][IB_MCAST_POSITION_MAX + 1];\r
} osm_mcast_tbl_t;\r
/*\r
* FIELDS\r
*\r
* p_mask_tbl\r
* Pointer to a two dimensional array of port_masks for this switch.\r
-* The first dimension is MLID, the second dimension is mask position.\r
+* The first dimension is MLID offset, second dimension is mask position.\r
* This pointer is null for switches that do not support multicast.\r
*\r
* SEE ALSO\r
*/\r
typedef struct osm_mgrp {\r
cl_fmap_item_t map_item;\r
+ cl_list_item_t list_item;\r
ib_net16_t mlid;\r
- osm_mtree_node_t *p_root;\r
cl_qmap_t mcm_port_tbl;\r
ib_member_rec_t mcmember_rec;\r
boolean_t well_known;\r
* map_item\r
* Map Item for fmap linkage. Must be first element!!\r
*\r
+* list_item\r
+* List item for linkage in osm_mgrp_box's mgrp_list qlist.\r
+*\r
* mlid\r
* The network ordered LID of this Multicast Group (must be\r
* >= 0xC000).\r
*\r
-* p_root\r
-* Pointer to the root "tree node" in the single spanning tree\r
-* for this multicast group. The nodes of the tree represent\r
-* switches. Member ports are not represented in the tree.\r
-*\r
* mcm_port_tbl\r
* Table (sorted by port GUID) of osm_mcm_port_t objects\r
* representing the member ports of this multicast group.\r
* SEE ALSO\r
*********/\r
\r
-/****f* OpenSM: Multicast Group/osm_mgrp_new\r
+/****s* OpenSM: Multicast Group/osm_mgrp_box_t\r
* NAME\r
-* osm_mgrp_new\r
+* osm_mgrp_box_t\r
*\r
* DESCRIPTION\r
-* Allocates and initializes a Multicast Group for use.\r
+* Multicast structure which holds all multicast groups with same MLID.\r
*\r
* SYNOPSIS\r
*/\r
-osm_mgrp_t *osm_mgrp_new(IN ib_net16_t mlid, IN ib_member_rec_t * mcmr);\r
+typedef struct osm_mgrp_box {\r
+ uint16_t mlid;\r
+ cl_qlist_t mgrp_list;\r
+ osm_mtree_node_t *root;\r
+} osm_mgrp_box_t;\r
/*\r
-* PARAMETERS\r
+* FIELDS\r
* mlid\r
-* [in] Multicast LID for this multicast group.\r
-*\r
-* mcmr\r
-* [in] MCMember Record for this multicast group.\r
+* The host ordered LID of this Multicast Group (must be\r
+* >= 0xC000).\r
*\r
-* RETURN VALUES\r
-* IB_SUCCESS if initialization was successful.\r
+* p_root\r
+* Pointer to the root "tree node" in the single spanning tree\r
+* for this multicast group. The nodes of the tree represent\r
+* switches. Member ports are not represented in the tree.\r
*\r
-* NOTES\r
-* Allows calling other Multicast Group methods.\r
+* mgrp_list\r
+* List of multicast groups (mpgr object) having same MLID value.\r
*\r
* SEE ALSO\r
-* Multicast Group, osm_mgrp_delete\r
*********/\r
\r
-/****f* OpenSM: Multicast Group/osm_mgrp_delete\r
+/****f* OpenSM: Multicast Group/osm_mgrp_new\r
* NAME\r
-* osm_mgrp_delete\r
+* osm_mgrp_new\r
*\r
* DESCRIPTION\r
-* Destroys and deallocates a Multicast Group.\r
+* Allocates and initializes a Multicast Group for use.\r
*\r
* SYNOPSIS\r
*/\r
-void osm_mgrp_delete(IN osm_mgrp_t * p_mgrp);\r
+osm_mgrp_t *osm_mgrp_new(IN osm_subn_t * subn, IN ib_net16_t mlid,\r
+ IN ib_member_rec_t * mcmr);\r
/*\r
* PARAMETERS\r
-* p_mgrp\r
-* [in] Pointer to an osm_mgrp_t object.\r
+* subn\r
+* [in] Pointer to osm_subn_t object.\r
+* mlid\r
+* [in] Multicast LID for this multicast group.\r
+*\r
+* mcmr\r
+* [in] MCMember Record for this multicast group.\r
*\r
* RETURN VALUES\r
-* None.\r
+* IB_SUCCESS if initialization was successful.\r
*\r
* NOTES\r
+* Allows calling other Multicast Group methods.\r
*\r
* SEE ALSO\r
-* Multicast Group, osm_mgrp_new\r
+* Multicast Group, osm_mgrp_delete\r
*********/\r
\r
/****f* OpenSM: Multicast Group/osm_mgrp_is_guid\r
void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * mgrp,\r
osm_mcm_port_t * mcm_port, ib_member_rec_t * mcmr);\r
void osm_mgrp_cleanup(osm_subn_t * subn, osm_mgrp_t * mpgr);\r
+void osm_mgrp_box_delete(osm_mgrp_box_t *mbox);\r
\r
END_C_DECLS\r
#endif /* _OSM_MULTICAST_H_ */\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <complib/cl_map.h>\r
#include <opensm/osm_log.h>\r
#include <opensm/osm_subnet.h>\r
+#include <opensm/osm_multicast.h>\r
\r
#ifdef __cplusplus\r
# define BEGIN_C_DECLS extern "C" {\r
typedef struct osm_prtn {\r
cl_map_item_t map_item;\r
ib_net16_t pkey;\r
- ib_net16_t mlid;\r
uint8_t sl;\r
+ osm_mgrp_t *mgrp;\r
cl_map_t full_guid_tbl;\r
cl_map_t part_guid_tbl;\r
char name[32];\r
* pkey\r
* The IBA defined P_KEY of this Partition.\r
*\r
-* mlid\r
-* The network ordered LID of the well known Multicast Group\r
-* that was created for this partition.\r
-*\r
* sl\r
* The Service Level (SL) associated with this Partiton.\r
*\r
+* mgrp\r
+* The pointer to the well known Multicast Group\r
+* that was created for this partition (when configured).\r
+*\r
* full_guid_tbl\r
* Container of pointers to all Port objects in the Partition\r
* with full membership, indexed by port GUID.\r
/*\r
+ * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
*********/\r
\r
-/****f* OpenSM: osm_pkey_get_num_blocks\r
+/****f* OpenSM: osm_pkey_tbl_get_num_blocks\r
* NAME\r
-* osm_pkey_get_num_blocks\r
+* osm_pkey_tbl_get_num_blocks\r
*\r
* DESCRIPTION\r
* Obtain the number of blocks in IB PKey table\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
*\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
atomic32_t sa_trans_id;\r
osm_sa_mad_ctrl_t mad_ctrl;\r
cl_timer_t sr_timer;\r
+ boolean_t dirty;\r
cl_disp_reg_handle_t cpi_disp_h;\r
cl_disp_reg_handle_t nr_disp_h;\r
cl_disp_reg_handle_t pir_disp_h;\r
* mad_ctrl\r
* Mad Controller\r
*\r
+* dirty\r
+* A flag that denotes that SA DB is dirty and needs\r
+* to be written to the dump file (if dumping is enabled)\r
+*\r
* SEE ALSO\r
* SM object\r
*********/\r
* [in] Pointer to an osm_opensm_t object.\r
*\r
* RETURN VALUES\r
-* None\r
+* 0 if the SA DB was actually dumped\r
+* >0 if there was no need to dump the SA DB\r
+* <0 if some error occurred.\r
*\r
*********/\r
\r
*\r
*********/\r
\r
-osm_mgrp_t *osm_get_mgrp_by_mgid(IN osm_sa_t * sa, IN ib_gid_t * p_mgid);\r
-\r
END_C_DECLS\r
#endif /* _OSM_SA_H_ */\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
* Copyright (c) 2009 System Fabric Works, Inc. All rights reserved.\r
uint16_t console_port;\r
char *port_prof_ignore_file;\r
char *hop_weights_file;\r
+ char *dimn_ports_file;\r
boolean_t port_profile_switch_nodes;\r
boolean_t sweep_on_trap;\r
char *routing_engine_names;\r
char *ids_guid_file;\r
char *guid_routing_order_file;\r
char *sa_db_file;\r
+ boolean_t sa_db_dump;\r
boolean_t do_mesh_analysis;\r
boolean_t exit_on_fatal;\r
boolean_t honor_guid2lid_file;\r
boolean_t daemon;\r
boolean_t sm_inactive;\r
boolean_t babbling_port_policy;\r
+ boolean_t use_optimized_slvl;\r
osm_qos_options_t qos_options;\r
osm_qos_options_t qos_ca_options;\r
osm_qos_options_t qos_sw0_options;\r
char *event_db_dump_file;\r
#endif /* ENABLE_OSM_PERF_MGR */\r
char *event_plugin_name;\r
+ char *event_plugin_options;\r
char *node_name_map_name;\r
char *prefix_routes_file;\r
+ char *log_prefix;\r
boolean_t consolidate_ipv6_snm_req;\r
struct osm_subn_opt *file_opts; /* used for update */\r
uint8_t lash_start_vl; /* starting vl to use in lash */\r
*\r
* connect_roots\r
* The option which will enforce root to root connectivity with\r
-* up/down routing engine (even if this violates "pure" deadlock\r
-* free up/down algorithm)\r
+* up/down and fat-tree routing engines (even if this violates\r
+* "pure" deadlock free up/down or fat-tree algorithm)\r
*\r
* use_ucast_cache\r
* When TRUE enables unicast routing cache.\r
* sa_db_file\r
* Name of the SA database file.\r
*\r
+* sa_db_dump\r
+* When TRUE causes OpenSM to dump SA DB at the end of every\r
+* light sweep regardless the current verbosity level.\r
+*\r
* exit_on_fatal\r
* If TRUE (default) - SM will exit on fatal subnet initialization\r
* issues.\r
* babbling_port_policy\r
* OpenSM will enforce its "babbling" port policy.\r
*\r
+* use_optimized_slvl\r
+* Use optimized SLtoVLMappingTable programming if\r
+* device indicates it supports this.\r
+*\r
* perfmgr\r
* Enable or disable the performance manager\r
*\r
* event_db_dump_file\r
* File to dump the event database to\r
*\r
-* event_db_plugin\r
-* Specify the name of the event plugin\r
+* event_plugin_name\r
+* Specify the name(s) of the event plugin(s)\r
+*\r
+* event_plugin_options\r
+* Options string that would be passed to the plugin(s)\r
*\r
* qos_options\r
* Default set of QoS options\r
boolean_t coming_out_of_standby;\r
unsigned need_update;\r
cl_fmap_t mgrp_mgid_tbl;\r
- void *mgroups[IB_LID_MCAST_END_HO - IB_LID_MCAST_START_HO + 1];\r
+ void *mboxes[IB_LID_MCAST_END_HO - IB_LID_MCAST_START_HO + 1];\r
} osm_subn_t;\r
/*\r
* FIELDS\r
* Container of pointers to all Multicast group objects in\r
* the subnet. Indexed by MGID.\r
*\r
-* mgroups\r
-* Array of pointers to all Multicast Group objects in the subnet.\r
-* Indexed by MLID offset from base MLID.\r
+* mboxes\r
+* Array of pointers to all Multicast MLID box objects in the\r
+* subnet. Indexed by MLID offset from base MLID.\r
*\r
* SEE ALSO\r
* Subnet object\r
* osm_port_t\r
*********/\r
\r
+/****f* OpenSM: Port/osm_get_port_by_lid_ho\r
+* NAME\r
+* osm_get_port_by_lid_ho\r
+*\r
+* DESCRIPTION\r
+* Returns a pointer of the port object for given lid value.\r
+*\r
+* SYNOPSIS\r
+*/\r
+struct osm_port *osm_get_port_by_lid_ho(const osm_subn_t * subn, uint16_t lid);\r
+/*\r
+* PARAMETERS\r
+* subn\r
+* [in] Pointer to the subnet data structure.\r
+*\r
+* lid\r
+* [in] LID requested in hot byte order.\r
+*\r
+* RETURN VALUES\r
+* The port structure pointer if found. NULL otherwise.\r
+*\r
+* SEE ALSO\r
+* Subnet object, osm_port_t\r
+*********/\r
+\r
/****f* OpenSM: Port/osm_get_port_by_lid\r
* NAME\r
* osm_get_port_by_lid\r
*\r
* SYNOPSIS\r
*/\r
-struct osm_port *osm_get_port_by_lid(const osm_subn_t * subn, ib_net16_t lid);\r
+static inline struct osm_port *osm_get_port_by_lid(IN osm_subn_t const * subn,\r
+ IN ib_net16_t lid)\r
+{\r
+ return osm_get_port_by_lid_ho(subn, cl_ntoh16(lid));\r
+}\r
/*\r
* PARAMETERS\r
* subn\r
* [in] Pointer to the subnet data structure.\r
*\r
* lid\r
-* [in] LID requested.\r
+* [in] LID requested in network byte order.\r
*\r
* RETURN VALUES\r
* The port structure pointer if found. NULL otherwise.\r
* Subnet object, osm_port_t\r
*********/\r
\r
-/****f* OpenSM: Subnet/osm_get_mgrp_by_mlid\r
+/****f* OpenSM: Subnet/osm_get_mgrp_by_mgid\r
* NAME\r
-* osm_get_mgrp_by_mlid\r
+* osm_get_mgrp_by_mgid\r
*\r
* DESCRIPTION\r
-* The looks for the given multicast group in the subnet table by mlid.\r
+* The looks for the given multicast group in the subnet table by mgid.\r
* NOTE: this code is not thread safe. Need to grab the lock before\r
* calling it.\r
*\r
* SYNOPSIS\r
*/\r
-static inline\r
-struct osm_mgrp *osm_get_mgrp_by_mlid(osm_subn_t const *p_subn, ib_net16_t mlid)\r
-{\r
- return p_subn->mgroups[cl_ntoh16(mlid) - IB_LID_MCAST_START_HO];\r
-}\r
+struct osm_mgrp *osm_get_mgrp_by_mgid(IN osm_subn_t * subn, IN ib_gid_t * mgid);\r
/*\r
* PARAMETERS\r
-* p_subn\r
+* subn\r
* [in] Pointer to an osm_subn_t object\r
*\r
-* mlid\r
-* [in] The multicast group mlid in network order\r
+* mgid\r
+* [in] The multicast group MGID value\r
*\r
* RETURN VALUES\r
* The multicast group structure pointer if found. NULL otherwise.\r
*********/\r
\r
-/****f* OpenSM: Helper/osm_get_physp_by_mad_addr\r
+/****f* OpenSM: Subnet/osm_get_mbox_by_mlid\r
* NAME\r
-* osm_get_physp_by_mad_addr\r
+* osm_get_mbox_by_mlid\r
*\r
* DESCRIPTION\r
-* Looks for the requester physical port in the mad address.\r
-*\r
-* Note: This code is not thread safe. Need to grab the lock before\r
-* calling it.\r
+* The looks for the given multicast group in the subnet table by mlid.\r
+* NOTE: this code is not thread safe. Need to grab the lock before\r
+* calling it.\r
*\r
* SYNOPSIS\r
*/\r
-struct osm_physp *osm_get_physp_by_mad_addr(IN struct osm_log *p_log,\r
- IN const osm_subn_t * p_subn,\r
- IN struct osm_mad_addr\r
- *p_mad_addr);\r
+static inline struct osm_mgrp_box *osm_get_mbox_by_mlid(osm_subn_t const *p_subn, ib_net16_t mlid)\r
+{\r
+ return p_subn->mboxes[cl_ntoh16(mlid) - IB_LID_MCAST_START_HO];\r
+}\r
/*\r
* PARAMETERS\r
-* p_log\r
-* [in] Pointer to a log object.\r
-*\r
* p_subn\r
-* [in] Pointer to subnet object.\r
+* [in] Pointer to an osm_subn_t object\r
*\r
-* p_mad_addr\r
-* [in] Pointer to mad address object.\r
+* mlid\r
+* [in] The multicast group mlid in network order\r
*\r
* RETURN VALUES\r
-* Pointer to requester physical port object if found. Null otherwise.\r
-*\r
-* NOTES\r
-*\r
-* SEE ALSO\r
+* The multicast group structure pointer if found. NULL otherwise.\r
*********/\r
\r
/****f* OpenSM: Subnet/osm_subn_set_default_opt\r
uint16_t num_hops;\r
uint8_t **hops;\r
osm_port_profile_t *p_prof;\r
+ uint8_t *dimn_ports;\r
uint8_t *lft;\r
uint8_t *new_lft;\r
uint16_t lft_size;\r
unsigned endport_links;\r
unsigned need_update;\r
void *priv;\r
+ cl_map_item_t mgrp_item;\r
+ uint32_t num_of_mcm;\r
+ uint8_t is_mc_member;\r
} osm_switch_t;\r
/*\r
* FIELDS\r
* When set indicates that switch was probably reset, so\r
* fwd tables and rest cached data should be flushed\r
*\r
+* mgrp_item\r
+* map item for switch in building mcast tree\r
+*\r
+* num_of_mcm\r
+* number of mcast members(ports) connected to switch\r
+*\r
+* is_mc_member\r
+* whether switch is a mcast member itself\r
+*\r
* SEE ALSO\r
* Switch object\r
*********/\r
* Switch object\r
*********/\r
\r
-/****f* OpenSM: Switch/osm_switch_get_physp_ptr\r
-* NAME\r
-* osm_switch_get_physp_ptr\r
-*\r
-* DESCRIPTION\r
-* Gets the Physical Port Object at the specified port number.\r
-*\r
-* SYNOPSIS\r
-*/\r
-osm_physp_t *osm_switch_get_physp_ptr(IN const osm_switch_t * p_sw,\r
- IN uint32_t port_num);\r
-/*\r
-* PARAMETERS\r
-* p_sw\r
-* [in] Pointer to an osm_switch_t object.\r
-*\r
-* port_num\r
-* [in] Port number for which to retrieve the Physical Port Object.\r
-*\r
-* RETURN VALUES\r
-* Returns a pointer to the Physical Port Object object at the specified\r
-* port number.\r
-* A return value of zero means the port number was out of range.\r
-*\r
-*\r
-* NOTES\r
-*\r
-* SEE ALSO\r
-* Switch object\r
-*********/\r
-\r
/****f* OpenSM: Switch/osm_switch_get_route_by_lid\r
* NAME\r
* osm_switch_get_route_by_lid\r
* RETURN VALUE\r
*/\r
\r
+/****f* OpenSM: Switch/osm_switch_get_dimn_port\r
+* NAME\r
+* osm_switch_get_dimn_port\r
+*\r
+* DESCRIPTION\r
+* Get the routing ordered port\r
+*\r
+* SYNOPSIS\r
+*/\r
+static inline uint8_t osm_switch_get_dimn_port(IN const osm_switch_t * p_sw,\r
+ IN uint8_t port_num)\r
+{\r
+ CL_ASSERT(p_sw);\r
+ if (p_sw->dimn_ports == NULL)\r
+ return port_num;\r
+ return p_sw->dimn_ports[port_num];\r
+}\r
+/*\r
+* PARAMETERS\r
+* p_sw\r
+* [in] Pointer to the switch object.\r
+*\r
+* port_num\r
+* [in] Port number in the switch\r
+*\r
+* RETURN VALUES\r
+* Returns the port number ordered for routing purposes.\r
+*/\r
+\r
/****f* OpenSM: Switch/osm_switch_recommend_path\r
* NAME\r
* osm_switch_recommend_path\r
/*\r
* Copyright (c) 2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2008 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2008 Mellanox Technologies LTD. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
* SYNOPSIS\r
*/\r
#ifdef OSM_VENDOR_INTF_AL\r
-#define OSM_VERSION "OpenSM 3.3.3" " IBAL"\r
+#define OSM_VERSION "OpenSM 3.3.6" " IBAL"\r
#else\r
-#define OSM_VERSION "OpenSM 3.3.3" " UMAD"\r
+#define OSM_VERSION "OpenSM 3.3.6" " UMAD"\r
#endif\r
/********/\r
\r
/*\r
* Abstract:\r
* Declaration of osm_vl15_t.\r
- * This object represents an IBA subnet.\r
+ * This object represents a VL15 interface object.\r
* This object is part of the OpenSM family of objects.\r
*/\r
\r
osm_bind_handle_t h_bind;\r
ib_mad_element_t *p_elem;\r
ib_av_handle_t h_av;\r
- void* p_resp_madw;\r
+ void *p_resp_madw;\r
\r
} osm_vend_wrap_t;\r
/*\r
*\r
* NOTES\r
* 1. Only mads that expect a response are tracked for transaction competion.\r
-* 2. A mad that does not expect a response is being put back immediatly after\r
-* being sent.\r
+* 2. A mad that does not expect a response is being put back immediately\r
+* after being sent.\r
*\r
* SEE ALSO\r
*********/\r
/*\r
* Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#define OSM_BIND_INVALID_HANDLE NULL\r
#endif\r
\r
+/* The maximum number of retransmissions of the same MAD */\r
+#define OSM_DEFAULT_RETRY_COUNT 3\r
+\r
END_C_DECLS\r
#endif\r
/*\r
* Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
BEGIN_C_DECLS\r
/* The maximum number of outstanding MADs an RMPP sender can transmit */\r
#define OSMV_RMPP_RECV_WIN 16\r
-/* The maximum number of retransmissions of the same MAD */\r
-#define OSMV_MAX_RETRANSMIT 3\r
/* Transaction Timeout = OSMV_TXN_TIMEOUT_FACTOR * Response Timeout */\r
#define OSMV_TXN_TIMEOUT_FACTOR 128\r
/************/\r
\r
#define usleep(usec) SleepEx(usec/1000,TRUE)\r
\r
+#ifdef HAVE_LIBPTHREAD\r
+#error HAVE_LIBPTHREAD defined?\r
+#endif\r
+\r
+/* for those cases where uses of pthreads constructs do not have\r
+ * #ifdef HAVE_LIBPTHREAD protection.\r
+ */\r
#define pthread_t cl_thread_t\r
#define pthread_mutex_t cl_mutex_t\r
\r
#endif\r
\r
extern char *strdup_expand(const char *);\r
+extern FILE *Fopen(const char *,const char *);\r
+#define fopen Fopen\r
\r
/* The following defines replace syslog.h */\r
\r
--- /dev/null
+2007-07-11 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump version to 2.2.1\r
+\r
+2007-07-10 Sean Hefty <sean.hefty@intel.com>\r
+\r
+ * osm_vendor_ibumad.c: Use pkey index, rather than pkey\r
+ on umad_set_pkey call. Using index 0 for now.\r
+\r
+2007-05-07 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.(h c): Remove support for issmdisabled\r
+\r
+2007-03-29 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump version to 2.2.0\r
+\r
+2007-03-27 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.(h c): Add support for issmdisabled\r
+\r
+2007-03-13 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.c: In osm_vendor_set_sm, set issmfd to\r
+ -1 on open error\r
+\r
+2007-03-12 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.c: In umad_receiver, display DR path of\r
+ sent MAD when it times out. In osm_vendor_send, simplify redundant\r
+ code. Cosmetic change to osm_log message in osm_vendor_bind.\r
+\r
+2007-02-20 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump version to 2.1.1\r
+\r
+2007-02-20 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.(h c): Fix termination crash associated\r
+ with umad_receiver thread termination.\r
+\r
+ * osm_vendor_mlx_sa.c, osm_vendor_mlx_sim.c: Changes for\r
+ compilation failures detected during ibutils/ibmgtsim building\r
+\r
+2007=01-10 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.c: Close umad port in\r
+ osm_vendor_delete so same process can reinitialize\r
+ and resuse vendor layer.\r
+\r
+2006-10-12 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.c (umad_receiver): Fix endian of LID\r
+ displayed in send timeout error message.\r
+\r
+2006-10-10 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_vendor_ibumad.c: Print errors to stderr rather than\r
+ stdout.\r
+\r
+2006-09-28 Eitan Zahavi <eitan@mellanox.co.il>\r
+\r
+ * osm_vendor_mlx_sa.c: Missing status on timeout SA query.\r
+\r
!if !$(FREEBUILD)\r
C_DEFINES=$(C_DEFINES) -D_DEBUG -DDEBUG -DDBG\r
# in cl_types_osd.h '_DEBUG_' is defined by virture of '_DEBUG" being defined.\r
+!else\r
+# favor fast over default small; default is /Oxs.\r
+MSC_OPTIMIZATION= /Oxt\r
!endif\r
\r
LINKER_FLAGS= $(LINKER_FLAGS) /DEF:$(VENDOR_LIB).exports\r
\r
MSC_WARNING_LEVEL= /W2 /wd4242\r
\r
-#MSC_OPTIMIZATION= /O0\r
\r
# API_REV - advance on any added API\r
# RUNNING_REV - advance any change to the vendor files\r
# AGE - number of backward versions the API still supports\r
-LIBVERSION=3:0:0\r
+LIBVERSION=3:3:0\r
return res;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t\r
osm_pkt_randomizer_mad_drop(IN osm_log_t * p_log,\r
IN osm_pkt_randomizer_t * p_pkt_randomizer,\r
return res;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osm_pkt_randomizer_init(IN OUT osm_pkt_randomizer_t ** pp_pkt_randomizer,\r
IN osm_log_t * p_log)\r
return (res);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void\r
osm_pkt_randomizer_destroy(IN OUT osm_pkt_randomizer_t ** pp_pkt_randomizer,\r
IN osm_log_t * p_log)\r
*/\r
typedef struct _osm_al_bind_info\r
{\r
- osm_vendor_t *p_vend;\r
- void *client_context;\r
- ib_qp_handle_t h_qp;\r
- ib_mad_svc_handle_t h_svc;\r
- uint8_t port_num;\r
- ib_pool_key_t pool_key;\r
- osm_vend_mad_recv_callback_t rcv_callback;\r
- osm_vend_mad_send_err_callback_t send_err_callback;\r
- osm_mad_pool_t *p_osm_pool;\r
- ib_av_handle_t h_dr_av;\r
+ osm_vendor_t *p_vend;\r
+ void *client_context;\r
+ ib_qp_handle_t h_qp;\r
+ ib_mad_svc_handle_t h_svc;\r
+ uint8_t port_num;\r
+ ib_pool_key_t pool_key;\r
+ osm_vend_mad_recv_callback_t rcv_callback;\r
+ osm_vend_mad_send_err_callback_t send_err_callback;\r
+ osm_mad_pool_t *p_osm_pool;\r
+ ib_av_handle_t h_dr_av;\r
\r
} osm_al_bind_info_t;\r
/*\r
* SEE ALSO\r
*********/\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
inline static ib_api_status_t\r
__osm_al_convert_wcs(\r
IN ib_wc_status_t const wc_status )\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
void AL_API\r
__osm_set_vend_wrap( IN osm_al_bind_info_t* const p_bind,\r
IN ib_mad_element_t* const p_elem,\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
static void AL_API\r
__osm_al_ca_destroy_callback( IN void *context )\r
{\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
\r
static void AL_API\r
__osm_al_err_callback( IN ib_async_event_rec_t *p_async_rec )\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
/* \r
- Send_cb will handle the following cases :\r
- Element Status | Send Response (no reponse expected) | Send Request (response expeceted) \r
- ================|===========================================|==========================================\r
- ERROR | Free : AV , madw(send_err_cb) | Free : AV , madw , resp_madw \r
- SUCCESS | Free : AV , madw | Free : AV , madw\r
-\r
- Element Status | Receive Response (no reponse expected) \r
- ================|===========================================\r
- ERROR | Free : AV , madw(send_err_cb) \r
- SUCCESS | Free : AV , madw, resp_madw (both through rcv_callback) \r
- \r
+Send_cb will handle the following cases:\r
+Element Status | Send Response (no reponse expected) | Send Request (response expeceted) \r
+================|======================================|========================\r
+ ERROR | Free : AV , madw(send_err_cb) | Free:AV,madw,resp_madw \r
+ SUCCESS | Free : AV , madw | Free:AV,madw\r
+\r
+Element Status | Receive Response (no reponse expected) \r
+================|===========================================\r
+ ERROR | Free : AV , madw(send_err_cb) \r
+ SUCCESS | Free : AV , madw, resp_madw (both through rcv_callback)\r
*/ \r
+\r
static void AL_API\r
__osm_al_send_callback(\r
- IN const ib_mad_svc_handle_t h_mad_svc,\r
- IN void *mad_svc_context,\r
- IN ib_mad_element_t *p_elem )\r
+ IN const ib_mad_svc_handle_t h_mad_svc,\r
+ IN void *mad_svc_context,\r
+ IN ib_mad_element_t *p_elem )\r
{\r
osm_al_bind_info_t* const p_bind = (osm_al_bind_info_t*)mad_svc_context;\r
osm_vendor_t* const p_vend = p_bind->p_vend;\r
osm_madw_t* const p_madw = (osm_madw_t*)p_elem->context1;\r
osm_vend_wrap_t* p_vw = osm_madw_get_vend_ptr( p_madw );\r
ib_mad_t *p_mad = ib_get_mad_buf( p_elem );\r
- ib_av_attr_t av_attr;\r
- ib_pd_handle_t h_pd;\r
+ ib_av_attr_t av_attr;\r
+ ib_pd_handle_t h_pd;\r
ib_api_status_t status_elem,status;\r
osm_madw_t *p_new_madw;\r
\r
OSM_LOG_ENTER( p_vend->p_log );\r
UNUSED_PARAM(h_mad_svc);\r
+\r
CL_ASSERT( p_vw );\r
CL_ASSERT( p_vw->h_av );\r
- /* since we use context1 , safely , and its the only place that remove the clean \r
- p_elem,p_madw , h_av no checks are required */\r
+\r
+ /* since we use context1 safely, and its the only place that removes the\r
+ clean p_elem, p_madw, h_av no checks are required */\r
+\r
status_elem = __osm_al_convert_wcs(p_elem->status);\r
+\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_send_callback: "\r
- "Destroying av handle %p.\n", p_elem->h_av );\r
+ "%s[line %d]: Destroying av handle %p.\n",\r
+ __FUNCTION__, __LINE__, p_elem->h_av );\r
+\r
/* Check first if its a direct route handle , in this case skip */\r
if (p_elem->h_av != p_bind->h_dr_av) \r
{\r
ib_destroy_av( p_elem->h_av );\r
}\r
+\r
/* Since the free order is first resp_madw then madw (PARENT) we should check\r
this case first */\r
if (p_elem->resp_expected)\r
pre-emptively allocated to handle a receive.\r
*/\r
osm_log(p_vend->p_log, OSM_LOG_ERROR,\r
- "__osm_al_send_callback: ERR 3333 "\r
- " Mad Completed with WQE Error : %s.\n",ib_get_wc_status_str(p_elem->status));\r
+ "%s[line %d]: ERR 3333 "\r
+ "Mad Completed with WQE Error: %s.\n",\r
+ __FUNCTION__,__LINE__,ib_get_wc_status_str(p_elem->status));\r
if( p_vw->p_resp_madw )\r
{\r
osm_mad_pool_put( p_bind->p_osm_pool, p_vw->p_resp_madw );\r
p_vw->p_resp_madw = NULL;\r
}\r
-\r
p_bind->send_err_callback( p_bind->client_context, p_madw );\r
}\r
else\r
{\r
- /* We are in response flow of receive , need to apply the rcv_callback \r
- The rcv_callback will free the resp_madw , req_madw , p_elem of receive\r
- and request */\r
+ /* We are in response flow of receive, need to apply the rcv_callback.\r
+ The rcv_callback will free the resp_madw, req_madw, p_elem of\r
+ receive and request */\r
osm_log(p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_send_callback: "\r
- "The Mad is a response , thus handeled in __osm_al_send_callback\n");\r
+ "%s[line %d]: "\r
+ "Mad is a response, processed in p_bind->rcv_callback\n",\r
+ __FUNCTION__, __LINE__ );\r
p_new_madw = p_vw->p_resp_madw;\r
- p_bind->rcv_callback( p_new_madw, p_bind->client_context,\r
- p_madw );\r
-\r
+ p_bind->rcv_callback( p_new_madw, p_bind->client_context, p_madw );\r
}\r
}\r
else\r
{\r
+ uint64_t saved_trans_id = cl_ntoh64( p_mad->trans_id );\r
+\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_send_callback: "\r
- "Returning MAD to pool, TID = 0x%" PRIx64 ".\n",\r
- cl_ntoh64( p_mad->trans_id ) );\r
+ "%s[line %d]: Returning MAD to pool, TID 0x%" PRIx64 ".\n",\r
+ __FUNCTION__, __LINE__, saved_trans_id );\r
+\r
osm_mad_pool_put( p_bind->p_osm_pool, p_madw );\r
- if ( status_elem != IB_SUCCESS )\r
+\r
+ if ( status_elem != IB_SUCCESS ) {\r
osm_log( p_vend->p_log, OSM_LOG_ERROR,\r
- "__osm_al_send_callback: ERR 3b0b "\r
- "request mad had failed.\n");\r
- goto Exit;\r
+ "%s[line %d]: ERR 3B0B request Mad (TID 0x%" PRIx64 ") failed '%s' "\r
+ "pool mads_out %u\n",\r
+ __FUNCTION__, __LINE__, saved_trans_id, ib_get_err_str(status_elem),\r
+ p_bind->p_osm_pool->mads_out);\r
+ }\r
}\r
-\r
-\r
-\r
-\r
-\r
- Exit:\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
/*\r
Receive_cb will be applied in the following cases :\r
- Element Status | Receive Response (no reponse expected) | Receive Request (response expeceted) \r
- ================|==============================================|=======================================\r
- ERROR | NOT APPLIED | NOT_APPLIED\r
- SUCCESS | Free : Resp_madw , copy_req_madw | Allocate new_madw (for response then in send_cb free)\r
+ Element Status | Receive Response (no reponse expected) | Receive Request (response expected) \r
+ ================|=========================================\r
+ ERROR | NOT APPLIED | NOT_APPLIED\r
+ SUCCESS | Free : Resp_madw , copy_req_madw | Allocate new_madw (for response then in send_cb free)\r
*/\r
- static void AL_API\r
+\r
+static void AL_API\r
__osm_al_rcv_callback(\r
- IN const ib_mad_svc_handle_t h_mad_svc,\r
- IN void *mad_svc_context,\r
- IN ib_mad_element_t *p_elem )\r
+ IN const ib_mad_svc_handle_t h_mad_svc,\r
+ IN void *mad_svc_context,\r
+ IN ib_mad_element_t *p_elem )\r
{\r
osm_al_bind_info_t* const p_bind = (osm_al_bind_info_t*)mad_svc_context;\r
osm_vendor_t* const p_vend = p_bind->p_vend;\r
UNUSED_PARAM(h_mad_svc);\r
CL_ASSERT( p_elem->context1 == NULL );\r
CL_ASSERT( p_elem->context2 == NULL );\r
- /*\r
+\r
+#if 0\r
osm_log( p_vend->p_log, OSM_LOG_VERBOSE,\r
- "__osm_al_rcv_callback: "\r
- "Handling Transaction : 0x%" PRIx64 " .\n",\r
- cl_ntoh64(p_elem->p_mad_buf->trans_id));\r
- */\r
+ "%s[line %d]: Handling Transaction: 0x%" PRIx64 " .\n",\r
+ __FUNCTION__, __LINE__, cl_ntoh64(p_elem->p_mad_buf->trans_id));\r
+#endif\r
+\r
p_new_mad = ib_get_mad_buf( p_elem );\r
- osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_rcv_callback: "\r
- "Acquired implicitly MAD %p.\n", p_new_mad );\r
\r
+ osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
+ "%s[line %d]: Acquired implicitly MAD %p.\n",\r
+ __FUNCTION__, __LINE__, p_new_mad);\r
/*\r
In preperation for initializing the new mad wrapper,\r
Initialize the mad_addr structure for the received wire MAD.\r
mad_addr.addr_type.gsi.remote_qkey = p_elem->remote_qkey;\r
mad_addr.addr_type.gsi.pkey_ix = p_elem->pkey_index;\r
mad_addr.addr_type.gsi.service_level = p_elem->remote_sl;\r
- mad_addr.addr_type.gsi.global_route = FALSE;\r
+\r
+ mad_addr.addr_type.gsi.global_route = 0; /* FIXME: handle GRH */\r
+ memset(&mad_addr.addr_type.gsi.grh_info, 0,\r
+ sizeof(mad_addr.addr_type.gsi.grh_info));\r
}\r
\r
/*\r
allocated.\r
*/\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_rcv_callback: "\r
- "The Mad is a response , thus handled in __osm_al_send_callback\n");\r
+ "%s[line %d]: "\r
+ "The Mad is a response, processed in __osm_al_send_callback\n",\r
+ __FUNCTION__,__LINE__);\r
CL_ASSERT( p_elem->send_context1 != NULL );\r
CL_ASSERT( p_elem->send_context2 == NULL );\r
\r
osm_madw_set_mad( p_new_madw, p_new_mad );\r
p_new_vw = osm_madw_get_vend_ptr( p_new_madw );\r
__osm_set_vend_wrap(p_bind,p_elem,p_new_vw);\r
- goto Exit;\r
}\r
else\r
{\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_rcv_callback: "\r
- "The Mad is a request , thus handled in __osm_al_rcv_callback\n");\r
+ "%s[line %d]: "\r
+ "The Mad is a request, processed in p_bind->rcv_callback\n",\r
+ __FUNCTION__,__LINE__);\r
CL_ASSERT( p_elem->send_context1 == NULL );\r
CL_ASSERT( p_elem->send_context2 == NULL );\r
\r
- p_new_madw = osm_mad_pool_get_wrapper( p_bind->p_osm_pool,\r
- p_bind, p_elem->size, p_new_mad, &mad_addr );\r
+ p_new_madw = osm_mad_pool_get_wrapper( p_bind->p_osm_pool, p_bind,\r
+ p_elem->size, p_new_mad, &mad_addr );\r
CL_ASSERT(p_new_madw);\r
p_new_vw = osm_madw_get_vend_ptr( p_new_madw );\r
\r
__osm_set_vend_wrap(p_bind,p_elem,p_new_vw);\r
+\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
"__osm_al_rcv_callback: "\r
"Calling receive callback function %p.\n",\r
p_bind->rcv_callback );\r
\r
-\r
p_bind->rcv_callback( p_new_madw, p_bind->client_context,\r
((osm_madw_t*)p_elem->send_context1) );\r
}\r
\r
-\r
- Exit:\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
ib_api_status_t\r
osm_vendor_init(\r
IN osm_vendor_t* const p_vend,\r
"osm_vendor_init: ERR 3B03: "\r
"Error opening AL (%s).\n",\r
ib_get_err_str( status ) );\r
-\r
- goto Exit;\r
}\r
+ else\r
+ p_vend->timeout = timeout;\r
\r
- p_vend->timeout = timeout;\r
-\r
- Exit:\r
OSM_LOG_EXIT( p_log );\r
return( status );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
osm_vendor_t*\r
osm_vendor_new(\r
IN osm_log_t* const p_log,\r
return( p_vend );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
void\r
osm_vendor_delete(\r
IN osm_vendor_t** const pp_vend )\r
*pp_vend = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
static ib_api_status_t\r
__osm_ca_info_init(\r
- IN osm_vendor_t* const p_vend,\r
- IN osm_ca_info_t* const p_ca_info,\r
- IN const ib_net64_t ca_guid )\r
+ IN osm_vendor_t* const p_vend,\r
+ IN osm_ca_info_t* const p_ca_info,\r
+ IN const ib_net64_t ca_guid )\r
{\r
ib_api_status_t status;\r
\r
"Querying CA 0x%" PRIx64 ".\n",\r
cl_ntoh64( ca_guid ) );\r
}\r
-/* attr size by verbs definition is required to be (uint32_t *) under opensm is only being set as 1 */\r
+ /* attr size by verbs definition is required to be (uint32_t *) under opensm\r
+ it is only being set as 1 */\r
status = ib_query_ca_by_guid( p_vend->h_al, ca_guid, NULL,\r
(uint32_t*)&p_ca_info->attr_size );\r
+\r
if( (status != IB_INSUFFICIENT_MEMORY ) && (status != IB_SUCCESS ) )\r
{\r
osm_log( p_vend->p_log, OSM_LOG_ERROR,\r
"__osm_ca_info_init: ERR 3B07: "\r
"Unexpected status getting CA attributes (%s).\n",\r
ib_get_err_str( status ) );\r
- goto Exit;\r
}\r
\r
Exit:\r
}\r
\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void\r
osm_ca_info_destroy(\r
IN osm_vendor_t* const p_vend,\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
osm_ca_info_t*\r
osm_ca_info_new(\r
- IN osm_vendor_t* const p_vend,\r
- IN const ib_net64_t ca_guid )\r
+ IN osm_vendor_t* const p_vend,\r
+ IN const ib_net64_t ca_guid )\r
{\r
ib_api_status_t status;\r
osm_ca_info_t *p_ca_info;\r
{\r
osm_ca_info_destroy( p_vend, p_ca_info );\r
p_ca_info = NULL;\r
- goto Exit;\r
}\r
\r
Exit:\r
return( p_ca_info );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
static ib_api_status_t\r
__osm_vendor_get_ca_guids(\r
IN osm_vendor_t* const p_vend,\r
* SEE ALSO\r
*********/\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
ib_api_status_t\r
osm_vendor_get_all_port_attr(\r
- IN osm_vendor_t* const p_vend,\r
- IN ib_port_attr_t* const p_attr_array,\r
- IN uint32_t* const p_num_ports )\r
+ IN osm_vendor_t* const p_vend,\r
+ IN ib_port_attr_t* const p_attr_array,\r
+ IN uint32_t* const p_num_ports )\r
{\r
ib_api_status_t status;\r
\r
/*\r
1) Determine the number of CA's\r
2) If not allready allocated - allocate an array big enough to hold the\r
- ca info object , the ca info will be overwrite to contain the new ca info\r
+ ca info object, the ca info will be overwrite to contain the new ca info\r
3) Call again to retrieve the guids.\r
*/\r
status = __osm_vendor_get_ca_guids( p_vend, &p_ca_guid, &ca_count );\r
{\r
p_ca_info = &p_vend->p_ca_info[ca];\r
\r
- status = __osm_ca_info_init(\r
- p_vend,\r
- p_ca_info,\r
- p_ca_guid[ca] );\r
+ status = __osm_ca_info_init( p_vend, p_ca_info, p_ca_guid[ca] );\r
\r
if( status != IB_SUCCESS )\r
{\r
"Unable to initialize CA Info object (%s).\n",\r
ib_get_err_str( status ) );\r
}\r
-\r
total_ports += osm_ca_info_get_num_ports( p_ca_info );\r
}\r
\r
status = IB_INSUFFICIENT_MEMORY;\r
}\r
\r
-\r
*p_num_ports = total_ports;\r
\r
-\r
Exit:\r
if( p_ca_guid )\r
cl_free( p_ca_guid );\r
return( status );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
ib_net64_t\r
osm_vendor_get_ca_guid(\r
IN osm_vendor_t* const p_vend,\r
return( 0 );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
uint8_t\r
osm_vendor_get_port_num(\r
IN osm_vendor_t* const p_vend,\r
}\r
\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
__osm_vendor_open_ca(\r
IN osm_vendor_t* const p_vend,\r
\r
CL_ASSERT( p_vend->h_ca );\r
\r
- status = ib_alloc_pd(\r
- p_vend->h_ca,\r
- IB_PDT_ALIAS,\r
- p_vend,\r
- &p_vend->h_pd );\r
+ status = ib_alloc_pd( p_vend->h_ca, IB_PDT_ALIAS, p_vend, &p_vend->h_pd );\r
\r
if( status != IB_SUCCESS )\r
{\r
return( status );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
static void\r
__osm_vendor_init_av(\r
IN const osm_al_bind_info_t* p_bind,\r
p_av->dlid = IB_LID_PERMISSIVE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
osm_bind_handle_t\r
osm_vendor_bind(\r
IN osm_vendor_t* const p_vend,\r
\r
port_guid = p_user_bind->port_guid;\r
osm_log( p_vend->p_log, OSM_LOG_INFO,\r
- "osm_vendor_bind: "\r
- "Binding to port 0x%" PRIx64 ".\n",\r
+ "osm_vendor_bind: Binding to port 0x%" PRIx64 ".\n",\r
cl_ntoh64( port_guid ) );\r
\r
if( p_vend->h_ca == 0 )\r
{\r
- osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "osm_vendor_bind: "\r
- "Opening CA that owns port 0x%" PRIx64 ".\n", cl_ntoh64( port_guid ));\r
+ osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
+ "osm_vendor_bind: "\r
+ "Opening CA that owns port 0x%" PRIx64 ".\n",\r
+ cl_ntoh64( port_guid ));\r
\r
status = __osm_vendor_open_ca( p_vend, port_guid );\r
if( status != IB_SUCCESS )\r
qp_create.rq_depth = p_user_bind->recv_q_size;\r
qp_create.sq_sge = OSM_AL_SQ_SGE;\r
qp_create.rq_sge = OSM_AL_RQ_SGE;\r
- status = ib_get_spl_qp(\r
- p_vend->h_pd,\r
- port_guid,\r
- &qp_create,\r
- p_bind,\r
- __osm_al_err_callback,\r
- &p_bind->pool_key,\r
- &p_bind->h_qp );\r
+\r
+ status = ib_get_spl_qp( p_vend->h_pd,\r
+ port_guid,\r
+ &qp_create,\r
+ p_bind,\r
+ __osm_al_err_callback,\r
+ &p_bind->pool_key,\r
+ &p_bind->h_qp );\r
\r
if( status != IB_SUCCESS )\r
{\r
mad_svc.mgmt_version = p_user_bind->class_version;\r
mad_svc.support_unsol = p_user_bind->is_responder;\r
\r
+#define _NEW 1\r
+\r
+#if _NEW\r
+ if (p_user_bind->is_responder) {\r
+ mad_svc.method_array[IB_MAD_METHOD_GET] = TRUE;\r
+ mad_svc.method_array[IB_MAD_METHOD_SET] = TRUE;\r
+ if (p_user_bind->mad_class == IB_MCLASS_SUBN_ADM) {\r
+ mad_svc.method_array[IB_MAD_METHOD_GETTABLE] = TRUE;\r
+ mad_svc.method_array[IB_MAD_METHOD_DELETE] = TRUE;\r
+#ifdef DUAL_SIDED_RMPP\r
+ mad_svc.method_array[IB_MAD_METHOD_GETMULTI] = TRUE;\r
+#endif\r
+ /* Add in IB_MAD_METHOD_GETTRACETABLE when supported by OpenSM */\r
+ }\r
+ }\r
+#else\r
mad_svc.method_array[IB_MAD_METHOD_GET] = TRUE;\r
mad_svc.method_array[IB_MAD_METHOD_SET] = TRUE;\r
mad_svc.method_array[IB_MAD_METHOD_DELETE] = TRUE;\r
mad_svc.method_array[IB_MAD_METHOD_GETTABLE] = TRUE;\r
\r
#ifdef DUAL_SIDED_RMPP\r
- mad_svc.method_array[IB_MAD_METHOD_GETMULTI] = TRUE;\r
+ mad_svc.method_array[IB_MAD_METHOD_GETMULTI] = TRUE;\r
+#endif\r
#endif\r
\r
- status = ib_reg_mad_svc(\r
- p_bind->h_qp,\r
- &mad_svc,\r
- &p_bind->h_svc );\r
+ /* Add in IB_MAD_METHOD_GETTRACETABLE when supported by OpenSM */\r
+#if _NEW\r
+ if (p_user_bind->is_report_processor)\r
+ mad_svc.method_array[IB_MAD_METHOD_REPORT] = TRUE;\r
+\r
+ if (p_user_bind->is_trap_processor) {\r
+ mad_svc.method_array[IB_MAD_METHOD_TRAP] = TRUE;\r
+ mad_svc.method_array[IB_MAD_METHOD_TRAP_REPRESS] = TRUE;\r
+ }\r
+#endif\r
+ status = ib_reg_mad_svc( p_bind->h_qp, &mad_svc, &p_bind->h_svc );\r
\r
if( status != IB_SUCCESS )\r
{\r
status = ib_create_av( p_vend->h_pd, &av, &(p_bind->h_dr_av) );\r
if( status != IB_SUCCESS )\r
{\r
- osm_log( p_vend->p_log, OSM_LOG_ERROR,\r
+ osm_log( p_vend->p_log, OSM_LOG_ERROR,\r
"osm_vendor_bind: ERR 3B22: "\r
"Unable to create address vector (%s).\n",\r
ib_get_err_str( status ) );\r
\r
- cl_free( p_bind );\r
- p_bind = 0;\r
- goto Exit;\r
+ cl_free( p_bind );\r
+ p_bind = 0;\r
+ goto Exit;\r
}\r
\r
if( osm_log_is_active( p_vend->p_log, OSM_LOG_DEBUG ) )\r
{\r
- osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
+ osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
"osm_vendor_bind: "\r
"Allocating av handle %p.\n", p_bind->h_dr_av );\r
}\r
return( (osm_bind_handle_t)p_bind );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
/* osm_vendor_unbind is added due to OSM-1.8.0 gen2 merging\r
The functionality will be added when the Gen2 osm_vendor_unbind\r
will be implemented.\r
osm_vendor_unbind(\r
IN osm_bind_handle_t h_bind)\r
{\r
- osm_al_bind_info_t *p_bind = ( osm_al_bind_info_t * ) h_bind;\r
- osm_vendor_t *p_vend = p_bind->p_vend;\r
-\r
+ osm_al_bind_info_t *p_bind = ( osm_al_bind_info_t * ) h_bind;\r
+ osm_vendor_t *p_vend = p_bind->p_vend;\r
\r
- OSM_LOG_ENTER( p_vend->p_log );\r
+ OSM_LOG_ENTER( p_vend->p_log );\r
\r
- OSM_LOG_EXIT( p_vend->p_log);\r
+ OSM_LOG_EXIT( p_vend->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
ib_mad_t*\r
osm_vendor_get(\r
IN osm_bind_handle_t h_bind,\r
return( p_mad );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
void\r
osm_vendor_put(\r
IN osm_bind_handle_t h_bind,\r
\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
"osm_vendor_put: "\r
- "Retiring MAD %p.\n", ib_get_mad_buf( p_vw->p_elem ) );\r
- // "Retiring MAD %p.\n", p_mad);\r
+ "Retiring MAD %p.\n", p_vw->p_elem);\r
}\r
\r
status = ib_put_mad( p_vw->p_elem );\r
"Unable to retire MAD (%s).\n",\r
ib_get_err_str( status ) );\r
}\r
-\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
ib_api_status_t\r
osm_vendor_send(\r
- IN osm_bind_handle_t h_bind,\r
- IN osm_madw_t* const p_madw,\r
- IN boolean_t const resp_expected )\r
+ IN osm_bind_handle_t h_bind,\r
+ IN osm_madw_t* const p_madw,\r
+ IN boolean_t const resp_expected )\r
{\r
osm_al_bind_info_t* const p_bind = h_bind;\r
osm_vendor_t* const p_vend = p_bind->p_vend;\r
*/\r
if( resp_expected )\r
{\r
- p_vw->p_resp_madw = osm_mad_pool_get_wrapper_raw(\r
- p_bind->p_osm_pool );\r
- if( p_vw->p_resp_madw == NULL )\r
+ p_vw->p_resp_madw = osm_mad_pool_get_wrapper_raw( p_bind->p_osm_pool );\r
+ if( p_vw->p_resp_madw == NULL )\r
{\r
osm_log( p_vend->p_log, OSM_LOG_ERROR,\r
"osm_vendor_send: ERR 3B27: "\r
status = IB_INSUFFICIENT_RESOURCES;\r
goto Exit;\r
}\r
- \r
}\r
else\r
p_vw->p_resp_madw = NULL;\r
\r
if( p_vw->p_resp_madw )\r
osm_mad_pool_put( p_bind->p_osm_pool, p_vw->p_resp_madw );\r
- /* Since we in immediate error the vendor layer is expected to handle the rollback , i.e free of madw */\r
+ /* Since we in immediate error the vendor layer is expected to handle the\r
+ rollback , i.e free of madw */\r
if (p_madw) \r
osm_mad_pool_put( p_bind->p_osm_pool, p_madw );\r
goto Exit;\r
/* Completion information. */\r
p_elem->status = 0; /* Not trusting AL */\r
\r
-\r
if( (p_mad->mgmt_class == IB_MCLASS_SUBN_LID) ||\r
(p_mad->mgmt_class == IB_MCLASS_SUBN_DIR) )\r
{\r
}\r
\r
status = ib_send_mad( p_bind->h_svc, p_elem, NULL );\r
+\r
if( status != IB_SUCCESS )\r
{\r
osm_log( p_vend->p_log, OSM_LOG_ERROR,\r
"osm_vendor_send: ERR 3B29: "\r
- "Send failed , cleaning up (%s).\n",\r
+ "Send failed, cleaning up (%s)\n",\r
ib_get_err_str( status ) );\r
- /* When we destroy the av - we should take the pointer from local allocation since\r
- we do not "trust" IBAL to keep track in p_elem */\r
+\r
+ /* When we destroy the av - we should take the pointer from local allocation\r
+ since we do not "trust" IBAL to keep track in p_elem */\r
\r
if (p_vw->h_av && (p_vw->h_av != p_bind->h_dr_av) )\r
{\r
osm_log( p_vend->p_log, OSM_LOG_DEBUG,\r
- "__osm_al_send: "\r
- "Destroying av handle %p.\n", p_vw->h_av );\r
+ "%s[line %d] Destroying av handle %p.\n",\r
+ __FUNCTION__,__LINE__,p_vw->h_av );\r
ib_destroy_av( p_vw->h_av );\r
}\r
+\r
if( p_vw->p_resp_madw )\r
osm_mad_pool_put( p_bind->p_osm_pool, p_vw->p_resp_madw );\r
- /* Since we in immediate error the vendor layer is expected to handle the rollback , i.e free of madw */\r
+\r
+ /* Immediate error: the vendor layer is expected to handle the\r
+ rollback, i.e free of madw */\r
if (p_madw) \r
osm_mad_pool_put( p_bind->p_osm_pool, p_madw );\r
- goto Exit;\r
}\r
\r
Exit:\r
return( status );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
ib_api_status_t\r
osm_vendor_local_lid_change(\r
IN osm_bind_handle_t h_bind )\r
return( IB_SUCCESS );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
void\r
osm_vendor_set_sm(\r
IN osm_bind_handle_t h_bind,\r
OSM_LOG_EXIT( p_vend->p_log );\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+\r
void osm_vendor_set_debug(IN osm_vendor_t * const p_vend, IN int32_t level)\r
{\r
}\r
/*\r
- * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
ib_mad_t *mad;\r
void *umad = 0;\r
int mad_agent, length;\r
+ uint32_t status;\r
\r
OSM_LOG_ENTER(p_ur->p_log);\r
\r
if (length <= MAD_BLOCK_SIZE) {\r
OSM_LOG(p_ur->p_log, OSM_LOG_ERROR, "ERR 5404: "\r
"recv error on MAD sized umad (%m)\n");\r
+ _set_errno(0);\r
continue;\r
} else {\r
umad_free(umad);\r
"ERR 5405: "\r
"can't alloc umad length %d\n",\r
length);\r
+ _set_errno(0);\r
continue;\r
}\r
\r
MAX(length, MAD_BLOCK_SIZE),\r
&osm_addr))) {\r
OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5408: "\r
- "request for a new madw failed -- dropping packet\n");\r
+ "request for a new madw (%d bytes) failed -- dropping packet\n",\r
+ MAX(length, MAD_BLOCK_SIZE));\r
continue;\r
}\r
\r
umad = swap_mad_bufs(p_madw, umad);\r
\r
/* if status != 0 then we are handling recv timeout on send */\r
- if (umad_status(p_madw->vend_wrap.umad)) {\r
- OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5409: "\r
- "send completed with error"\r
- " (method=0x%X attr=0x%X trans_id=0x%" PRIx64\r
- ") -- dropping\n",\r
- mad->method, cl_ntoh16(mad->attr_id),\r
- cl_ntoh64(mad->trans_id));\r
+ if ((status=umad_status(p_madw->vend_wrap.umad))) {\r
+\r
if (mad->mgmt_class != IB_MCLASS_SUBN_DIR) {\r
/* LID routed */\r
- OSM_LOG(p_vend->p_log, OSM_LOG_ERROR,\r
- "ERR 5410: class 0x%x LID 0x%x\n",\r
- mad->mgmt_class,\r
+ OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5410: "\r
+ "Send completed with error(%u) -- dropping\n"\r
+ "\t\t\tClass 0x%x, Method 0x%X, Attr 0x%X, "\r
+ "TID 0x%" PRIx64 ", LID %u\n",\r
+ status, mad->mgmt_class, mad->method,\r
+ cl_ntoh16(mad->attr_id),\r
+ cl_ntoh64(mad->trans_id),\r
cl_ntoh16(ib_mad_addr->lid));\r
} else {\r
ib_smp_t *smp;\r
\r
/* Direct routed SMP */\r
smp = (ib_smp_t *) mad;\r
- OSM_LOG(p_vend->p_log, OSM_LOG_ERROR,\r
- "ERR 5411: DR SMP Hop Ptr: 0x%X\n",\r
- smp->hop_ptr);\r
+ OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5411: "\r
+ "DR SMP Send completed with error(%u) -- dropping\n"\r
+ "\t\t\tMethod 0x%X, Attr 0x%X, TID 0x%" PRIx64\r
+ ", Hop Ptr: 0x%X\n",\r
+ status, mad->method, cl_ntoh16(mad->attr_id),\r
+ cl_ntoh64(mad->trans_id), smp->hop_ptr);\r
osm_dump_smp_dr_path(p_vend->p_log, smp,\r
OSM_LOG_ERROR);\r
}\r
OSM_LOG(p_vend->p_log, OSM_LOG_ERROR,\r
"ERR 5412: "\r
"Failed to obtain request madw for timed out MAD"\r
- "(method=0x%X attr=0x%X tid=0x%"PRIx64") -- dropping\n",\r
+ " (method=0x%X attr=0x%X tid=0x%"PRIx64") -- dropping\n",\r
mad->method, cl_ntoh16(mad->attr_id),\r
cl_ntoh64(mad->trans_id));\r
} else {\r
#ifdef HAVE_LIBPTHREADS\r
if (pthread_create(&p_ur->tid, NULL, umad_receiver, p_ur) < 0)\r
return -1;\r
+\r
return 0;\r
#else\r
{\r
p_ur->p_log = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osm_vendor_init(IN osm_vendor_t * const p_vend,\r
IN osm_log_t * const p_log, IN const uint32_t timeout)\r
return (r);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_vendor_t *osm_vendor_new(IN osm_log_t * const p_log,\r
IN const uint32_t timeout)\r
{\r
return (p_vend);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vendor_delete(IN osm_vendor_t ** const pp_vend)\r
{\r
osm_vendor_close_port(*pp_vend);\r
*pp_vend = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osm_vendor_get_all_port_attr(IN osm_vendor_t * const p_vend,\r
IN ib_port_attr_t * const p_attr_array,\r
return r;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int\r
osm_vendor_open_port(IN osm_vendor_t * const p_vend,\r
IN const ib_net64_t port_guid)\r
}\r
\r
for (ca = 0; ca < p_vend->ca_count; ca++) {\r
- if ((r = umad_get_ca_portguids(p_vend->ca_names[ca],\r
- portguids,\r
- OSM_UMAD_MAX_CAS)) < 0) {\r
+ if ((r = umad_get_ca_portguids(p_vend->ca_names[ca], portguids,\r
+ OSM_UMAD_MAX_PORTS_PER_CA + 1)) < 0) {\r
OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5421: "\r
"Unable to get CA %s port guids (%s)\n",\r
p_vend->ca_names[ca], strerror(r));\r
return retval;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_bind_handle_t\r
osm_vendor_bind(IN osm_vendor_t * const p_vend,\r
IN osm_bind_info_t * const p_user_bind,\r
return ((osm_bind_handle_t) p_bind);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void\r
__osm_vendor_recv_dummy_cb(IN osm_madw_t * p_madw,\r
IN void *bind_context, IN osm_madw_t * p_req_madw)\r
#endif\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void\r
__osm_vendor_send_err_dummy_cb(IN void *bind_context,\r
IN osm_madw_t * p_req_madw)\r
#endif\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vendor_unbind(IN osm_bind_handle_t h_bind)\r
{\r
osm_umad_bind_info_t *p_bind = (osm_umad_bind_info_t *) h_bind;\r
OSM_LOG_EXIT(p_vend->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_mad_t *osm_vendor_get(IN osm_bind_handle_t h_bind,\r
IN const uint32_t mad_size,\r
IN osm_vend_wrap_t * const p_vw)\r
return (p_vw->umad ? umad_get_mad(p_vw->umad) : NULL);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void\r
osm_vendor_put(IN osm_bind_handle_t h_bind, IN osm_vend_wrap_t * const p_vw)\r
{\r
OSM_LOG_EXIT(p_vend->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osm_vendor_send(IN osm_bind_handle_t h_bind,\r
IN osm_madw_t * const p_madw, IN boolean_t const resp_expected)\r
resp_expected ? p_bind->timeout : 0,\r
p_bind->max_retries)) < 0) {\r
OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5430: "\r
- "Send p_madw = %p of size %d failed %d (%m)\n",\r
- p_madw, sent_mad_size, ret);\r
+ "Send p_madw = %p of size %d TID 0x%" PRIx64 " failed %d (%m)\n",\r
+ p_madw, sent_mad_size, cl_ntoh64(p_mad->trans_id), ret);\r
if (resp_expected) {\r
get_madw(p_vend, &p_mad->trans_id); /* remove from aging table */\r
p_madw->status = IB_ERROR;\r
return (ret);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_vendor_local_lid_change(IN osm_bind_handle_t h_bind)\r
{\r
osm_umad_bind_info_t *p_bind = (osm_umad_bind_info_t *) h_bind;\r
return (0);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
#ifndef __WIN__\r
\r
void osm_vendor_set_sm(IN osm_bind_handle_t h_bind, IN boolean_t is_sm_val)\r
/*\r
- * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2002-2007,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
#include <vendor/osm_vendor_sa_api.h>\r
#include <complib/cl_event.h>\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
-\r
/* this struct is the internal rep of the bind handle */\r
typedef struct _osmv_sa_bind_info {\r
osm_bind_handle_t h_bind;\r
time_t last_lids_update_sec;\r
} osmv_sa_bind_info_t;\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
-\r
/*\r
Call back on new mad received:\r
\r
number of records in here */\r
query_res.result_cnt = (uintn_t)\r
((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /\r
- ib_get_attr_size(p_sa_mad->attr_offset));\r
+ ib_get_attr_size(p_sa_mad->attr_offset));\r
OSM_LOG(p_bind->p_log, OSM_LOG_DEBUG,\r
"Count = %u = %u / %u (%u)\n",\r
query_res.result_cnt,\r
OSM_LOG_EXIT(p_bind->p_log);\r
}\r
\r
-/*****************************************************************************\r
- ****************************************************************************/\r
/*\r
Send Error Callback:\r
\r
return IB_SUCCESS;\r
}\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
osm_bind_handle_t\r
osmv_bind_sa(IN osm_vendor_t * const p_vend,\r
IN osm_mad_pool_t * const p_mad_pool, IN ib_net64_t port_guid)\r
bind_info.is_report_processor = FALSE;\r
bind_info.send_q_size = OSM_SM_DEFAULT_QP1_RCV_SIZE;\r
bind_info.recv_q_size = OSM_SM_DEFAULT_QP1_SEND_SIZE;\r
+ bind_info.timeout = OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC;\r
+ bind_info.retries = OSM_DEFAULT_RETRY_COUNT;\r
\r
/* allocate the new sa bind info */\r
p_sa_bind_info =\r
return (p_sa_bind_info);\r
}\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
-\r
/****t* OSM Vendor SA Client/osmv_sa_mad_data\r
* NAME\r
* osmv_sa_mad_data\r
*\r
*****/\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
/* Send a MAD out on the GSI interface */\r
static ib_api_status_t\r
__osmv_send_sa_req(IN osmv_sa_bind_info_t * p_bind,\r
return status;\r
}\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
/*\r
* Query the SA based on the user's request.\r
*/\r
#endif\r
\r
default:\r
- OSM_LOG(p_log, OSM_LOG_ERROR, "DBG:001 UNKNOWN\n");\r
+ OSM_LOG(p_log, OSM_LOG_ERROR, "DBG:001 UNKNOWN 0x%x (%d)\n",\r
+ p_query_req->query_type, p_query_req->query_type);\r
CL_ASSERT(0);\r
return IB_ERROR;\r
}\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vendor_set_debug(IN osm_vendor_t * const p_vend, IN int32_t level)\r
{\r
\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void\r
osm_ca_info_destroy(IN osm_vendor_t * const p_vend,\r
IN osm_ca_info_t * const p_ca_info, IN uint8_t num_ca)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void\r
osm_ca_info_destroy(IN osm_vendor_t * const p_vend,\r
IN osm_ca_info_t * const p_ca_info, IN uint8_t num_ca)\r
/*\r
- * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
#include <vendor/osm_vendor_api.h>\r
#include <vendor/osm_vendor_sa_api.h>\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
-\r
/* this struct is the internal rep of the bind handle */\r
typedef struct _osmv_sa_bind_info {\r
osm_bind_handle_t h_bind;\r
uint16_t sm_lid;\r
} osmv_sa_bind_info_t;\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
-\r
/*\r
Call back on new mad received:\r
\r
OSM_LOG_EXIT(p_bind->p_log);\r
}\r
\r
-/*****************************************************************************\r
- ****************************************************************************/\r
/*\r
Send Error Callback:\r
\r
return (status);\r
}\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
osm_bind_handle_t\r
osmv_bind_sa(IN osm_vendor_t * const p_vend,\r
IN osm_mad_pool_t * const p_mad_pool, IN ib_net64_t port_guid)\r
bind_info.is_responder = TRUE;\r
bind_info.is_trap_processor = FALSE;\r
bind_info.is_report_processor = TRUE;\r
- bind_info.send_q_size = 256;\r
- bind_info.recv_q_size = 256;\r
+ bind_info.send_q_size = OSM_SM_DEFAULT_QP1_RCV_SIZE;\r
+ bind_info.recv_q_size = OSM_SM_DEFAULT_QP1_SEND_SIZE;\r
+ bind_info.timeout = OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC;\r
+ bind_info.retries = OSM_DEFAULT_RETRY_COUNT;\r
\r
/* allocate the new sa bind info */\r
p_sa_bind_info =\r
return (p_sa_bind_info);\r
}\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
-\r
/****t* OSM Vendor SA Client/osmv_sa_mad_data\r
* NAME\r
* osmv_sa_mad_data\r
*\r
*****/\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
/* Send a MAD out on the GSI interface */\r
ib_api_status_t\r
__osmv_send_sa_req(IN osmv_sa_bind_info_t * p_bind,\r
return status;\r
}\r
\r
-/*****************************************************************************\r
- *****************************************************************************/\r
/*\r
* Query the SA based on the user's request.\r
*/\r
case OSMV_QUERY_ALL_SVC_RECS:\r
osm_log(p_log, OSM_LOG_DEBUG,\r
"osmv_query_sa DBG:001 %s", "SVC_REC_BY_NAME\n");\r
- sa_mad_data.method = IB_MAD_METHOD_GETTABLE;\r
sa_mad_data.attr_id = IB_MAD_ATTR_SERVICE_RECORD;\r
sa_mad_data.attr_offset =\r
ib_get_attr_offset(sizeof(ib_service_record_t));\r
case OSMV_QUERY_NODE_REC_BY_NODE_GUID:\r
osm_log(p_log, OSM_LOG_DEBUG,\r
"osmv_query_sa DBG:001 %s", "NODE_REC_BY_NODE_GUID\n");\r
- sa_mad_data.method = IB_MAD_METHOD_GETTABLE;\r
sa_mad_data.attr_id = IB_MAD_ATTR_NODE_RECORD;\r
sa_mad_data.attr_offset =\r
ib_get_attr_offset(sizeof(ib_node_record_t));\r
OSM_LOG_EXIT(p_log);\r
return status;\r
}\r
-\r
-/*****************************************************************************\r
- *****************************************************************************/\r
/*\r
* Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
CL_ASSERT(NULL != h_bind && NULL != pp_txn);\r
\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_DEBUG,\r
- "Starting transaction 0x%llX (key=0x%llX)\n", tid, key);\r
+ "Starting transaction 0x%016" PRIx64\r
+ " (key=0x%016" PRIx64 ")\n", tid, key);\r
\r
p_txn = malloc(sizeof(osmv_txn_ctx_t));\r
if (!p_txn) {\r
if (IB_SUCCESS != st) {\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_ERROR,\r
"osmv_txn_init: ERR 6703: "\r
- "Failed to insert to transaction 0x%llX (key=0x%llX) to manager DB\n",\r
+ "Failed to insert to transaction 0x%016" PRIx64\r
+ " (key=0x%016" PRIx64 ") to manager DB\n",\r
tid, key);\r
goto insert_txn_failed;\r
}\r
\r
osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,\r
"__osmv_txnmgr_lookup: "\r
- "Looking for key: 0x%llX in map ptr:%p\n", key,\r
+ "Looking for key: 0x%016" PRIx64 " in map ptr:%p\n", key,\r
p_tx_mgr->p_txn_map);\r
\r
p_item = cl_qmap_head(p_tx_mgr->p_txn_map);\r
tmp_key = cl_qmap_key(p_item);\r
osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,\r
"__osmv_txnmgr_lookup: "\r
- "Found key 0x%llX \n", tmp_key);\r
+ "Found key 0x%016" PRIx64 "\n", tmp_key);\r
p_item = cl_qmap_next(p_item);\r
}\r
\r
\r
osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,\r
"__osmv_txnmgr_insert_txn: "\r
- "Inserting key: 0x%llX to map ptr:%p\n", key,\r
+ "Inserting key: 0x%016" PRIx64 " to map ptr:%p\n", key,\r
p_tx_mgr->p_txn_map);\r
\r
memset(p_obj, 0, sizeof(cl_map_obj_t));\r
tmp_key = cl_qmap_key(p_item);\r
osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,\r
"__osmv_txnmgr_insert_txn: "\r
- "Found key 0x%llX \n", tmp_key);\r
+ "Found key 0x%016" PRIx64 "\n", tmp_key);\r
p_item = cl_qmap_next(p_item);\r
}\r
\r
\r
osm_log(p_tx_mgr->p_log, OSM_LOG_ERROR,\r
"__osmv_txnmgr_remove_txn: ERR 6701: "\r
- "Could not remove the transaction 0x%llX - "\r
+ "Could not remove the transaction 0x%016" PRIx64 " - "\r
"something is really wrong!\n", key);\r
OSM_LOG_EXIT(p_tx_mgr->p_log);\r
return IB_NOT_FOUND;\r
switch (osmv_txn_get_rmpp_state(p_txn)) {\r
\r
case OSMV_TXN_RMPP_NONE:\r
- if (num_regs <= OSMV_MAX_RETRANSMIT) {\r
+ if (num_regs <= OSM_DEFAULT_RETRY_COUNT) {\r
/* We still did not exceed the limit of retransmissions.\r
* Set the next timeout's value.\r
*/\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_DEBUG,\r
"__osmv_txn_timeout_cb: "\r
- "The transaction request (tid=0x%llX) timed out %d times. "\r
- "Retrying the send.\n",\r
+ "The transaction request (tid=0x%016" PRIx64 ")"\r
+ " timed out %d times. Retrying the send.\n",\r
osmv_txn_get_tid(p_txn), num_regs);\r
\r
/* resend this mad */\r
if (ret != IB_SUCCESS) {\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_ERROR,\r
"__osmv_txn_timeout_cb: "\r
- "Fail to send retry for transaction request (tid=0x%llX).\n",\r
+ "Fail to send retry for transaction"\r
+ "request (tid=0x%016" PRIx64 ").\n",\r
osmv_txn_get_tid(p_txn));\r
\r
osmv_txn_done((osm_bind_handle_t) p_bo, key,\r
} else {\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_ERROR,\r
"__osmv_txn_timeout_cb: ERR 6702: "\r
- "The transaction request (tid=0x%llX) timed out (after %d retries). "\r
+ "The transaction request (0x%016" PRIx64 ") "\r
+ "timed out (after %d retries). "\r
"Invoking the error callback.\n",\r
osmv_txn_get_tid(p_txn), num_regs);\r
\r
\r
case OSMV_TXN_RMPP_SENDER:\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_DEBUG,\r
- "RMPP sender (tid=0x%llX) did not receive ACK "\r
+ "RMPP sender (tid=0x%016" PRIx64 ") did not receive ACK "\r
"on every segment in the current send window.\n",\r
osmv_txn_get_tid(p_txn));\r
\r
p_send_ctx = osmv_txn_get_rmpp_send_ctx(p_txn);\r
- if (num_regs <= OSMV_MAX_RETRANSMIT) {\r
+ if (num_regs <= OSM_DEFAULT_RETRY_COUNT) {\r
/* We still did not exceed the limit of retransmissions.\r
* Set the next timeout's value.\r
*/\r
\r
case OSMV_TXN_RMPP_RECEIVER:\r
osm_log(p_bo->p_vendor->p_log, OSM_LOG_DEBUG,\r
- "Transaction timeout on an RMPP receiver (tid=0x%llX). "\r
- "Dropping the transaction.\n", osmv_txn_get_tid(p_txn));\r
+ "Transaction timeout on an RMPP receiver "\r
+ "(tid=0x%016" PRIx64 "). Dropping the transaction.\n",\r
+ osmv_txn_get_tid(p_txn));\r
\r
osmv_txn_done((osm_bind_handle_t) p_bo, key,\r
TRUE /*in timeout callback */ );\r
#include <..\..\..\..\etc\user\inet.c>
+/*
+ * Just like fopen() except the filename string is env var expanded prior
+ * to opening the file. Allows %TEMP%\osm.log to work.
+ */
+#undef fopen
+
+FILE *Fopen(
+ const char *filename,
+ const char *mode )
+{
+ FILE *pFile;
+ char *fname;
+
+ fname = strdup_expand(filename);
+ pFile = fopen(fname,mode);
+ free(fname);
+ return pFile;
+}
+
#define OSM_MAX_LOG_NAME_SIZE 512
static char *syslog_fname;
void openlog(char *ident, int option, int facility)
{
if (!syslog_fname)
- syslog_fname = strdup_expand(OSM_DEFAULT_TMP_DIR "osm.syslog");
+ syslog_fname = strdup(OSM_DEFAULT_TMP_DIR "osm.syslog");
if (!syslog_file) {
- syslog_file = fopen(syslog_fname,"w");
+ syslog_file = Fopen(syslog_fname,"w");
if (syslog_file)
syslog_id = strdup(ident);
}
void syslog(int prio, char *fmt, ... )
{
- char Buffer[1024];
+ char Buffer[1400];
SYSTEMTIME st;
uint32_t pid = GetCurrentThreadId();
+ int rc;
va_list args;
va_start(args,fmt);
- _vsnprintf(Buffer, 1024, (LPSTR)fmt, args);
+ rc = _vsnprintf(Buffer, sizeof(Buffer), (LPSTR)fmt, args);
va_end(args);
if (!syslog_file) {
return;
}
+ if ( rc < 0 )
+ fprintf(syslog_file,"syslog() overflow @ %d\n", sizeof(Buffer));
+
GetLocalTime(&st);
- fprintf(syslog_file, "[%s][%02d:%02d:%02d:%03d][%04X] %s", syslog_id,
+
+ fprintf(syslog_file, "[%s][%02d-%02d-%4d %02d:%02d:%02d:%03d][%04X] %s",
+ syslog_id, st.wMonth, st.wDay, st.wYear,
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, pid,
Buffer);
fflush(syslog_file);
\r
# include only 'one' mad vendor.\r
\r
-!INCLUDE vendor-ibal.inc\r
+#!INCLUDE vendor-ibal.inc\r
\r
-#!INCLUDE vendor-umad.inc\r
+!INCLUDE vendor-umad.inc\r
.TP\r
\fB\-F\fR, \fB\-\-config\fR <config file>\r
The name of the OpenSM config file. When not specified\r
-\fB\% @OPENSM_CONFIG_DIR@/@OPENSM_CONFIG_FILE@\fP will be used (if exists).\r
+\fB\% /usr/local/etc/opensm/opensm.conf\fP will be used (if exists).\r
.TP\r
\fB\-c\fR, \fB\-\-create-config\fR <file name>\r
OpenSM will dump its configuration to the specified file and exit.\r
.TP\r
\fB\-P\fR, \fB\-\-Pconfig\fR <partition config file>\r
This option defines the optional partition configuration file.\r
-The default name is \fB\%@OPENSM_CONFIG_DIR@/@PARTITION_CONFIG_FILE@\fP.\r
+The default name is \fB\%/usr/local/etc/opensm/partitions.conf\fP.\r
.TP\r
\fB\-\-prefix_routes_file\fR <file name>\r
Prefix routes control how the SA responds to path record queries for\r
off-subnet DGIDs. By default, the SA fails such queries. The\r
.B PREFIX ROUTES\r
section below describes the format of the configuration file.\r
-The default path is \fB\%@OPENSM_CONFIG_DIR@/prefix\-routes.conf\fP.\r
+The default path is \fB\%/usr/local/etc/opensm/prefix\-routes.conf\fP.\r
.TP\r
\fB\-Q\fR, \fB\-\-qos\fR\r
This option enables QoS setup. It is disabled by default.\r
.TP\r
\fB\-Y\fR, \fB\-\-qos_policy_file\fR <file name>\r
This option defines the optional QoS policy file. The default\r
-name is \fB\%@OPENSM_CONFIG_DIR@/@QOS_POLICY_FILE@\fP. See\r
+name is \fB\%/usr/local/etc/opensm/qos-policy.conf\fP. See\r
QoS_management_in_OpenSM.txt in opensm doc for more information on\r
configuring QoS policy via this file.\r
.TP\r
.SH PARTITION CONFIGURATION\r
.PP\r
The default name of OpenSM partitions configuration file is\r
-\fB\%@OPENSM_CONFIG_DIR@/@PARTITION_CONFIG_FILE@\fP. The default may be changed\r
+\fB\%/usr/local/etc/opensm/partitions.conf\fP. The default may be changed\r
by using the --Pconfig (-P) option with OpenSM.\r
\r
The default partition will be created by OpenSM unconditionally even\r
\r
.SH FILES\r
.TP\r
-.B @OPENSM_CONFIG_DIR@/@OPENSM_CONFIG_FILE@\r
+.B /usr/local/etc/opensm/opensm.conf\r
default OpenSM config file.\r
\r
.TP\r
-.B @OPENSM_CONFIG_DIR@/@NODENAMEMAPFILE@\r
+.B /usr/local/etc/opensm/ib-node-name-map\r
default node name map file. See ibnetdiscover for more information on format.\r
\r
.TP\r
-.B @OPENSM_CONFIG_DIR@/@PARTITION_CONFIG_FILE@\r
+.B /usr/local/etc/opensm/partitions.conf\r
default partition config file\r
\r
.TP\r
-.B @OPENSM_CONFIG_DIR@/@QOS_POLICY_FILE@\r
+.B /usr/local/etc/opensm/qos-policy.conf\r
default QOS policy config file\r
\r
.TP\r
-.B @OPENSM_CONFIG_DIR@/@PREFIX_ROUTES_FILE@\r
+.B /usr/local/etc/opensm/prefix-routes.conf\r
default prefix routes file.\r
\r
.SH AUTHORS\r
--- /dev/null
+2007-07-11 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump to version 2.2.1\r
+\r
+2007-06-20 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_helper.c: Add 3LeafNetworks and Xsigo to osm_get_manufacturer_str\r
+\r
+2007-06-15 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_helper.c: Fix PortInfo:CapMask printing when CapMask is 0\r
+\r
+2007-06-11 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_helper.c: Remove OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED\r
+ from __osm_sm_mgr_signal_str\r
+\r
+2007-06-06 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_helper.c: More optimally deal with manufacturer strings\r
+\r
+2007-06-06 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_helper.c: Add Sun to osm_get_manufacturer_str\r
+\r
+2007-06-04 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_helper.c: Add 8x to __osm_lwa_str_fixed_width\r
+\r
+2007-05-07 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_helper.c: Remove repeated strlen() calls\r
+\r
+2007-04-27 Ira K. Weiny <weiny2@llnl.gov>\r
+\r
+ * osm_helper.c: In osm_dump_notice, use ib_get_producer_type_str\r
+ for printing producer type\r
+\r
+2007-04-26 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_helper.c: Clarify the proper usage of\r
+ osm_get_node_type_str_fixed_width to take uint8_t rather\r
+ than uint32_t for node_type argument\r
+\r
+2007-04-25 Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>\r
+\r
+ * osm_helper.c: Fix problematic usage of sprintf() when\r
+ source and destination strings overlap.\r
+\r
+2007-04-24 Albert L. Chu <chu11@llnl.gov>\r
+\r
+ * osm_helper.c: In osm_get_node_type_str_fixed_width, fix\r
+ both range limit and endian of node type check\r
+\r
+2007-03-29 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump version to 2.2.0\r
+\r
+2007-03-21 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_log.c: Changed to support daemon mode\r
+\r
+2007-03-01 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump version to 2.1.2\r
+\r
+ * osm_helper.c: Eliminate extraneous comma in __osm_disp_msg_ string\r
+ for OSM_MSG_MAD_PORT_INFO\r
+\r
+2007-02-26 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_log.c: Minor optimization to previous change to osm_log\r
+ for also flushing on OSM_LOG_SYS\r
+\r
+2007-02-26 Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>\r
+\r
+ * osm_log.c: In osm_log, flush log on OSM_LOG_SYS (as well\r
+ as OSM_LOG_ERROR)\r
+\r
+2007-02-20 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * configure.in: Bump version to 2.1.1\r
+\r
+ * osm_helper.c: In osm_dbg_get_capabilities_str, only display\r
+ Capability Mask if there are capabilities present\r
+\r
+2007-01-22 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_helper.c: Change DR path format from [%X] to %d,\r
+\r
+2007-01-08 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_log.c: Add osm_log_reopen_file API\r
+\r
+2006-12-22 Hal Rosenstock <halr@voltaire.com>\r
+\r
+ * osm_helper.c: Add osm_dump_switch_info_record API\r
+\r
+2006-11-03 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_log.c: Add osm_log_printf API\r
+\r
+2006-10-30 Sasha Khapyorsky <sashak@voltaire.com>\r
+\r
+ * osm_helper.c: Fix seg fault with strings which\r
+ might not be null terminated\r
+\r
+2006-10-18 Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>\r
+\r
+ * osm_log.c: Windows porting changes\r
+\r
+2006-09-19 Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>\r
+\r
+ * osm_log.c: Windows porting changes\r
+\r
\r
!if !$(FREEBUILD)\r
C_DEFINES=$(C_DEFINES) -D_DEBUG -DDEBUG -DDBG\r
+# If not specified, default is no optimization: /Od /Oi per WDK docs.\r
+!else\r
+# If not specified, default is /Oxs, favor fast code here.\r
+MSC_OPTIMIZATION= /Oxt\r
!endif\r
\r
LINKER_FLAGS= $(LINKER_FLAGS)\r
\r
MSC_WARNING_LEVEL= /W2 /wd4090 /wd4242 /wd4334 /wd4007\r
\r
-#MSC_OPTIMIZATION= /O0\r
\r
# API_REV - advance on any added API\r
# RUNNING_REV - advance any change to the vendor files\r
# AGE - number of backward versions the API still supports\r
-LIBVERSION=3:4:1\r
+LIBVERSION=4:0:0\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 1996-2010 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
* Copyright (c) 2009 System Fabric Works, Inc. All rights reserved.\r
*\r
printf("--sm_sl <sl number>\n"\r
" Sets the SL to use to communicate with the SM/SA. Defaults to 0.\n\n");\r
printf("--connect_roots, -z\n"\r
- " This option enforces a routing engine (currently\n"\r
- " up/down only) to make connectivity between root switches\n"\r
+ " This option enforces routing engines (up/down and \n"\r
+ " fat-tree) to make connectivity between root switches\n"\r
" and in this way be IBA compliant. In many cases,\n"\r
" this can violate \"pure\" deadlock free algorithm, so\n"\r
" use it carefully.\n\n");\r
" This option provides the means to define a weighting\n"\r
" factor per port for customizing the least weight\n"\r
" hops for the routing.\n\n");\r
+ printf("--dimn_ports_file, -O <path to file>\n"\r
+ " This option provides the means to define a mapping\n"\r
+ " between ports and dimension (Order) for controlling\n"\r
+ " Dimension Order Routing (DOR).\n\n");\r
printf("--honor_guid2lid, -x\n"\r
" This option forces OpenSM to honor the guid2lid file,\n"\r
" when it comes out of Standby state, if such file exists\n"\r
" queries for off-subnet DGIDs. Default file is:\n"\r
" " OSM_DEFAULT_PREFIX_ROUTES_FILE "\n\n");\r
printf("--consolidate_ipv6_snm_req\n"\r
- " Consolidate IPv6 Solicited Node Multicast group joins\n"\r
- " into 1 IB multicast group.\n\n");\r
+ " Use shared MLID for IPv6 Solicited Node Multicast groups\n"\r
+ " per MGID scope and P_Key.\n\n");\r
+ printf("--log_prefix <prefix text>\n"\r
+ " Prefix to syslog messages from OpenSM.\n\n");\r
printf("--verbose, -v\n"\r
" This option increases the log verbosity level.\n"\r
" The -v option may be specified multiple times\n"\r
exit(2);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_net64_t get_port_guid(IN osm_opensm_t * p_osm, uint64_t port_guid)\r
{\r
ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];\r
if (status != IB_SUCCESS) {\r
printf("\nError from osm_vendor_get_all_port_attr (%x)\n",\r
status);\r
- return (0);\r
+ return 0;\r
}\r
\r
/* if num_ports is 0 - return 0 */\r
if (num_ports == 0) {\r
printf("\nNo local ports detected!\n");\r
- return (0);\r
+ return 0;\r
}\r
/* If num_ports is 1, then there is only one possible port to use.\r
* Use it. */\r
if (num_ports == 1) {\r
printf("Using default GUID 0x%" PRIx64 "\n",\r
cl_hton64(attr_array[0].port_guid));\r
- return (attr_array[0].port_guid);\r
+ return attr_array[0].port_guid;\r
}\r
/* If port_guid is 0 - use the first connected port */\r
if (port_guid == 0) {\r
i = 0;\r
printf("Using default GUID 0x%" PRIx64 "\n",\r
cl_hton64(attr_array[i].port_guid));\r
- return (attr_array[i].port_guid);\r
+ return attr_array[i].port_guid;\r
}\r
\r
if (p_osm->subn.opt.daemon)\r
i + 1, cl_ntoh64(attr_array[i].port_guid),\r
attr_array[i].lid,\r
ib_get_port_state_str(attr_array[i].link_state));\r
- printf("\nEnter choice (1-%u): ", i);\r
+ printf("\n\t0: Exit\n");\r
+ printf("\nEnter choice (0-%u): ", i);\r
fflush(stdout);\r
if (scanf("%u", &choice) <= 0) {\r
char junk[128];\r
if (scanf("%s", junk) <= 0)\r
printf("\nError: Cannot scan!\n");\r
- } else if (choice && choice <= num_ports)\r
+ } else if (choice == 0)\r
+ return 0;\r
+ else if (choice <= num_ports)\r
break;\r
- printf("\nError: Lame choice!\n");\r
+ printf("\nError: Lame choice! Please try again.\n");\r
}\r
choice--;\r
printf("Choice guid=0x%" PRIx64 "\n",\r
cl_ntoh64(attr_array[choice].port_guid));\r
- return (attr_array[choice].port_guid);\r
+ return attr_array[choice].port_guid;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
#ifndef __WIN__\r
\r
static int daemonize(osm_opensm_t * osm)\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
#define SET_STR_OPT(opt, val) do { \\r
opt = val ? strdup(val) : NULL ; \\r
} while (0)\r
uint32_t val;\r
const char *const short_option =\r
#ifdef __WIN__\r
- "?F:c:i:w:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:";\r
-#else\r
- "F:c:i:w:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:";\r
+ "?"\r
#endif\r
+ "F:c:i:w:O:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:";\r
\r
/*\r
In the array below, the 2nd parameter specifies the number\r
{"guid", 1, NULL, 'g'},\r
{"ignore_guids", 1, NULL, 'i'},\r
{"hop_weights_file", 1, NULL, 'w'},\r
+ {"dimn_ports_file", 1, NULL, 'O'},\r
{"lmc", 1, NULL, 'l'},\r
{"sweep", 1, NULL, 's'},\r
{"timeout", 1, NULL, 't'},\r
{"lash_start_vl", 1, NULL, 6},\r
{"sm_sl", 1, NULL, 7},\r
{"retries", 1, NULL, 8},\r
+ {"log_prefix", 1, NULL, 9},\r
{NULL, 0, NULL, 0} /* Required at the end of the array */\r
};\r
\r
exit(1);\r
}\r
\r
+#ifdef __WIN__\r
if (osm_main_args.is_service) {\r
// incorporate Windows system event log write()\r
// printf("%s\n", OSM_VERSION);\r
printf("-------------------------------------------------\n");\r
printf("%s\n", OSM_VERSION);\r
}\r
+#else\r
+ printf("-------------------------------------------------\n");\r
+ printf("%s\n", OSM_VERSION);\r
+#endif\r
\r
osm_subn_set_default_opt(&opt);\r
\r
opt.hop_weights_file);\r
break;\r
\r
+ case 'O':\r
+ opt.dimn_ports_file = optarg;\r
+ printf(" Dimension Ports File = %s\n",\r
+ opt.dimn_ports_file);\r
+ break;\r
+\r
case 'g':\r
/*\r
Specifies port guid with which to bind.\r
break;\r
\r
case 't':\r
- opt.transaction_timeout = strtol(optarg, NULL, 0);\r
- printf(" Transaction timeout = %d\n",\r
+ opt.transaction_timeout = strtoul(optarg, NULL, 0);\r
+ printf(" Transaction timeout = %u\n",\r
opt.transaction_timeout);\r
break;\r
\r
if (temp > 7) {\r
fprintf(stderr,\r
"ERROR: LMC must be 7 or less.\n");\r
- return (-1);\r
+ return -1;\r
}\r
opt.lmc = (uint8_t) temp;\r
printf(" LMC = %d\n", temp);\r
if (0 > temp || 15 < temp) {\r
fprintf(stderr,\r
"ERROR: priority must be between 0 and 15\n");\r
- return (-1);\r
+ return -1;\r
}\r
opt.sm_priority = (uint8_t) temp;\r
printf(" Priority = %d\n", temp);\r
if (temp < 0 || temp >= IB_MAX_NUM_VLS) {\r
fprintf(stderr,\r
"ERROR: starting lash vl must be between 0 and 15\n");\r
- return (-1);\r
+ return -1;\r
}\r
opt.lash_start_vl = (uint8_t) temp;\r
printf(" LASH starting VL = %d\n", opt.lash_start_vl);\r
if (temp < 0 || temp > 15) {\r
fprintf(stderr,\r
"ERROR: SM's SL must be between 0 and 15\n");\r
- return (-1);\r
+ return -1;\r
}\r
opt.sm_sl = (uint8_t) temp;\r
printf(" SMSL = %d\n", opt.sm_sl);\r
printf(" Transaction retries = %u\n",\r
opt.transaction_retries);\r
break;\r
+ case 9:\r
+ SET_STR_OPT(opt.log_prefix, optarg);\r
+ printf("Log prefix = %s\n", opt.log_prefix);\r
+ break;\r
case 'h':\r
case '?':\r
case ':':\r
/* We will just exit, and not go to Exit, since we don't\r
want the destroy to be called. */\r
complib_exit();\r
- return (status);\r
+ return status;\r
}\r
\r
/*\r
if (opt.guid == 0 || cl_hton64(opt.guid) == CL_HTON64(INVALID_GUID))\r
opt.guid = get_port_guid(&osm, opt.guid);\r
\r
+ if (opt.guid == 0)\r
+ goto Exit;\r
+\r
status = osm_opensm_bind(&osm, opt.guid);\r
if (status != IB_SUCCESS) {\r
printf("\nError from osm_opensm_bind (0x%X)\n", status);\r
}\r
\r
if (osm.mad_pool.mads_out) {\r
- fprintf(stdout,\r
- "There are still %u MADs out. Forcing the exit of the OpenSM application...\n",\r
- osm.mad_pool.mads_out);\r
+ fprintf(stdout, "Still outstanding MADs (mad_pool %u) QP0(%u), "\r
+ "Forcing OpenSM exit...\n",\r
+ osm_exit_flag, osm.mad_pool.mads_out,\r
+ osm.stats.qp0_mads_outstanding);\r
#ifdef HAVE_LIBPTHREAD\r
pthread_cond_signal(&osm.stats.cond);\r
#else\r
void WINAPI OsmServiceCtrlHandler( IN DWORD Opcode ) \r
{ \r
DWORD status=0; \r
+ char *ctl;\r
\r
switch(Opcode) \r
{ \r
case SERVICE_CONTROL_SHUTDOWN: \r
case SERVICE_CONTROL_STOP: \r
+ if (Opcode == SERVICE_CONTROL_STOP)\r
+ ctl = "STOP";\r
+ else\r
+ ctl = "SHUTDOWN";\r
+ syslog(LOG_INFO,"[OSM_SERVICE] SERVICE_CONTROL_%s\n",ctl); \r
+\r
// Do whatever it takes to stop here. \r
osm_exit_flag = TRUE;\r
SetEvent(osm_exit_event);\r
status = GetLastError(); \r
} \r
SvcDebugOut(" [OSM_SERVICE] Exit SERVICE_CONTROL_%s (%ld) '%s'\n",\r
- (Opcode == SERVICE_CONTROL_SHUTDOWN ? "SHUTDOWN" : "STOP"),\r
- status, WinErrorStr(status)); \r
+ ctl, status, WinErrorStr(status)); \r
return; \r
\r
case SERVICE_CONTROL_INTERROGATE: \r
#define VER_FILETYPE VFT_APP\r
#define VER_FILESUBTYPE VFT2_UNKNOWN\r
#ifdef _DEBUG_\r
-#define VER_FILEDESCRIPTION_STR "OpenSM Subnet Manager 3.3.3 (Debug)"\r
+#define VER_FILEDESCRIPTION_STR "OpenSM InfiniBand Subnet Manager 3.3.6 (Debug)"\r
#define VER_INTERNALNAME_STR "opensm.exe"\r
#define VER_ORIGINALFILENAME_STR "opensm.exe"\r
#else\r
-#define VER_FILEDESCRIPTION_STR "OpenSM Subnet Manager 3.3.3"\r
+#define VER_FILEDESCRIPTION_STR "OpenSM InfiniBand Subnet Manager 3.3.6"\r
#define VER_INTERNALNAME_STR "opensm.exe"\r
#define VER_ORIGINALFILENAME_STR "opensm.exe"\r
#endif\r
#include <opensm/osm_perfmgr.h>\r
#include <opensm/osm_subnet.h>\r
\r
+extern void osm_update_node_desc(IN osm_opensm_t *osm);\r
+\r
struct command {\r
char *name;\r
void (*help_function) (FILE * out, int detail);\r
}\r
}\r
\r
+static void help_update_desc(FILE *out, int detail)\r
+{\r
+ fprintf(out, "update_desc\n");\r
+ if (detail) {\r
+ fprintf(out, "update node description for all nodes\n");\r
+ }\r
+}\r
+\r
#ifdef ENABLE_OSM_PERF_MGR\r
static void help_perfmgr(FILE * out, int detail)\r
{\r
}\r
}\r
\r
-static char *sm_state_str(int state)\r
+static const char *sm_state_str(int state)\r
{\r
switch (state) {\r
case IB_SMINFO_STATE_DISCOVERING:\r
- return ("Discovering");\r
+ return "Discovering";\r
case IB_SMINFO_STATE_STANDBY:\r
- return ("Standby ");\r
+ return "Standby ";\r
case IB_SMINFO_STATE_NOTACTIVE:\r
- return ("Not Active ");\r
+ return "Not Active ";\r
case IB_SMINFO_STATE_MASTER:\r
- return ("Master ");\r
+ return "Master ";\r
}\r
- return ("UNKNOWN ");\r
+ return "UNKNOWN ";\r
}\r
\r
-static char *sa_state_str(osm_sa_state_t state)\r
+static const char *sa_state_str(osm_sa_state_t state)\r
{\r
switch (state) {\r
case OSM_SA_STATE_INIT:\r
- return ("Init");\r
+ return "Init";\r
case OSM_SA_STATE_READY:\r
- return ("Ready");\r
+ return "Ready";\r
}\r
- return ("UNKNOWN");\r
+ return "UNKNOWN";\r
}\r
\r
static void dump_sms(osm_opensm_t * p_osm, FILE * out)\r
" SA MADs rcvd : %d\n"\r
" SA MADs sent : %d\n"\r
" SA unknown MADs rcvd : %d\n"\r
- " SA MADs ignored : %d\n",\r
+ " SA MADs ignored : %d\n"\r
+ " SA MAD pool outstanding : %d\n"\r
+ " SM MAD pool outstanding : %d\n",\r
p_osm->stats.qp0_mads_outstanding,\r
p_osm->stats.qp0_mads_outstanding_on_wire,\r
p_osm->stats.qp0_mads_rcvd,\r
p_osm->stats.sa_mads_rcvd,\r
p_osm->stats.sa_mads_sent,\r
p_osm->stats.sa_mads_rcvd_unknown,\r
- p_osm->stats.sa_mads_ignored);\r
+ p_osm->stats.sa_mads_ignored,\r
+ p_osm->sa.p_mad_pool->mads_out,\r
+ p_osm->sm.p_mad_pool->mads_out\r
+);\r
fprintf(out, "\n Subnet flags\n"\r
" ------------\n"\r
" Ignore existing lfts : %d\n"\r
time_t cur = time(NULL);\r
if ((loop_command.previous + loop_command.delay_s) < cur) {\r
loop_command.previous = cur;\r
- return (1);\r
+ return 1;\r
}\r
- return (0);\r
+ return 0;\r
}\r
\r
static void status_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)\r
\r
lid = (uint16_t) strtoul(p_cmd, NULL, 0);\r
cl_plock_acquire(&p_osm->lock);\r
- if (lid > cl_ptr_vector_get_capacity(&(p_osm->subn.port_lid_tbl)))\r
- goto invalid_lid;\r
- p_port = cl_ptr_vector_get(&(p_osm->subn.port_lid_tbl), lid);\r
+ p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid);\r
if (!p_port)\r
goto invalid_lid;\r
\r
osm_subn_output_conf(out, &p_osm->subn.opt);\r
}\r
\r
+static void update_desc_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)\r
+{\r
+ osm_update_node_desc(p_osm);\r
+}\r
+\r
#ifdef ENABLE_OSM_PERF_MGR\r
static void perfmgr_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)\r
{\r
\r
static void exit_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)\r
{\r
+ syslog(LOG_INFO, "graceful OpenSM shutdown.\n");\r
osm_exit_flag = 1;\r
}\r
\r
fprintf(out, "exit - graceful OpenSM shutdown.\n");\r
}\r
\r
+static void logit(char **p_last, osm_opensm_t * p_osm, FILE * out)\r
+{\r
+ OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "%s",p_last[0]);\r
+ fflush(p_osm->log.out_port);\r
+}\r
+\r
+static void help_logit(FILE * out, int detail)\r
+{\r
+ fprintf(out, "logit - write cmd-line to osm.log file.\n");\r
+}\r
+\r
+static void reset_log(char **p_last, osm_opensm_t * p_osm, FILE * out)\r
+{\r
+ extern void truncate_log_file(osm_log_t * p_log);\r
+\r
+ OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "LogFile Reset - last entry.\n");\r
+ truncate_log_file(&p_osm->log);\r
+ OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "LogFile Reset\n");\r
+ fflush(p_osm->log.out_port);\r
+}\r
+\r
+static void help_reset_log(FILE * out, int detail)\r
+{\r
+ fprintf(out, "logreset - clear the osm.log file.\n");\r
+}\r
+\r
#else /* def __WIN__ */\r
\r
typedef struct _regexp_list {\r
} else\r
fprintf(out, "No file name passed\n");\r
} else if (!(p_regexp = malloc(sizeof(*p_regexp)))) {\r
- fprintf(out, "No memory.\n");\r
+ fprintf(out, "No memory\n");\r
break;\r
} else if (regcomp(&p_regexp->exp, p_cmd,\r
REG_NOSUB | REG_EXTENDED) != 0) {\r
fprintf(out, "Cannot parse regular expression \'%s\'."\r
- " Skipping.\n", p_cmd);\r
+ " Skipping\n", p_cmd);\r
free(p_regexp);\r
continue;\r
} else {\r
}\r
\r
if (p_osm->sm.p_subn->need_update != 0) {\r
- fprintf(out, "Subnet is not ready yet. Try again later.\n");\r
+ fprintf(out, "Subnet is not ready yet. Try again later\n");\r
return;\r
}\r
\r
{"help", &help_command, &help_parse},\r
#ifdef __WIN__\r
{"exit", &help_exit, &exit_parse},\r
+ {"logit", &help_logit, &logit},\r
+ {"logreset", &help_reset_log, &reset_log},\r
#else\r
{"quit", &help_quit, &quit_parse},\r
#endif\r
{"switchbalance", &help_switchbalance, &switchbalance_parse},\r
{"lidbalance", &help_lidbalance, &lidbalance_parse},\r
{"dump_conf", &help_dump_conf, &dump_conf_parse},\r
+ {"update_desc", &help_update_desc, &update_desc_parse},\r
{"version", &help_version, &version_parse},\r
#ifdef ENABLE_OSM_PERF_MGR\r
{"perfmgr", &help_perfmgr, &perfmgr_parse},\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* osm_db_t\r
*********/\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
void osm_db_construct(IN osm_db_t * p_db)\r
{\r
memset(p_db, 0, sizeof(osm_db_t));\r
cl_list_construct(&p_db->domains);\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
void osm_db_domain_destroy(IN osm_db_domain_t * p_db_domain)\r
{\r
osm_db_domain_imp_t *p_domain_imp;\r
free(p_domain_imp);\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
void osm_db_destroy(IN osm_db_t * p_db)\r
{\r
osm_db_domain_t *p_domain;\r
free(p_db->p_db_imp);\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log)\r
{\r
osm_db_imp_t *p_db_imp;\r
return 0;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
osm_db_domain_t *osm_db_domain_init(IN osm_db_t * p_db, IN char *domain_name)\r
{\r
osm_db_domain_t *p_domain;\r
osm_db_domain_imp_t *p_domain_imp;\r
- int dir_name_len;\r
+ size_t path_len;\r
osm_log_t *p_log = p_db->p_log;\r
FILE *p_file;\r
\r
OSM_LOG_ENTER(p_log);\r
\r
/* allocate a new domain object */\r
- p_domain = (osm_db_domain_t *) malloc(sizeof(osm_db_domain_t));\r
+ p_domain = malloc(sizeof(osm_db_domain_t));\r
CL_ASSERT(p_domain != NULL);\r
\r
- p_domain_imp =\r
- (osm_db_domain_imp_t *) malloc(sizeof(osm_db_domain_imp_t));\r
+ p_domain_imp = malloc(sizeof(osm_db_domain_imp_t));\r
CL_ASSERT(p_domain_imp != NULL);\r
\r
- dir_name_len = strlen(((osm_db_imp_t *) p_db->p_db_imp)->db_dir_name);\r
+ path_len = strlen(((osm_db_imp_t *) p_db->p_db_imp)->db_dir_name)\r
+ + strlen(domain_name) + 2;\r
\r
/* set the domain file name */\r
- p_domain_imp->file_name =\r
- (char *)malloc(sizeof(char) * (dir_name_len) + strlen(domain_name) +\r
- 2);\r
+ p_domain_imp->file_name = malloc(path_len);\r
CL_ASSERT(p_domain_imp->file_name != NULL);\r
- strcpy(p_domain_imp->file_name,\r
- ((osm_db_imp_t *) p_db->p_db_imp)->db_dir_name);\r
- strcat(p_domain_imp->file_name, domain_name);\r
+ snprintf(p_domain_imp->file_name, path_len,\r
+#ifdef __WIN__\r
+ "%s\\%s",\r
+#else\r
+ "%s/%s",\r
+#endif\r
+ ((osm_db_imp_t *) p_db->p_db_imp)->db_dir_name, domain_name);\r
\r
/* make sure the file exists - or exit if not writable */\r
p_file = fopen(p_domain_imp->file_name, "a+");\r
return p_domain;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
int osm_db_restore(IN osm_db_domain_t * p_domain)\r
{\r
\r
goto EndParsing;\r
}\r
\r
- p_key =\r
- (char *)malloc(sizeof(char) *\r
- (strlen(p_first_word) + 1));\r
+ p_key = malloc(sizeof(char) *\r
+ (strlen(p_first_word) + 1));\r
strcpy(p_key, p_first_word);\r
\r
p_rest_of_line = strtok_r(NULL, "\n", &p_last);\r
if (p_rest_of_line != NULL) {\r
- p_accum_val =\r
- (char *)malloc(sizeof(char) *\r
- (strlen\r
- (p_rest_of_line) +\r
- 1));\r
+ p_accum_val = malloc(sizeof(char) *\r
+ (strlen(p_rest_of_line) + 1));\r
strcpy(p_accum_val, p_rest_of_line);\r
} else {\r
- p_accum_val = (char *)malloc(2);\r
+ p_accum_val = malloc(2);\r
strcpy(p_accum_val, "\0");\r
}\r
} else if (sLine[0] != '\n') {\r
} else {\r
/* accumulate into the value */\r
p_prev_val = p_accum_val;\r
- p_accum_val =\r
- (char *)malloc(strlen(p_prev_val) +\r
- strlen(sLine) + 1);\r
+ p_accum_val = malloc(strlen(p_prev_val) +\r
+ strlen(sLine) + 1);\r
strcpy(p_accum_val, p_prev_val);\r
free(p_prev_val);\r
strcat(p_accum_val, sLine);\r
return status;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
static int dump_tbl_entry(st_data_t key, st_data_t val, st_data_t arg)\r
{\r
FILE *p_file = (FILE *) arg;\r
OSM_LOG_ENTER(p_log);\r
\r
p_domain_imp = (osm_db_domain_imp_t *) p_domain->p_domain_imp;\r
- p_tmp_file_name =\r
- (char *)malloc(sizeof(char) *\r
- (strlen(p_domain_imp->file_name) + 8));\r
+ p_tmp_file_name = malloc(sizeof(char) *\r
+ (strlen(p_domain_imp->file_name) + 8));\r
strcpy(p_tmp_file_name, p_domain_imp->file_name);\r
strcat(p_tmp_file_name, ".tmp");\r
\r
return status;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
/* simply de-allocate the key and the value and return the code\r
that makes the st_foreach delete the entry */\r
static int clear_tbl_entry(st_data_t key, st_data_t val, st_data_t arg)\r
return 0;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
static int get_key_of_tbl_entry(st_data_t key, st_data_t val, st_data_t arg)\r
{\r
cl_list_t *p_list = (cl_list_t *) arg;\r
return 0;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
char *osm_db_lookup(IN osm_db_domain_t * p_domain, IN char *p_key)\r
{\r
osm_db_domain_imp_t *p_domain_imp =\r
return p_val;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
int osm_db_update(IN osm_db_domain_t * p_domain, IN char *p_key, IN char *p_val)\r
{\r
osm_log_t *p_log = p_domain->p_db->p_log;\r
return 0;\r
}\r
\r
-/***************************************************************************\r
- ***************************************************************************/\r
int osm_db_delete(IN osm_db_domain_t * p_domain, IN char *p_key)\r
{\r
osm_log_t *p_log = p_domain->p_db->p_log;\r
pack_guid(guid, guid_str);\r
pack_lids(min_lid, max_lid, lid_str);\r
\r
- return (osm_db_update(p_g2l, guid_str, lid_str));\r
+ return osm_db_update(p_g2l, guid_str, lid_str);\r
}\r
\r
int osm_db_guid2lid_delete(IN osm_db_domain_t * p_g2l, IN uint64_t guid)\r
{\r
char guid_str[20];\r
pack_guid(guid, guid_str);\r
- return (osm_db_delete(p_g2l, guid_str));\r
+ return osm_db_delete(p_g2l, guid_str);\r
}\r
#include <opensm/osm_inform.h>\r
#include <opensm/osm_ucast_mgr.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void drop_mgr_remove_router(osm_sm_t * sm, IN const ib_net64_t portguid)\r
{\r
osm_router_t *p_rtr;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void drop_mgr_clean_physp(osm_sm_t * sm, IN osm_physp_t * p_physp)\r
{\r
osm_physp_t *p_remote_physp;\r
p_remote_physp->port_guid);\r
\r
if (p_remote_port) {\r
- /* Let's check if this is a case of link that is lost (both ports\r
- weren't recognized), or a "hiccup" in the subnet - in which case\r
- the remote port was recognized, and its state is ACTIVE.\r
- If this is just a "hiccup" - force a heavy sweep in the next sweep.\r
- We don't want to lose that part of the subnet. */\r
+ /* Let's check if this is a case of link that is lost\r
+ (both ports weren't recognized), or a "hiccup" in the\r
+ subnet - in which case the remote port was\r
+ recognized, and its state is ACTIVE.\r
+ If this is just a "hiccup" - force a heavy sweep in\r
+ the next sweep. We don't want to lose that part of\r
+ the subnet. */\r
if (p_remote_port->discovery_count &&\r
osm_physp_get_port_state(p_remote_physp) ==\r
IB_LINK_ACTIVE) {\r
sm->p_subn->force_heavy_sweep = TRUE;\r
}\r
\r
- /* If the remote node is ca or router - need to remove the remote port,\r
- since it is no longer reachable. This can be done if we reset the\r
- discovery count of the remote port. */\r
+ /* If the remote node is ca or router - need to remove\r
+ the remote port, since it is no longer reachable.\r
+ This can be done if we reset the discovery count\r
+ of the remote port. */\r
if (!p_remote_physp->p_node->sw) {\r
p_remote_port->discovery_count = 0;\r
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,\r
p_remote_physp->port_num);\r
\r
if (sm->ucast_mgr.cache_valid)\r
- osm_ucast_cache_add_link(&sm->ucast_mgr,\r
- p_physp, p_remote_physp);\r
+ osm_ucast_cache_add_link(&sm->ucast_mgr, p_physp,\r
+ p_remote_physp);\r
\r
osm_physp_unlink(p_physp, p_remote_physp);\r
\r
osm_physp_destroy(p_physp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port)\r
{\r
ib_net64_t port_guid;\r
goto Exit;\r
}\r
\r
+ /* issue a notice - trap 65 */\r
+ /* details of the notice */\r
+ notice.generic_type = 0x83; /* is generic subn mgt type */\r
+ ib_notice_set_prod_type_ho(¬ice, 4); /* A class manager generator */\r
+ /* endport ceases to be reachable */\r
+ notice.g_or_v.generic.trap_num = CL_HTON16(65);\r
+ /* The sm_base_lid is saved in network order already. */\r
+ notice.issuer_lid = sm->p_subn->sm_base_lid;\r
+ /* following C14-72.1.2 and table 119 p725 */\r
+ /* we need to provide the GID */\r
+ port_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix;\r
+ port_gid.unicast.interface_id = port_guid;\r
+ memcpy(&(notice.data_details.ntc_64_67.gid),\r
+ &(port_gid), sizeof(ib_gid_t));\r
+\r
+ /* According to page 653 - the issuer gid in this case of trap\r
+ is the SM gid, since the SM is the initiator of this trap. */\r
+ notice.issuer_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix;\r
+ notice.issuer_gid.unicast.interface_id = sm->p_subn->sm_port_guid;\r
+\r
+ status = osm_report_notice(sm->p_log, sm->p_subn, ¬ice);\r
+ if (status != IB_SUCCESS) {\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0103: "\r
+ "Error sending trap reports (%s)\n",\r
+ ib_get_err_str(status));\r
+ }\r
+\r
p_sm_guid_tbl = &sm->p_subn->sm_guid_tbl;\r
p_sm = (osm_remote_sm_t *) cl_qmap_remove(p_sm_guid_tbl, port_guid);\r
if (p_sm != (osm_remote_sm_t *) cl_qmap_end(p_sm_guid_tbl)) {\r
while (!cl_is_qlist_empty(&p_port->mcm_list)) {\r
mcm_port = cl_item_obj(cl_qlist_head(&p_port->mcm_list),\r
mcm_port, list_item);\r
-\r
osm_mgrp_delete_port(sm->p_subn, sm->p_log, mcm_port->mgrp,\r
p_port->guid);\r
}\r
\r
osm_port_delete(&p_port);\r
\r
- /* issue a notice - trap 65 */\r
-\r
- /* details of the notice */\r
- notice.generic_type = 0x83; /* is generic subn mgt type */\r
- ib_notice_set_prod_type_ho(¬ice, 4); /* A class manager generator */\r
- /* endport ceases to be reachable */\r
- notice.g_or_v.generic.trap_num = CL_HTON16(65);\r
- /* The sm_base_lid is saved in network order already. */\r
- notice.issuer_lid = sm->p_subn->sm_base_lid;\r
- /* following C14-72.1.2 and table 119 p725 */\r
- /* we need to provide the GID */\r
- port_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix;\r
- port_gid.unicast.interface_id = port_guid;\r
- memcpy(&(notice.data_details.ntc_64_67.gid),\r
- &(port_gid), sizeof(ib_gid_t));\r
-\r
- /* According to page 653 - the issuer gid in this case of trap\r
- is the SM gid, since the SM is the initiator of this trap. */\r
- notice.issuer_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix;\r
- notice.issuer_gid.unicast.interface_id = sm->p_subn->sm_port_guid;\r
-\r
- status = osm_report_notice(sm->p_log, sm->p_subn, ¬ice);\r
- if (status != IB_SUCCESS) {\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0103: "\r
- "Error sending trap reports (%s)\n",\r
- ib_get_err_str(status));\r
- goto Exit;\r
- }\r
-\r
OSM_LOG(sm->p_log, OSM_LOG_INFO,\r
"Removed port with GUID:0x%016" PRIx64\r
" LID range [%u, %u] of node:%s\n",\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void drop_mgr_remove_switch(osm_sm_t * sm, IN osm_node_t * p_node)\r
{\r
osm_switch_t *p_sw;\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t drop_mgr_process_node(osm_sm_t * sm, IN osm_node_t * p_node)\r
{\r
osm_physp_t *p_physp;\r
osm_node_delete(&p_node);\r
\r
OSM_LOG_EXIT(sm->p_log);\r
- return (return_val);\r
+ return return_val;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void drop_mgr_check_node(osm_sm_t * sm, IN osm_node_t * p_node)\r
{\r
ib_net64_t node_guid;\r
return;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_drop_mgr_process(osm_sm_t * sm)\r
{\r
- cl_qmap_t *p_node_guid_tbl;\r
- cl_qmap_t *p_port_guid_tbl;\r
- osm_port_t *p_port;\r
- osm_port_t *p_next_port;\r
- osm_node_t *p_node;\r
- osm_node_t *p_next_node;\r
+ cl_qmap_t *p_node_guid_tbl, *p_port_guid_tbl;\r
+ osm_port_t *p_port, *p_next_port;\r
+ osm_node_t *p_node, *p_next_node;\r
\r
CL_ASSERT(sm);\r
\r
for (lid_ho = 1; lid_ho <= max_lid_ho; lid_ho++) {\r
fprintf(file, "0x%04X : ", lid_ho);\r
\r
- p_port = cl_ptr_vector_get(&p_osm->subn.port_lid_tbl, lid_ho);\r
+ p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid_ho);\r
if (!p_port) {\r
fprintf(file, "UNREACHABLE\n");\r
continue;\r
for (port = 0; port < max_port; port++)\r
fprintf(file, " %02x",\r
osm_switch_get_hop_count(p_sw, lid, port));\r
- p_port = cl_ptr_vector_get(&p_osm->subn.port_lid_tbl, lid);\r
+ p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid);\r
if (p_port)\r
fprintf(file, " # portguid 0x016%" PRIx64,\r
cl_ntoh64(osm_port_get_guid(p_port)));\r
\r
fprintf(file, "0x%04x %03u # ", lid, port);\r
\r
- p_port = cl_ptr_vector_get(&p_osm->subn.port_lid_tbl, lid);\r
+ p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid);\r
if (p_port) {\r
p_node = p_port->p_node;\r
fprintf(file, "%s portguid 0x%016" PRIx64 ": \'%s\'",\r
"------------------------------------------------\n");\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
struct dump_context {\r
osm_opensm_t *p_osm;\r
FILE *file;\r
fclose(file);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
\r
static void print_report(osm_opensm_t * osm, FILE * file)\r
{\r
/*\r
- * Copyright (c) 2008 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2008-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2007 The Regents of the University of California.\r
*\r
* This software is available to you under a choice of one of two\r
osm_epi_plugin_t *rc = NULL;\r
\r
if (!plugin_name || !*plugin_name)\r
- return (NULL);\r
+ return NULL;\r
\r
/* find the plugin */\r
snprintf(lib_name, sizeof(lib_name), "lib%s.so", plugin_name);\r
\r
rc = malloc(sizeof(*rc));\r
if (!rc)\r
- return (NULL);\r
+ return NULL;\r
\r
rc->handle = dlopen(lib_name, RTLD_LAZY);\r
if (!rc->handle) {\r
goto Exit;\r
\r
rc->plugin_name = strdup(plugin_name);\r
- return (rc);\r
+ return rc;\r
\r
Exit:\r
dlclose(rc->handle);\r
DLOPENFAIL:\r
free(rc);\r
- return (NULL);\r
+ return NULL;\r
}\r
\r
void osm_epi_destroy(osm_epi_plugin_t * plugin)\r
#define ARR_SIZE(a) (sizeof(a)/sizeof((a)[0]))\r
\r
/* we use two tables - one for queries and one for responses */\r
-static const char *__ib_sa_method_str[] = {\r
+static const char *ib_sa_method_str[] = {\r
"RESERVED", /* 0 */\r
"SubnAdmGet", /* 1 */\r
"SubnAdmSet", /* 2 */\r
"UNKNOWN" /* 16 */\r
};\r
\r
-static const char *__ib_sa_resp_method_str[] = {\r
+static const char *ib_sa_resp_method_str[] = {\r
"RESERVED", /* 80 */\r
"SubnAdmGetResp", /* 81 */\r
"RESERVED (SetResp?)", /* 82 */\r
\r
#define OSM_SA_METHOD_STR_UNKNOWN_VAL 0x16\r
\r
-static const char *__ib_sm_method_str[] = {\r
+static const char *ib_sm_method_str[] = {\r
"RESERVED0", /* 0 */\r
"SubnGet", /* 1 */\r
"SubnSet", /* 2 */\r
\r
#define OSM_SM_METHOD_STR_UNKNOWN_VAL 0x21\r
\r
-static const char *__ib_sm_attr_str[] = {\r
+static const char *ib_sm_attr_str[] = {\r
"RESERVED", /* 0 */\r
"ClassPortInfo", /* 1 */\r
"Notice", /* 2 */\r
\r
#define OSM_SM_ATTR_STR_UNKNOWN_VAL 0x21\r
\r
-static const char *__ib_sa_attr_str[] = {\r
+static const char *ib_sa_attr_str[] = {\r
"RESERVED", /* 0 */\r
"ClassPortInfo", /* 1 */\r
"Notice", /* 2 */\r
return n;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *ib_get_sa_method_str(IN uint8_t method)\r
{\r
if (method & 0x80) {\r
if (method > OSM_SA_METHOD_STR_UNKNOWN_VAL)\r
method = OSM_SA_METHOD_STR_UNKNOWN_VAL;\r
/* it is a response - use the response table */\r
- return (__ib_sa_resp_method_str[method]);\r
+ return ib_sa_resp_method_str[method];\r
} else {\r
if (method > OSM_SA_METHOD_STR_UNKNOWN_VAL)\r
method = OSM_SA_METHOD_STR_UNKNOWN_VAL;\r
- return (__ib_sa_method_str[method]);\r
+ return ib_sa_method_str[method];\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *ib_get_sm_method_str(IN uint8_t method)\r
{\r
if (method & 0x80)\r
method = (method & 0x0F) | 0x10;\r
if (method > OSM_SM_METHOD_STR_UNKNOWN_VAL)\r
method = OSM_SM_METHOD_STR_UNKNOWN_VAL;\r
- return (__ib_sm_method_str[method]);\r
+ return ib_sm_method_str[method];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *ib_get_sm_attr_str(IN ib_net16_t attr)\r
{\r
uint16_t host_attr = cl_ntoh16(attr);\r
if (host_attr > OSM_SM_ATTR_STR_UNKNOWN_VAL)\r
host_attr = OSM_SM_ATTR_STR_UNKNOWN_VAL;\r
\r
- return (__ib_sm_attr_str[host_attr]);\r
+ return ib_sm_attr_str[host_attr];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *ib_get_sa_attr_str(IN ib_net16_t attr)\r
{\r
uint16_t host_attr = cl_ntoh16(attr);\r
if (host_attr > OSM_SA_ATTR_STR_UNKNOWN_VAL)\r
host_attr = OSM_SA_ATTR_STR_UNKNOWN_VAL;\r
\r
- return (__ib_sa_attr_str[host_attr]);\r
+ return ib_sa_attr_str[host_attr];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *ib_get_trap_str(ib_net16_t trap_num)\r
{\r
switch (cl_ntoh16(trap_num)) {\r
\r
const ib_gid_t ib_zero_gid = { {0} };\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t dbg_do_line(IN char **pp_local, IN uint32_t buf_size,\r
IN const char *p_prefix_str,\r
IN const char *p_new_str,\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void dbg_get_capabilities_str(IN char *p_buf, IN uint32_t buf_size,\r
IN const char *p_prefix_str,\r
IN const ib_port_info_t * p_pi)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid,\r
IN ib_net64_t port_guid, IN uint8_t port_num,\r
IN const ib_port_info_t * p_pi,\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_portinfo_record(IN osm_log_t * p_log,\r
IN const ib_portinfo_record_t * p_pir,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_guidinfo_record(IN osm_log_t * p_log,\r
IN const ib_guidinfo_record_t * p_gir,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni,\r
IN osm_log_level_t log_level)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_node_record(IN osm_log_t * p_log,\r
IN const ib_node_record_t * p_nr,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,\r
IN osm_log_level_t log_level)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_multipath_record(IN osm_log_t * p_log,\r
IN const ib_multipath_rec_t * p_mpr,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,\r
IN osm_log_level_t log_level)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_service_record(IN osm_log_t * p_log,\r
IN const ib_service_record_t * p_sr,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_inform_info(IN osm_log_t * p_log,\r
IN const ib_inform_info_t * p_ii,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_inform_info_record(IN osm_log_t * p_log,\r
IN const ib_inform_info_record_t * p_iir,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_link_record(IN osm_log_t * p_log,\r
IN const ib_link_record_t * p_lr,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_switch_info(IN osm_log_t * p_log,\r
IN const ib_switch_info_t * p_si,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_switch_info_record(IN osm_log_t * p_log,\r
IN const ib_switch_info_record_t * p_sir,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid,\r
IN uint16_t block_num, IN uint8_t port_num,\r
IN const ib_pkey_table_t * p_pkey_tbl,\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid,\r
IN uint8_t in_port_num, IN uint8_t out_port_num,\r
IN const ib_slvl_table_t * p_slvl_tbl,\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid,\r
IN uint8_t block_num, IN uint8_t port_num,\r
IN const ib_vl_arb_table_t * p_vla_tbl,\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi,\r
IN osm_log_level_t log_level)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_sm_info_record(IN osm_log_t * p_log,\r
IN const ib_sminfo_record_t * p_smir,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_notice(IN osm_log_t * p_log,\r
IN const ib_mad_notice_attr_t * p_ntci,\r
IN osm_log_level_t log_level)\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,\r
IN osm_log_level_t log_level)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad,\r
IN osm_log_level_t log_level)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path,\r
IN osm_log_level_t log_level)\r
{\r
char buf[BUF_SIZE];\r
unsigned n = 0;\r
\r
- n = sprintf(buf, "Directed Path Dump of %u hop path:"\r
- "\n\t\t\t\tPath = ", p_path->hop_count);\r
+ n = sprintf(buf, "Directed Path Dump of %u hop path: "\r
+ "Path = ", p_path->hop_count);\r
\r
sprint_uint8_arr(buf + n, sizeof(buf) - n, p_path->path,\r
p_path->hop_count + 1);\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,\r
IN osm_log_level_t log_level)\r
{\r
char buf[BUF_SIZE];\r
unsigned n;\r
\r
- n = sprintf(buf, "Received SMP on a %u hop path:"\r
- "\n\t\t\t\tInitial path = ", p_smp->hop_count);\r
+ n = sprintf(buf, "Received SMP on a %u hop path: "\r
+ "Initial path = ", p_smp->hop_count);\r
n += sprint_uint8_arr(buf + n, sizeof(buf) - n,\r
p_smp->initial_path,\r
p_smp->hop_count + 1);\r
\r
- n += sprintf(buf + n, "\n\t\t\t\tReturn path = ");\r
+ n += sprintf(buf + n, ", Return path = ");\r
n += sprint_uint8_arr(buf + n, sizeof(buf) - n,\r
p_smp->return_path, p_smp->hop_count + 1);\r
\r
"UNKNOWN SIGNAL!!" /* 5 */\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_sm_signal_str(IN osm_signal_t signal)\r
{\r
if (signal > OSM_SIGNAL_MAX)\r
signal = OSM_SIGNAL_MAX;\r
- return (sm_signal_str[signal]);\r
+ return sm_signal_str[signal];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static const char *disp_msg_str[] = {\r
"OSM_MSG_NONE",\r
"OSM_MSG_MAD_NODE_INFO",\r
"UNKNOWN!!"\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_disp_msg_str(IN cl_disp_msgid_t msg)\r
{\r
if (msg > OSM_MSG_MAX)\r
msg = OSM_MSG_MAX;\r
- return (disp_msg_str[msg]);\r
+ return disp_msg_str[msg];\r
}\r
\r
static const char *port_state_str_fixed_width[] = {\r
"???"\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_port_state_str_fixed_width(IN uint8_t port_state)\r
{\r
if (port_state > IB_LINK_ACTIVE)\r
port_state = IB_LINK_ACTIVE + 1;\r
- return (port_state_str_fixed_width[port_state]);\r
+ return port_state_str_fixed_width[port_state];\r
}\r
\r
static const char *node_type_str_fixed_width[] = {\r
"RT",\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_node_type_str_fixed_width(IN uint8_t node_type)\r
{\r
if (node_type > IB_NODE_TYPE_ROUTER)\r
node_type = 0;\r
- return (node_type_str_fixed_width[node_type]);\r
+ return node_type_str_fixed_width[node_type];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_manufacturer_str(IN uint64_t guid_ho)\r
{\r
/* note that the max vendor string length is 11 */\r
\r
switch ((uint32_t) (guid_ho >> (5 * 8))) {\r
case OSM_VENDOR_ID_INTEL:\r
- return (intel_str);\r
+ return intel_str;\r
case OSM_VENDOR_ID_MELLANOX:\r
- return (mellanox_str);\r
+ return mellanox_str;\r
case OSM_VENDOR_ID_REDSWITCH:\r
- return (redswitch_str);\r
+ return redswitch_str;\r
case OSM_VENDOR_ID_SILVERSTORM:\r
- return (silverstorm_str);\r
+ return silverstorm_str;\r
case OSM_VENDOR_ID_TOPSPIN:\r
- return (topspin_str);\r
+ return topspin_str;\r
case OSM_VENDOR_ID_FUJITSU:\r
case OSM_VENDOR_ID_FUJITSU2:\r
- return (fujitsu_str);\r
+ return fujitsu_str;\r
case OSM_VENDOR_ID_VOLTAIRE:\r
- return (voltaire_str);\r
+ return voltaire_str;\r
case OSM_VENDOR_ID_YOTTAYOTTA:\r
- return (yotta_str);\r
+ return yotta_str;\r
case OSM_VENDOR_ID_PATHSCALE:\r
- return (pathscale_str);\r
+ return pathscale_str;\r
case OSM_VENDOR_ID_IBM:\r
- return (ibm_str);\r
+ return ibm_str;\r
case OSM_VENDOR_ID_DIVERGENET:\r
- return (divergenet_str);\r
+ return divergenet_str;\r
case OSM_VENDOR_ID_FLEXTRONICS:\r
- return (flextronics_str);\r
+ return flextronics_str;\r
case OSM_VENDOR_ID_AGILENT:\r
- return (agilent_str);\r
+ return agilent_str;\r
case OSM_VENDOR_ID_OBSIDIAN:\r
- return (obsidian_str);\r
+ return obsidian_str;\r
case OSM_VENDOR_ID_BAYMICRO:\r
- return (baymicro_str);\r
+ return baymicro_str;\r
case OSM_VENDOR_ID_LSILOGIC:\r
- return (lsilogic_str);\r
+ return lsilogic_str;\r
case OSM_VENDOR_ID_DDN:\r
- return (ddn_str);\r
+ return ddn_str;\r
case OSM_VENDOR_ID_PANTA:\r
- return (panta_str);\r
+ return panta_str;\r
case OSM_VENDOR_ID_HP:\r
case OSM_VENDOR_ID_HP2:\r
case OSM_VENDOR_ID_HP3:\r
case OSM_VENDOR_ID_HP4:\r
- return (hp_str);\r
+ return hp_str;\r
case OSM_VENDOR_ID_RIOWORKS:\r
- return (rioworks_str);\r
+ return rioworks_str;\r
case OSM_VENDOR_ID_SUN:\r
case OSM_VENDOR_ID_SUN2:\r
- return (sun_str);\r
+ return sun_str;\r
case OSM_VENDOR_ID_3LEAFNTWKS:\r
- return (leafntwks_str);\r
+ return leafntwks_str;\r
case OSM_VENDOR_ID_XSIGO:\r
- return (xsigo_str);\r
+ return xsigo_str;\r
case OSM_VENDOR_ID_DELL:\r
- return (dell_str);\r
+ return dell_str;\r
case OSM_VENDOR_ID_SUPERMICRO:\r
- return (supermicro_str);\r
+ return supermicro_str;\r
default:\r
- return (unknown_str);\r
+ return unknown_str;\r
}\r
}\r
\r
"4096"\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_mtu_str(IN uint8_t mtu)\r
{\r
if (mtu > IB_MTU_LEN_4096)\r
- return (mtu_str_fixed_width[0]);\r
+ return mtu_str_fixed_width[0];\r
else\r
- return (mtu_str_fixed_width[mtu]);\r
+ return mtu_str_fixed_width[mtu];\r
}\r
\r
static const char *lwa_str_fixed_width[] = {\r
"12x"\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_lwa_str(IN uint8_t lwa)\r
{\r
if (lwa > 8)\r
- return (lwa_str_fixed_width[0]);\r
+ return lwa_str_fixed_width[0];\r
else\r
- return (lwa_str_fixed_width[lwa]);\r
+ return lwa_str_fixed_width[lwa];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static const char *lsa_str_fixed_width[] = {\r
"???",\r
"2.5",\r
const char *osm_get_lsa_str(IN uint8_t lsa)\r
{\r
if (lsa > 4)\r
- return (lsa_str_fixed_width[0]);\r
+ return lsa_str_fixed_width[0];\r
else\r
- return (lsa_str_fixed_width[lsa]);\r
+ return lsa_str_fixed_width[lsa];\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static const char *sm_mgr_signal_str[] = {\r
"OSM_SM_SIGNAL_NONE", /* 0 */\r
"OSM_SM_SIGNAL_DISCOVERY_COMPLETED", /* 2 */\r
"UNKNOWN STATE!!" /* 12 */\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_get_sm_mgr_signal_str(IN osm_sm_signal_t signal)\r
{\r
if (signal > OSM_SM_SIGNAL_MAX)\r
signal = OSM_SM_SIGNAL_MAX;\r
- return (sm_mgr_signal_str[signal]);\r
+ return sm_mgr_signal_str[signal];\r
}\r
\r
static const char *sm_mgr_state_str[] = {\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
ib_mad_notice_attr_t *p_ntc;\r
} osm_infr_match_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_infr_delete(IN osm_infr_t * p_infr)\r
{\r
free(p_infr);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_infr_t *osm_infr_new(IN const osm_infr_t * p_infr_rec)\r
{\r
osm_infr_t *p_infr;\r
if (p_infr)\r
memcpy(p_infr, p_infr_rec, sizeof(osm_infr_t));\r
\r
- return (p_infr);\r
+ return p_infr;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void dump_all_informs(IN const osm_subn_t * p_subn, IN osm_log_t * p_log)\r
{\r
cl_list_item_t *p_list_item;\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_infr_t *osm_infr_get_by_rec(IN osm_subn_t const *p_subn,\r
IN osm_log_t * p_log,\r
IN osm_infr_t * p_infr_rec)\r
return (osm_infr_t *) p_list_item;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_infr_insert_to_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log,\r
IN osm_infr_t * p_infr)\r
{\r
#endif\r
\r
cl_qlist_insert_head(&p_subn->sa_infr_list, &p_infr->list_item);\r
+ p_subn->p_osm->sa.dirty = TRUE;\r
\r
OSM_LOG(p_log, OSM_LOG_DEBUG, "Dump after insertion (size %d)\n",\r
cl_qlist_count(&p_subn->sa_infr_list));\r
OSM_LOG_EXIT(p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_infr_remove_from_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log,\r
IN osm_infr_t * p_infr)\r
{\r
OSM_LOG_DEBUG);\r
\r
cl_qlist_remove_item(&p_subn->sa_infr_list, &p_infr->list_item);\r
+ p_subn->p_osm->sa.dirty = TRUE;\r
\r
osm_infr_delete(p_infr);\r
\r
\r
Exit:\r
OSM_LOG_EXIT(p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
/**********************************************************************\r
goto Exit;\r
}\r
\r
- p_dest_port =\r
- cl_ptr_vector_get(&p_subn->port_lid_tbl,\r
- cl_ntoh16(p_infr_rec->report_addr.dest_lid));\r
+ p_dest_port = osm_get_port_by_lid(p_subn,\r
+ p_infr_rec->report_addr.dest_lid);\r
if (!p_dest_port) {\r
OSM_LOG(p_log, OSM_LOG_INFO,\r
"Cannot find destination port with LID:%u\n",\r
if (p_subn->sa_infr_list.state != CL_INITIALIZED) {\r
OSM_LOG(p_log, OSM_LOG_DEBUG,\r
"Ignoring Notice Reports since Inform List is not initialized yet!\n");\r
- return (IB_ERROR);\r
+ return IB_ERROR;\r
}\r
\r
if (osm_log_is_active(p_log, OSM_LOG_INFO))\r
\r
OSM_LOG_EXIT(p_log);\r
\r
- return (IB_SUCCESS);\r
+ return IB_SUCCESS;\r
}\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
uint16_t max_lid;\r
} osm_lid_mgr_range_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_lid_mgr_construct(IN osm_lid_mgr_t * p_mgr)\r
{\r
memset(p_mgr, 0, sizeof(*p_mgr));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_lid_mgr_destroy(IN osm_lid_mgr_t * p_mgr)\r
{\r
cl_list_item_t *p_item;\r
\r
OSM_LOG_ENTER(p_mgr->p_log);\r
\r
- p_item = cl_qlist_remove_head(&p_mgr->free_ranges);\r
- while (p_item != cl_qlist_end(&p_mgr->free_ranges)) {\r
+ while ((p_item = cl_qlist_remove_head(&p_mgr->free_ranges)) !=\r
+ cl_qlist_end(&p_mgr->free_ranges))\r
free((osm_lid_mgr_range_t *) p_item);\r
- p_item = cl_qlist_remove_head(&p_mgr->free_ranges);\r
- }\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
goto Exit;\r
}\r
\r
- p_item = (osm_db_guid_elem_t *) cl_qlist_remove_head(&guids);\r
- while ((cl_list_item_t *) p_item != cl_qlist_end(&guids)) {\r
+ while ((p_item = (osm_db_guid_elem_t *) cl_qlist_remove_head(&guids))\r
+ != (osm_db_guid_elem_t *) cl_qlist_end(&guids)) {\r
if (osm_db_guid2lid_get(p_mgr->p_g2l, p_item->guid,\r
&min_lid, &max_lid))\r
OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 0311: "\r
}\r
}\r
\r
- if (!lids_ok) {\r
- if (osm_db_guid2lid_delete(p_mgr->p_g2l,\r
- p_item->guid))\r
- OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR,\r
- "ERR 0315: "\r
- "failed to delete entry for "\r
- "guid:0x%016" PRIx64 "\n",\r
- p_item->guid);\r
- } else {\r
+ if (lids_ok)\r
/* mark that it was visited */\r
for (lid = min_lid; lid <= max_lid; lid++)\r
p_mgr->used_lids[lid] = 1;\r
- }\r
+ else if (osm_db_guid2lid_delete(p_mgr->p_g2l,\r
+ p_item->guid))\r
+ OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR,\r
+ "ERR 0315: failed to delete entry for "\r
+ "guid:0x%016" PRIx64 "\n",\r
+ p_item->guid);\r
} /* got a lid */\r
free(p_item);\r
- p_item = (osm_db_guid_elem_t *) cl_qlist_remove_head(&guids);\r
} /* all guids */\r
Exit:\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_lid_mgr_init(IN osm_lid_mgr_t * p_mgr, IN osm_sm_t * sm)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
\r
Exit:\r
OSM_LOG_EXIT(p_mgr->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
static uint16_t trim_lid(IN uint16_t lid)\r
static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr)\r
{\r
cl_ptr_vector_t *p_discovered_vec = &p_mgr->p_subn->port_lid_tbl;\r
- uint16_t max_defined_lid;\r
- uint16_t max_persistent_lid;\r
- uint16_t max_discovered_lid;\r
- uint16_t lid;\r
- uint16_t disc_min_lid;\r
- uint16_t disc_max_lid;\r
- uint16_t db_min_lid;\r
- uint16_t db_max_lid;\r
+ uint16_t max_defined_lid, max_persistent_lid, max_discovered_lid;\r
+ uint16_t disc_min_lid, disc_max_lid, db_min_lid, db_max_lid;\r
int status = 0;\r
cl_list_item_t *p_item;\r
boolean_t is_free;\r
osm_port_t *p_port;\r
cl_qmap_t *p_port_guid_tbl;\r
uint8_t lmc_num_lids = (uint8_t) (1 << p_mgr->p_subn->opt.lmc);\r
- uint16_t lmc_mask;\r
- uint16_t req_lid, num_lids;\r
+ uint16_t lmc_mask, req_lid, num_lids, lid;\r
\r
OSM_LOG_ENTER(p_mgr->p_log);\r
\r
Do this only if the honor_guid2lid_file option is FALSE. If not, then\r
need to honor this file. */\r
if (p_mgr->p_subn->coming_out_of_standby == TRUE) {\r
- if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE) {\r
+ osm_db_clear(p_mgr->p_g2l);\r
+ memset(p_mgr->used_lids, 0, sizeof(p_mgr->used_lids));\r
+ if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE)\r
OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
"Ignore guid2lid file when coming out of standby\n");\r
- osm_db_clear(p_mgr->p_g2l);\r
- memset(p_mgr->used_lids, 0, sizeof(p_mgr->used_lids));\r
- } else {\r
+ else {\r
OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
"Honor current guid2lid file when coming out "\r
"of standby\n");\r
- osm_db_clear(p_mgr->p_g2l);\r
if (osm_db_restore(p_mgr->p_g2l))\r
OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR,\r
"ERR 0306: "\r
"Error restoring Guid-to-Lid "\r
"persistent database. Ignoring it\n");\r
+ lid_mgr_validate_db(p_mgr);\r
}\r
}\r
\r
/* we need to cleanup the empty ranges list */\r
- p_item = cl_qlist_remove_head(&p_mgr->free_ranges);\r
- while (p_item != cl_qlist_end(&p_mgr->free_ranges)) {\r
+ while ((p_item = cl_qlist_remove_head(&p_mgr->free_ranges)) !=\r
+ cl_qlist_end(&p_mgr->free_ranges))\r
free((osm_lid_mgr_range_t *) p_item);\r
- p_item = cl_qlist_remove_head(&p_mgr->free_ranges);\r
- }\r
\r
/* first clean up the port_by_lid_tbl */\r
for (lid = 0; lid < cl_ptr_vector_get_size(p_discovered_vec); lid++)\r
p_mgr->p_subn->opt.reassign_lids == TRUE) {\r
OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
"Skipping all lids as we are reassigning them\n");\r
- p_range =\r
- (osm_lid_mgr_range_t *) malloc(sizeof(osm_lid_mgr_range_t));\r
+ p_range = malloc(sizeof(osm_lid_mgr_range_t));\r
if (p_range)\r
p_range->min_lid = 1;\r
goto AfterScanningLids;\r
"persistent db\n", lid);\r
is_free = FALSE;\r
/* check this is a discovered port */\r
- } else if (lid <= max_discovered_lid && (p_port = (osm_port_t *)\r
- cl_ptr_vector_get\r
- (p_discovered_vec,\r
- lid))) {\r
+ } else if (lid <= max_discovered_lid &&\r
+ (p_port = cl_ptr_vector_get(p_discovered_vec,\r
+ lid))) {\r
/* we have a port. Now lets see if we can preserve its lid range. */\r
/* For that, we need to make sure:\r
1. The port has a (legal) persistency entry. Then the\r
if (p_range)\r
p_range->max_lid = lid;\r
else {\r
- p_range = (osm_lid_mgr_range_t *)\r
- malloc(sizeof(osm_lid_mgr_range_t));\r
+ p_range = malloc(sizeof(osm_lid_mgr_range_t));\r
if (p_range) {\r
p_range->min_lid = lid;\r
p_range->max_lid = lid;\r
}\r
}\r
- } else {\r
- /* this lid is used so we need to finalize the previous free range */\r
- if (p_range) {\r
- cl_qlist_insert_tail(&p_mgr->free_ranges,\r
- &p_range->item);\r
- OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
- "new free lid range [%u:%u]\n",\r
- p_range->min_lid, p_range->max_lid);\r
- p_range = NULL;\r
- }\r
+ /* this lid is used so we need to finalize the previous free range */\r
+ } else if (p_range) {\r
+ cl_qlist_insert_tail(&p_mgr->free_ranges,\r
+ &p_range->item);\r
+ OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
+ "new free lid range [%u:%u]\n",\r
+ p_range->min_lid, p_range->max_lid);\r
+ p_range = NULL;\r
}\r
}\r
\r
/* after scanning all known lids we need to extend the last range\r
to the max allowed lid */\r
if (!p_range) {\r
- p_range =\r
- (osm_lid_mgr_range_t *) malloc(sizeof(osm_lid_mgr_range_t));\r
+ p_range = malloc(sizeof(osm_lid_mgr_range_t));\r
/*\r
The p_range can be NULL in one of 2 cases:\r
1. If max_defined_lid == 0. In this case, we want the\r
/* but we can be out of the range */\r
if (lid + num_lids - 1 <= p_range->max_lid) {\r
/* ok let us use that range */\r
- if (lid + num_lids - 1 == p_range->max_lid)\r
+ if (lid + num_lids - 1 == p_range->max_lid) {\r
/* we consumed the entire range */\r
cl_qlist_remove_item(&p_mgr->free_ranges,\r
p_item);\r
- else\r
+ free(p_item);\r
+ } else\r
/* only update the available range */\r
p_range->min_lid = lid + num_lids;\r
\r
CL_ASSERT(0);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void lid_mgr_cleanup_discovered_port_lid_range(IN osm_lid_mgr_t * p_mgr,\r
IN osm_port_t * p_port)\r
{\r
osm_port_get_lid_range_ho(p_port, &min_lid, &max_lid);\r
min_lid = trim_lid(min_lid);\r
max_lid = trim_lid(max_lid);\r
- for (lid = min_lid; lid <= max_lid; lid++) {\r
- if ((lid < max_tbl_lid) &&\r
- (p_port ==\r
- (osm_port_t *) cl_ptr_vector_get(p_discovered_vec, lid)))\r
+ for (lid = min_lid; lid <= max_lid; lid++)\r
+ if (lid < max_tbl_lid &&\r
+ p_port == cl_ptr_vector_get(p_discovered_vec, lid))\r
cl_ptr_vector_set(p_discovered_vec, lid, NULL);\r
- }\r
}\r
\r
/**********************************************************************\r
if (!osm_db_guid2lid_get(p_mgr->p_g2l, guid, &min_lid, &max_lid)) {\r
*p_min_lid = min_lid;\r
*p_max_lid = min_lid + num_lids - 1;\r
- if (min_lid == cl_ntoh16(osm_port_get_base_lid(p_port))) {\r
+ if (min_lid == cl_ntoh16(osm_port_get_base_lid(p_port)))\r
OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG, "0x%016" PRIx64\r
" matches its known lid:%u\n", guid, min_lid);\r
- goto Exit;\r
- } else {\r
+ else {\r
OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
"0x%016" PRIx64 " with lid:%u "\r
"does not match its known lid:%u\n",\r
p_port);\r
/* we still need to send the setting to the target port */\r
lid_changed = 1;\r
- goto Exit;\r
}\r
+ goto NewLidSet;\r
} else\r
OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,\r
"0x%016" PRIx64 " has no persistent lid assigned\n",\r
for (lid = *p_min_lid; lid <= *p_max_lid; lid++)\r
p_mgr->used_lids[lid] = 1;\r
\r
-Exit:\r
/* make sure the assigned lids are marked in port_lid_tbl */\r
for (lid = *p_min_lid; lid <= *p_max_lid; lid++)\r
cl_ptr_vector_set(&p_mgr->p_subn->port_lid_tbl, lid, p_port);\r
ib_port_info_set_port_state(&p_rem_physp->port_info, IB_LINK_INIT);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr,\r
IN osm_port_t * p_port,\r
IN osm_physp_t * p_physp, IN ib_net16_t lid)\r
Third, send the SMP to this physical port.\r
*/\r
\r
- memset(payload, 0, IB_SMP_DATA_SIZE);\r
memcpy(payload, p_old_pi, sizeof(ib_port_info_t));\r
+ memset(payload + sizeof(ib_port_info_t), 0,\r
+ IB_SMP_DATA_SIZE - sizeof(ib_port_info_t));\r
\r
/*\r
Should never write back a value that is bigger then 3 in\r
send_set = TRUE;\r
\r
/* calc new op_vls and mtu */\r
- op_vls =\r
- osm_physp_calc_link_op_vls(p_mgr->p_log, p_mgr->p_subn,\r
- p_physp);\r
+ op_vls = osm_physp_calc_link_op_vls(p_mgr->p_log, p_mgr->p_subn,\r
+ p_physp);\r
mtu = osm_physp_calc_link_mtu(p_mgr->p_log, p_physp);\r
\r
ib_port_info_set_neighbor_mtu(p_pi, mtu);\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_lid_mgr_process_sm(IN osm_lid_mgr_t * p_mgr)\r
{\r
int ret;\r
to look for any field change and will only send an updated\r
if required */\r
OSM_LOG(p_mgr->p_log, OSM_LOG_VERBOSE,\r
- "Assigned port 0x%016" PRIx64\r
- ", LID [%u,%u]\n", cl_ntoh64(port_guid),\r
- min_lid_ho, max_lid_ho);\r
+ "Assigned port 0x%016" PRIx64 ", LID [%u,%u]\n",\r
+ cl_ntoh64(port_guid), min_lid_ho, max_lid_ho);\r
\r
/* the proc returns the fact it sent a set port info */\r
if (lid_mgr_set_physp_pi(p_mgr, p_port, p_port->p_physp,\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_switch.h>\r
#include <opensm/osm_sm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_lft_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
if (status != IB_SUCCESS) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0402: "\r
"Setting forwarding table block failed (%s)"\r
- "\n\t\t\t\tSwitch 0x%" PRIx64 "\n",\r
- ib_get_err_str(status), cl_ntoh64(node_guid));\r
+ ", Switch 0x%" PRIx64 " %s\n",\r
+ ib_get_err_str(status), cl_ntoh64(node_guid),\r
+ p_sw->p_node->print_desc);\r
}\r
}\r
\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
#include <opensm/osm_opensm.h>\r
#include <opensm/osm_ucast_lash.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp)\r
{\r
osm_opensm_t *p_osm = sm->p_subn->p_osm;\r
- const osm_port_t *p_sm_port;\r
- const osm_port_t *p_src_port;\r
+ const osm_port_t *p_sm_port, *p_src_port;\r
ib_net16_t slid;\r
- ib_net16_t smlid;\r
uint8_t sl;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
|| !(slid = osm_physp_get_base_lid(p_physp))) {\r
/* Use default SL if lash routing is not used */\r
OSM_LOG_EXIT(sm->p_log);\r
- return (sm->p_subn->opt.sm_sl);\r
+ return sm->p_subn->opt.sm_sl;\r
}\r
\r
/* Find osm_port of the SM itself = dest_port */\r
- smlid = sm->p_subn->sm_base_lid;\r
- p_sm_port =\r
- cl_ptr_vector_get(&sm->p_subn->port_lid_tbl, cl_ntoh16(smlid));\r
+ p_sm_port = osm_get_port_by_lid(sm->p_subn, sm->p_subn->sm_base_lid);\r
\r
/* Find osm_port of the source = p_physp */\r
- p_src_port =\r
- cl_ptr_vector_get(&sm->p_subn->port_lid_tbl, cl_ntoh16(slid));\r
+ p_src_port = osm_get_port_by_lid(sm->p_subn, slid);\r
\r
/* Call lash to find proper SL */\r
sl = osm_get_lash_sl(p_osm, p_src_port, p_sm_port);\r
\r
OSM_LOG_EXIT(sm->p_log);\r
- return (sl);\r
+ return sl;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp,\r
IN uint8_t port_state)\r
{\r
/*\r
CAs don't have a port 0, and for switch port 0,\r
we need to check if this is enhanced or base port 0.\r
- For base port 0 the following parameters are not valid (p822, table 145).\r
+ For base port 0 the following parameters are not valid\r
+ (IBA 1.2.1 p.830 table 146).\r
*/\r
if (!p_node->sw) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 4201: "\r
esp0 = TRUE;\r
}\r
\r
- memset(payload, 0, IB_SMP_DATA_SIZE);\r
memcpy(payload, p_old_pi, sizeof(ib_port_info_t));\r
+ memset(payload + sizeof(ib_port_info_t), 0,\r
+ IB_SMP_DATA_SIZE - sizeof(ib_port_info_t));\r
\r
/*\r
Should never write back a value that is bigger then 3 in\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int link_mgr_process_node(osm_sm_t * sm, IN osm_node_t * p_node,\r
IN const uint8_t link_state)\r
{\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_link_mgr_process(osm_sm_t * sm, IN const uint8_t link_state)\r
{\r
cl_qmap_t *p_node_guid_tbl;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
\r
static int log_exit_count = 0;\r
\r
-#ifndef __WIN__\r
#include <sys/time.h>\r
#include <unistd.h>\r
#include <complib/cl_timer.h>\r
"Nov",\r
"Dec"\r
};\r
-#else\r
-void OsmReportState(IN const char *p_str);\r
-#endif /* ndef __WIN__ */\r
\r
#ifndef __WIN__\r
\r
\r
#else /* Windows */\r
\r
-static void truncate_log_file(osm_log_t * p_log)\r
+void truncate_log_file(osm_log_t * p_log)\r
{\r
int fd = _fileno(p_log->out_port);\r
HANDLE hFile = (HANDLE) _get_osfhandle(fd);\r
SetEndOfFile(hFile);\r
p_log->count = 0;\r
}\r
+\r
+extern void OsmReportState(IN const char *p_str);\r
+\r
#endif /* ndef __WIN__ */\r
\r
void osm_log(IN osm_log_t * p_log, IN osm_log_level_t verbosity,\r
#ifdef __WIN__\r
SYSTEMTIME st;\r
uint32_t pid = GetCurrentThreadId();\r
+ int rc;\r
#else\r
pid_t pid = 0;\r
time_t tim;\r
#endif /* __WIN__ */\r
\r
/* If this is a call to syslog - always print it */\r
- if (!(verbosity & (OSM_LOG_SYS | p_log->level)))\r
+ if (!(verbosity & p_log->level))\r
return;\r
\r
va_start(args, p_str);\r
#ifndef __WIN__\r
- vsprintf(buffer, p_str, args);\r
+ if (p_log->log_prefix == NULL)\r
+ vsprintf(buffer, p_str, args);\r
+ else {\r
+ int n = snprintf(buffer, sizeof(buffer), "%s: ", p_log->log_prefix);\r
+ vsprintf(buffer + n, p_str, args);\r
+ }\r
#else\r
- _vsnprintf(buffer, 1024, (LPSTR)p_str, args);\r
+ if (p_log->log_prefix == NULL)\r
+ rc = _vsnprintf(buffer, sizeof(buffer), (LPSTR)p_str, args);\r
+ else {\r
+ int n = snprintf(buffer, sizeof(buffer), "%s: ", p_log->log_prefix);\r
+ rc = _vsnprintf(buffer + n, (sizeof(buffer) - n), (LPSTR)p_str, args);\r
+ }\r
#endif\r
va_end(args);\r
\r
+ if ( rc < 0 ) {\r
+ syslog(LOG_INFO,"%s() osm.log buffer-overflow @ bufsize %d\n",\r
+ __FUNCTION__,sizeof(buffer));\r
+ }\r
+\r
/* this is a call to the syslog */\r
if (verbosity & OSM_LOG_SYS) {\r
syslog(LOG_INFO, "%s\n", buffer);\r
_retry:\r
ret =\r
fprintf(p_log->out_port,\r
- "[%02d:%02d:%02d:%03d][%04X] 0x%02x -> %s",\r
- st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,\r
+ "[%s-%02d-%04d %02d:%02d:%02d:%03d][%04X] 0x%02x -> %s",\r
+ month_str[st.wMonth-1], st.wDay, st.wYear,\r
+ st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,\r
pid, verbosity, buffer);\r
#else\r
time_usecs = cl_get_time_stamp();\r
IN unsigned long max_size,\r
IN boolean_t accum_log_file)\r
{\r
- p_log->level = log_flags;\r
+ p_log->level = log_flags | OSM_LOG_SYS;\r
p_log->flush = flush;\r
p_log->count = 0;\r
p_log->max_size = max_size << 20; /* convert size in MB to bytes */\r
#include <opensm/osm_madw.h>\r
#include <vendor/osm_vendor_api.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mad_pool_construct(IN osm_mad_pool_t * p_pool)\r
{\r
CL_ASSERT(p_pool);\r
memset(p_pool, 0, sizeof(*p_pool));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mad_pool_destroy(IN osm_mad_pool_t * p_pool)\r
{\r
CL_ASSERT(p_pool);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_mad_pool_init(IN osm_mad_pool_t * p_pool)\r
{\r
p_pool->mads_out = 0;\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_madw_t *osm_mad_pool_get(IN osm_mad_pool_t * p_pool,\r
IN osm_bind_handle_t h_bind,\r
IN uint32_t total_size,\r
return p_madw;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_madw_t *osm_mad_pool_get_wrapper(IN osm_mad_pool_t * p_pool,\r
IN osm_bind_handle_t h_bind,\r
IN uint32_t total_size,\r
osm_madw_set_mad(p_madw, p_mad);\r
\r
Exit:\r
- return (p_madw);\r
+ return p_madw;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_madw_t *osm_mad_pool_get_wrapper_raw(IN osm_mad_pool_t * p_pool)\r
{\r
osm_madw_t *p_madw;\r
osm_madw_set_mad(p_madw, 0);\r
cl_atomic_inc(&p_pool->mads_out);\r
\r
- return (p_madw);\r
+ return p_madw;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mad_pool_put(IN osm_mad_pool_t * p_pool, IN osm_madw_t * p_madw)\r
{\r
CL_ASSERT(p_madw);\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_subnet.h>\r
#include <opensm/osm_sm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mft_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
if (status != IB_SUCCESS) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0802: "\r
"Setting MFT block failed (%s)"\r
- "\n\t\t\t\tSwitch 0x%016" PRIx64\r
- ", block %u, position %u\n",\r
- ib_get_err_str(status),\r
- cl_ntoh64(node_guid), block_num, position);\r
+ ", Switch 0x%016" PRIx64\r
+ " (%s), block %u, position %u\n",\r
+ ib_get_err_str(status), cl_ntoh64(node_guid),\r
+ p_sw->p_node->print_desc, block_num, position);\r
}\r
}\r
\r
* Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_helper.h>\r
#include <opensm/osm_msgdef.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
typedef struct osm_mcast_work_obj {\r
cl_list_item_t list_item;\r
osm_port_t *p_port;\r
+ cl_map_item_t map_item;\r
} osm_mcast_work_obj_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static osm_mcast_work_obj_t *mcast_work_obj_new(IN const osm_port_t * p_port)\r
+static osm_mcast_work_obj_t *mcast_work_obj_new(IN osm_port_t * p_port)\r
{\r
osm_mcast_work_obj_t *p_obj;\r
\r
p_obj = malloc(sizeof(*p_obj));\r
if (p_obj) {\r
memset(p_obj, 0, sizeof(*p_obj));\r
- p_obj->p_port = (osm_port_t *) p_port;\r
+ p_obj->p_port = p_port;\r
}\r
\r
- return (p_obj);\r
+ return p_obj;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mcast_work_obj_delete(IN osm_mcast_work_obj_t * p_wobj)\r
{\r
free(p_wobj);\r
}\r
\r
+static int make_port_list(cl_qlist_t * list, osm_mgrp_box_t * mbox)\r
+{\r
+ cl_qmap_t map;\r
+ cl_map_item_t *map_item;\r
+ cl_list_item_t *list_item;\r
+ osm_mgrp_t *mgrp=NULL;\r
+ osm_mcm_port_t *mcm_port=NULL;\r
+ osm_mcast_work_obj_t *wobj;\r
+\r
+ cl_qmap_init(&map);\r
+ cl_qlist_init(list);\r
+\r
+ for (list_item = cl_qlist_head(&mbox->mgrp_list);\r
+ list_item != cl_qlist_end(&mbox->mgrp_list);\r
+ list_item = cl_qlist_next(list_item)) {\r
+ mgrp = cl_item_obj(list_item, mgrp, list_item);\r
+ for (map_item = cl_qmap_head(&mgrp->mcm_port_tbl);\r
+ map_item != cl_qmap_end(&mgrp->mcm_port_tbl);\r
+ map_item = cl_qmap_next(map_item)) {\r
+ /* Acquire the port object for this port guid, then\r
+ create the new worker object to build the list. */\r
+ mcm_port = cl_item_obj(map_item, mcm_port, map_item);\r
+ if (cl_qmap_get(&map, mcm_port->port->guid) !=\r
+ cl_qmap_end(&map))\r
+ continue;\r
+ wobj = mcast_work_obj_new(mcm_port->port);\r
+ if (!wobj)\r
+ return -1;\r
+ cl_qlist_insert_tail(list, &wobj->list_item);\r
+ cl_qmap_insert(&map, mcm_port->port->guid,\r
+ &wobj->map_item);\r
+ }\r
+ }\r
+ return 0;\r
+}\r
+\r
+static void drop_port_list(cl_qlist_t * list)\r
+{\r
+ while (cl_qlist_count(list))\r
+ mcast_work_obj_delete((osm_mcast_work_obj_t *)\r
+ cl_qlist_remove_head(list));\r
+}\r
+\r
/**********************************************************************\r
Recursively remove nodes from the tree\r
*********************************************************************/\r
if (p_mtn->child_array[i] &&\r
(p_mtn->child_array[i] != OSM_MTREE_LEAF))\r
mcast_mgr_purge_tree_node(p_mtn->child_array[i]);\r
-\r
p_mtn->child_array[i] = NULL;\r
-\r
}\r
\r
free(p_mtn);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static void mcast_mgr_purge_tree(osm_sm_t * sm, IN osm_mgrp_t * p_mgrp)\r
+static void mcast_mgr_purge_tree(osm_sm_t * sm, IN osm_mgrp_box_t * mbox)\r
{\r
OSM_LOG_ENTER(sm->p_log);\r
\r
- if (p_mgrp->p_root)\r
- mcast_mgr_purge_tree_node(p_mgrp->p_root);\r
-\r
- p_mgrp->p_root = NULL;\r
+ if (mbox->root)\r
+ mcast_mgr_purge_tree_node(mbox->root);\r
+ mbox->root = NULL;\r
\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
+static void create_mgrp_switch_map(cl_qmap_t * m, cl_qlist_t * port_list)\r
+{\r
+ osm_mcast_work_obj_t *wobj=NULL;\r
+ osm_port_t *port;\r
+ osm_switch_t *sw;\r
+ ib_net64_t guid;\r
+ cl_list_item_t *i;\r
+\r
+ cl_qmap_init(m);\r
+ for (i = cl_qlist_head(port_list); i != cl_qlist_end(port_list);\r
+ i = cl_qlist_next(i)) {\r
+ wobj = cl_item_obj(i, wobj, list_item);\r
+ port = wobj->p_port;\r
+ if (port->p_node->sw) {\r
+ sw = port->p_node->sw;\r
+ sw->is_mc_member = 1;\r
+ } else {\r
+ sw = port->p_physp->p_remote_physp->p_node->sw;\r
+ sw->num_of_mcm++;\r
+ }\r
+ guid = osm_node_get_node_guid(sw->p_node);\r
+ if (cl_qmap_get(m, guid) == cl_qmap_end(m))\r
+ cl_qmap_insert(m, guid, &sw->mgrp_item);\r
+ }\r
+}\r
+\r
+static void destroy_mgrp_switch_map(cl_qmap_t * m)\r
+{\r
+ osm_switch_t *sw=NULL;\r
+ cl_map_item_t *i;\r
+\r
+ for (i = cl_qmap_head(m); i != cl_qmap_end(m); i = cl_qmap_next(i)) {\r
+ sw = cl_item_obj(i, sw, mgrp_item);\r
+ sw->num_of_mcm = 0;\r
+ sw->is_mc_member = 0;\r
+ }\r
+ cl_qmap_remove_all(m);\r
+}\r
+\r
/**********************************************************************\r
+ Calculate the maximal "min hops" from the given switch to any\r
+ of the group HCAs\r
**********************************************************************/\r
-static float osm_mcast_mgr_compute_avg_hops(osm_sm_t * sm,\r
- const osm_mgrp_t * p_mgrp,\r
- const osm_switch_t * p_sw)\r
+#ifdef OSM_VENDOR_INTF_ANAFA\r
+static float mcast_mgr_compute_avg_hops(osm_sm_t * sm, cl_qmap_t * m,\r
+ const osm_switch_t * this_sw)\r
{\r
float avg_hops = 0;\r
uint32_t hops = 0;\r
uint32_t num_ports = 0;\r
- const osm_mcm_port_t *p_mcm_port;\r
- const cl_qmap_t *p_mcm_tbl;\r
+ uint16_t lid;\r
+ uint32_t least_hops;\r
+ cl_map_item_t *i;\r
+ osm_switch_t *sw;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
- p_mcm_tbl = &p_mgrp->mcm_port_tbl;\r
-\r
- /*\r
- For each member of the multicast group, compute the\r
- number of hops to its base LID.\r
- */\r
- for (p_mcm_port = (osm_mcm_port_t *) cl_qmap_head(p_mcm_tbl);\r
- p_mcm_port != (osm_mcm_port_t *) cl_qmap_end(p_mcm_tbl);\r
- p_mcm_port =\r
- (osm_mcm_port_t *) cl_qmap_next(&p_mcm_port->map_item)) {\r
- hops += osm_switch_get_port_least_hops(p_sw, p_mcm_port->port);\r
- num_ports++;\r
+ for (i = cl_qmap_head(m); i != cl_qmap_end(m); i = cl_qmap_next(i)) {\r
+ sw = cl_item_obj(i, sw, mcast_item);\r
+ lid = cl_ntoh16(osm_node_get_base_lid(sw->p_node, 0));\r
+ least_hops = osm_switch_get_least_hops(this_sw, lid);\r
+ /* for all host that are MC members and attached to the switch,\r
+ we should add the (least_hops + 1) * number_of_such_hosts.\r
+ If switch itself is in the MC, we should add the least_hops only */\r
+ hops += (least_hops + 1) * sw->num_of_mcm +\r
+ least_hops * sw->is_mc_member;\r
+ num_ports += sw->num_of_mcm + sw->is_mc_member;\r
}\r
\r
- /*\r
- We should be here if there aren't any ports in the group.\r
- */\r
+ /* We shouldn't be here if there aren't any ports in the group. */\r
CL_ASSERT(num_ports);\r
\r
- if (num_ports != 0)\r
- avg_hops = (float)(hops / num_ports);\r
+ avg_hops = (float)(hops / num_ports);\r
\r
OSM_LOG_EXIT(sm->p_log);\r
return avg_hops;\r
}\r
-\r
-/**********************************************************************\r
- Calculate the maximal "min hops" from the given switch to any\r
- of the group HCAs\r
- **********************************************************************/\r
-static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm,\r
- const osm_mgrp_t * p_mgrp,\r
- const osm_switch_t * p_sw)\r
+#else\r
+static float mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qmap_t * m,\r
+ const osm_switch_t * this_sw)\r
{\r
- uint32_t max_hops = 0;\r
- uint32_t hops = 0;\r
- const osm_mcm_port_t *p_mcm_port;\r
- const cl_qmap_t *p_mcm_tbl;\r
+ uint32_t max_hops = 0, hops;\r
+ uint16_t lid;\r
+ cl_map_item_t *i;\r
+ osm_switch_t *sw=NULL;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
- p_mcm_tbl = &p_mgrp->mcm_port_tbl;\r
-\r
/*\r
For each member of the multicast group, compute the\r
number of hops to its base LID.\r
*/\r
- for (p_mcm_port = (osm_mcm_port_t *) cl_qmap_head(p_mcm_tbl);\r
- p_mcm_port != (osm_mcm_port_t *) cl_qmap_end(p_mcm_tbl);\r
- p_mcm_port =\r
- (osm_mcm_port_t *) cl_qmap_next(&p_mcm_port->map_item)) {\r
- hops = osm_switch_get_port_least_hops(p_sw, p_mcm_port->port);\r
+ for (i = cl_qmap_head(m); i != cl_qmap_end(m); i = cl_qmap_next(i)) {\r
+ sw = cl_item_obj(i, sw, mgrp_item);\r
+ lid = cl_ntoh16(osm_node_get_base_lid(sw->p_node, 0));\r
+ hops = osm_switch_get_least_hops(this_sw, lid);\r
+ if (!sw->is_mc_member)\r
+ hops += 1;\r
if (hops > max_hops)\r
max_hops = hops;\r
}\r
\r
- if (max_hops == 0)\r
- /*\r
- We should be here if there aren't any ports in the group.\r
- */\r
- max_hops = 10001; /* see later - we use it to realize no hops */\r
+ /* Note that at this point we might get (max_hops == 0),\r
+ which means that there's only one member in the mcast\r
+ group, and it's the current switch */\r
\r
OSM_LOG_EXIT(sm->p_log);\r
return (float)max_hops;\r
}\r
+#endif\r
\r
/**********************************************************************\r
This function attempts to locate the optimal switch for the\r
of the multicast group.\r
**********************************************************************/\r
static osm_switch_t *mcast_mgr_find_optimal_switch(osm_sm_t * sm,\r
- const osm_mgrp_t * p_mgrp)\r
+ cl_qlist_t * list)\r
{\r
+ cl_qmap_t mgrp_sw_map;\r
cl_qmap_t *p_sw_tbl;\r
- const osm_switch_t *p_sw;\r
- const osm_switch_t *p_best_sw = NULL;\r
+ osm_switch_t *p_sw, *p_best_sw = NULL;\r
float hops = 0;\r
float best_hops = 10000; /* any big # will do */\r
-#ifdef OSM_VENDOR_INTF_ANAFA\r
- boolean_t use_avg_hops = TRUE; /* anafa2 - bug hca on switch *//* use max hops for root */\r
-#else\r
- boolean_t use_avg_hops = FALSE; /* use max hops for root */\r
-#endif\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
p_sw_tbl = &sm->p_subn->sw_guid_tbl;\r
\r
- CL_ASSERT(!osm_mgrp_is_empty(p_mgrp));\r
-\r
+ create_mgrp_switch_map(&mgrp_sw_map, list);\r
for (p_sw = (osm_switch_t *) cl_qmap_head(p_sw_tbl);\r
p_sw != (osm_switch_t *) cl_qmap_end(p_sw_tbl);\r
p_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item)) {\r
if (!osm_switch_supports_mcast(p_sw))\r
continue;\r
\r
- if (use_avg_hops)\r
- hops = osm_mcast_mgr_compute_avg_hops(sm, p_mgrp, p_sw);\r
- else\r
- hops = osm_mcast_mgr_compute_max_hops(sm, p_mgrp, p_sw);\r
+#ifdef OSM_VENDOR_INTF_ANAFA\r
+ hops = mcast_mgr_compute_avg_hops(sm, &mgrp_sw_map, p_sw);\r
+#else\r
+ hops = mcast_mgr_compute_max_hops(sm, &mgrp_sw_map, p_sw);\r
+#endif\r
\r
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,\r
"Switch 0x%016" PRIx64 ", hops = %f\n",\r
\r
if (p_best_sw)\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
- "Best switch is 0x%" PRIx64 ", hops = %f\n",\r
+ "Best switch is 0x%" PRIx64 " (%s), hops = %f\n",\r
cl_ntoh64(osm_node_get_node_guid(p_best_sw->p_node)),\r
- best_hops);\r
+ p_best_sw->p_node->print_desc, best_hops);\r
else\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"No multicast capable switches detected\n");\r
\r
+ destroy_mgrp_switch_map(&mgrp_sw_map);\r
OSM_LOG_EXIT(sm->p_log);\r
- return (osm_switch_t *) p_best_sw;\r
+ return p_best_sw;\r
}\r
\r
/**********************************************************************\r
- This function returns the existing or optimal root swtich for the tree.\r
+ This function returns the existing or optimal root switch for the tree.\r
**********************************************************************/\r
-static osm_switch_t *mcast_mgr_find_root_switch(osm_sm_t * sm,\r
- const osm_mgrp_t * p_mgrp)\r
+static osm_switch_t *mcast_mgr_find_root_switch(osm_sm_t * sm, cl_qlist_t *list)\r
{\r
- const osm_switch_t *p_sw = NULL;\r
+ osm_switch_t *p_sw = NULL;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
the root will be always on the first switch attached to it.\r
- Very bad ...\r
*/\r
- p_sw = mcast_mgr_find_optimal_switch(sm, p_mgrp);\r
+ p_sw = mcast_mgr_find_optimal_switch(sm, list);\r
\r
OSM_LOG_EXIT(sm->p_log);\r
- return (osm_switch_t *) p_sw;\r
+ return p_sw;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int mcast_mgr_set_mft_block(osm_sm_t * sm, IN osm_switch_t * p_sw,\r
uint32_t block_num, uint32_t position)\r
{\r
\r
if (osm_mcast_tbl_get_block(p_tbl, (uint16_t) block_num,\r
(uint8_t) position, block)) {\r
-\r
block_id_ho = block_num + (position << 28);\r
\r
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,\r
- "Writing MFT block %u position %u to switch 0x%" PRIx64 "\n",\r
- block_num, position,\r
+ "Writing MFT block %u position %u to switch 0x%" PRIx64\r
+ "\n", block_num, position,\r
cl_ntoh64(context.mft_context.node_guid));\r
\r
status = osm_req_set(sm, p_path, (void *)block, sizeof(block),\r
IB_MAD_ATTR_MCAST_FWD_TBL,\r
cl_hton32(block_id_ho), CL_DISP_MSGID_NONE,\r
&context);\r
-\r
if (status != IB_SUCCESS) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A02: "\r
- "Sending multicast fwd. tbl. block failed (%s)\n",\r
- ib_get_err_str(status));\r
+ "Sending multicast fwd. tbl. block to %s failed (%s)\n",\r
+ p_node->print_desc, ib_get_err_str(status));\r
ret = -1;\r
}\r
}\r
spanning tree that emanate from this switch. On input, the p_list\r
contains the group members that must be routed from this switch.\r
**********************************************************************/\r
-static void mcast_mgr_subdivide(osm_sm_t * sm, osm_mgrp_t * p_mgrp,\r
+static void mcast_mgr_subdivide(osm_sm_t * sm, uint16_t mlid_ho,\r
osm_switch_t * p_sw, cl_qlist_t * p_list,\r
cl_qlist_t * list_array, uint8_t array_size)\r
{\r
uint8_t port_num;\r
- uint16_t mlid_ho;\r
boolean_t ignore_existing;\r
osm_mcast_work_obj_t *p_wobj;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
- mlid_ho = cl_ntoh16(osm_mgrp_get_mlid(p_mgrp));\r
-\r
/*\r
For Multicast Groups, we don't want to count on previous\r
configurations - since we can easily generate a storm\r
port_num =\r
osm_switch_recommend_mcast_path(p_sw, p_wobj->p_port,\r
mlid_ho, ignore_existing);\r
-\r
if (port_num == OSM_NO_PATH) {\r
/*\r
This typically occurs if the switch does not support\r
multicast and the multicast tree must branch at this\r
switch.\r
*/\r
- uint64_t node_guid_ho =\r
- cl_ntoh64(osm_node_get_node_guid(p_sw->p_node));\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A03: "\r
"Error routing MLID 0x%X through switch 0x%"\r
- PRIx64 "\n"\r
+ PRIx64 " %s\n"\r
"\t\t\t\tNo multicast paths from this switch "\r
- "for port with LID %u\n", mlid_ho, node_guid_ho,\r
+ "for port with LID %u\n", mlid_ho,\r
+ cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)),\r
+ p_sw->p_node->print_desc,\r
cl_ntoh16(osm_port_get_base_lid\r
(p_wobj->p_port)));\r
-\r
mcast_work_obj_delete(p_wobj);\r
continue;\r
}\r
\r
if (port_num > array_size) {\r
- uint64_t node_guid_ho =\r
- cl_ntoh64(osm_node_get_node_guid(p_sw->p_node));\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A04: "\r
"Error routing MLID 0x%X through switch 0x%"\r
- PRIx64 "\n"\r
+ PRIx64 " %s\n"\r
"\t\t\t\tNo multicast paths from this switch "\r
- "to port with LID %u\n", mlid_ho, node_guid_ho,\r
+ "to port with LID %u\n", mlid_ho,\r
+ cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)),\r
+ p_sw->p_node->print_desc,\r
cl_ntoh16(osm_port_get_base_lid\r
(p_wobj->p_port)));\r
-\r
mcast_work_obj_delete(p_wobj);\r
-\r
/* This is means OpenSM has a bug. */\r
CL_ASSERT(FALSE);\r
continue;\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static void mcast_mgr_purge_list(osm_sm_t * sm, cl_qlist_t * p_list)\r
+static void mcast_mgr_purge_list(osm_sm_t * sm, cl_qlist_t * list)\r
{\r
- osm_mcast_work_obj_t *p_wobj;\r
-\r
- OSM_LOG_ENTER(sm->p_log);\r
-\r
- while ((p_wobj = (osm_mcast_work_obj_t *) cl_qlist_remove_head(p_list))\r
- != (osm_mcast_work_obj_t *) cl_qlist_end(p_list)) {\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A06: "\r
- "Unable to route for port 0x%" PRIx64 "\n",\r
- osm_port_get_guid(p_wobj->p_port));\r
- mcast_work_obj_delete(p_wobj);\r
+ if (osm_log_is_active(sm->p_log, OSM_LOG_ERROR)) {\r
+ osm_mcast_work_obj_t *wobj=NULL;\r
+ cl_list_item_t *i;\r
+ for (i = cl_qlist_head(list); i != cl_qlist_end(list);\r
+ i = cl_qlist_next(i)) {\r
+ wobj = cl_item_obj(i, wobj, list_item);\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A06: "\r
+ "Unable to route for port 0x%" PRIx64 "\n",\r
+ osm_port_get_guid(wobj->p_port));\r
+ }\r
}\r
-\r
- OSM_LOG_EXIT(sm->p_log);\r
+ drop_port_list(list);\r
}\r
\r
/**********************************************************************\r
\r
The function returns the newly created mtree node element.\r
**********************************************************************/\r
-static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, osm_mgrp_t * p_mgrp,\r
+static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,\r
osm_switch_t * p_sw,\r
cl_qlist_t * p_list, uint8_t depth,\r
uint8_t upstream_port,\r
cl_qlist_t *list_array = NULL;\r
uint8_t i;\r
ib_net64_t node_guid;\r
- uint64_t node_guid_ho;\r
osm_mcast_work_obj_t *p_wobj;\r
cl_qlist_t *p_port_list;\r
size_t count;\r
- uint16_t mlid_ho;\r
osm_mcast_tbl_t *p_tbl;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
CL_ASSERT(p_max_depth);\r
\r
node_guid = osm_node_get_node_guid(p_sw->p_node);\r
- node_guid_ho = cl_ntoh64(node_guid);\r
- mlid_ho = cl_ntoh16(osm_mgrp_get_mlid(p_mgrp));\r
\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Routing MLID 0x%X through switch 0x%" PRIx64\r
- ", %u nodes at depth %u\n",\r
- mlid_ho, node_guid_ho, cl_qlist_count(p_list), depth);\r
+ " %s, %u nodes at depth %u\n",\r
+ mlid_ho, cl_ntoh64(node_guid), p_sw->p_node->print_desc,\r
+ cl_qlist_count(p_list), depth);\r
\r
CL_ASSERT(cl_qlist_count(p_list) > 0);\r
\r
This switch doesn't do multicast. Clean-up.\r
*/\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A14: "\r
- "Switch 0x%" PRIx64 " does not support multicast\n",\r
- node_guid_ho);\r
+ "Switch 0x%" PRIx64 " %s does not support multicast\n",\r
+ cl_ntoh64(node_guid), p_sw->p_node->print_desc);\r
\r
/*\r
Deallocate all the work objects on this branch of the tree.\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A16: "\r
"Unable to allocate list array\n");\r
mcast_mgr_purge_list(sm, p_list);\r
+ osm_mtree_destroy(p_mtn);\r
+ p_mtn = NULL;\r
goto Exit;\r
}\r
\r
for (i = 0; i < max_children; i++)\r
cl_qlist_init(&list_array[i]);\r
\r
- mcast_mgr_subdivide(sm, p_mgrp, p_sw, p_list, list_array, max_children);\r
+ mcast_mgr_subdivide(sm, mlid_ho, p_sw, p_list, list_array, max_children);\r
\r
p_tbl = osm_switch_get_mcast_tbl_ptr(p_sw);\r
\r
CL_ASSERT(p_remote_physp);\r
\r
p_mtn->child_array[i] =\r
- mcast_mgr_branch(sm, p_mgrp, p_remote_node->sw,\r
+ mcast_mgr_branch(sm, mlid_ho, p_remote_node->sw,\r
p_port_list, depth,\r
osm_physp_get_port_num\r
(p_remote_physp), p_max_depth);\r
" on switch port %u\n",\r
cl_ntoh64(osm_port_get_guid(p_wobj->p_port)),\r
i);\r
-\r
mcast_work_obj_delete(p_wobj);\r
}\r
}\r
return p_mtn;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t mcast_mgr_build_spanning_tree(osm_sm_t * sm,\r
- osm_mgrp_t * p_mgrp)\r
+ osm_mgrp_box_t * mbox)\r
{\r
- const cl_qmap_t *p_mcm_tbl;\r
- const osm_mcm_port_t *p_mcm_port;\r
- uint32_t num_ports;\r
cl_qlist_t port_list;\r
+ uint32_t num_ports;\r
osm_switch_t *p_sw;\r
- osm_mcast_work_obj_t *p_wobj;\r
ib_api_status_t status = IB_SUCCESS;\r
uint8_t max_depth = 0;\r
- uint32_t count;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
- cl_qlist_init(&port_list);\r
-\r
/*\r
TO DO - for now, just blow away the old tree.\r
In the future we'll need to construct the tree based\r
on multicast forwarding table information if the user wants to\r
preserve existing multicast routes.\r
*/\r
- mcast_mgr_purge_tree(sm, p_mgrp);\r
+ mcast_mgr_purge_tree(sm, mbox);\r
+\r
+ /* build the first "subset" containing all member ports */\r
+ if (make_port_list(&port_list, mbox)) {\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A10: "\r
+ "Insufficient memory to make port list\n");\r
+ status = IB_ERROR;\r
+ goto Exit;\r
+ }\r
\r
- p_mcm_tbl = &p_mgrp->mcm_port_tbl;\r
- num_ports = cl_qmap_count(p_mcm_tbl);\r
+ num_ports = cl_qlist_count(&port_list);\r
if (num_ports == 0) {\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"MLID 0x%X has no members - nothing to do\n",\r
- cl_ntoh16(osm_mgrp_get_mlid(p_mgrp)));\r
+ mbox->mlid);\r
goto Exit;\r
}\r
\r
Locate the switch around which to create the spanning\r
tree for this multicast group.\r
*/\r
- p_sw = mcast_mgr_find_root_switch(sm, p_mgrp);\r
+ p_sw = mcast_mgr_find_root_switch(sm, &port_list);\r
if (p_sw == NULL) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A08: "\r
"Unable to locate a suitable switch for group 0x%X\n",\r
- cl_ntoh16(osm_mgrp_get_mlid(p_mgrp)));\r
+ mbox->mlid);\r
+ drop_port_list(&port_list);\r
status = IB_ERROR;\r
goto Exit;\r
}\r
\r
- /*\r
- Build the first "subset" containing all member ports.\r
- */\r
- for (p_mcm_port = (osm_mcm_port_t *) cl_qmap_head(p_mcm_tbl);\r
- p_mcm_port != (osm_mcm_port_t *) cl_qmap_end(p_mcm_tbl);\r
- p_mcm_port =\r
- (osm_mcm_port_t *) cl_qmap_next(&p_mcm_port->map_item)) {\r
- /*\r
- Acquire the port object for this port guid, then create\r
- the new worker object to build the list.\r
- */\r
- p_wobj = mcast_work_obj_new(p_mcm_port->port);\r
- if (p_wobj == NULL) {\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A10: "\r
- "Insufficient memory to route port 0x%016"\r
- PRIx64 "\n",\r
- cl_ntoh64(osm_port_get_guid(p_mcm_port->port)));\r
- continue;\r
- }\r
-\r
- cl_qlist_insert_tail(&port_list, &p_wobj->list_item);\r
- }\r
-\r
- count = cl_qlist_count(&port_list);\r
- p_mgrp->p_root = mcast_mgr_branch(sm, p_mgrp, p_sw, &port_list, 0, 0,\r
- &max_depth);\r
+ mbox->root = mcast_mgr_branch(sm, mbox->mlid, p_sw, &port_list, 0, 0,\r
+ &max_depth);\r
\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Configured MLID 0x%X for %u ports, max tree depth = %u\n",\r
- cl_ntoh16(osm_mgrp_get_mlid(p_mgrp)), count, max_depth);\r
-\r
+ mbox->mlid, num_ports, max_depth);\r
Exit:\r
OSM_LOG_EXIT(sm->p_log);\r
return status;\r
\r
#if 0\r
/* unused */\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcast_mgr_set_table(osm_sm_t * sm, IN const osm_mgrp_t * p_mgrp,\r
IN const osm_mtree_node_t * p_mtn)\r
{\r
}\r
#endif\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mcast_mgr_clear(osm_sm_t * sm, uint16_t mlid)\r
{\r
osm_switch_t *p_sw;\r
static ib_api_status_t mcast_mgr_process_mlid(osm_sm_t * sm, uint16_t mlid)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
- osm_mgrp_t *mgrp;\r
+ osm_mgrp_box_t *mbox;\r
\r
OSM_LOG_ENTER(sm->p_log);\r
\r
port in the group. */\r
mcast_mgr_clear(sm, mlid);\r
\r
- mgrp = osm_get_mgrp_by_mlid(sm->p_subn, cl_hton16(mlid));\r
- if (mgrp) {\r
- status = mcast_mgr_build_spanning_tree(sm, mgrp);\r
+ mbox = osm_get_mbox_by_mlid(sm->p_subn, cl_hton16(mlid));\r
+ if (mbox) {\r
+ status = mcast_mgr_build_spanning_tree(sm, mbox);\r
if (status != IB_SUCCESS)\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A17: "\r
"Unable to create spanning tree (%s) for mlid "\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int mcast_mgr_set_mftables(osm_sm_t * sm)\r
{\r
cl_qmap_t *p_sw_tbl = &sm->p_subn->sw_guid_tbl;\r
\r
for (i = sm->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO; i >= 0;\r
i--)\r
- if (sm->p_subn->mgroups[i])\r
+ if (sm->p_subn->mboxes[i])\r
break;\r
if (i < 0)\r
return 0;\r
for (item = cl_qmap_head(&sm->p_subn->sw_guid_tbl);\r
item != cl_qmap_end(&sm->p_subn->sw_guid_tbl);\r
item = cl_qmap_next(item)) {\r
- p_sw = (osm_switch_t *)item;\r
+ p_sw = (osm_switch_t *) item;\r
if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl, i))\r
return -1;\r
}\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_mcast_mgr_process(osm_sm_t * sm)\r
{\r
int i, ret = 0;\r
if (alloc_mfts(sm)) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"ERR 0A07: alloc_mfts failed\n");\r
+ ret = -1;\r
goto exit;\r
}\r
\r
for (i = 0; i <= sm->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO;\r
i++)\r
- if (sm->p_subn->mgroups[i] || sm->mlids_req[i])\r
+ if (sm->p_subn->mboxes[i] || sm->mlids_req[i])\r
mcast_mgr_process_mlid(sm, i + IB_LID_MCAST_START_HO);\r
\r
memset(sm->mlids_req, 0, sm->mlids_req_max);\r
if (alloc_mfts(sm)) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"ERR 0A09: alloc_mfts failed\n");\r
+ ret = -1;\r
goto exit;\r
}\r
\r
#include <iba/ib_types.h>\r
#include <opensm/osm_mcast_tbl.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcast_tbl_init(IN osm_mcast_tbl_t * p_tbl, IN uint8_t num_ports,\r
IN uint16_t capacity)\r
{\r
IB_MCAST_BLOCK_SIZE) - 1);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcast_tbl_destroy(IN osm_mcast_tbl_t * p_tbl)\r
{\r
free(p_tbl->p_mask_tbl);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcast_tbl_set(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho,\r
IN uint8_t port)\r
{\r
p_tbl->max_block_in_use = (uint16_t) block_num;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN unsigned mlid_offset)\r
{\r
size_t mft_depth, size;\r
- uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX];\r
+ uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX + 1];\r
\r
if (mlid_offset < p_tbl->mft_depth)\r
goto done;\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,\r
IN uint16_t mlid_ho, IN uint8_t port_num)\r
{\r
return FALSE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,\r
IN uint16_t mlid_ho)\r
{\r
return (result != 0);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_mcast_tbl_set_block(IN osm_mcast_tbl_t * p_tbl,\r
IN const ib_net16_t * p_block,\r
IN int16_t block_num,\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)\r
{\r
- uint8_t i;\r
unsigned mlid_offset;\r
\r
CL_ASSERT(p_tbl);\r
\r
mlid_offset = mlid_ho - IB_LID_MCAST_START_HO;\r
if (p_tbl->p_mask_tbl && mlid_offset < p_tbl->mft_depth)\r
- for (i = 0; i <= p_tbl->max_position; i++)\r
- (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0;\r
+ memset((uint8_t *)p_tbl->p_mask_tbl + mlid_offset * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8,\r
+ 0,\r
+ (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_mcast_tbl_get_block(IN osm_mcast_tbl_t * p_tbl,\r
IN int16_t block_num, IN uint8_t position,\r
OUT ib_net16_t * p_block)\r
#include <opensm/osm_mcm_port.h>\r
#include <opensm/osm_multicast.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_mcm_port_t *osm_mcm_port_new(IN osm_port_t *port, IN osm_mgrp_t *mgrp,\r
IN ib_member_rec_t *mcmr, IN boolean_t proxy)\r
{\r
p_mcm->proxy_join = proxy;\r
}\r
\r
- return (p_mcm);\r
+ return p_mcm;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcm_port_delete(IN osm_mcm_port_t * p_mcm)\r
{\r
CL_ASSERT(p_mcm);\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
free(p_mtn);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
#if 0\r
static void mtree_dump(IN osm_mtree_node_t * p_mtn)\r
{\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <opensm/osm_inform.h>\r
#include <opensm/osm_opensm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-void osm_mgrp_delete(IN osm_mgrp_t * p_mgrp)\r
+static osm_mgrp_box_t *mgrp_box_new(uint16_t mlid)\r
+{\r
+ osm_mgrp_box_t *mbox = malloc(sizeof(*mbox));\r
+ if (!mbox)\r
+ return NULL;\r
+\r
+ memset(mbox, 0, sizeof(*mbox));\r
+ mbox->mlid = mlid;\r
+ cl_qlist_init(&mbox->mgrp_list);\r
+\r
+ return mbox;\r
+}\r
+\r
+void mgrp_box_delete(osm_mgrp_box_t *mbox)\r
+{\r
+ osm_mtree_destroy(mbox->root);\r
+ free(mbox);\r
+}\r
+\r
+void mgrp_delete(IN osm_mgrp_t * p_mgrp)\r
{\r
osm_mcm_port_t *p_mcm_port;\r
osm_mcm_port_t *p_next_mcm_port;\r
(osm_mcm_port_t *) cl_qmap_next(&p_mcm_port->map_item);\r
osm_mcm_port_delete(p_mcm_port);\r
}\r
- /* destroy the mtree_node structure */\r
- osm_mtree_destroy(p_mgrp->p_root);\r
\r
free(p_mgrp);\r
}\r
\r
-osm_mgrp_t *osm_mgrp_new(IN ib_net16_t mlid, IN ib_member_rec_t * mcmr)\r
+void osm_mgrp_box_delete(osm_mgrp_box_t *mbox)\r
+{\r
+ osm_mgrp_t *mgrp=NULL;\r
+ while(cl_qlist_count(&mbox->mgrp_list)) {\r
+ mgrp = cl_item_obj(cl_qlist_remove_head(&mbox->mgrp_list),\r
+ mgrp, list_item);\r
+ mgrp_delete(mgrp);\r
+ }\r
+ mgrp_box_delete(mbox);\r
+}\r
+\r
+osm_mgrp_t *osm_mgrp_new(IN osm_subn_t * subn, IN ib_net16_t mlid,\r
+ IN ib_member_rec_t * mcmr)\r
{\r
osm_mgrp_t *p_mgrp;\r
+ osm_mgrp_box_t *mbox;\r
\r
p_mgrp = (osm_mgrp_t *) malloc(sizeof(*p_mgrp));\r
if (!p_mgrp)\r
p_mgrp->mlid = mlid;\r
p_mgrp->mcmember_rec = *mcmr;\r
\r
+ mbox = osm_get_mbox_by_mlid(subn, p_mgrp->mlid);\r
+ if (!mbox && !(mbox = mgrp_box_new(cl_ntoh16(p_mgrp->mlid)))) {\r
+ free(p_mgrp);\r
+ return NULL;\r
+ }\r
+\r
+ cl_qlist_insert_tail(&mbox->mgrp_list, &p_mgrp->list_item);\r
+ subn->mboxes[mbox->mlid - IB_LID_MCAST_START_HO] = mbox;\r
+\r
+ cl_fmap_insert(&subn->mgrp_mgid_tbl, &p_mgrp->mcmember_rec.mgid,\r
+ &p_mgrp->map_item);\r
+\r
return p_mgrp;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mgrp_cleanup(osm_subn_t * subn, osm_mgrp_t * mgrp)\r
{\r
+ osm_mgrp_box_t *mbox;\r
osm_mcm_port_t *mcm_port;\r
\r
if (mgrp->full_members)\r
return;\r
\r
- osm_mtree_destroy(mgrp->p_root);\r
- mgrp->p_root = NULL;\r
-\r
while (cl_qmap_count(&mgrp->mcm_port_tbl)) {\r
mcm_port = (osm_mcm_port_t *)cl_qmap_head(&mgrp->mcm_port_tbl);\r
cl_qmap_remove_item(&mgrp->mcm_port_tbl, &mcm_port->map_item);\r
return;\r
\r
cl_fmap_remove_item(&subn->mgrp_mgid_tbl, &mgrp->map_item);\r
- subn->mgroups[cl_ntoh16(mgrp->mlid) - IB_LID_MCAST_START_HO] = NULL;\r
+\r
+ mbox = osm_get_mbox_by_mlid(subn, mgrp->mlid);\r
+ cl_qlist_remove_item(&mbox->mgrp_list, &mgrp->list_item);\r
+ if (cl_is_qlist_empty(&mbox->mgrp_list)) {\r
+ subn->mboxes[cl_ntoh16(mgrp->mlid) - IB_LID_MCAST_START_HO] = NULL;\r
+ mgrp_box_delete(mbox);\r
+ }\r
free(mgrp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mgrp_send_notice(osm_subn_t * subn, osm_log_t * log,\r
osm_mgrp_t * mgrp, unsigned num)\r
{\r
ib_get_err_str(status));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_mcm_port_t *osm_mgrp_add_port(IN osm_subn_t * subn, osm_log_t * log,\r
IN osm_mgrp_t * mgrp, osm_port_t *port,\r
IN ib_member_rec_t *mcmr, IN boolean_t proxy)\r
++mgrp->full_members == 1)\r
mgrp_send_notice(subn, log, mgrp, 66);\r
\r
+ subn->p_osm->sa.dirty = TRUE;\r
return mcm_port;\r
}\r
\r
mgrp_send_notice(subn, log, mgrp, 67);\r
osm_mgrp_cleanup(subn, mgrp);\r
}\r
+\r
+ subn->p_osm->sa.dirty = TRUE;\r
}\r
\r
void osm_mgrp_delete_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * mgrp,\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_mcm_port_t *osm_mgrp_get_mcm_port(IN const osm_mgrp_t * p_mgrp,\r
IN ib_net64_t port_guid)\r
{\r
#include <opensm/osm_node.h>\r
#include <opensm/osm_madw.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_node_init_physp(IN osm_node_t * p_node, uint8_t port_num,\r
IN const osm_madw_t * p_madw)\r
{\r
p_smp->hop_count, p_smp->initial_path);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_node_t *osm_node_new(IN const osm_madw_t * p_madw)\r
{\r
osm_node_t *p_node;\r
p_madw);\r
p_node->print_desc = strdup(OSM_NODE_DESC_UNKNOWN);\r
\r
- return (p_node);\r
+ return p_node;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void node_destroy(IN osm_node_t * p_node)\r
{\r
uint16_t i;\r
osm_physp_destroy(&p_node->physp_table[i]);\r
\r
/* cleanup printable node_desc field */\r
- if (p_node->print_desc) {\r
+ if (p_node->print_desc)\r
free(p_node->print_desc);\r
- }\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_node_delete(IN OUT osm_node_t ** p_node)\r
{\r
CL_ASSERT(p_node && *p_node);\r
*p_node = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_node_link(IN osm_node_t * p_node, IN uint8_t port_num,\r
IN osm_node_t * p_remote_node, IN uint8_t remote_port_num)\r
{\r
osm_physp_link(p_physp, p_remote_physp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_node_unlink(IN osm_node_t * p_node, IN uint8_t port_num,\r
IN osm_node_t * p_remote_node, IN uint8_t remote_port_num)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_node_link_exists(IN osm_node_t * p_node, IN uint8_t port_num,\r
IN osm_node_t * p_remote_node,\r
IN uint8_t remote_port_num)\r
p_physp = osm_node_get_physp_ptr(p_node, port_num);\r
p_remote_physp = osm_node_get_physp_ptr(p_remote_node, remote_port_num);\r
\r
- return (osm_physp_link_exists(p_physp, p_remote_physp));\r
+ return osm_physp_link_exists(p_physp, p_remote_physp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_node_link_has_valid_ports(IN osm_node_t * p_node,\r
IN uint8_t port_num,\r
IN osm_node_t * p_remote_node,\r
return (p_physp && p_remote_physp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_node_has_any_link(IN osm_node_t * p_node, IN uint8_t port_num)\r
{\r
osm_physp_t *p_physp;\r
CL_ASSERT(port_num < p_node->physp_tbl_size);\r
p_physp = osm_node_get_physp_ptr(p_node, port_num);\r
- return (osm_physp_has_any_link(p_physp));\r
+ return osm_physp_has_any_link(p_physp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_node_t *osm_node_get_remote_node(IN osm_node_t * p_node,\r
IN uint8_t port_num,\r
OUT uint8_t * p_remote_port_num)\r
p_physp = osm_node_get_physp_ptr(p_node, port_num);\r
\r
if (!p_physp || !osm_physp_has_any_link(p_physp))\r
- return (NULL);\r
+ return NULL;\r
\r
p_remote_physp = osm_physp_get_remote(p_physp);\r
if (p_remote_port_num)\r
*p_remote_port_num = osm_physp_get_port_num(p_remote_physp);\r
\r
- return (osm_physp_get_node_ptr(p_remote_physp));\r
+ return osm_physp_get_node_ptr(p_remote_physp);\r
}\r
\r
/**********************************************************************\r
p_physp = osm_node_get_physp_ptr(p_node, port_num);\r
if (p_physp) {\r
p_remote_physp = osm_physp_get_remote(p_physp);\r
- return (osm_physp_get_base_lid(p_remote_physp));\r
+ return osm_physp_get_base_lid(p_remote_physp);\r
}\r
\r
- return (0);\r
+ return 0;\r
}\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <opensm/osm_opensm.h>\r
#include <opensm/osm_subnet.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void nd_rcv_process_nd(IN osm_sm_t * sm, IN osm_node_t * p_node,\r
IN const ib_node_desc_t * p_nd)\r
{\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_nd_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
(2 nodes have the same guid) or a 12x link with lane reversal\r
that is not configured correctly.\r
We will try to recover by querying NodeInfo again.\r
- In order to catch even fast port moving to new location(s) and\r
- back we will count up to 5.\r
- Some crazy reconnections (newly created switch loop right before\r
- targeted CA) will not be catched this way. So in worst case -\r
- report GUID duplication and request new discovery.\r
- When switch node is targeted NodeInfo querying will be done in\r
- opposite order, this is much stronger check, unfortunately it is\r
- impossible with CAs.\r
+ In order to catch even fast port moving to new location(s)\r
+ and back we will count up to 5.\r
+ Some crazy reconnections (newly created switch loop right\r
+ before targeted CA) will not be catched this way. So in worst\r
+ case - report GUID duplication and request new discovery.\r
+ When switch node is targeted NodeInfo querying will be done\r
+ in opposite order, this is much stronger check, unfortunately\r
+ it is impossible with CAs.\r
*/\r
p_physp = osm_node_get_physp_ptr(p_node, port_num);\r
if (p_ni_context->dup_count > 5) {\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
-**********************************************************************/\r
static void ni_rcv_get_port_info(IN osm_sm_t * sm, IN osm_node_t * node,\r
IN const osm_madw_t * madw)\r
{\r
}\r
\r
/* If we are a master, then this means the port is new on the subnet.\r
- Mark it as new - need to send trap 64 on these ports.\r
+ Mark it as new - need to send trap 64 for these ports.\r
The condition that we are master is true, since if we are in discovering\r
state (meaning we woke up from standby or we are just initializing),\r
then these ports may be new to us, but are not new on the subnet.\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void ni_rcv_process_switch(IN osm_sm_t * sm, IN osm_node_t * p_node,\r
IN const osm_madw_t * p_madw)\r
{\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_ni_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
{NULL, NULL}\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *osm_routing_engine_type_str(IN osm_routing_engine_type_t type)\r
{\r
switch (type) {\r
return "unknown";\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_routing_engine_type_t osm_routing_engine_type(IN const char *str)\r
{\r
/* For legacy reasons, consider a NULL pointer and the string\r
return OSM_ROUTING_ENGINE_TYPE_UNKNOWN;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void append_routing_engine(osm_opensm_t *osm,\r
struct osm_routing_engine *routing_engine)\r
{\r
setup_routing_engine(osm, "minhop");\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_opensm_construct(IN osm_opensm_t * p_osm)\r
{\r
memset(p_osm, 0, sizeof(*p_osm));\r
osm_log_construct(&p_osm->log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void destroy_routing_engines(osm_opensm_t *osm)\r
{\r
struct osm_routing_engine *r, *next;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void destroy_plugins(osm_opensm_t *osm)\r
{\r
osm_epi_plugin_t *p;\r
free(p_names);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_opensm_init(IN osm_opensm_t * p_osm,\r
IN const osm_subn_opt_t * p_opt)\r
{\r
p_opt->log_flags, p_opt->log_file,\r
p_opt->log_max_size, p_opt->accum_log_file);\r
if (status != IB_SUCCESS)\r
- return (status);\r
+ return status;\r
+ p_osm->log.log_prefix = p_opt->log_prefix;\r
\r
/* If there is a log level defined - add the OSM_VERSION to it */\r
osm_log(&p_osm->log,\r
\r
Exit:\r
OSM_LOG(&p_osm->log, OSM_LOG_FUNCS, "]\n"); /* Format Waived */\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_opensm_bind(IN osm_opensm_t * p_osm, IN ib_net64_t guid)\r
{\r
ib_api_status_t status;\r
\r
Exit:\r
OSM_LOG_EXIT(&p_osm->log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_opensm_report_event(osm_opensm_t *osm, osm_epi_event_id_t event_id,\r
void *event_data)\r
{\r
\r
Exit:\r
OSM_LOG_EXIT(pm->log);\r
- return (status);\r
+ return status;\r
}\r
\r
/**********************************************************************\r
}\r
\r
OSM_LOG_EXIT(perfmgr->log);\r
- return (status);\r
+ return status;\r
}\r
\r
/**********************************************************************\r
cl_timer_start(&pm->sweep_timer, pm->sweep_time_s * 1000);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_perfmgr_shutdown(osm_perfmgr_t * pm)\r
{\r
OSM_LOG_ENTER(pm->log);\r
OSM_LOG_EXIT(pm->log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_perfmgr_destroy(osm_perfmgr_t * pm)\r
{\r
OSM_LOG_ENTER(pm->log);\r
/*\r
- * Copyright (c) 2008 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2008-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2007 The Regents of the University of California.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
{\r
perfmgr_db_t *db = malloc(sizeof(*db));\r
if (!db)\r
- return (NULL);\r
+ return NULL;\r
\r
cl_qmap_init(&db->pc_data);\r
cl_plock_construct(&db->lock);\r
cl_plock_init(&db->lock);\r
db->perfmgr = perfmgr;\r
- return ((void *)db);\r
+ return db;\r
}\r
\r
/** =========================================================================\r
const cl_map_item_t *end = cl_qmap_end(&db->pc_data);\r
\r
if (rc == end)\r
- return (NULL);\r
- return ((db_node_t *) rc);\r
+ return NULL;\r
+ return (db_node_t *) rc;\r
}\r
\r
static inline perfmgr_db_err_t bad_node_port(db_node_t * node, uint8_t port)\r
{\r
if (!node)\r
- return (PERFMGR_EVENT_DB_GUIDNOTFOUND);\r
+ return PERFMGR_EVENT_DB_GUIDNOTFOUND;\r
if (port >= node->num_ports || (!node->esp0 && port == 0))\r
- return (PERFMGR_EVENT_DB_PORTNOTFOUND);\r
- return (PERFMGR_EVENT_DB_SUCCESS);\r
+ return PERFMGR_EVENT_DB_PORTNOTFOUND;\r
+ return PERFMGR_EVENT_DB_SUCCESS;\r
}\r
\r
/** =========================================================================\r
time_t cur_time = 0;\r
db_node_t *rc = malloc(sizeof(*rc));\r
if (!rc)\r
- return (NULL);\r
+ return NULL;\r
\r
rc->ports = calloc(num_ports, sizeof(db_port_t));\r
if (!rc->ports)\r
}\r
snprintf(rc->node_name, sizeof(rc->node_name), "%s", name);\r
\r
- return (rc);\r
+ return rc;\r
\r
free_rc:\r
free(rc);\r
- return (NULL);\r
+ return NULL;\r
}\r
\r
/** =========================================================================\r
(cl_map_item_t *) node);\r
\r
if ((void *)rc != (void *)node)\r
- return (PERFMGR_EVENT_DB_FAIL);\r
- return (PERFMGR_EVENT_DB_SUCCESS);\r
+ return PERFMGR_EVENT_DB_FAIL;\r
+ return PERFMGR_EVENT_DB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
perfmgr_db_err_t\r
perfmgr_db_create_entry(perfmgr_db_t * db, uint64_t guid, boolean_t esp0,\r
uint8_t num_ports, char *name)\r
}\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
/**********************************************************************\r
\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
perfmgr_db_err_t perfmgr_db_get_prev_err(perfmgr_db_t * db, uint64_t guid,\r
\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
perfmgr_db_err_t\r
\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
static inline void\r
\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
perfmgr_db_err_t perfmgr_db_get_prev_dc(perfmgr_db_t * db, uint64_t guid,\r
\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
perfmgr_db_err_t\r
\r
Exit:\r
cl_plock_release(&db->lock);\r
- return (rc);\r
+ return rc;\r
}\r
\r
static void clear_counters(cl_map_item_t * const p_map_item, void *context)\r
perfmgr_db_dump_t dump_type;\r
} dump_context_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void db_dump(cl_map_item_t * const p_map_item, void *context)\r
{\r
db_node_t *node = (db_node_t *) p_map_item;\r
\r
context.fp = fopen(file, "w+");\r
if (!context.fp)\r
- return (PERFMGR_EVENT_DB_FAIL);\r
+ return PERFMGR_EVENT_DB_FAIL;\r
context.dump_type = dump_type;\r
\r
cl_plock_acquire(&db->lock);\r
cl_qmap_apply_func(&db->pc_data, db_dump, (void *)&context);\r
cl_plock_release(&db->lock);\r
fclose(context.fp);\r
- return (PERFMGR_EVENT_DB_SUCCESS);\r
+ return PERFMGR_EVENT_DB_SUCCESS;\r
}\r
\r
/**********************************************************************\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <opensm/osm_switch.h>\r
#include <opensm/osm_helper.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pkey_tbl_construct(IN osm_pkey_tbl_t * p_pkey_tbl)\r
{\r
cl_ptr_vector_construct(&p_pkey_tbl->blocks);\r
cl_map_construct(&p_pkey_tbl->keys);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pkey_tbl_destroy(IN osm_pkey_tbl_t * p_pkey_tbl)\r
{\r
ib_pkey_table_t *p_block;\r
cl_map_destroy(&p_pkey_tbl->keys);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_pkey_tbl_init(IN osm_pkey_tbl_t * p_pkey_tbl)\r
{\r
cl_ptr_vector_init(&p_pkey_tbl->blocks, 0, 1);\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pkey_tbl_init_new_blocks(IN const osm_pkey_tbl_t * p_pkey_tbl)\r
{\r
ib_pkey_table_t *p_block;\r
memset(p_block, 0, sizeof(*p_block));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pkey_tbl_cleanup_pending(IN osm_pkey_tbl_t * p_pkey_tbl)\r
{\r
cl_list_item_t *p_item;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_pkey_tbl_set(IN osm_pkey_tbl_t * p_pkey_tbl,\r
IN uint16_t block, IN ib_pkey_table_t * p_tbl)\r
{\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
Store the given pkey in the "new" blocks array.\r
Also, make sure the regular block exists.\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_pkey_find_next_free_entry(IN osm_pkey_tbl_t * p_pkey_tbl,\r
OUT uint16_t * p_block_idx,\r
OUT uint8_t * p_pkey_idx)\r
return FALSE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_pkey_tbl_get_block_and_idx(IN osm_pkey_tbl_t * p_pkey_tbl,\r
IN uint16_t * p_pkey,\r
OUT uint16_t * p_block_idx,\r
return IB_NOT_FOUND;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t match_pkey(IN const ib_net16_t * pkey1,\r
IN const ib_net16_t * pkey2)\r
{\r
\r
/* if both pkeys are not full member - this is not a match */\r
if (!(ib_pkey_is_full_member(*pkey1) || ib_pkey_is_full_member(*pkey2)))\r
- return (FALSE);\r
+ return FALSE;\r
\r
/* compare if the bases are the same. if they are - then\r
this is a match */\r
return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_physp_share_this_pkey(IN const osm_physp_t * p_physp1,\r
IN const osm_physp_t * p_physp2,\r
IN ib_net16_t pkey)\r
return (pkey1 && pkey2 && match_pkey(pkey1, pkey2));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_net16_t osm_physp_find_common_pkey(IN const osm_physp_t * p_physp1,\r
IN const osm_physp_t * p_physp2)\r
{\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_physp_share_pkey(IN osm_log_t * p_log,\r
IN const osm_physp_t * p_physp_1,\r
IN const osm_physp_t * p_physp_2)\r
(p_physp_1, p_physp_2));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_port_share_pkey(IN osm_log_t * p_log,\r
IN const osm_port_t * p_port_1,\r
IN const osm_port_t * p_port_2)\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_physp_has_pkey(IN osm_log_t * p_log, IN ib_net16_t pkey,\r
IN const osm_physp_t * p_physp)\r
{\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_partition.h>\r
#include <opensm/osm_opensm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
The max number of pkey blocks for a physical port is located in\r
a different place for switch external ports (SwitchInfo) and the\r
return ((num_pkeys + 31) / 32);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* Insert new pending pkey entry to the specific port pkey table\r
* pending pkeys. New entries are inserted at the back.\r
&p_pending->index) !=\r
IB_SUCCESS) {\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0503: "\r
- "Failed to obtain P_Key 0x%04x block and index for node "\r
- "0x%016" PRIx64 " port %u\n",\r
+ "Failed to obtain P_Key 0x%04x block and index "\r
+ "for node 0x%016" PRIx64 " port %u\n",\r
cl_ntoh16(ib_pkey_get_base(pkey)),\r
cl_ntoh64(osm_node_get_node_guid(p_node)),\r
osm_physp_get_port_num(p_physp));\r
osm_physp_get_port_num(p_physp));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void\r
pkey_mgr_process_partition_table(osm_log_t * p_log, osm_sm_t * sm,\r
const osm_prtn_t * p_prtn,\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
pkey_mgr_update_pkey_entry(IN osm_sm_t * sm,\r
IN const osm_physp_t * p_physp,\r
cl_hton32(attr_mod), CL_DISP_MSGID_NONE, &context);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
pkey_mgr_enforce_partition(IN osm_log_t * p_log, osm_sm_t * sm,\r
IN osm_physp_t * p_physp, IN const boolean_t enforce)\r
if ((p_pi->vl_enforce & 0xc) == (0xc) * (enforce == TRUE)) {\r
OSM_LOG(p_log, OSM_LOG_DEBUG,\r
"No need to update PortInfo for "\r
- "node 0x%016" PRIx64 " port %u\n",\r
+ "node 0x%016" PRIx64 " port %u (%s)\n",\r
cl_ntoh64(osm_node_get_node_guid\r
(osm_physp_get_node_ptr(p_physp))),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
return IB_SUCCESS;\r
}\r
\r
- memset(payload, 0, IB_SMP_DATA_SIZE);\r
memcpy(payload, p_pi, sizeof(ib_port_info_t));\r
+ memset(payload + sizeof(ib_port_info_t), 0,\r
+ IB_SMP_DATA_SIZE - sizeof(ib_port_info_t));\r
\r
p_pi = (ib_port_info_t *) payload;\r
if (enforce == TRUE)\r
if (status != IB_SUCCESS)\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0511: "\r
"Failed to set PortInfo for "\r
- "node 0x%016" PRIx64 " port %u\n",\r
+ "node 0x%016" PRIx64 " port %u (%s)\n",\r
cl_ntoh64(osm_node_get_node_guid\r
(osm_physp_get_node_ptr(p_physp))),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
else\r
OSM_LOG(p_log, OSM_LOG_DEBUG,\r
- "Set PortInfo for node 0x%016" PRIx64 " port %u\n",\r
+ "Set PortInfo for node 0x%016" PRIx64 " port %u (%s)\n",\r
cl_ntoh64(osm_node_get_node_guid\r
(osm_physp_get_node_ptr(p_physp))),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int pkey_mgr_update_port(osm_log_t * p_log, osm_sm_t * sm,\r
const osm_port_t * const p_port)\r
{\r
if (p_pkey_tbl->max_blocks > max_num_of_blocks) {\r
OSM_LOG(p_log, OSM_LOG_INFO,\r
"Max number of blocks reduced from %u to %u "\r
- "for node 0x%016" PRIx64 " port %u\n",\r
+ "for node 0x%016" PRIx64 " port %u (%s)\n",\r
p_pkey_tbl->max_blocks, max_num_of_blocks,\r
cl_ntoh64(osm_node_get_node_guid(p_node)),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
}\r
p_pkey_tbl->max_blocks = max_num_of_blocks;\r
\r
if (!found) {\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0504: "\r
"Failed to find empty space for new pkey 0x%04x "\r
- "for node 0x%016" PRIx64 " port %u\n",\r
+ "for node 0x%016" PRIx64 " port %u (%s)\n",\r
cl_ntoh16(p_pending->pkey),\r
cl_ntoh64(osm_node_get_node_guid\r
(p_node)),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
} else {\r
block_index = last_free_block_index;\r
pkey_index = last_free_pkey_index++;\r
p_pending->pkey)) {\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0505: "\r
"Failed to set PKey 0x%04x in block %u idx %u "\r
- "for node 0x%016" PRIx64 " port %u\n",\r
+ "for node 0x%016" PRIx64 " port %u (%s)\n",\r
cl_ntoh16(p_pending->pkey), block_index,\r
pkey_index,\r
cl_ntoh64(osm_node_get_node_guid\r
(p_node)),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
}\r
}\r
\r
if (status == IB_SUCCESS)\r
OSM_LOG(p_log, OSM_LOG_DEBUG,\r
"Updated pkey table block %d for node 0x%016"\r
- PRIx64 " port %u\n", block_index,\r
+ PRIx64 " port %u (%s)\n", block_index,\r
cl_ntoh64(osm_node_get_node_guid(p_node)),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
else {\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0506: "\r
"pkey_mgr_update_pkey_entry() failed to update "\r
"pkey table block %d for node 0x%016" PRIx64\r
- " port %u\n", block_index,\r
+ " port %u (%s)\n", block_index,\r
cl_ntoh64(osm_node_get_node_guid(p_node)),\r
- osm_physp_get_port_num(p_physp));\r
+ osm_physp_get_port_num(p_physp),\r
+ p_physp->p_node->print_desc);\r
ret = -1;\r
}\r
}\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int pkey_mgr_update_peer_port(osm_log_t * p_log, osm_sm_t * sm,\r
const osm_subn_t * p_subn,\r
const osm_port_t * const p_port,\r
if (peer_max_blocks < p_pkey_tbl->used_blocks) {\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0508: "\r
"Not enough pkey entries (%u < %u) on switch 0x%016"\r
- PRIx64 " port %u. Clearing Enforcement bit\n",\r
+ PRIx64 " port %u (%s). Clearing Enforcement bit\n",\r
peer_max_blocks, num_of_blocks,\r
cl_ntoh64(osm_node_get_node_guid(p_node)),\r
- osm_physp_get_port_num(peer));\r
+ osm_physp_get_port_num(peer),\r
+ p_node->print_desc);\r
enforce = FALSE;\r
ret = -1;\r
}\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0509: "\r
"pkey_mgr_update_pkey_entry() failed to update "\r
"pkey table block %d for node 0x%016"\r
- PRIx64 " port %u\n", block_index,\r
+ PRIx64 " port %u (%s)\n", block_index,\r
cl_ntoh64(osm_node_get_node_guid\r
(p_node)),\r
- osm_physp_get_port_num(peer));\r
+ osm_physp_get_port_num(peer),\r
+ p_node->print_desc);\r
ret = -1;\r
}\r
}\r
if (!ret)\r
OSM_LOG(p_log, OSM_LOG_DEBUG,\r
"Pkey table was updated for node 0x%016" PRIx64\r
- " port %u\n",\r
+ " port %u (%s)\n",\r
cl_ntoh64(osm_node_get_node_guid(p_node)),\r
- osm_physp_get_port_num(peer));\r
+ osm_physp_get_port_num(peer), p_node->print_desc);\r
\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)\r
{\r
cl_qmap_t *p_tbl;\r
#include <opensm/osm_helper.h>\r
#include <opensm/osm_sm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* WE ONLY RECEIVE GET or SET responses\r
*/\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 4806: "\r
"No port object for port with GUID 0x%" PRIx64\r
"\n\t\t\t\tfor parent node GUID 0x%" PRIx64\r
- ", TID 0x%" PRIx64 "\n",\r
- cl_ntoh64(port_guid),\r
+ ", TID 0x%" PRIx64 "\n", cl_ntoh64(port_guid),\r
cl_ntoh64(node_guid), cl_ntoh64(p_smp->trans_id));\r
goto Exit;\r
}\r
#include <opensm/osm_madw.h>\r
#include <opensm/osm_switch.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_physp_construct(IN osm_physp_t * p_physp)\r
{\r
memset(p_physp, 0, sizeof(*p_physp));\r
osm_pkey_tbl_construct(&p_physp->pkeys);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_physp_destroy(IN osm_physp_t * p_physp)\r
{\r
size_t num_slvl, i;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_physp_init(IN osm_physp_t * p_physp, IN ib_net64_t port_guid,\r
IN uint8_t port_num, IN const struct osm_node *p_node,\r
IN osm_bind_handle_t h_bind, IN uint8_t hop_count,\r
osm_pkey_tbl_init(&p_physp->pkeys);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_port_delete(IN OUT osm_port_t ** pp_port)\r
{\r
free(*pp_port);\r
*pp_port = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_port_t *osm_port_new(IN const ib_node_info_t * p_ni,\r
IN osm_node_t * p_parent_node)\r
{\r
return p_port;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_port_get_lid_range_ho(IN const osm_port_t * p_port,\r
IN uint16_t * p_min_lid, IN uint16_t * p_max_lid)\r
{\r
*p_max_lid = (uint16_t) (*p_min_lid + (1 << lmc) - 1);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
uint8_t osm_physp_calc_link_mtu(IN osm_log_t * p_log,\r
IN const osm_physp_t * p_physp)\r
{\r
return mtu;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
uint8_t osm_physp_calc_link_op_vls(IN osm_log_t * p_log,\r
IN const osm_subn_t * p_subn,\r
IN const osm_physp_t * p_physp)\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void physp_update_new_dr_path(IN osm_physp_t const *p_dest_physp,\r
IN cl_map_t * p_visited_map,\r
IN osm_bind_handle_t * h_bind)\r
cl_list_destroy(&tmpPortsList);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_physp_replace_dr_path_with_alternate_dr_path(IN osm_log_t * p_log,\r
IN osm_subn_t const\r
*p_subn, IN osm_physp_t const\r
cl_map_destroy(&visited_map);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_link_is_healthy(IN const osm_physp_t * p_physp)\r
{\r
osm_physp_t *p_remote_physp;\r
return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_physp_set_pkey_tbl(IN osm_log_t * p_log, IN const osm_subn_t * p_subn,\r
IN osm_physp_t * p_physp,\r
IN ib_pkey_table_t * p_pkey_tbl,\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
#endif /* HAVE_CONFIG_H */\r
\r
#include <string.h>\r
+#include <stdlib.h>\r
#include <iba/ib_types.h>\r
#include <complib/cl_qmap.h>\r
#include <complib/cl_passivelock.h>\r
#include <opensm/osm_opensm.h>\r
#include <opensm/osm_ucast_mgr.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pi_rcv_check_and_fix_lid(osm_log_t * log, ib_port_info_t * pi,\r
osm_physp_t * p)\r
{\r
if (cl_ntoh16(pi->base_lid) > IB_LID_UCAST_END_HO) {\r
OSM_LOG(log, OSM_LOG_ERROR, "ERR 0F04: "\r
"Got invalid base LID %u from the network. "\r
- "Corrected to %u.\n", cl_ntoh16(pi->base_lid),\r
+ "Corrected to %u\n", cl_ntoh16(pi->base_lid),\r
cl_ntoh16(p->port_info.base_lid));\r
pi->base_lid = p->port_info.base_lid;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pi_rcv_process_endport(IN osm_sm_t * sm, IN osm_physp_t * p_physp,\r
IN const ib_port_info_t * p_pi)\r
{\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pi_rcv_process_ca_or_router_port(IN osm_sm_t * sm,\r
IN osm_node_t * p_node,\r
IN osm_physp_t * p_physp,\r
}\r
\r
#define IBM_VENDOR_ID (0x5076)\r
-/**********************************************************************\r
- **********************************************************************/\r
static void get_pkey_table(IN osm_log_t * p_log, IN osm_sm_t * sm,\r
IN osm_node_t * p_node, IN osm_physp_t * p_physp)\r
{\r
port_num = p_physp->port_num;\r
\r
if (!p_node->sw || port_num == 0)\r
- /* The maximum blocks is defined by the node info partition cap for CA,\r
- router, and switch management ports. */\r
+ /* The maximum blocks is defined by the node info partition cap\r
+ for CA, router, and switch management ports. */\r
max_blocks =\r
(cl_ntoh16(p_node->node_info.partition_cap) +\r
IB_NUM_PKEY_ELEMENTS_IN_BLOCK - 1)\r
OSM_LOG_EXIT(p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pi_rcv_get_pkey_slvl_vla_tables(IN osm_sm_t * sm,\r
IN osm_node_t * p_node,\r
IN osm_physp_t * p_physp)\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pi_rcv_process_set(IN osm_sm_t * sm, IN osm_node_t * p_node,\r
IN uint8_t port_num, IN osm_madw_t * p_madw)\r
{\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pi_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
p_item = cl_qmap_next(p_item);\r
if (!type || osm_node_get_type(p_port->p_node) == type) {\r
status = osm_prtn_add_port(p_log, p_subn, p,\r
- osm_port_get_guid(p_port), full);\r
+ osm_port_get_guid(p_port),\r
+ full);\r
if (status != IB_SUCCESS)\r
goto _err;\r
}\r
cl_ntoh16(pkey));\r
if (p_mgrp) {\r
p_mgrp->well_known = TRUE;\r
- p->mlid = p_mgrp->mlid;\r
+ p->mgrp = p_mgrp;\r
}\r
\r
/* workaround for TS */\r
&p_mgrp);\r
if (p_mgrp) {\r
p_mgrp->well_known = TRUE;\r
- if (!p->mlid)\r
- p->mlid = p_mgrp->mlid;\r
+ if (!p->mgrp)\r
+ p->mgrp = p_mgrp;\r
}\r
\r
return status;\r
/*\r
* Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
osm_madw_context_t context;\r
uint32_t attr_mod;\r
unsigned vl_mask, i;\r
+ ib_api_status_t status;\r
\r
vl_mask = (1 << (ib_port_info_get_op_vls(&p->port_info) - 1)) - 1;\r
\r
context.vla_context.set_method = TRUE;\r
attr_mod = ((block_num + 1) << 16) | port_num;\r
\r
- return osm_req_set(sm, osm_physp_get_dr_path_ptr(p),\r
- (uint8_t *) & block, sizeof(block),\r
- IB_MAD_ATTR_VL_ARBITRATION, cl_hton32(attr_mod),\r
- CL_DISP_MSGID_NONE, &context);\r
+ status = osm_req_set(sm, osm_physp_get_dr_path_ptr(p),\r
+ (uint8_t *) & block, sizeof(block),\r
+ IB_MAD_ATTR_VL_ARBITRATION, cl_hton32(attr_mod),\r
+ CL_DISP_MSGID_NONE, &context);\r
+ if (status != IB_SUCCESS)\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 6202 : "\r
+ "failed to update VLArbitration tables "\r
+ "for port %" PRIx64 " block %u\n",\r
+ cl_ntoh64(p->port_guid), block_num);\r
+\r
+ return status;\r
}\r
\r
static ib_api_status_t vlarb_update(osm_sm_t * sm, osm_physp_t * p,\r
}\r
\r
static ib_api_status_t sl2vl_update_table(osm_sm_t * sm, osm_physp_t * p,\r
- uint8_t in_port, uint8_t out_port,\r
+ uint8_t in_port, uint32_t attr_mod,\r
unsigned force_update,\r
const ib_slvl_table_t * sl2vl_table)\r
{\r
osm_madw_context_t context;\r
ib_slvl_table_t tbl, *p_tbl;\r
osm_node_t *p_node = osm_physp_get_node_ptr(p);\r
- uint32_t attr_mod;\r
+ ib_api_status_t status;\r
unsigned vl_mask;\r
uint8_t vl1, vl2;\r
int i;\r
context.slvl_context.node_guid = osm_node_get_node_guid(p_node);\r
context.slvl_context.port_guid = osm_physp_get_port_guid(p);\r
context.slvl_context.set_method = TRUE;\r
- attr_mod = in_port << 8 | out_port;\r
- return osm_req_set(sm, osm_physp_get_dr_path_ptr(p),\r
- (uint8_t *) & tbl, sizeof(tbl),\r
- IB_MAD_ATTR_SLVL_TABLE, cl_hton32(attr_mod),\r
- CL_DISP_MSGID_NONE, &context);\r
+ status = osm_req_set(sm, osm_physp_get_dr_path_ptr(p),\r
+ (uint8_t *) & tbl, sizeof(tbl),\r
+ IB_MAD_ATTR_SLVL_TABLE, cl_hton32(attr_mod),\r
+ CL_DISP_MSGID_NONE, &context);\r
+ if (status != IB_SUCCESS)\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 6203 : "\r
+ "failed to update SL2VLMapping tables "\r
+ "for port %" PRIx64 ", attr_mod 0x%x\n",\r
+ cl_ntoh64(p->port_guid), attr_mod);\r
+ return status;\r
}\r
\r
-static ib_api_status_t sl2vl_update(osm_sm_t * sm, osm_port_t * p_port,\r
- osm_physp_t * p, uint8_t port_num,\r
- unsigned force_update,\r
- const struct qos_config *qcfg)\r
+static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node,\r
+ const struct qos_config *qcfg)\r
{\r
- ib_api_status_t status;\r
- uint8_t i, num_ports;\r
- osm_physp_t *p_physp;\r
-\r
- if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH) {\r
- if (ib_port_info_get_vl_cap(&p->port_info) == 1) {\r
- /* Check port 0's capability mask */\r
- p_physp = p_port->p_physp;\r
- if (!\r
- (p_physp->port_info.\r
- capability_mask & IB_PORT_CAP_HAS_SL_MAP))\r
- return IB_SUCCESS;\r
- }\r
- num_ports = osm_node_get_num_physp(osm_physp_get_node_ptr(p));\r
- } else {\r
- if (!(p->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP))\r
- return IB_SUCCESS;\r
- num_ports = 1;\r
+ osm_physp_t *p0, *p;\r
+ unsigned force_update;\r
+ unsigned num_ports = osm_node_get_num_physp(node);\r
+ int ret = 0;\r
+ unsigned i, j;\r
+\r
+ for (i = 1; i < num_ports; i++) {\r
+ p = osm_node_get_physp_ptr(node, i);\r
+ force_update = p->need_update || sm->p_subn->need_update;\r
+ p->vl_high_limit = qcfg->vl_high_limit;\r
+ if (vlarb_update(sm, p, p->port_num, force_update, qcfg))\r
+ ret = -1;\r
}\r
\r
- for (i = 0; i < num_ports; i++) {\r
- status = sl2vl_update_table(sm, p, i, port_num, force_update,\r
- &qcfg->sl2vl);\r
- if (status != IB_SUCCESS)\r
- return status;\r
+ p0 = osm_node_get_physp_ptr(node, 0);\r
+ if (!(p0->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP))\r
+ return ret;\r
+\r
+ if (ib_switch_info_get_opt_sl2vlmapping(&node->sw->switch_info) &&\r
+ sm->p_subn->opt.use_optimized_slvl) {\r
+ p = osm_node_get_physp_ptr(node, 1);\r
+ force_update = p->need_update || sm->p_subn->need_update;\r
+ return sl2vl_update_table(sm, p, 1, 0x30000, force_update,\r
+ &qcfg->sl2vl);\r
}\r
\r
- return IB_SUCCESS;\r
+ for (i = 1; i < num_ports; i++) {\r
+ p = osm_node_get_physp_ptr(node, i);\r
+ force_update = p->need_update || sm->p_subn->need_update;\r
+ for (j = 0; j < num_ports; j++)\r
+ if (sl2vl_update_table(sm, p, i, i << 8 | j,\r
+ force_update, &qcfg->sl2vl))\r
+ ret = -1;\r
+ }\r
+\r
+ return ret;\r
}\r
\r
-static int qos_physp_setup(osm_log_t * p_log, osm_sm_t * sm,\r
- osm_port_t * p_port, osm_physp_t * p,\r
- uint8_t port_num, unsigned force_update,\r
- const struct qos_config *qcfg)\r
+static int qos_endport_setup(osm_sm_t * sm, osm_physp_t * p,\r
+ const struct qos_config *qcfg)\r
{\r
- ib_api_status_t status;\r
+ unsigned force_update = p->need_update || sm->p_subn->need_update;\r
\r
- /* OpVLs should be ok at this moment - just use it */\r
-\r
- /* setup VL high limit on the physp later to be updated by link mgr */\r
p->vl_high_limit = qcfg->vl_high_limit;\r
-\r
- /* setup VLArbitration */\r
- status = vlarb_update(sm, p, port_num, force_update, qcfg);\r
- if (status != IB_SUCCESS) {\r
- OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6202 : "\r
- "failed to update VLArbitration tables "\r
- "for port %" PRIx64 " #%d\n",\r
- cl_ntoh64(p->port_guid), port_num);\r
+ if (vlarb_update(sm, p, 0, force_update, qcfg))\r
return -1;\r
- }\r
\r
- /* setup SL2VL tables */\r
- status = sl2vl_update(sm, p_port, p, port_num, force_update, qcfg);\r
- if (status != IB_SUCCESS) {\r
- OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6203 : "\r
- "failed to update SL2VLMapping tables "\r
- "for port %" PRIx64 " #%d\n",\r
- cl_ntoh64(p->port_guid), port_num);\r
+ if (!(p->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP))\r
+ return 0;\r
+\r
+ if (sl2vl_update_table(sm, p, 0, 0, force_update, &qcfg->sl2vl))\r
return -1;\r
- }\r
\r
return 0;\r
}\r
cl_qmap_t *p_tbl;\r
cl_map_item_t *p_next;\r
osm_port_t *p_port;\r
- uint32_t num_physp;\r
- osm_physp_t *p_physp;\r
osm_node_t *p_node;\r
- unsigned force_update;\r
int ret = 0;\r
- uint8_t i;\r
\r
if (!p_osm->subn.opt.qos)\r
return 0;\r
\r
p_node = p_port->p_node;\r
if (p_node->sw) {\r
- num_physp = osm_node_get_num_physp(p_node);\r
- for (i = 1; i < num_physp; i++) {\r
- p_physp = osm_node_get_physp_ptr(p_node, i);\r
- if (!p_physp)\r
- continue;\r
- force_update = p_physp->need_update ||\r
- p_osm->subn.need_update;\r
- if (qos_physp_setup(&p_osm->log, &p_osm->sm,\r
- p_port, p_physp, i,\r
- force_update, &swe_config))\r
- ret = -1;\r
- }\r
+ if (qos_extports_setup(&p_osm->sm, p_node, &swe_config))\r
+ ret = -1;\r
+\r
/* skip base port 0 */\r
if (!ib_switch_info_is_enhanced_port0\r
(&p_node->sw->switch_info))\r
else\r
cfg = &ca_config;\r
\r
- p_physp = p_port->p_physp;\r
- if (!p_physp)\r
- continue;\r
-\r
- force_update = p_physp->need_update || p_osm->subn.need_update;\r
- if (qos_physp_setup(&p_osm->log, &p_osm->sm, p_port, p_physp,\r
- 0, force_update, cfg))\r
+ if (qos_endport_setup(&p_osm->sm, p_port->p_physp, cfg))\r
ret = -1;\r
}\r
\r
#line 2 "osm_qos_parser_l.l"\r
/*\r
* Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
%{\r
/*\r
* Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 HNR Consulting. All rights reserved.\r
*\r
#ifdef __WIN__\r
#define malloc\r
#define free\r
+#define fopen Fopen\r
#endif\r
\r
#define OSM_QOS_POLICY_MAX_LINE_LEN 1024*10\r
%{\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 HNR Consulting. All rights reserved.\r
*\r
#include <opensm/osm_opensm.h>\r
#include <opensm/osm_qos_policy.h>\r
#ifdef __WIN__\r
+/* prevent redefinition in windows header files */\r
#define malloc\r
#define free\r
#endif\r
/*\r
- * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
uint8_t sl;\r
uint32_t flow;\r
uint8_t hop;\r
- osm_mgrp_t * p_mgrp;\r
\r
if (!p_qos_policy || !p_qos_match_rule || !p_prtn)\r
return;\r
\r
/* If this partition is an IPoIB partition, there should\r
be a matching MCast group. Fix this group's SL too */\r
-\r
- if (!p_prtn->mlid)\r
- return;\r
-\r
- p_mgrp = osm_get_mgrp_by_mlid(p_qos_policy->p_subn, p_prtn->mlid);\r
- if (!p_mgrp) {\r
- OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_ERROR,\r
- "ERR AC16: MCast group for partition with "\r
- "pkey 0x%04X not found\n",\r
- cl_ntoh16(p_prtn->pkey));\r
+ if (!p_prtn->mgrp)\r
return;\r
- }\r
\r
- CL_ASSERT((cl_ntoh16(p_mgrp->mcmember_rec.pkey) & 0x7fff) ==\r
+ CL_ASSERT((cl_ntoh16(p_prtn->mgrp->mcmember_rec.pkey) & 0x7fff) ==\r
(cl_ntoh16(p_prtn->pkey) & 0x7fff));\r
\r
- ib_member_get_sl_flow_hop(p_mgrp->mcmember_rec.sl_flow_hop,\r
+ ib_member_get_sl_flow_hop(p_prtn->mgrp->mcmember_rec.sl_flow_hop,\r
&sl, &flow, &hop);\r
if (sl != p_prtn->sl) {\r
OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG,\r
"Updating MCGroup (MLID 0x%04x) SL to "\r
"match partition SL (%u)\n",\r
- cl_hton16(p_mgrp->mcmember_rec.mlid),\r
+ cl_hton16(p_prtn->mgrp->mcmember_rec.mlid),\r
p_prtn->sl);\r
- p_mgrp->mcmember_rec.sl_flow_hop =\r
+ p_prtn->mgrp->mcmember_rec.sl_flow_hop =\r
ib_member_set_sl_flow_hop(p_prtn->sl, flow, hop);\r
}\r
}\r
#include <string.h>\r
#include <opensm/osm_remote_sm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_remote_sm_construct(IN osm_remote_sm_t * p_sm)\r
{\r
memset(p_sm, 0, sizeof(*p_sm));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_remote_sm_destroy(IN osm_remote_sm_t * p_sm)\r
{\r
memset(p_sm, 0, sizeof(*p_sm));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_remote_sm_init(IN osm_remote_sm_t * p_sm, IN const osm_port_t * p_port,\r
IN const ib_sm_info_t * p_smi)\r
{\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
\r
p_madw = osm_mad_pool_get(sm->p_mad_pool, p_path->h_bind,\r
MAD_BLOCK_SIZE, NULL);\r
-\r
if (p_madw == NULL) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"ERR 1101: Unable to acquire MAD\n");\r
\r
p_madw = osm_mad_pool_get(sm->p_mad_pool, p_path->h_bind,\r
MAD_BLOCK_SIZE, NULL);\r
-\r
if (p_madw == NULL) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"ERR 1102: Unable to acquire MAD\n");\r
osm_madw_t *madw;\r
ib_smp_t *smp;\r
ib_mad_notice_attr_t *ntc;\r
- osm_port_t *port;\r
- osm_port_t *smport;\r
+ osm_port_t *port, *smport;\r
ib_port_info_t *pi;\r
\r
port = osm_get_port_by_guid(sm->p_subn, sm->p_subn->sm_port_guid);\r
#include <opensm/osm_msgdef.h>\r
#include <opensm/osm_opensm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void resp_make_resp_smp(IN osm_sm_t * sm, IN const ib_smp_t * p_src_smp,\r
IN ib_net16_t status,\r
IN const uint8_t * p_payload,\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_resp_send(IN osm_sm_t * sm,\r
IN const osm_madw_t * p_req_madw,\r
IN ib_net16_t mad_status,\r
#include <iba/ib_types.h>\r
#include <opensm/osm_router.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_router_delete(IN OUT osm_router_t ** pp_rtr)\r
{\r
free(*pp_rtr);\r
*pp_rtr = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_router_t *osm_router_new(IN osm_port_t * p_port)\r
{\r
osm_router_t *p_rtr;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
+ * Copyright (c) 2010 HNR Consulting. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
extern void osm_vlarb_rec_rcv_process(IN void *context, IN void *data);\r
extern void osm_sr_rcv_lease_cb(IN void *context);\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sa_construct(IN osm_sa_t * p_sa)\r
{\r
memset(p_sa, 0, sizeof(*p_sa));\r
cl_timer_construct(&p_sa->sr_timer);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sa_shutdown(IN osm_sa_t * p_sa)\r
{\r
ib_api_status_t status;\r
OSM_LOG_EXIT(p_sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sa_destroy(IN osm_sa_t * p_sa)\r
{\r
OSM_LOG_ENTER(p_sa->p_log);\r
OSM_LOG_EXIT(p_sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sa_init(IN osm_sm_t * p_sm, IN osm_sa_t * p_sa,\r
IN osm_subn_t * p_subn, IN osm_vendor_t * p_vendor,\r
IN osm_mad_pool_t * p_mad_pool,\r
status = IB_SUCCESS;\r
Exit:\r
OSM_LOG_EXIT(p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sa_bind(IN osm_sa_t * p_sa, IN ib_net64_t port_guid)\r
{\r
ib_api_status_t status;\r
/* C15-0.1.5 - always return SM_Key = 0 (table 185 p 884) */\r
resp_sa_mad->sm_key = 0;\r
\r
- /* Fill in the offset (paylen will be done by the rmpp SAR) */\r
- resp_sa_mad->attr_offset = num_rec ? ib_get_attr_offset(attr_size) : 0;\r
+#ifdef DUAL_SIDED_RMPP\r
+ if (resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP ||\r
+ resp_sa_mad->method == IB_MAD_METHOD_GETMULTI_RESP) {\r
+#else\r
+ if (resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP) {\r
+#endif\r
+ /* Fill in the offset (paylen will be done by the rmpp SAR) */\r
+ resp_sa_mad->attr_offset = num_rec ? ib_get_attr_offset(attr_size) : 0;\r
+ }\r
\r
p = ib_sa_mad_get_payload_ptr(resp_sa_mad);\r
\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* SA DB Dumper\r
*\r
{\r
struct opensm_dump_context dump_context;\r
osm_mgrp_t *p_mgrp;\r
- int i;\r
\r
dump_context.p_osm = p_osm;\r
dump_context.file = file;\r
OSM_LOG(&p_osm->log, OSM_LOG_DEBUG, "Dump multicast\n");\r
cl_plock_acquire(&p_osm->lock);\r
- for (i = 0; i <= p_osm->subn.max_mcast_lid_ho - IB_LID_MCAST_START_HO;\r
- i++) {\r
- p_mgrp = p_osm->subn.mgroups[i];\r
- if (p_mgrp)\r
- sa_dump_one_mgrp(p_mgrp, &dump_context);\r
- }\r
+ for (p_mgrp = (osm_mgrp_t *) cl_fmap_head(&p_osm->subn.mgrp_mgid_tbl);\r
+ p_mgrp != (osm_mgrp_t *) cl_fmap_end(&p_osm->subn.mgrp_mgid_tbl);\r
+ p_mgrp = (osm_mgrp_t *) cl_fmap_next(&p_mgrp->map_item))\r
+ sa_dump_one_mgrp(p_mgrp, &dump_context);\r
OSM_LOG(&p_osm->log, OSM_LOG_DEBUG, "Dump inform\n");\r
cl_qlist_apply_func(&p_osm->subn.sa_infr_list,\r
sa_dump_one_inform, &dump_context);\r
\r
int osm_sa_db_file_dump(osm_opensm_t * p_osm)\r
{\r
- return opensm_dump_to_file(p_osm, "opensm-sa.dump", sa_dump_all_sa);\r
+ int res = 1;\r
+ if (p_osm->sa.dirty) {\r
+ res = opensm_dump_to_file(\r
+ p_osm, "opensm-sa.dump", sa_dump_all_sa);\r
+ p_osm->sa.dirty = FALSE;\r
+ }\r
+ return res;\r
}\r
\r
/*\r
\r
cl_plock_excl_acquire(&p_osm->lock);\r
\r
- p_mgrp = osm_get_mgrp_by_mlid(&p_osm->subn, mlid);\r
+ p_mgrp = osm_get_mgrp_by_mgid(&p_osm->subn, &p_mcm_rec->mgid);\r
if (p_mgrp) {\r
- if (!memcmp(&p_mgrp->mcmember_rec.mgid, &p_mcm_rec->mgid,\r
- sizeof(ib_gid_t))) {\r
+ if (p_mgrp->mlid == mlid) {\r
OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,\r
"mgrp %04x is already here.", cl_ntoh16(mlid));\r
goto _out;\r
unsigned rereg_clients = 0;\r
unsigned lineno;\r
\r
+ if (!p_osm->subn.first_time_master_sweep) {\r
+ OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,\r
+ "Not first sweep - skip SA DB restore\n");\r
+ return 0;\r
+ }\r
+\r
file_name = p_osm->subn.opt.sa_db_file;\r
if (!file_name) {\r
OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,\r
return -1;\r
}\r
\r
+ OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,\r
+ "Restoring SA DB from file \'%s\'\n",\r
+ file_name);\r
+\r
lineno = 0;\r
\r
while (fgets(line, sizeof(line) - 1, file) != NULL) {\r
}\r
}\r
\r
- if (!rereg_clients)\r
- p_osm->subn.opt.no_clients_rereg = TRUE;\r
+ /*\r
+ * If loading succeeded, do whatever 'no_clients_rereg' says.\r
+ * If loading failed at some point, turn off the 'no_clients_rereg'\r
+ * option (turn on re-registartion requests).\r
+ */\r
+ if (rereg_clients)\r
+ p_osm->subn.opt.no_clients_rereg = FALSE;\r
+\r
+ /* We've just finished loading SA DB file - clear the "dirty" flag */\r
+ p_osm->sa.dirty = FALSE;\r
\r
_error:\r
fclose(file);\r
/*\r
* Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
1099511, 2199023, 4398046, 8796093\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void cpi_rcv_respond(IN osm_sa_t * sa, IN const osm_madw_t * p_madw)\r
{\r
osm_madw_t *p_resp_madw;\r
/*\r
* Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
const osm_physp_t *p_req_physp;\r
} osm_gir_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t gir_rcv_new_gir(IN osm_sa_t * sa,\r
IN const osm_node_t * p_node,\r
IN cl_qlist_t * p_list,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_gir_create_gir(IN osm_sa_t * sa, IN osm_node_t * p_node,\r
IN cl_qlist_t * p_list,\r
IN ib_net64_t const match_port_guid,\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_gir_by_comp_mask_cb(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_gir_search_ctxt_t *p_ctxt = cxt;\r
OSM_LOG_EXIT(p_ctxt->sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_gir_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
boolean_t valid = TRUE;\r
osm_physp_t *p_requester_physp;\r
osm_port_t *p_port;\r
- osm_physp_t *p_physp;\r
ib_net64_t portguid;\r
- ib_net16_t lid_range_begin;\r
- ib_net16_t lid_range_end;\r
- ib_net16_t lid;\r
- const cl_ptr_vector_t *p_tbl;\r
+ uint16_t lid_range_begin, lid_range_end, lid;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
interface_id;\r
\r
p_port = osm_get_port_by_guid(sa->p_subn, portguid);\r
-\r
if (p_port == NULL) {\r
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4301: "\r
"Invalid port guid: 0x%016" PRIx64 "\n",\r
goto Exit;\r
}\r
\r
- /* get the destination InformInfo physical port */\r
- p_physp = p_port->p_physp;\r
-\r
- /* make sure that the requester and destination port can access each other\r
- according to the current partitioning. */\r
+ /* make sure that the requester and destination port can access\r
+ each other according to the current partitioning. */\r
if (!osm_physp_share_pkey\r
- (sa->p_log, p_physp, p_requester_physp)) {\r
+ (sa->p_log, p_port->p_physp, p_requester_physp)) {\r
OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
"port and requester don't share pkey\n");\r
valid = FALSE;\r
goto Exit;\r
}\r
} else {\r
+ size_t lids_size;\r
+\r
/* gid is zero - check if LID range is defined */\r
lid_range_begin =\r
cl_ntoh16(p_infr_rec->inform_record.inform_info.\r
cl_ntoh16(p_infr_rec->inform_record.inform_info.\r
lid_range_end);\r
\r
- /* lid_range_end is set to zero if no range desired. In this case -\r
- just make it equal to the lid_range_begin. */\r
+ lids_size = cl_ptr_vector_get_size(&sa->p_subn->port_lid_tbl);\r
+\r
+ /* lid_range_end is set to zero if no range desired. In this\r
+ case - just make it equal to the lid_range_begin. */\r
if (lid_range_end == 0)\r
lid_range_end = lid_range_begin;\r
+ else if (lid_range_end >= lids_size)\r
+ lid_range_end = lids_size - 1;\r
+\r
+ if (lid_range_begin >= lids_size) {\r
+ /* requested lids are out of range */\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4302: "\r
+ "Given LIDs (%u-%u) are out of range (%u)\n",\r
+ lid_range_begin, lid_range_end, lids_size);\r
+ valid = FALSE;\r
+ goto Exit;\r
+ }\r
\r
/* go over all defined lids within the range and make sure that the\r
requester port can access them according to current partitioning. */\r
for (lid = lid_range_begin; lid <= lid_range_end; lid++) {\r
- p_tbl = &sa->p_subn->port_lid_tbl;\r
- if (cl_ptr_vector_get_size(p_tbl) > lid)\r
- p_port = cl_ptr_vector_get(p_tbl, lid);\r
- else {\r
- /* lid requested is out of range */\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4302: "\r
- "Given LID (%u) is out of range:%u\n",\r
- lid, cl_ptr_vector_get_size(p_tbl));\r
- valid = FALSE;\r
- goto Exit;\r
- }\r
+ p_port = osm_get_port_by_lid_ho(sa->p_subn, lid);\r
if (p_port == NULL)\r
continue;\r
\r
- p_physp = p_port->p_physp;\r
/* make sure that the requester and destination port can access\r
each other according to the current partitioning. */\r
if (!osm_physp_share_pkey\r
- (sa->p_log, p_physp, p_requester_physp)) {\r
+ (sa->p_log, p_port->p_physp, p_requester_physp)) {\r
OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
"port and requester don't share pkey\n");\r
valid = FALSE;\r
return valid;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t validate_infr(IN osm_sa_t * sa, IN osm_infr_t * p_infr_rec)\r
{\r
boolean_t valid = TRUE;\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_inform_info_rec_by_comp_mask(IN osm_sa_t * sa,\r
IN const osm_infr_t * p_infr,\r
osm_iir_search_ctxt_t * p_ctxt)\r
\r
/* get the subscriber InformInfo physical port */\r
p_subscriber_physp = p_subscriber_port->p_physp;\r
- /* make sure that the requester and subscriber port can access each other\r
- according to the current partitioning. */\r
+ /* make sure that the requester and subscriber port can access each\r
+ other according to the current partitioning. */\r
if (!osm_physp_share_pkey(sa->p_log, p_req_physp, p_subscriber_physp)) {\r
OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
"requester and subscriber ports don't share pkey\n");\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_inform_info_rec_by_comp_mask_cb(IN cl_list_item_t * p_list_item,\r
IN void *context)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/*********************************************************************\r
-**********************************************************************/\r
void osm_infr_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
CL_ASSERT(p_sa_mad->attr_id == IB_MAD_ATTR_INFORM_INFO);\r
\r
if (p_sa_mad->method != IB_MAD_METHOD_SET) {\r
- OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
- "Unsupported Method (%s)\n",\r
+ OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Unsupported Method (%s)\n",\r
ib_get_sa_method_str(p_sa_mad->method));\r
osm_sa_send_error(sa, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR);\r
goto Exit;\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/*********************************************************************\r
-**********************************************************************/\r
void osm_infir_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
const osm_physp_t *p_req_physp;\r
} osm_lftr_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t lftr_rcv_new_lftr(IN osm_sa_t * sa,\r
IN const osm_switch_t * p_sw,\r
IN cl_qlist_t * p_list,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void lftr_rcv_by_comp_mask(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_lftr_search_ctxt_t *p_ctxt = cxt;\r
osm_port_get_base_lid(p_port), block);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_lftr_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
ib_link_record_t link_rec;\r
} osm_lr_item_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void lr_rcv_build_physp_link(IN osm_sa_t * sa, IN ib_net16_t from_lid,\r
IN ib_net16_t to_lid, IN uint8_t from_port,\r
IN uint8_t to_port, IN cl_qlist_t * p_list)\r
cl_qlist_insert_tail(p_list, &p_lr_item->list_item);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_net16_t get_base_lid(IN const osm_physp_t * p_physp)\r
{\r
if (p_physp->p_node->node_info.node_type == IB_NODE_TYPE_SWITCH)\r
return osm_physp_get_base_lid(p_physp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void lr_rcv_get_physp_link(IN osm_sa_t * sa,\r
IN const ib_link_record_t * p_lr,\r
IN const osm_physp_t * p_src_physp,\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void lr_rcv_get_port_links(IN osm_sa_t * sa,\r
IN const ib_link_record_t * p_lr,\r
IN const osm_port_t * p_src_port,\r
return sa_status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_lr_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
\r
/*\r
If the dispatcher is showing us that it is overloaded\r
- there is no point in placing the request in. We should instead provide\r
- immediate response - IB_RESOURCE_BUSY\r
+ there is no point in placing the request in. We should instead\r
+ provide immediate response - IB_RESOURCE_BUSY\r
But how do we know?\r
- The dispatcher reports back the number of outstanding messages and the\r
- time the last message stayed in the queue.\r
+ The dispatcher reports back the number of outstanding messages and\r
+ the time the last message stayed in the queue.\r
HACK: Actually, we cannot send a mad from within the receive callback;\r
thus - we will just drop it.\r
*/\r
* SEE ALSO\r
*********/\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sa_mad_ctrl_construct(IN osm_sa_mad_ctrl_t * p_ctrl)\r
{\r
CL_ASSERT(p_ctrl);\r
p_ctrl->h_disp = CL_DISP_INVALID_HANDLE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sa_mad_ctrl_destroy(IN osm_sa_mad_ctrl_t * p_ctrl)\r
{\r
CL_ASSERT(p_ctrl);\r
cl_disp_unregister(p_ctrl->h_disp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sa_mad_ctrl_init(IN osm_sa_mad_ctrl_t * p_ctrl,\r
IN osm_sa_t * sa,\r
IN osm_mad_pool_t * p_mad_pool,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sa_mad_ctrl_bind(IN osm_sa_mad_ctrl_t * p_ctrl,\r
IN ib_net64_t port_guid)\r
{\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sa_mad_ctrl_unbind(IN osm_sa_mad_ctrl_t * p_ctrl)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
*\r
/*********************************************************************\r
Get a new unused mlid by scanning all the used ones in the subnet.\r
**********************************************************************/\r
-static ib_net16_t get_new_mlid(osm_sa_t * sa, ib_net16_t requested_mlid)\r
+/* Special Case IPv6 Solicited Node Multicast (SNM) addresses */\r
+/* 0xff1Z601bXXXX0000 : 0x00000001ffYYYYYY */\r
+/* Where Z is the scope, XXXX is the P_Key, and\r
+ * YYYYYY is the last 24 bits of the port guid */\r
+#define PREFIX_MASK CL_HTON64(0xff10ffff0000ffffULL)\r
+#define PREFIX_SIGNATURE CL_HTON64(0xff10601b00000000ULL)\r
+#define INT_ID_MASK CL_HTON64(0xfffffff1ff000000ULL)\r
+#define INT_ID_SIGNATURE CL_HTON64(0x00000001ff000000ULL)\r
+\r
+static int compare_ipv6_snm_mgids(const void *m1, const void *m2)\r
+{\r
+ return memcmp(m1, m2, sizeof(ib_gid_t) - 6);\r
+}\r
+\r
+static ib_net16_t find_ipv6_snm_mlid(osm_subn_t *subn, ib_gid_t *mgid)\r
+{\r
+ osm_mgrp_t *m = (osm_mgrp_t *)cl_fmap_match(&subn->mgrp_mgid_tbl, mgid,\r
+ compare_ipv6_snm_mgids);\r
+ if (m != (osm_mgrp_t *)cl_fmap_end(&subn->mgrp_mgid_tbl))\r
+ return m->mlid;\r
+ return 0;\r
+}\r
+\r
+static unsigned match_ipv6_snm_mgid(ib_gid_t * mgid)\r
+{\r
+ return ((mgid->unicast.prefix & PREFIX_MASK) == PREFIX_SIGNATURE &&\r
+ (mgid->unicast.interface_id & INT_ID_MASK) == INT_ID_SIGNATURE);\r
+}\r
+\r
+static ib_net16_t get_new_mlid(osm_sa_t * sa, ib_member_rec_t * mcmr)\r
{\r
osm_subn_t *p_subn = sa->p_subn;\r
+ ib_net16_t requested_mlid = mcmr->mlid;\r
unsigned i, max;\r
\r
if (requested_mlid && cl_ntoh16(requested_mlid) >= IB_LID_MCAST_START_HO\r
&& cl_ntoh16(requested_mlid) <= p_subn->max_mcast_lid_ho\r
- && !osm_get_mgrp_by_mlid(p_subn, requested_mlid))\r
+ && !osm_get_mbox_by_mlid(p_subn, requested_mlid))\r
return requested_mlid;\r
\r
+ if (sa->p_subn->opt.consolidate_ipv6_snm_req\r
+ && match_ipv6_snm_mgid(&mcmr->mgid)\r
+ && (requested_mlid = find_ipv6_snm_mlid(sa->p_subn, &mcmr->mgid))) {\r
+ char str[INET6_ADDRSTRLEN];\r
+ OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
+ "Special Case Solicited Node Mcast Join for MGID %s\n",\r
+ inet_ntop(AF_INET6, mcmr->mgid.raw, str, sizeof(str)));\r
+ return requested_mlid;\r
+ }\r
+\r
max = p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO + 1;\r
for (i = 0; i < max; i++)\r
- if (!sa->p_subn->mgroups[i])\r
+ if (!sa->p_subn->mboxes[i])\r
return cl_hton16(i + IB_LID_MCAST_START_HO);\r
\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static inline boolean_t check_join_comp_mask(ib_net64_t comp_mask)\r
{\r
return ((comp_mask & JOIN_MC_COMP_MASK) == JOIN_MC_COMP_MASK);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t check_create_comp_mask(ib_net64_t comp_mask,\r
ib_member_rec_t * p_recvd_mcmember_rec)\r
{\r
switch (mtu_sel) {\r
case 0: /* Greater than MTU specified */\r
if (mtu_mgrp <= mtu_required) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested mcast group has MTU %x, "\r
"which is not greater than %x\n",\r
mtu_mgrp, mtu_required);\r
break;\r
case 1: /* Less than MTU specified */\r
if (mtu_mgrp >= mtu_required) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested mcast group has MTU %x, "\r
"which is not less than %x\n",\r
mtu_mgrp, mtu_required);\r
break;\r
case 2: /* Exactly MTU specified */\r
if (mtu_mgrp != mtu_required) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested mcast group has MTU %x, "\r
"which is not equal to %x\n",\r
mtu_mgrp, mtu_required);\r
switch (rate_sel) {\r
case 0: /* Greater than RATE specified */\r
if (rate_mgrp <= rate_required) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested mcast group has RATE %x, "\r
"which is not greater than %x\n",\r
rate_mgrp, rate_required);\r
break;\r
case 1: /* Less than RATE specified */\r
if (rate_mgrp >= rate_required) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested mcast group has RATE %x, "\r
"which is not less than %x\n",\r
rate_mgrp, rate_required);\r
break;\r
case 2: /* Exactly RATE specified */\r
if (rate_mgrp != rate_required) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested mcast group has RATE %x, "\r
"which is not equal to %x\n",\r
rate_mgrp, rate_required);\r
mtu_required = ib_port_info_get_mtu_cap(&p_physp->port_info);\r
mtu_mgrp = (uint8_t) (p_mgrp->mcmember_rec.mtu & 0x3F);\r
if (mtu_required < mtu_mgrp) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Port's MTU %x is less than %x\n",\r
mtu_required, mtu_mgrp);\r
return FALSE;\r
rate_required = ib_port_info_compute_rate(&p_physp->port_info);\r
rate_mgrp = (uint8_t) (p_mgrp->mcmember_rec.rate & 0x3F);\r
if (rate_required < rate_mgrp) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Port's RATE %x is less than %x\n",\r
rate_required, rate_mgrp);\r
return FALSE;\r
return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* Check legality of the requested MGID DELETE\r
* o15-0.1.14 = VALID DELETE:\r
return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* Check legality of the requested MGID (note this does not hold for SA\r
* created MGIDs)\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (valid);\r
+ return valid;\r
}\r
\r
/**********************************************************************\r
switch (mtu_sel) {\r
case 0: /* Greater than MTU specified */\r
if (port_mtu && mtu_required >= port_mtu) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested MTU %x >= the port\'s mtu:%x\n",\r
mtu_required, port_mtu);\r
return FALSE;\r
}\r
/* make sure it still be in the range */\r
if (mtu < IB_MIN_MTU || mtu > IB_MAX_MTU) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Calculated MTU %x is out of range\n", mtu);\r
return FALSE;\r
}\r
switch (rate_sel) {\r
case 0: /* Greater than RATE specified */\r
if (port_rate && rate_required >= port_rate) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Requested RATE %x >= the port\'s rate:%x\n",\r
rate_required, port_rate);\r
return FALSE;\r
}\r
/* make sure it still is in the range */\r
if (rate < IB_MIN_RATE || rate > IB_MAX_RATE) {\r
- OSM_LOG(p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(p_log, OSM_LOG_VERBOSE,\r
"Calculated RATE %x is out of range\n", rate);\r
return FALSE;\r
}\r
return TRUE;\r
}\r
\r
+static unsigned build_new_mgid(osm_sa_t * sa, ib_net64_t comp_mask,\r
+ ib_member_rec_t * mcmr)\r
+{\r
+ static uint32_t uniq_count;\r
+ ib_gid_t *mgid = &mcmr->mgid;\r
+ uint8_t scope;\r
+ unsigned i;\r
+\r
+ /* use the given scope state only if requested! */\r
+ if (comp_mask & IB_MCR_COMPMASK_SCOPE)\r
+ ib_member_get_scope_state(mcmr->scope_state, &scope, NULL);\r
+ else\r
+ /* to guarantee no collision with other subnets use local scope! */\r
+ scope = IB_MC_SCOPE_LINK_LOCAL;\r
+\r
+ mgid->raw[0] = 0xff;\r
+ mgid->raw[1] = 0x10 | scope;\r
+ mgid->raw[2] = 0xa0;\r
+ mgid->raw[3] = 0x1b;\r
+\r
+ /* HACK: use the SA port gid to make it globally unique */\r
+ memcpy(&mgid->raw[4], &sa->p_subn->opt.subnet_prefix, sizeof(uint64_t));\r
+\r
+ for (i = 0; i < 1000; i++) {\r
+ memcpy(&mgid->raw[10], &uniq_count, 4);\r
+ uniq_count++;\r
+ if (!osm_get_mgrp_by_mgid(sa->p_subn, mgid))\r
+ return 1;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
/**********************************************************************\r
Call this function to create a new mgrp.\r
**********************************************************************/\r
static ib_api_status_t mcmr_rcv_create_new_mgrp(IN osm_sa_t * sa,\r
IN ib_net64_t comp_mask,\r
IN const ib_member_rec_t *\r
- const p_recvd_mcmember_rec,\r
+ p_recvd_mcmember_rec,\r
IN const osm_physp_t * p_physp,\r
OUT osm_mgrp_t ** pp_mgrp)\r
{\r
ib_net16_t mlid;\r
- unsigned zero_mgid = 1;\r
- uint8_t scope;\r
- ib_gid_t *p_mgid;\r
ib_api_status_t status = IB_SUCCESS;\r
ib_member_rec_t mcm_rec = *p_recvd_mcmember_rec; /* copy for modifications */\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
- /* but what if the given MGID was not 0 ? */\r
- if (p_recvd_mcmember_rec->mgid.unicast.prefix != 0 ||\r
- p_recvd_mcmember_rec->mgid.unicast.interface_id != 0)\r
- zero_mgid = 0;\r
-\r
- /*\r
- we allocate a new mlid number before we might use it\r
- for MGID ...\r
- */\r
- mlid = get_new_mlid(sa, mcm_rec.mlid);\r
- if (mlid == 0) {\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B19: "\r
- "get_new_mlid failed request mlid 0x%04x\n",\r
- cl_ntoh16(mcm_rec.mlid));\r
- status = IB_SA_MAD_STATUS_NO_RESOURCES;\r
- goto Exit;\r
- }\r
-\r
- OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
- "Obtained new mlid 0x%X\n", cl_ntoh16(mlid));\r
-\r
/* we need to create the new MGID if it was not defined */\r
- if (zero_mgid) {\r
+ if (!ib_gid_is_notzero(&p_recvd_mcmember_rec->mgid)) {\r
/* create a new MGID */\r
char gid_str[INET6_ADDRSTRLEN];\r
\r
- /* use the given scope state only if requested! */\r
- if (comp_mask & IB_MCR_COMPMASK_SCOPE)\r
- ib_member_get_scope_state(p_recvd_mcmember_rec->\r
- scope_state, &scope, NULL);\r
- else\r
- /* to guarantee no collision with other subnets use local scope! */\r
- scope = IB_MC_SCOPE_LINK_LOCAL;\r
-\r
- p_mgid = &(mcm_rec.mgid);\r
- p_mgid->raw[0] = 0xFF;\r
- p_mgid->raw[1] = 0x10 | scope;\r
- p_mgid->raw[2] = 0xA0;\r
- p_mgid->raw[3] = 0x1B;\r
-\r
- /* HACK: use the SA port gid to make it globally unique */\r
- memcpy((&p_mgid->raw[4]),\r
- &sa->p_subn->opt.subnet_prefix, sizeof(uint64_t));\r
-\r
- /* HACK: how do we get a unique number - use the mlid twice */\r
- memcpy(&p_mgid->raw[10], &mlid, sizeof(uint16_t));\r
- memcpy(&p_mgid->raw[12], &mlid, sizeof(uint16_t));\r
+ if (!build_new_mgid(sa, comp_mask, &mcm_rec)) {\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B23: "\r
+ "cannot allocate unique MGID value\n");\r
+ status = IB_SA_MAD_STATUS_NO_RESOURCES;\r
+ goto Exit;\r
+ }\r
OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Allocated new MGID:%s\n",\r
- inet_ntop(AF_INET6, p_mgid->raw, gid_str,\r
+ inet_ntop(AF_INET6, mcm_rec.mgid.raw, gid_str,\r
sizeof gid_str));\r
} else if (!validate_requested_mgid(sa, &mcm_rec)) {\r
/* a specific MGID was requested so validate the resulting MGID */\r
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B22: "\r
"Invalid requested MGID\n");\r
- free_mlid(sa, mlid);\r
status = IB_SA_MAD_STATUS_REQ_INVALID;\r
goto Exit;\r
}\r
FALSE) {\r
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B26: "\r
"Requested MGRP parameters are not realizable\n");\r
- free_mlid(sa, mlid);\r
status = IB_SA_MAD_STATUS_REQ_INVALID;\r
goto Exit;\r
}\r
\r
- /* create a new MC Group */\r
+ mlid = get_new_mlid(sa, &mcm_rec);\r
+ if (mlid == 0) {\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B19: "\r
+ "get_new_mlid failed request mlid 0x%04x\n",\r
+ cl_ntoh16(mcm_rec.mlid));\r
+ status = IB_SA_MAD_STATUS_NO_RESOURCES;\r
+ goto Exit;\r
+ }\r
+\r
+ OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Obtained new mlid 0x%X\n",\r
+ cl_ntoh16(mlid));\r
+\r
mcm_rec.mlid = mlid;\r
- *pp_mgrp = osm_mgrp_new(mlid, &mcm_rec);\r
+ /* create a new MC Group */\r
+ *pp_mgrp = osm_mgrp_new(sa->p_subn, mlid, &mcm_rec);\r
if (*pp_mgrp == NULL) {\r
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B08: "\r
"osm_mgrp_new failed\n");\r
(*pp_mgrp)->mcmember_rec.pkt_life &= 0x3f;\r
(*pp_mgrp)->mcmember_rec.pkt_life |= 2 << 6; /* exactly */\r
\r
- /* Insert the new group in the data base */\r
- cl_fmap_insert(&sa->p_subn->mgrp_mgid_tbl,\r
- &(*pp_mgrp)->mcmember_rec.mgid, &(*pp_mgrp)->map_item);\r
- sa->p_subn->mgroups[cl_ntoh16(mlid) - IB_LID_MCAST_START_HO] = *pp_mgrp;\r
-\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-#define PREFIX_MASK CL_HTON64(0xff10ffff0000ffffULL)\r
-#define PREFIX_SIGNATURE CL_HTON64(0xff10601b00000000ULL)\r
-#define INT_ID_MASK CL_HTON64(0xfffffff1ff000000ULL)\r
-#define INT_ID_SIGNATURE CL_HTON64(0x00000001ff000000ULL)\r
-\r
-/* Special Case IPv6 Solicited Node Multicast (SNM) addresses */\r
-/* 0xff1Z601bXXXX0000 : 0x00000001ffYYYYYY */\r
-/* Where Z is the scope, XXXX is the P_Key, and\r
- * YYYYYY is the last 24 bits of the port guid */\r
-static unsigned match_and_update_ipv6_snm_mgid(ib_gid_t * mgid)\r
-{\r
- if ((mgid->unicast.prefix & PREFIX_MASK) == PREFIX_SIGNATURE &&\r
- (mgid->unicast.interface_id & INT_ID_MASK) == INT_ID_SIGNATURE) {\r
- mgid->unicast.prefix &= PREFIX_MASK;\r
- mgid->unicast.interface_id &= INT_ID_MASK;\r
- return 1;\r
- }\r
- return 0;\r
-}\r
-\r
-osm_mgrp_t *osm_get_mgrp_by_mgid(IN osm_sa_t * sa, IN ib_gid_t * p_mgid)\r
-{\r
- osm_mgrp_t *mg;\r
-\r
- if (sa->p_subn->opt.consolidate_ipv6_snm_req &&\r
- match_and_update_ipv6_snm_mgid(p_mgid)) {\r
- char gid_str[INET6_ADDRSTRLEN];\r
- OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
- "Special Case Solicited Node Mcast Join for MGID %s\n",\r
- inet_ntop(AF_INET6, p_mgid->raw, gid_str,\r
- sizeof gid_str));\r
- }\r
-\r
- mg = (osm_mgrp_t *)cl_fmap_get(&sa->p_subn->mgrp_mgid_tbl, p_mgid);\r
- if (mg != (osm_mgrp_t *)cl_fmap_end(&sa->p_subn->mgrp_mgid_tbl))\r
- return mg;\r
-\r
- return NULL;\r
-}\r
-\r
/**********************************************************************\r
Call this function to find or create a new mgrp.\r
**********************************************************************/\r
{\r
osm_mgrp_t *mgrp;\r
\r
- if ((mgrp = osm_get_mgrp_by_mgid(sa, &p_recvd_mcmember_rec->mgid))) {\r
+ if ((mgrp = osm_get_mgrp_by_mgid(sa->p_subn,\r
+ &p_recvd_mcmember_rec->mgid))) {\r
*pp_mgrp = mgrp;\r
return IB_SUCCESS;\r
}\r
}\r
\r
CL_PLOCK_EXCL_ACQUIRE(sa->p_lock);\r
- p_mgrp = osm_get_mgrp_by_mgid(sa, &p_recvd_mcmember_rec->mgid);\r
+ p_mgrp = osm_get_mgrp_by_mgid(sa->p_subn, &p_recvd_mcmember_rec->mgid);\r
if (!p_mgrp) {\r
char gid_str[INET6_ADDRSTRLEN];\r
CL_PLOCK_RELEASE(sa->p_lock);\r
goto Exit;\r
}\r
\r
- if (!osm_physp_share_pkey(sa->p_log, p_physp, p_request_physp)) {\r
+ proxy = (p_physp != p_request_physp);\r
+\r
+ if (proxy && !osm_physp_share_pkey(sa->p_log, p_physp, p_request_physp)) {\r
CL_PLOCK_RELEASE(sa->p_lock);\r
- OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
+ OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,\r
"Port and requester don't share pkey\n");\r
osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);\r
goto Exit;\r
}\r
\r
- proxy = (p_physp != p_request_physp);\r
-\r
ib_member_get_scope_state(p_recvd_mcmember_rec->scope_state, NULL,\r
&join_state);\r
\r
/* do we need to create a new group? */\r
- p_mgrp = osm_get_mgrp_by_mgid(sa, &p_recvd_mcmember_rec->mgid);\r
+ p_mgrp = osm_get_mgrp_by_mgid(sa->p_subn, &p_recvd_mcmember_rec->mgid);\r
if (!p_mgrp) {\r
/* check for JoinState.FullMember = 1 o15.0.1.9 */\r
if ((join_state & 0x01) != 0x01) {\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
/**********************************************************************\r
osm_physp_t *p_req_physp;\r
boolean_t trusted_req;\r
osm_mgrp_t *p_mgrp;\r
- int i;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
CL_PLOCK_ACQUIRE(sa->p_lock);\r
\r
/* simply go over all MCGs and match */\r
- for (i = 0; i <= sa->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO;\r
- i++) {\r
- p_mgrp = sa->p_subn->mgroups[i];\r
- if (p_mgrp)\r
- mcmr_by_comp_mask(sa, p_rcvd_rec, comp_mask, p_mgrp,\r
- p_req_physp, trusted_req, &rec_list);\r
- }\r
+ for (p_mgrp = (osm_mgrp_t *) cl_fmap_head(&sa->p_subn->mgrp_mgid_tbl);\r
+ p_mgrp != (osm_mgrp_t *) cl_fmap_end(&sa->p_subn->mgrp_mgid_tbl);\r
+ p_mgrp = (osm_mgrp_t *) cl_fmap_next(&p_mgrp->map_item))\r
+ mcmr_by_comp_mask(sa, p_rcvd_rec, comp_mask, p_mgrp,\r
+ p_req_physp, trusted_req, &rec_list);\r
\r
CL_PLOCK_RELEASE(sa->p_lock);\r
\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mcmr_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
const osm_physp_t *p_req_physp;\r
} osm_mftr_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t mftr_rcv_new_mftr(IN osm_sa_t * sa,\r
IN osm_switch_t * p_sw,\r
IN cl_qlist_t * p_list,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mftr_rcv_by_comp_mask(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_mftr_search_ctxt_t *p_ctxt = cxt;\r
position);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mftr_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
/*\r
* Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
int hops;\r
} osm_path_parms_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t sa_multipath_rec_is_tavor_port(IN const osm_port_t * p_port)\r
{\r
osm_node_t const *p_node;\r
(vend_id == CL_HTON32(OSM_VENDOR_ID_VOLTAIRE))));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t\r
sa_multipath_rec_apply_tavor_mtu_limit(IN const ib_multipath_rec_t * p_mpr,\r
IN const osm_port_t * p_src_port,\r
/* only if at least one of the ports is a Tavor device */\r
if (!sa_multipath_rec_is_tavor_port(p_src_port) &&\r
!sa_multipath_rec_is_tavor_port(p_dest_port))\r
- return (FALSE);\r
+ return FALSE;\r
\r
/*\r
we can apply the patch if either:\r
case 0: /* must be greater than */\r
case 2: /* exact match */\r
if (IB_MTU_LEN_1024 < required_mtu)\r
- return (FALSE);\r
+ return FALSE;\r
break;\r
\r
case 1: /* must be less than */\r
case 3: /* largest available */\r
/* the ULP intentionally requested */\r
/* the largest MTU possible */\r
- return (FALSE);\r
+ return FALSE;\r
break;\r
\r
default:\r
}\r
}\r
\r
- return (TRUE);\r
+ return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t mpr_rcv_get_path_parms(IN osm_sa_t * sa,\r
IN const ib_multipath_rec_t *\r
p_mpr,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mpr_rcv_build_pr(IN osm_sa_t * sa, IN const osm_port_t * p_src_port,\r
IN const osm_port_t * p_dest_port,\r
IN uint16_t src_lid_ho, IN uint16_t dest_lid_ho,\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static osm_mpr_item_t *mpr_rcv_get_lid_pair_path(IN osm_sa_t * sa,\r
IN const ib_multipath_rec_t *\r
p_mpr,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (p_pr_item);\r
+ return p_pr_item;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static uint32_t mpr_rcv_get_port_pair_paths(IN osm_sa_t * sa,\r
IN const ib_multipath_rec_t * p_mpr,\r
IN const osm_port_t * p_req_port,\r
#undef min\r
#define min(x,y) (((x) < (y)) ? (x) : (y))\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static osm_mpr_item_t *mpr_rcv_get_apm_port_pair_paths(IN osm_sa_t * sa,\r
IN const\r
ib_multipath_rec_t *\r
return p_pr_item;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_net16_t mpr_rcv_get_gids(IN osm_sa_t * sa, IN const ib_gid_t * gids,\r
IN int ngids, IN int is_sgid,\r
OUT osm_port_t ** pp_port)\r
return ib_status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_net16_t mpr_rcv_get_end_points(IN osm_sa_t * sa,\r
IN const osm_madw_t * p_madw,\r
OUT osm_port_t ** pp_ports,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (sa_status);\r
+ return sa_status;\r
}\r
\r
#define hash_lids(a, b, lmc) \\r
(((((a) >> (lmc)) << 4) | ((b) >> (lmc))) % 103)\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mpr_rcv_get_apm_paths(IN osm_sa_t * sa,\r
IN const ib_multipath_rec_t * p_mpr,\r
IN const osm_port_t * p_req_port,\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void mpr_rcv_process_pairs(IN osm_sa_t * sa,\r
IN const ib_multipath_rec_t * p_mpr,\r
IN osm_port_t * p_req_port,\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_mpr_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
const osm_physp_t *p_req_physp;\r
} osm_nr_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t nr_rcv_new_nr(osm_sa_t * sa,\r
IN const osm_node_t * p_node,\r
IN cl_qlist_t * p_list,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void nr_rcv_create_nr(IN osm_sa_t * sa, IN osm_node_t * p_node,\r
IN cl_qlist_t * p_list,\r
IN ib_net64_t const match_port_guid,\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void nr_rcv_by_comp_mask(IN cl_map_item_t * p_map_item, IN void *context)\r
{\r
const osm_nr_search_ctxt_t *p_ctxt = context;\r
OSM_LOG_EXIT(p_ctxt->sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_nr_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
+ * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_prefix_route.h>\r
#include <opensm/osm_ucast_lash.h>\r
\r
+#define MAX_HOPS 64\r
+\r
typedef struct osm_pr_item {\r
cl_list_item_t list_item;\r
ib_path_rec_t path_rec;\r
boolean_t reversible;\r
} osm_path_parms_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static inline boolean_t sa_path_rec_is_tavor_port(IN const osm_port_t * p_port)\r
{\r
osm_node_t const *p_node;\r
(vend_id == CL_HTON32(OSM_VENDOR_ID_VOLTAIRE))));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t\r
sa_path_rec_apply_tavor_mtu_limit(IN const ib_path_rec_t * p_pr,\r
IN const osm_port_t * p_src_port,\r
/* only if at least one of the ports is a Tavor device */\r
if (!sa_path_rec_is_tavor_port(p_src_port) &&\r
!sa_path_rec_is_tavor_port(p_dest_port))\r
- return (FALSE);\r
+ return FALSE;\r
\r
/*\r
we can apply the patch if either:\r
case 0: /* must be greater than */\r
case 2: /* exact match */\r
if (IB_MTU_LEN_1024 < required_mtu)\r
- return (FALSE);\r
+ return FALSE;\r
break;\r
\r
case 1: /* must be less than */\r
case 3: /* largest available */\r
/* the ULP intentionally requested */\r
/* the largest MTU possible */\r
- return (FALSE);\r
+ return FALSE;\r
\r
default:\r
/* if we're here, there's a bug in ib_path_rec_mtu_sel() */\r
}\r
}\r
\r
- return (TRUE);\r
+ return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa,\r
IN const ib_path_rec_t * p_pr,\r
IN const osm_port_t * p_src_port,\r
osm_qos_level_t *p_qos_level = NULL;\r
uint16_t valid_sl_mask = 0xffff;\r
int is_lash;\r
+ int hops = 0;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
goto Exit;\r
}\r
}\r
+\r
+ /* update number of hops traversed */\r
+ hops++;\r
+ if (hops > MAX_HOPS) {\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR,\r
+ "Path from GUID 0x%016" PRIx64 " (%s) to"\r
+ " lid %u GUID 0x%016" PRIx64 " (%s) needs"\r
+ " more than %d hops, max %d hops allowed\n",\r
+ cl_ntoh64(osm_physp_get_port_guid(p_src_physp)),\r
+ p_src_physp->p_node->print_desc, dest_lid_ho,\r
+ cl_ntoh64(osm_physp_get_port_guid\r
+ (p_dest_physp)),\r
+ p_dest_physp->p_node->print_desc, hops,\r
+ MAX_HOPS);\r
+ status = IB_NOT_FOUND;\r
+ goto Exit;\r
+ }\r
}\r
\r
/*\r
}\r
\r
/*\r
- * Set PathRecord SL.\r
+ * Set PathRecord SL\r
*/\r
\r
is_lash = (p_osm->routing_engine_used == OSM_ROUTING_ENGINE_TYPE_LASH);\r
mtu, rate, pkt_life, cl_ntoh16(pkey), sl);\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pr_rcv_build_pr(IN osm_sa_t * sa, IN const osm_port_t * p_src_port,\r
IN const osm_port_t * p_dest_port,\r
IN const ib_gid_t * p_dgid,\r
{\r
const osm_physp_t *p_src_physp;\r
const osm_physp_t *p_dest_physp;\r
- boolean_t is_nonzero_gid = 0;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
p_src_physp = p_src_port->p_physp;\r
\r
if (p_dgid)\r
- is_nonzero_gid = ib_gid_is_notzero(p_dgid);\r
-\r
- if (is_nonzero_gid)\r
p_pr->dgid = *p_dgid;\r
else {\r
p_dest_physp = p_dest_port->p_physp;\r
p_pr->hop_flow_raw &= cl_hton32(1 << 31);\r
\r
/* Only set HopLimit if going through a router */\r
- if (is_nonzero_gid)\r
- p_pr->hop_flow_raw |= IB_HOPLIMIT_MAX;\r
+ if (p_dgid)\r
+ p_pr->hop_flow_raw |= cl_hton32(IB_HOPLIMIT_MAX);\r
\r
p_pr->pkey = p_parms->pkey;\r
ib_path_rec_set_sl(p_pr, p_parms->sl);\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static osm_pr_item_t *pr_rcv_get_lid_pair_path(IN osm_sa_t * sa,\r
IN const ib_path_rec_t * p_pr,\r
IN const osm_port_t * p_src_port,\r
rather then requiring non-reversible paths ...\r
see Vol1 Ver1.2 p900 l16\r
*/\r
- if (comp_mask & IB_PR_COMPMASK_REVERSIBLE) {\r
- if ((!path_parms.reversible && (p_pr->num_path & 0x80))) {\r
- OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
- "Requested reversible path but failed to get one\n");\r
-\r
- free(p_pr_item);\r
- p_pr_item = NULL;\r
- goto Exit;\r
- }\r
+ if ((comp_mask & IB_PR_COMPMASK_REVERSIBLE) &&\r
+ !path_parms.reversible && (p_pr->num_path & 0x80)) {\r
+ OSM_LOG(sa->p_log, OSM_LOG_DEBUG,\r
+ "Requested reversible path but failed to get one\n");\r
+ free(p_pr_item);\r
+ p_pr_item = NULL;\r
+ goto Exit;\r
}\r
\r
pr_rcv_build_pr(sa, p_src_port, p_dest_port, p_dgid, src_lid_ho,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (p_pr_item);\r
+ return p_pr_item;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void pr_rcv_get_port_pair_paths(IN osm_sa_t * sa,\r
- IN const osm_madw_t * p_madw,\r
+ IN const ib_sa_mad_t *sa_mad,\r
IN const osm_port_t * p_req_port,\r
IN const osm_port_t * p_src_port,\r
IN const osm_port_t * p_dest_port,\r
IN const ib_gid_t * p_dgid,\r
- IN const ib_net64_t comp_mask,\r
IN cl_qlist_t * p_list)\r
{\r
- const ib_path_rec_t *p_pr;\r
- const ib_sa_mad_t *p_sa_mad;\r
+ const ib_path_rec_t *p_pr = ib_sa_mad_get_payload_ptr(sa_mad);\r
+ ib_net64_t comp_mask = sa_mad->comp_mask;\r
osm_pr_item_t *p_pr_item;\r
uint16_t src_lid_min_ho;\r
uint16_t src_lid_max_ho;\r
/* One of the pairs doesn't share a pkey so the path is disqualified. */\r
goto Exit;\r
\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = (ib_path_rec_t *) ib_sa_mad_get_payload_ptr(p_sa_mad);\r
-\r
/*\r
We shouldn't be here if the paths are disqualified in some way...\r
Thus, we assume every possible connection is valid.\r
/*\r
Refine our search if the client specified end-point LIDs\r
*/\r
- if (comp_mask & IB_PR_COMPMASK_DLID) {\r
- dest_lid_min_ho = cl_ntoh16(p_pr->dlid);\r
- dest_lid_max_ho = cl_ntoh16(p_pr->dlid);\r
- } else\r
+ if (comp_mask & IB_PR_COMPMASK_DLID)\r
+ dest_lid_max_ho = dest_lid_min_ho = cl_ntoh16(p_pr->dlid);\r
+ else\r
osm_port_get_lid_range_ho(p_dest_port, &dest_lid_min_ho,\r
&dest_lid_max_ho);\r
\r
- if (comp_mask & IB_PR_COMPMASK_SLID) {\r
- src_lid_min_ho = cl_ntoh16(p_pr->slid);\r
- src_lid_max_ho = cl_ntoh16(p_pr->slid);\r
- } else\r
+ if (comp_mask & IB_PR_COMPMASK_SLID)\r
+ src_lid_max_ho = src_lid_min_ho = cl_ntoh16(p_pr->slid);\r
+ else\r
osm_port_get_lid_range_ho(p_src_port, &src_lid_min_ho,\r
&src_lid_max_ho);\r
\r
path_num = 0;\r
\r
/* If SubnAdmGet, assume NumbPaths 1 (1.2 erratum) */\r
- if (p_sa_mad->method != IB_MAD_METHOD_GET)\r
- if (comp_mask & IB_PR_COMPMASK_NUMBPATH)\r
- iterations = ib_path_rec_num_path(p_pr);\r
- else\r
- iterations = (unsigned) (-1);\r
- else\r
+ if (sa_mad->method == IB_MAD_METHOD_GET)\r
iterations = 1;\r
+ else if (comp_mask & IB_PR_COMPMASK_NUMBPATH)\r
+ iterations = ib_path_rec_num_path(p_pr);\r
+ else\r
+ iterations = (unsigned) (-1);\r
\r
while (path_num < iterations) {\r
/*\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/* Find the router port that is configured to handle this prefix, if any */\r
static ib_net64_t find_router(const osm_sa_t *sa, ib_net64_t prefix)\r
{\r
}\r
\r
static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa,\r
- IN const osm_madw_t * p_madw,\r
+ IN const ib_sa_mad_t *sa_mad,\r
OUT const osm_port_t ** pp_src_port,\r
OUT const osm_port_t ** pp_dest_port,\r
- OUT ib_gid_t * p_dgid)\r
+ OUT const ib_gid_t ** pp_dgid)\r
{\r
- const ib_path_rec_t *p_pr;\r
- const ib_sa_mad_t *p_sa_mad;\r
- ib_net64_t comp_mask;\r
+ const ib_path_rec_t *p_pr = ib_sa_mad_get_payload_ptr(sa_mad);\r
+ ib_net64_t comp_mask = sa_mad->comp_mask;\r
ib_net64_t dest_guid;\r
- ib_api_status_t status;\r
ib_net16_t sa_status = IB_SA_MAD_STATUS_SUCCESS;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
to the source and destination port objects, if possible.\r
*/\r
\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = (ib_path_rec_t *) ib_sa_mad_get_payload_ptr(p_sa_mad);\r
-\r
- comp_mask = p_sa_mad->comp_mask;\r
-\r
/*\r
Check a few easy disqualifying cases up front before getting\r
into the endpoints.\r
"Non local SGID subnet prefix 0x%016"\r
PRIx64 "\n",\r
cl_ntoh64(p_pr->sgid.unicast.prefix));\r
-\r
sa_status = IB_SA_MAD_STATUS_INVALID_GID;\r
goto Exit;\r
}\r
OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,\r
"No source port with GUID 0x%016" PRIx64 "\n",\r
cl_ntoh64(p_pr->sgid.unicast.interface_id));\r
-\r
sa_status = IB_SA_MAD_STATUS_INVALID_GID;\r
goto Exit;\r
}\r
- } else {\r
- *pp_src_port = 0;\r
- if (comp_mask & IB_PR_COMPMASK_SLID) {\r
- status = cl_ptr_vector_at(&sa->p_subn->port_lid_tbl,\r
- cl_ntoh16(p_pr->slid),\r
- (void **)pp_src_port);\r
-\r
- if ((status != CL_SUCCESS) || (*pp_src_port == NULL)) {\r
- /*\r
- This 'error' is the client's fault (bad lid) so\r
- don't enter it as an error in our own log.\r
- Return an error response to the client.\r
- */\r
- OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,\r
- "No source port with LID %u\n",\r
- cl_ntoh16(p_pr->slid));\r
-\r
- sa_status = IB_SA_MAD_STATUS_NO_RECORDS;\r
- goto Exit;\r
- }\r
+ } else if (comp_mask & IB_PR_COMPMASK_SLID) {\r
+ *pp_src_port = osm_get_port_by_lid(sa->p_subn, p_pr->slid);\r
+ if (!*pp_src_port) {\r
+ /*\r
+ This 'error' is the client's fault (bad lid) so\r
+ don't enter it as an error in our own log.\r
+ Return an error response to the client.\r
+ */\r
+ OSM_LOG(sa->p_log, OSM_LOG_VERBOSE, "No source port "\r
+ "with LID %u\n", cl_ntoh16(p_pr->slid));\r
+ sa_status = IB_SA_MAD_STATUS_NO_RECORDS;\r
+ goto Exit;\r
}\r
- }\r
-\r
- if (p_dgid)\r
- memset(p_dgid, 0, sizeof(*p_dgid));\r
+ } else\r
+ *pp_src_port = NULL;\r
\r
if (comp_mask & IB_PR_COMPMASK_DGID) {\r
if (!ib_gid_is_link_local(&p_pr->dgid) &&\r
sa_status = IB_SA_MAD_STATUS_INVALID_GID;\r
goto Exit;\r
}\r
+ if (pp_dgid)\r
+ *pp_dgid = &p_pr->dgid;\r
} else\r
dest_guid = p_pr->dgid.unicast.interface_id;\r
\r
OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,\r
"No dest port with GUID 0x%016" PRIx64 "\n",\r
cl_ntoh64(dest_guid));\r
-\r
sa_status = IB_SA_MAD_STATUS_INVALID_GID;\r
goto Exit;\r
}\r
-\r
- if (p_dgid)\r
- *p_dgid = p_pr->dgid;\r
- } else {\r
- *pp_dest_port = 0;\r
- if (comp_mask & IB_PR_COMPMASK_DLID) {\r
- status = cl_ptr_vector_at(&sa->p_subn->port_lid_tbl,\r
- cl_ntoh16(p_pr->dlid),\r
- (void **)pp_dest_port);\r
-\r
- if ((status != CL_SUCCESS) || (*pp_dest_port == NULL)) {\r
- /*\r
- This 'error' is the client's fault (bad lid)\r
- so don't enter it as an error in our own log.\r
- Return an error response to the client.\r
- */\r
- OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,\r
- "No dest port with LID %u\n",\r
- cl_ntoh16(p_pr->dlid));\r
-\r
- sa_status = IB_SA_MAD_STATUS_NO_RECORDS;\r
- goto Exit;\r
- }\r
+ } else if (comp_mask & IB_PR_COMPMASK_DLID) {\r
+ *pp_dest_port = osm_get_port_by_lid(sa->p_subn, p_pr->dlid);\r
+ if (!*pp_dest_port) {\r
+ /*\r
+ This 'error' is the client's fault (bad lid)\r
+ so don't enter it as an error in our own log.\r
+ Return an error response to the client.\r
+ */\r
+ OSM_LOG(sa->p_log, OSM_LOG_VERBOSE, "No dest port "\r
+ "with LID %u\n", cl_ntoh16(p_pr->dlid));\r
+ sa_status = IB_SA_MAD_STATUS_NO_RECORDS;\r
+ goto Exit;\r
}\r
- }\r
+ } else\r
+ *pp_dest_port = NULL;\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (sa_status);\r
+ return sa_status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static void pr_rcv_process_world(IN osm_sa_t * sa, IN const osm_madw_t * p_madw,\r
+static void pr_rcv_process_world(IN osm_sa_t * sa, IN const ib_sa_mad_t * sa_mad,\r
IN const osm_port_t * requester_port,\r
IN const ib_gid_t * p_dgid,\r
- IN const ib_net64_t comp_mask,\r
IN cl_qlist_t * p_list)\r
{\r
const cl_qmap_t *p_tbl;\r
while (p_dest_port != (osm_port_t *) cl_qmap_end(p_tbl)) {\r
p_src_port = (osm_port_t *) cl_qmap_head(p_tbl);\r
while (p_src_port != (osm_port_t *) cl_qmap_end(p_tbl)) {\r
- pr_rcv_get_port_pair_paths(sa, p_madw, requester_port,\r
+ pr_rcv_get_port_pair_paths(sa, sa_mad, requester_port,\r
p_src_port, p_dest_port,\r
- p_dgid, comp_mask, p_list);\r
+ p_dgid, p_list);\r
+ if (sa_mad->method == IB_MAD_METHOD_GET &&\r
+ cl_qlist_count(p_list) > 0)\r
+ goto Exit;\r
\r
p_src_port =\r
(osm_port_t *) cl_qmap_next(&p_src_port->map_item);\r
(osm_port_t *) cl_qmap_next(&p_dest_port->map_item);\r
}\r
\r
+Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static void pr_rcv_process_half(IN osm_sa_t * sa, IN const osm_madw_t * p_madw,\r
+static void pr_rcv_process_half(IN osm_sa_t * sa, IN const ib_sa_mad_t * sa_mad,\r
IN const osm_port_t * requester_port,\r
IN const osm_port_t * p_src_port,\r
IN const osm_port_t * p_dest_port,\r
IN const ib_gid_t * p_dgid,\r
- IN const ib_net64_t comp_mask,\r
IN cl_qlist_t * p_list)\r
{\r
const cl_qmap_t *p_tbl;\r
*/\r
p_port = (osm_port_t *) cl_qmap_head(p_tbl);\r
while (p_port != (osm_port_t *) cl_qmap_end(p_tbl)) {\r
- pr_rcv_get_port_pair_paths(sa, p_madw, requester_port,\r
+ pr_rcv_get_port_pair_paths(sa, sa_mad, requester_port,\r
p_src_port, p_port, p_dgid,\r
- comp_mask, p_list);\r
+ p_list);\r
+ if (sa_mad->method == IB_MAD_METHOD_GET &&\r
+ cl_qlist_count(p_list) > 0)\r
+ break;\r
p_port = (osm_port_t *) cl_qmap_next(&p_port->map_item);\r
}\r
} else {\r
*/\r
p_port = (osm_port_t *) cl_qmap_head(p_tbl);\r
while (p_port != (osm_port_t *) cl_qmap_end(p_tbl)) {\r
- pr_rcv_get_port_pair_paths(sa, p_madw, requester_port,\r
+ pr_rcv_get_port_pair_paths(sa, sa_mad, requester_port,\r
p_port, p_dest_port, p_dgid,\r
- comp_mask, p_list);\r
+ p_list);\r
+ if (sa_mad->method == IB_MAD_METHOD_GET &&\r
+ cl_qlist_count(p_list) > 0)\r
+ break;\r
p_port = (osm_port_t *) cl_qmap_next(&p_port->map_item);\r
}\r
}\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static void pr_rcv_process_pair(IN osm_sa_t * sa, IN const osm_madw_t * p_madw,\r
+static void pr_rcv_process_pair(IN osm_sa_t * sa, IN const ib_sa_mad_t * sa_mad,\r
IN const osm_port_t * requester_port,\r
IN const osm_port_t * p_src_port,\r
IN const osm_port_t * p_dest_port,\r
IN const ib_gid_t * p_dgid,\r
- IN const ib_net64_t comp_mask,\r
IN cl_qlist_t * p_list)\r
{\r
OSM_LOG_ENTER(sa->p_log);\r
\r
- pr_rcv_get_port_pair_paths(sa, p_madw, requester_port, p_src_port,\r
- p_dest_port, p_dgid, comp_mask, p_list);\r
+ pr_rcv_get_port_pair_paths(sa, sa_mad, requester_port, p_src_port,\r
+ p_dest_port, p_dgid, p_list);\r
\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static osm_mgrp_t *pr_get_mgrp(IN osm_sa_t * sa, IN const osm_madw_t * p_madw)\r
-{\r
- ib_path_rec_t *p_pr;\r
- const ib_sa_mad_t *p_sa_mad;\r
- osm_mgrp_t *mgrp;\r
-\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = ib_sa_mad_get_payload_ptr(p_sa_mad);\r
-\r
- if (!(p_sa_mad->comp_mask & IB_PR_COMPMASK_DGID)) {\r
- OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,\r
- "discard multicast target SA PR with wildcarded MGID");\r
- return NULL;\r
- }\r
-\r
- mgrp = osm_get_mgrp_by_mgid(sa, &p_pr->dgid);\r
- if (!mgrp) {\r
- char gid_str[INET6_ADDRSTRLEN];\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F09: "\r
- "No MC group found for PathRecord destination GID %s\n",\r
- inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,\r
- sizeof gid_str));\r
- return NULL;\r
- }\r
-\r
- return mgrp;\r
-}\r
-\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t pr_match_mgrp_attributes(IN osm_sa_t * sa,\r
- IN const osm_madw_t * p_madw,\r
+ IN const ib_sa_mad_t * sa_mad,\r
IN const osm_mgrp_t * p_mgrp)\r
{\r
- const ib_path_rec_t *p_pr;\r
- const ib_sa_mad_t *p_sa_mad;\r
- ib_net64_t comp_mask;\r
+ const ib_path_rec_t *p_pr = ib_sa_mad_get_payload_ptr(sa_mad);\r
+ ib_net64_t comp_mask = sa_mad->comp_mask;\r
const osm_port_t *port;\r
ib_api_status_t status = IB_ERROR;\r
uint32_t flow_label;\r
- uint8_t sl;\r
- uint8_t hop_limit;\r
+ uint8_t sl, hop_limit;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = ib_sa_mad_get_payload_ptr(p_sa_mad);\r
-\r
- comp_mask = p_sa_mad->comp_mask;\r
-\r
- /* check that MLID of the MC group matchs the PathRecord DLID */\r
+ /* check that MLID of the MC group matches the PathRecord DLID */\r
if ((comp_mask & IB_PR_COMPMASK_DLID) && p_mgrp->mlid != p_pr->dlid)\r
goto Exit;\r
\r
}\r
\r
/* Also, MTU, rate, packet lifetime, and raw traffic requested are not currently checked */\r
- if (comp_mask & IB_PR_COMPMASK_PKEY) {\r
- if (p_pr->pkey != p_mgrp->mcmember_rec.pkey)\r
- goto Exit;\r
- }\r
+ if ((comp_mask & IB_PR_COMPMASK_PKEY) &&\r
+ p_pr->pkey != p_mgrp->mcmember_rec.pkey)\r
+ goto Exit;\r
\r
ib_member_get_sl_flow_hop(p_mgrp->mcmember_rec.sl_flow_hop,\r
&sl, &flow_label, &hop_limit);\r
\r
- if (comp_mask & IB_PR_COMPMASK_SL) {\r
- if (ib_path_rec_sl(p_pr) != sl)\r
- goto Exit;\r
- }\r
+ if ((comp_mask & IB_PR_COMPMASK_SL) && ib_path_rec_sl(p_pr) != sl)\r
+ goto Exit;\r
\r
/* If SubnAdmGet, assume NumbPaths of 1 (1.2 erratum) */\r
if ((comp_mask & IB_PR_COMPMASK_NUMBPATH) &&\r
- (p_sa_mad->method != IB_MAD_METHOD_GET)) {\r
- if (ib_path_rec_num_path(p_pr) == 0)\r
- goto Exit;\r
- }\r
+ sa_mad->method != IB_MAD_METHOD_GET &&\r
+ ib_path_rec_num_path(p_pr) == 0)\r
+ goto Exit;\r
\r
- if (comp_mask & IB_PR_COMPMASK_FLOWLABEL) {\r
- if (ib_path_rec_flow_lbl(p_pr) != flow_label)\r
- goto Exit;\r
- }\r
+ if ((comp_mask & IB_PR_COMPMASK_FLOWLABEL) &&\r
+ ib_path_rec_flow_lbl(p_pr) != flow_label)\r
+ goto Exit;\r
\r
- if (comp_mask & IB_PR_COMPMASK_HOPLIMIT) {\r
- if (ib_path_rec_hop_limit(p_pr) != hop_limit)\r
- goto Exit;\r
- }\r
+ if ((comp_mask & IB_PR_COMPMASK_HOPLIMIT) &&\r
+ ib_path_rec_hop_limit(p_pr) != hop_limit)\r
+ goto Exit;\r
\r
- if (comp_mask & IB_PR_COMPMASK_TCLASS) {\r
- if (p_pr->tclass != p_mgrp->mcmember_rec.tclass)\r
- goto Exit;\r
- }\r
+ if ((comp_mask & IB_PR_COMPMASK_TCLASS) &&\r
+ p_pr->tclass != p_mgrp->mcmember_rec.tclass)\r
+ goto Exit;\r
\r
status = IB_SUCCESS;\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static int pr_rcv_check_mcast_dest(osm_sa_t * sa, IN const osm_madw_t * p_madw)\r
+static void pr_process_multicast(osm_sa_t * sa, const ib_sa_mad_t *sa_mad,\r
+ cl_qlist_t *list)\r
{\r
- const ib_path_rec_t *p_pr;\r
- const ib_sa_mad_t *p_sa_mad;\r
- ib_net64_t comp_mask;\r
- int is_multicast = 0;\r
-\r
- OSM_LOG_ENTER(sa->p_log);\r
+ ib_path_rec_t *pr = ib_sa_mad_get_payload_ptr(sa_mad);\r
+ osm_mgrp_t *mgrp;\r
+ ib_api_status_t status;\r
+ osm_pr_item_t *pr_item;\r
+ uint32_t flow_label;\r
+ uint8_t sl, hop_limit;\r
\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = (ib_path_rec_t *) ib_sa_mad_get_payload_ptr(p_sa_mad);\r
+ OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Multicast destination requested\n");\r
\r
- comp_mask = p_sa_mad->comp_mask;\r
+ mgrp = osm_get_mgrp_by_mgid(sa->p_subn, &pr->dgid);\r
+ if (!mgrp) {\r
+ char gid_str[INET6_ADDRSTRLEN];\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F09: "\r
+ "No MC group found for PathRecord destination GID %s\n",\r
+ inet_ntop(AF_INET6, pr->dgid.raw, gid_str,\r
+ sizeof gid_str));\r
+ return;\r
+ }\r
\r
- if (comp_mask & IB_PR_COMPMASK_DGID) {\r
- is_multicast = ib_gid_is_multicast(&p_pr->dgid);\r
- if (!is_multicast)\r
- goto Exit;\r
+ /* Make sure the rest of the PathRecord matches the MC group attributes */\r
+ status = pr_match_mgrp_attributes(sa, sa_mad, mgrp);\r
+ if (status != IB_SUCCESS) {\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F19: "\r
+ "MC group attributes don't match PathRecord request\n");\r
+ return;\r
}\r
\r
- if (comp_mask & IB_PR_COMPMASK_DLID) {\r
- if (cl_ntoh16(p_pr->dlid) >= IB_LID_MCAST_START_HO &&\r
- cl_ntoh16(p_pr->dlid) <= IB_LID_MCAST_END_HO)\r
- is_multicast = 1;\r
- else if (is_multicast) {\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F12: "\r
- "PathRecord request indicates MGID but not MLID\n");\r
- is_multicast = -1;\r
- }\r
+ pr_item = malloc(sizeof(*pr_item));\r
+ if (pr_item == NULL) {\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F18: "\r
+ "Unable to allocate path record for MC group\n");\r
+ return;\r
}\r
+ memset(pr_item, 0, sizeof(*pr_item));\r
\r
-Exit:\r
- OSM_LOG_EXIT(sa->p_log);\r
- return (is_multicast);\r
+ /* Copy PathRecord request into response */\r
+ pr_item->path_rec = *pr;\r
+\r
+ /* Now, use the MC info to cruft up the PathRecord response */\r
+ pr_item->path_rec.dgid = mgrp->mcmember_rec.mgid;\r
+ pr_item->path_rec.dlid = mgrp->mcmember_rec.mlid;\r
+ pr_item->path_rec.tclass = mgrp->mcmember_rec.tclass;\r
+ pr_item->path_rec.num_path = 1;\r
+ pr_item->path_rec.pkey = mgrp->mcmember_rec.pkey;\r
+\r
+ /* MTU, rate, and packet lifetime should be exactly */\r
+ pr_item->path_rec.mtu = (2 << 6) | mgrp->mcmember_rec.mtu;\r
+ pr_item->path_rec.rate = (2 << 6) | mgrp->mcmember_rec.rate;\r
+ pr_item->path_rec.pkt_life = (2 << 6) | mgrp->mcmember_rec.pkt_life;\r
+\r
+ /* SL, Hop Limit, and Flow Label */\r
+ ib_member_get_sl_flow_hop(mgrp->mcmember_rec.sl_flow_hop,\r
+ &sl, &flow_label, &hop_limit);\r
+ ib_path_rec_set_sl(&pr_item->path_rec, sl);\r
+ ib_path_rec_set_qos_class(&pr_item->path_rec, 0);\r
+\r
+ /* HopLimit is not yet set in non link local MC groups */\r
+ /* If it were, this would not be needed */\r
+ if (ib_mgid_get_scope(&mgrp->mcmember_rec.mgid) !=\r
+ IB_MC_SCOPE_LINK_LOCAL)\r
+ hop_limit = IB_HOPLIMIT_MAX;\r
+\r
+ pr_item->path_rec.hop_flow_raw =\r
+ cl_hton32(hop_limit) | (flow_label << 8);\r
+\r
+ cl_qlist_insert_tail(list, &pr_item->list_item);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pr_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
osm_madw_t *p_madw = data;\r
- const ib_path_rec_t *p_pr;\r
- const ib_sa_mad_t *p_sa_mad;\r
- const osm_port_t *p_src_port;\r
- const osm_port_t *p_dest_port;\r
+ const ib_sa_mad_t *p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
+ ib_path_rec_t *p_pr = ib_sa_mad_get_payload_ptr(p_sa_mad);\r
cl_qlist_t pr_list;\r
- ib_gid_t dgid;\r
- ib_net16_t sa_status;\r
+ const ib_gid_t *p_dgid = NULL;\r
+ const osm_port_t *p_src_port, *p_dest_port;\r
osm_port_t *requester_port;\r
- int ret;\r
\r
OSM_LOG_ENTER(sa->p_log);\r
\r
CL_ASSERT(p_madw);\r
\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = (ib_path_rec_t *) ib_sa_mad_get_payload_ptr(p_sa_mad);\r
-\r
CL_ASSERT(p_sa_mad->attr_id == IB_MAD_ATTR_PATH_RECORD);\r
\r
/* we only support SubnAdmGet and SubnAdmGetTable methods */\r
\r
/* update the requester physical port. */\r
requester_port = osm_get_port_by_mad_addr(sa->p_log, sa->p_subn,\r
- osm_madw_get_mad_addr_ptr\r
- (p_madw));\r
+ osm_madw_get_mad_addr_ptr(p_madw));\r
if (requester_port == NULL) {\r
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F16: "\r
"Cannot find requester physical port\n");\r
cl_plock_acquire(sa->p_lock);\r
\r
/* Handle multicast destinations separately */\r
- if ((ret = pr_rcv_check_mcast_dest(sa, p_madw)) < 0) {\r
- /* Multicast DGID with unicast DLID */\r
- cl_plock_release(sa->p_lock);\r
- osm_sa_send_error(sa, p_madw, IB_MAD_STATUS_INVALID_FIELD);\r
- goto Exit;\r
+ if ((p_sa_mad->comp_mask & IB_PR_COMPMASK_DGID) &&\r
+ ib_gid_is_multicast(&p_pr->dgid)) {\r
+ pr_process_multicast(sa, p_sa_mad, &pr_list);\r
+ goto Unlock;\r
}\r
\r
- if (ret > 0)\r
- goto McastDest;\r
-\r
OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Unicast destination requested\n");\r
\r
- sa_status = pr_rcv_get_end_points(sa, p_madw, &p_src_port, &p_dest_port,\r
- &dgid);\r
-\r
- if (sa_status == IB_SA_MAD_STATUS_SUCCESS) {\r
- /*\r
- What happens next depends on the type of endpoint information\r
- that was specified....\r
- */\r
- if (p_src_port) {\r
- if (p_dest_port)\r
- pr_rcv_process_pair(sa, p_madw, requester_port,\r
- p_src_port, p_dest_port,\r
- &dgid, p_sa_mad->comp_mask,\r
- &pr_list);\r
- else\r
- pr_rcv_process_half(sa, p_madw, requester_port,\r
- p_src_port, NULL, &dgid,\r
- p_sa_mad->comp_mask,\r
- &pr_list);\r
- } else {\r
- if (p_dest_port)\r
- pr_rcv_process_half(sa, p_madw, requester_port,\r
- NULL, p_dest_port, &dgid,\r
- p_sa_mad->comp_mask,\r
- &pr_list);\r
- else\r
- /*\r
- Katie, bar the door!\r
- */\r
- pr_rcv_process_world(sa, p_madw, requester_port,\r
- &dgid, p_sa_mad->comp_mask,\r
- &pr_list);\r
- }\r
- }\r
- goto Unlock;\r
-\r
-McastDest:\r
- OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Multicast destination requested\n");\r
- {\r
- osm_mgrp_t *p_mgrp = NULL;\r
- ib_api_status_t status;\r
- osm_pr_item_t *p_pr_item;\r
- uint32_t flow_label;\r
- uint8_t sl;\r
- uint8_t hop_limit;\r
-\r
- /* First, get the MC info */\r
- p_mgrp = pr_get_mgrp(sa, p_madw);\r
- if (!p_mgrp)\r
- goto Unlock;\r
-\r
- /* Make sure the rest of the PathRecord matches the MC group attributes */\r
- status = pr_match_mgrp_attributes(sa, p_madw, p_mgrp);\r
- if (status != IB_SUCCESS) {\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F19: "\r
- "MC group attributes don't match PathRecord request\n");\r
- goto Unlock;\r
- }\r
-\r
- p_pr_item = malloc(sizeof(*p_pr_item));\r
- if (p_pr_item == NULL) {\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F18: "\r
- "Unable to allocate path record for MC group\n");\r
- goto Unlock;\r
- }\r
- memset(p_pr_item, 0, sizeof(*p_pr_item));\r
-\r
- /* Copy PathRecord request into response */\r
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);\r
- p_pr = (ib_path_rec_t *)\r
- ib_sa_mad_get_payload_ptr(p_sa_mad);\r
- p_pr_item->path_rec = *p_pr;\r
-\r
- /* Now, use the MC info to cruft up the PathRecord response */\r
- p_pr_item->path_rec.dgid = p_mgrp->mcmember_rec.mgid;\r
- p_pr_item->path_rec.dlid = p_mgrp->mcmember_rec.mlid;\r
- p_pr_item->path_rec.tclass = p_mgrp->mcmember_rec.tclass;\r
- p_pr_item->path_rec.num_path = 1;\r
- p_pr_item->path_rec.pkey = p_mgrp->mcmember_rec.pkey;\r
-\r
- /* MTU, rate, and packet lifetime should be exactly */\r
- p_pr_item->path_rec.mtu = (2 << 6) | p_mgrp->mcmember_rec.mtu;\r
- p_pr_item->path_rec.rate = (2 << 6) | p_mgrp->mcmember_rec.rate;\r
- p_pr_item->path_rec.pkt_life =\r
- (2 << 6) | p_mgrp->mcmember_rec.pkt_life;\r
-\r
- /* SL, Hop Limit, and Flow Label */\r
- ib_member_get_sl_flow_hop(p_mgrp->mcmember_rec.sl_flow_hop,\r
- &sl, &flow_label, &hop_limit);\r
- ib_path_rec_set_sl(&p_pr_item->path_rec, sl);\r
- ib_path_rec_set_qos_class(&p_pr_item->path_rec, 0);\r
-\r
- /* HopLimit is not yet set in non link local MC groups */\r
- /* If it were, this would not be needed */\r
- if (ib_mgid_get_scope(&p_mgrp->mcmember_rec.mgid) !=\r
- IB_MC_SCOPE_LINK_LOCAL)\r
- hop_limit = IB_HOPLIMIT_MAX;\r
-\r
- p_pr_item->path_rec.hop_flow_raw =\r
- cl_hton32(hop_limit) | (flow_label << 8);\r
-\r
- cl_qlist_insert_tail(&pr_list, &p_pr_item->list_item);\r
+ if (pr_rcv_get_end_points(sa, p_sa_mad, &p_src_port, &p_dest_port,\r
+ &p_dgid) != IB_SA_MAD_STATUS_SUCCESS)\r
+ goto Unlock;\r
+ /*\r
+ What happens next depends on the type of endpoint information\r
+ that was specified....\r
+ */\r
+ if (p_src_port) {\r
+ if (p_dest_port)\r
+ pr_rcv_process_pair(sa, p_sa_mad, requester_port,\r
+ p_src_port, p_dest_port, p_dgid,\r
+ &pr_list);\r
+ else\r
+ pr_rcv_process_half(sa, p_sa_mad, requester_port,\r
+ p_src_port, NULL, p_dgid, &pr_list);\r
+ } else {\r
+ if (p_dest_port)\r
+ pr_rcv_process_half(sa, p_sa_mad, requester_port,\r
+ NULL, p_dest_port, p_dgid, &pr_list);\r
+ else\r
+ /*\r
+ Katie, bar the door!\r
+ */\r
+ pr_rcv_process_world(sa, p_sa_mad, requester_port,\r
+ p_dgid, &pr_list);\r
}\r
\r
Unlock:\r
const osm_physp_t *p_req_physp;\r
} osm_pkey_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pkey_create(IN osm_sa_t * sa, IN osm_physp_t * p_physp,\r
IN osm_pkey_search_ctxt_t * p_ctxt,\r
IN uint16_t block)\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pkey_check_physp(IN osm_sa_t * sa, IN osm_physp_t * p_physp,\r
osm_pkey_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pkey_by_comp_mask(IN osm_sa_t * sa, IN const osm_port_t * p_port,\r
osm_pkey_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pkey_by_comp_mask_cb(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_port_t *p_port = (osm_port_t *) p_map_item;\r
sa_pkey_by_comp_mask(p_ctxt->sa, p_port, p_ctxt);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pkey_rec_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
const ib_pkey_table_t *p_pkey;\r
cl_qlist_t rec_list;\r
osm_pkey_search_ctxt_t context;\r
- ib_api_status_t status = IB_SUCCESS;\r
ib_net64_t comp_mask;\r
osm_physp_t *p_req_physp;\r
\r
*/\r
if (comp_mask & IB_PKEY_COMPMASK_LID) {\r
p_port = osm_get_port_by_lid(sa->p_subn, p_rcvd_rec->lid);\r
- if (!p_port) {\r
- status = IB_NOT_FOUND;\r
+ if (!p_port)\r
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 460B: "\r
"No port found with LID %u\n",\r
cl_ntoh16(p_rcvd_rec->lid));\r
- }\r
- }\r
-\r
- if (status == IB_SUCCESS) {\r
- /* if we got a unique port - no need for a port search */\r
- if (p_port)\r
- /* this does the loop on all the port phys ports */\r
- sa_pkey_by_comp_mask(sa, p_port, &context);\r
else\r
- cl_qmap_apply_func(&sa->p_subn->port_guid_tbl,\r
- sa_pkey_by_comp_mask_cb, &context);\r
- }\r
+ sa_pkey_by_comp_mask(sa, p_port, &context);\r
+ } else\r
+ cl_qmap_apply_func(&sa->p_subn->port_guid_tbl,\r
+ sa_pkey_by_comp_mask_cb, &context);\r
\r
cl_plock_release(sa->p_lock);\r
\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
boolean_t is_enhanced_comp_mask;\r
} osm_pir_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t pir_rcv_new_pir(IN osm_sa_t * sa,\r
IN const osm_physp_t * p_physp,\r
IN cl_qlist_t * p_list,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pir_create(IN osm_sa_t * sa, IN const osm_physp_t * p_physp,\r
IN osm_pir_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pir_check_physp(IN osm_sa_t * sa, IN const osm_physp_t * p_physp,\r
osm_pir_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pir_by_comp_mask(IN osm_sa_t * sa, IN osm_node_t * p_node,\r
osm_pir_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_pir_by_comp_mask_cb(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
osm_node_t *p_node = (osm_node_t *) p_map_item;\r
sa_pir_by_comp_mask(p_ctxt->sa, p_node, p_ctxt);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_pir_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
osm_madw_t *p_madw = data;\r
const ib_sa_mad_t *p_rcvd_mad;\r
const ib_portinfo_record_t *p_rcvd_rec;\r
- const cl_ptr_vector_t *p_tbl;\r
const osm_port_t *p_port = NULL;\r
const ib_port_info_t *p_pi;\r
cl_qlist_t rec_list;\r
osm_pir_search_ctxt_t context;\r
- ib_api_status_t status = IB_SUCCESS;\r
ib_net64_t comp_mask;\r
osm_physp_t *p_req_physp;\r
\r
if (osm_log_is_active(sa->p_log, OSM_LOG_DEBUG))\r
osm_dump_portinfo_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG);\r
\r
- p_tbl = &sa->p_subn->port_lid_tbl;\r
p_pi = &p_rcvd_rec->port_info;\r
\r
cl_qlist_init(&rec_list);\r
\r
cl_plock_acquire(sa->p_lock);\r
\r
- CL_ASSERT(cl_ptr_vector_get_size(p_tbl) < 0x10000);\r
-\r
/*\r
If the user specified a LID, it obviously narrows our\r
work load, since we don't have to search every port\r
*/\r
- if (comp_mask & IB_PIR_COMPMASK_LID) {\r
+ if (comp_mask & (IB_PIR_COMPMASK_LID | IB_PIR_COMPMASK_BASELID)) {\r
p_port = osm_get_port_by_lid(sa->p_subn, p_rcvd_rec->lid);\r
- if (!p_port) {\r
- status = IB_NOT_FOUND;\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2109: "\r
- "No port found with LID %u\n",\r
- cl_ntoh16(p_rcvd_rec->lid));\r
- }\r
- } else if (comp_mask & IB_PIR_COMPMASK_BASELID) {\r
- if ((uint16_t) cl_ptr_vector_get_size(p_tbl) >\r
- cl_ntoh16(p_pi->base_lid))\r
- p_port = cl_ptr_vector_get(p_tbl,\r
- cl_ntoh16(p_pi->base_lid));\r
- else {\r
- status = IB_NOT_FOUND;\r
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2103: "\r
- "Given LID (%u) is out of range:%u\n",\r
- cl_ntoh16(p_pi->base_lid),\r
- cl_ptr_vector_get_size(p_tbl));\r
- }\r
- }\r
-\r
- if (status == IB_SUCCESS) {\r
if (p_port)\r
sa_pir_by_comp_mask(sa, p_port->p_node, &context);\r
else\r
- cl_qmap_apply_func(&sa->p_subn->node_guid_tbl,\r
- sa_pir_by_comp_mask_cb, &context);\r
- }\r
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2109: "\r
+ "No port found with LID %u\n",\r
+ cl_ntoh16(p_rcvd_rec->lid));\r
+ } else\r
+ cl_qmap_apply_func(&sa->p_subn->node_guid_tbl,\r
+ sa_pir_by_comp_mask_cb, &context);\r
\r
cl_plock_release(sa->p_lock);\r
\r
const osm_physp_t *p_req_physp;\r
} osm_sr_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t\r
match_service_pkey_with_ports_pkey(IN osm_sa_t * sa,\r
IN const osm_madw_t * p_madw,\r
return valid;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t\r
match_name_to_key_association(IN osm_sa_t * sa,\r
ib_service_record_t * p_service_rec,\r
return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t validate_sr(IN osm_sa_t * sa, IN const osm_madw_t * p_madw)\r
{\r
boolean_t valid = TRUE;\r
return valid;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sr_rcv_respond(IN osm_sa_t * sa, IN osm_madw_t * p_madw,\r
IN cl_qlist_t * p_list)\r
{\r
osm_sa_respond(sa, p_madw, sizeof(ib_service_record_t), p_list);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void get_matching_sr(IN cl_list_item_t * p_list_item, IN void *context)\r
{\r
osm_sr_search_ctxt_t *p_ctxt = context;\r
return;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sr_rcv_process_get_method(osm_sa_t * sa, IN osm_madw_t * p_madw)\r
{\r
ib_sa_mad_t *p_sa_mad;\r
return;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sr_rcv_process_set_method(osm_sa_t * sa, IN osm_madw_t * p_madw)\r
{\r
ib_sa_mad_t *p_sa_mad;\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sr_rcv_process_delete_method(osm_sa_t * sa, IN osm_madw_t * p_madw)\r
{\r
ib_sa_mad_t *p_sa_mad;\r
return;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sr_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sa_t *sa = context;\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sr_rcv_lease_cb(IN void *context)\r
{\r
osm_sa_t *sa = context;\r
const osm_physp_t *p_req_physp;\r
} osm_slvl_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_slvl_create(IN osm_sa_t * sa, IN const osm_physp_t * p_physp,\r
IN osm_slvl_search_ctxt_t * p_ctxt,\r
IN uint8_t in_port_idx)\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_slvl_by_comp_mask(IN osm_sa_t * sa, IN const osm_port_t * p_port,\r
osm_slvl_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_slvl_by_comp_mask_cb(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_port_t *p_port = (osm_port_t *) p_map_item;\r
sa_slvl_by_comp_mask(p_ctxt->sa, p_port, p_ctxt);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_slvl_rec_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_smir_by_comp_mask(IN osm_sa_t * sa,\r
IN const osm_remote_sm_t * p_rem_sm,\r
osm_smir_search_ctxt_t * p_ctxt)\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_smir_by_comp_mask_cb(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_remote_sm_t *p_rem_sm = (osm_remote_sm_t *) p_map_item;\r
sa_smir_by_comp_mask(p_ctxt->sa, p_rem_sm, p_ctxt);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_smir_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
const osm_physp_t *p_req_physp;\r
} osm_sir_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t sir_rcv_new_sir(IN osm_sa_t * sa,\r
IN const osm_switch_t * p_sw,\r
IN cl_qlist_t * p_list,\r
\r
Exit:\r
OSM_LOG_EXIT(sa->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sir_rcv_create_sir(IN osm_sa_t * sa, IN const osm_switch_t * p_sw,\r
IN cl_qlist_t * p_list, IN ib_net16_t match_lid,\r
IN const osm_physp_t * p_req_physp)\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sir_rcv_by_comp_mask(IN cl_map_item_t * p_map_item, IN void *cxt)\r
{\r
const osm_sir_search_ctxt_t *p_ctxt = cxt;\r
OSM_LOG_EXIT(p_ctxt->sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sir_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
const osm_physp_t *p_req_physp;\r
} osm_vl_arb_search_ctxt_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_vl_arb_create(IN osm_sa_t * sa, IN osm_physp_t * p_physp,\r
IN osm_vl_arb_search_ctxt_t * p_ctxt,\r
IN uint8_t block)\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_vl_arb_check_physp(IN osm_sa_t * sa, IN osm_physp_t * p_physp,\r
osm_vl_arb_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_vl_arb_by_comp_mask(osm_sa_t * sa, IN const osm_port_t * p_port,\r
osm_vl_arb_search_ctxt_t * p_ctxt)\r
{\r
OSM_LOG_EXIT(sa->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sa_vl_arb_by_comp_mask_cb(IN cl_map_item_t * p_map_item, void *cxt)\r
{\r
const osm_port_t *p_port = (osm_port_t *) p_map_item;\r
sa_vl_arb_by_comp_mask(p_ctxt->sa, p_port, p_ctxt);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vlarb_rec_rcv_process(IN void *ctx, IN void *data)\r
{\r
osm_sa_t *sa = ctx;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <complib/cl_debug.h>\r
#include <complib/cl_timer.h>\r
#include <opensm/osm_service.h>\r
+#include <opensm/osm_opensm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_svcr_delete(IN osm_svcr_t * p_svcr)\r
{\r
free(p_svcr);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_svcr_init(IN osm_svcr_t * p_svcr,\r
IN const ib_service_record_t * p_svc_rec)\r
{\r
p_svcr->service_record = *p_svc_rec;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_svcr_t *osm_svcr_new(IN const ib_service_record_t * p_svc_rec)\r
{\r
osm_svcr_t *p_svcr;\r
return p_svcr;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static cl_status_t match_rid_of_svc_rec(IN const cl_list_item_t * p_list_item,\r
IN void *context)\r
{\r
return CL_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_svcr_t *osm_svcr_get_by_rid(IN osm_subn_t const *p_subn,\r
IN osm_log_t * p_log,\r
IN ib_service_record_t * p_svc_rec)\r
return (osm_svcr_t *) p_list_item;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_svcr_insert_to_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log,\r
IN osm_svcr_t * p_svcr)\r
{\r
"Inserting new Service Record into Database\n");\r
\r
cl_qlist_insert_head(&p_subn->sa_sr_list, &p_svcr->list_item);\r
+ p_subn->p_osm->sa.dirty = TRUE;\r
\r
OSM_LOG_EXIT(p_log);\r
}\r
p_svcr->service_record.service_id);\r
\r
cl_qlist_remove_item(&p_subn->sa_sr_list, &p_svcr->list_item);\r
+ p_subn->p_osm->sa.dirty = TRUE;\r
\r
OSM_LOG_EXIT(p_log);\r
}\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_helper.h>\r
#include <opensm/osm_sm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* WE ONLY RECEIVE GET or SET responses\r
*/\r
osm_slvl_context_t *p_context;\r
ib_net64_t port_guid;\r
ib_net64_t node_guid;\r
- uint8_t out_port_num, in_port_num;\r
+ uint32_t attr_mod;\r
+ uint8_t startinport, endinport, startoutport, endoutport;\r
+ uint8_t in_port, out_port;\r
\r
CL_ASSERT(sm);\r
\r
p_port = osm_get_port_by_guid(sm->p_subn, port_guid);\r
\r
if (!p_port) {\r
- cl_plock_release(sm->p_lock);\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 2C06: "\r
"No port object for port with GUID 0x%" PRIx64\r
"\n\t\t\t\tfor parent node GUID 0x%" PRIx64\r
\r
/* in case of a non switch node the attr modifier should be ignored */\r
if (osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH) {\r
- out_port_num =\r
- (uint8_t) cl_ntoh32(p_smp->attr_mod & 0xFF000000);\r
- in_port_num =\r
- (uint8_t) cl_ntoh32((p_smp->attr_mod & 0x00FF0000) << 8);\r
- p_physp = osm_node_get_physp_ptr(p_node, out_port_num);\r
+ unsigned num_ports = osm_node_get_num_physp(p_node) - 1;\r
+ attr_mod = cl_ntoh32(p_smp->attr_mod);\r
+\r
+ if (attr_mod & 0x10000) {\r
+ startoutport = ib_switch_info_is_enhanced_port0(&p_node->sw->switch_info) ? 0 : 1;\r
+ endoutport = osm_node_get_num_physp(p_node) - 1;\r
+ } else\r
+ startoutport = endoutport = attr_mod & 0xff;\r
+\r
+ if (attr_mod & 0x20000) {\r
+ startinport = ib_switch_info_is_enhanced_port0(&p_node->sw->switch_info) ? 0 : 1;\r
+ endinport = osm_node_get_num_physp(p_node) - 1;\r
+ } else\r
+ startinport = endinport = (attr_mod >> 8) & 0xff;\r
+\r
+ if (startinport > num_ports || startoutport > num_ports) {\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 2C07"\r
+ "Invalid attribute modifier 0x%x received in"\r
+ " response from switch 0x%" PRIx64 "\n",\r
+ cl_ntoh32(attr_mod), cl_ntoh64(node_guid));\r
+ goto Exit;\r
+ }\r
+\r
} else {\r
- p_physp = p_port->p_physp;\r
- out_port_num = p_physp->port_num;\r
- in_port_num = 0;\r
+ startoutport = endoutport = p_port->p_physp->port_num;\r
+ startinport = endinport = 0;\r
}\r
\r
- /*\r
- We do not care if this is a result of a set or get -\r
- all we want is to update the subnet.\r
- */\r
- OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
- "Got SLtoVL get response in_port_num %u out_port_num %u with "\r
- "GUID 0x%" PRIx64 " for parent node GUID 0x%" PRIx64 ", TID 0x%"\r
- PRIx64 "\n", in_port_num, out_port_num, cl_ntoh64(port_guid),\r
- cl_ntoh64(node_guid), cl_ntoh64(p_smp->trans_id));\r
-\r
- /*\r
- Determine if we encountered a new Physical Port.\r
- If so, Ignore it.\r
- */\r
- if (!p_physp) {\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
- "Got invalid port number %u\n", out_port_num);\r
- goto Exit;\r
+ OSM_LOG(sm->p_log, OSM_LOG_DEBUG, "Received SLtoVL GetResp"\r
+ " in_port_num %u out_port_num %u with GUID 0x%" PRIx64\r
+ " for parent node GUID 0x%" PRIx64 ", TID 0x%" PRIx64 "\n",\r
+ startinport == endinport ? startinport : 0xff,\r
+ startoutport == endoutport ? startoutport : 0xff,\r
+ cl_ntoh64(port_guid), cl_ntoh64(node_guid),\r
+ cl_ntoh64(p_smp->trans_id));\r
+\r
+ osm_dump_slvl_map_table(sm->p_log, port_guid,\r
+ startinport == endinport ? startinport : 0xff,\r
+ startoutport == endoutport ? startoutport : 0xff,\r
+ p_slvl_tbl, OSM_LOG_DEBUG);\r
+\r
+ for (out_port = startoutport; out_port <= endoutport; out_port++) {\r
+ p_physp = osm_node_get_physp_ptr(p_node, out_port);\r
+ for (in_port = startinport; in_port <= endinport; in_port++)\r
+ osm_physp_set_slvl_tbl(p_physp, p_slvl_tbl, in_port);\r
}\r
\r
- osm_dump_slvl_map_table(sm->p_log, port_guid, in_port_num,\r
- out_port_num, p_slvl_tbl, OSM_LOG_DEBUG);\r
-\r
- osm_physp_set_slvl_tbl(p_physp, p_slvl_tbl, in_port_num);\r
-\r
Exit:\r
cl_plock_release(sm->p_lock);\r
\r
extern void osm_state_mgr_process(IN osm_sm_t * sm, IN osm_signal_t signal);\r
extern void osm_sm_state_mgr_polling_callback(IN void *context);\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sm_process(osm_sm_t * sm, osm_signal_t signal)\r
{\r
#ifdef ENABLE_OSM_PERF_MGR\r
sm->p_subn->force_heavy_sweep = TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_construct(IN osm_sm_t * p_sm)\r
{\r
memset(p_sm, 0, sizeof(*p_sm));\r
osm_ucast_mgr_construct(&p_sm->ucast_mgr);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_shutdown(IN osm_sm_t * p_sm)\r
{\r
boolean_t signal_event = FALSE;\r
OSM_LOG_EXIT(p_sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_destroy(IN osm_sm_t * p_sm)\r
{\r
OSM_LOG_ENTER(p_sm->p_log);\r
OSM_LOG_EXIT(p_sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sm_init(IN osm_sm_t * p_sm, IN osm_subn_t * p_subn,\r
IN osm_db_t * p_db, IN osm_vendor_t * p_vendor,\r
IN osm_mad_pool_t * p_mad_pool,\r
\r
Exit:\r
OSM_LOG_EXIT(p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_signal(osm_sm_t * p_sm, osm_signal_t signal)\r
{\r
cl_spinlock_acquire(&p_sm->signal_lock);\r
cl_spinlock_release(&p_sm->signal_lock);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_sweep(IN osm_sm_t * p_sm)\r
{\r
OSM_LOG_ENTER(p_sm->p_log);\r
OSM_LOG_EXIT(p_sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sm_bind(IN osm_sm_t * p_sm, IN ib_net64_t port_guid)\r
{\r
ib_api_status_t status;\r
\r
Exit:\r
OSM_LOG_EXIT(p_sm->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_reroute_mlid(osm_sm_t * sm, ib_net16_t mlid)\r
{\r
mlid = cl_ntoh16(mlid) - IB_LID_MCAST_START_HO;\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
goto Exit;\r
}\r
\r
- if (msg_id == CL_DISP_MSGID_NONE)\r
- goto Exit;\r
-\r
/*\r
Post this MAD to the dispatcher for asynchronous\r
processing by the appropriate controller.\r
OSM_LOG(p_ctrl->p_log, OSM_LOG_VERBOSE,\r
"Ignoring SubnGet MAD - unsupported attribute 0x%X\n",\r
cl_ntoh16(p_smp->attr_id));\r
- break;\r
- }\r
-\r
- if (msg_id == CL_DISP_MSGID_NONE) {\r
- /*\r
- There is an unknown MAD attribute type for which there is\r
- no recipient. Simply retire the MAD here.\r
- */\r
osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw);\r
goto Exit;\r
}\r
"Unsupported attribute 0x%X\n",\r
cl_ntoh16(p_smp->attr_id));\r
osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR);\r
- break;\r
- }\r
-\r
- if (msg_id == CL_DISP_MSGID_NONE) {\r
- /*\r
- There is an unknown MAD attribute type for which there is\r
- no recipient. Simply retire the MAD here.\r
- */\r
osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw);\r
goto Exit;\r
}\r
"Unsupported attribute 0x%X\n",\r
cl_ntoh16(p_smp->attr_id));\r
osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR);\r
- break;\r
- }\r
-\r
- if (msg_id == CL_DISP_MSGID_NONE) {\r
- /*\r
- There is an unknown MAD attribute type for which there is\r
- no recipient. Simply retire the MAD here.\r
- */\r
osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw);\r
goto Exit;\r
}\r
*/\r
switch (p_smp->attr_id) {\r
case IB_MAD_ATTR_NOTICE:\r
+ sm_mad_ctrl_retire_trans_mad(p_ctrl, p_madw);\r
break;\r
default:\r
cl_atomic_inc(&p_ctrl->p_stats->qp0_mads_rcvd_unknown);\r
"Unsupported attribute 0x%X\n",\r
cl_ntoh16(p_smp->attr_id));\r
osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR);\r
+ osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw);\r
break;\r
}\r
\r
- osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw);\r
-\r
OSM_LOG_EXIT(p_ctrl->p_log);\r
}\r
\r
+static void log_rcv_cb_error(osm_log_t *p_log, ib_smp_t *p_smp, ib_net16_t status)\r
+{\r
+ char buf[BUF_SIZE];\r
+ uint32_t i;\r
+\r
+ if (p_smp->mgmt_class == IB_MCLASS_SUBN_DIR) {\r
+ char ipath[BUF_SIZE], rpath[BUF_SIZE];\r
+ int ni = sprintf(ipath, "%d", p_smp->initial_path[0]);\r
+ int nr = sprintf(rpath, "%d", p_smp->return_path[0]);\r
+ for (i = 1; i <= p_smp->hop_count; i++) {\r
+ ni += sprintf(ipath + ni, ",%d", p_smp->initial_path[i]);\r
+ nr += sprintf(rpath + nr, ",%d", p_smp->return_path[i]);\r
+ }\r
+ snprintf(buf, sizeof(buf),\r
+ "\n\t\t\tInitial path: %s Return path: %s",\r
+ ipath, rpath);\r
+ }\r
+\r
+ OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 3111: "\r
+ "Received MAD with error status = 0x%X\n"\r
+ "\t\t\t%s(%s), attr_mod 0x%x, TID 0x%" PRIx64 "%s\n",\r
+ cl_ntoh16(status), ib_get_sm_method_str(p_smp->method),\r
+ ib_get_sm_attr_str(p_smp->attr_id), cl_ntoh32(p_smp->attr_mod),\r
+ cl_ntoh64(p_smp->trans_id),\r
+ p_smp->mgmt_class == IB_MCLASS_SUBN_DIR ? buf : "");\r
+\r
+ osm_dump_dr_smp(p_log, p_smp, OSM_LOG_VERBOSE);\r
+}\r
+\r
/*\r
* PARAMETERS\r
*\r
else\r
status = p_smp->status;\r
\r
- if (status != 0) {\r
- OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3111: "\r
- "Error status = 0x%X\n", cl_ntoh16(status));\r
- osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR);\r
- }\r
+ if (status != 0)\r
+ log_rcv_cb_error(p_ctrl->p_log, p_smp, status);\r
\r
switch (p_smp->method) {\r
case IB_MAD_METHOD_GET_RESP:\r
\r
CL_ASSERT(p_madw);\r
\r
+ p_smp = osm_madw_get_smp_ptr(p_madw);\r
OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3113: "\r
- "MAD completed in error (%s)\n",\r
- ib_get_err_str(p_madw->status));\r
+ "MAD completed in error (%s): "\r
+ "%s(%s), attr_mod 0x%x, TID 0x%" PRIx64 "\n",\r
+ ib_get_err_str(p_madw->status),\r
+ ib_get_sm_method_str(p_smp->method),\r
+ ib_get_sm_attr_str(p_smp->attr_id), cl_ntoh32(p_smp->attr_mod),\r
+ cl_ntoh64(p_smp->trans_id));\r
\r
/*\r
If this was a SubnSet MAD, then this error might indicate a problem\r
such a problem. The subnet will not be up, and the next sweep should\r
be a heavy sweep as well.\r
*/\r
- p_smp = osm_madw_get_smp_ptr(p_madw);\r
if (p_smp->method == IB_MAD_METHOD_SET &&\r
(p_smp->attr_id == IB_MAD_ATTR_PORT_INFO ||\r
p_smp->attr_id == IB_MAD_ATTR_MCAST_FWD_TBL ||\r
p_smp->attr_id == IB_MAD_ATTR_SWITCH_INFO ||\r
p_smp->attr_id == IB_MAD_ATTR_LIN_FWD_TBL ||\r
- p_smp->attr_id == IB_MAD_ATTR_P_KEY_TABLE ||\r
- p_smp->attr_id == IB_MAD_ATTR_SLVL_TABLE ||\r
- p_smp->attr_id == IB_MAD_ATTR_VL_ARBITRATION)) {\r
+ p_smp->attr_id == IB_MAD_ATTR_P_KEY_TABLE)) {\r
OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3119: "\r
"Set method failed for attribute 0x%X (%s)\n",\r
cl_ntoh16(p_smp->attr_id),\r
p_ctrl->p_subn->subnet_initialization_error = TRUE;\r
}\r
\r
+ osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_VERBOSE);\r
+\r
/*\r
Since we did not get any response we suspect the DR path\r
used for the target port.\r
An error occurred. No response was received to a request MAD.\r
Retire the original request MAD.\r
*/\r
-\r
- osm_dump_dr_smp(p_ctrl->p_log, osm_madw_get_smp_ptr(p_madw),\r
- OSM_LOG_ERROR);\r
-\r
sm_mad_ctrl_update_wire_stats(p_ctrl);\r
\r
if (osm_madw_get_err_msg(p_madw) != CL_DISP_MSGID_NONE) {\r
* SEE ALSO\r
*********/\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_mad_ctrl_construct(IN osm_sm_mad_ctrl_t * p_ctrl)\r
{\r
CL_ASSERT(p_ctrl);\r
p_ctrl->h_disp = CL_DISP_INVALID_HANDLE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_mad_ctrl_destroy(IN osm_sm_mad_ctrl_t * p_ctrl)\r
{\r
CL_ASSERT(p_ctrl);\r
cl_disp_unregister(p_ctrl->h_disp);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sm_mad_ctrl_init(IN osm_sm_mad_ctrl_t * p_ctrl,\r
IN osm_subn_t * p_subn,\r
IN osm_mad_pool_t * p_mad_pool,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sm_mad_ctrl_bind(IN osm_sm_mad_ctrl_t * p_ctrl,\r
IN ib_net64_t port_guid)\r
{\r
#include <opensm/osm_helper.h>\r
#include <opensm/osm_opensm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_report_sm_state(osm_sm_t * sm)\r
{\r
char buf[64];\r
OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, buf);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sm_state_mgr_send_master_sm_info_req(osm_sm_t * sm)\r
{\r
osm_madw_context_t context;\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sm_state_mgr_start_polling(osm_sm_t * sm)\r
{\r
uint32_t timeout = sm->p_subn->opt.sminfo_polling_timeout;\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_state_mgr_polling_callback(IN void *context)\r
{\r
osm_sm_t *sm = context;\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void sm_state_mgr_signal_error(osm_sm_t * sm, IN osm_sm_signal_t signal)\r
{\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3207: "\r
osm_get_sm_mgr_state_str(sm->p_subn->sm_state));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sm_state_mgr_signal_master_is_alive(osm_sm_t * sm)\r
{\r
OSM_LOG_ENTER(sm->p_log);\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,\r
IN osm_sm_signal_t signal)\r
{\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_sm_state_mgr_check_legality(osm_sm_t * sm,\r
IN osm_sm_signal_t signal)\r
{\r
\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void smi_rcv_process_get_request(IN osm_sm_t * sm,\r
IN const osm_madw_t * p_madw)\r
{\r
return IB_INVALID_PARAMETER;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void smi_rcv_process_set_request(IN osm_sm_t * sm,\r
IN const osm_madw_t * p_madw)\r
{\r
status = osm_sm_state_mgr_check_legality(sm, sm_signal);\r
if (status != IB_SUCCESS) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 2F07: "\r
- "Failed check of legality of needed SM transition. AttributeModifier:0x%X RemoteState:%s\n",\r
+ "Failed check of legality of needed SM transition. "\r
+ "AttributeModifier:0x%X RemoteState:%s\n",\r
p_smp->attr_mod,\r
osm_get_sm_mgr_state_str(ib_sminfo_get_state(sm_smi)));\r
status = osm_resp_send(sm, p_madw, 7, payload);\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int smi_rcv_process_get_sm(IN osm_sm_t * sm,\r
IN const osm_remote_sm_t * p_sm,\r
boolean_t light_sweep)\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void smi_rcv_process_get_response(IN osm_sm_t * sm,\r
IN const osm_madw_t * p_madw)\r
{\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void smi_rcv_process_set_response(IN osm_sm_t * sm,\r
IN const osm_madw_t * p_madw)\r
{\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_sminfo_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
/*\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
extern int osm_mcast_mgr_process_mgroups(IN osm_sm_t * sm);\r
extern int osm_link_mgr_process(IN osm_sm_t * sm, IN uint8_t state);\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void state_mgr_up_msg(IN const osm_sm_t * sm)\r
{\r
/*\r
"SUBNET UP" : "SUBNET UP (sweep disabled)");\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void state_mgr_reset_node_count(IN cl_map_item_t * p_map_item,\r
IN void *context)\r
{\r
p_node->discovery_count = 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void state_mgr_reset_port_count(IN cl_map_item_t * p_map_item,\r
IN void *context)\r
{\r
p_port->discovery_count = 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void state_mgr_reset_switch_count(IN cl_map_item_t * p_map_item,\r
IN void *context)\r
{\r
p_sw->need_update = 1;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void state_mgr_get_sw_info(IN cl_map_item_t * p_object, IN void *context)\r
{\r
osm_node_t *p_node;\r
\r
status = osm_req_get(sm, p_dr_path, IB_MAD_ATTR_SWITCH_INFO, 0,\r
OSM_MSG_LIGHT_SWEEP_FAIL, &mad_context);\r
-\r
if (status != IB_SUCCESS)\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3304: "\r
- "Request for SwitchInfo failed\n");\r
+ "Request for SwitchInfo failed (%s)\n",\r
+ ib_get_err_str(status));\r
\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
mad_context.pi_context.light_sweep = TRUE;\r
mad_context.pi_context.active_transition = FALSE;\r
\r
- /* note that with some negative logic - if the query failed it means that\r
- * there is no point in going to heavy sweep */\r
- status = osm_req_get(sm, &rem_node_dr_path,\r
- IB_MAD_ATTR_PORT_INFO, 0, CL_DISP_MSGID_NONE,\r
- &mad_context);\r
-\r
+ /* note that with some negative logic - if the query failed it means\r
+ * that there is no point in going to heavy sweep */\r
+ status = osm_req_get(sm, &rem_node_dr_path, IB_MAD_ATTR_PORT_INFO, 0,\r
+ CL_DISP_MSGID_NONE, &mad_context);\r
if (status != IB_SUCCESS)\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 332E: "\r
- "Request for PortInfo failed\n");\r
+ "Request for PortInfo failed (%s)\n",\r
+ ib_get_err_str(status));\r
\r
Exit:\r
OSM_LOG_EXIT(sm->p_log);\r
osm_dr_path_init(&dr_path, h_bind, 0, path_array);\r
status = osm_req_get(sm, &dr_path, IB_MAD_ATTR_NODE_INFO, 0,\r
CL_DISP_MSGID_NONE, NULL);\r
-\r
if (status != IB_SUCCESS)\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3305: "\r
- "Request for NodeInfo failed\n");\r
+ "Request for NodeInfo failed (%s)\n",\r
+ ib_get_err_str(status));\r
} else {\r
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,\r
"No bound ports. Deferring sweep...\n");\r
CL_DISP_MSGID_NONE, &context);\r
if (status != IB_SUCCESS)\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3311: "\r
- "Request for NodeInfo failed\n");\r
+ "Request for NodeInfo failed (%s)\n",\r
+ ib_get_err_str(status));\r
break;\r
\r
case IB_NODE_TYPE_SWITCH:\r
- /* Need to go over all the ports of the switch, and send a node_info\r
- * from them. This doesn't include the port 0 of the switch, which\r
- * hosts the SM.\r
- * Note: We'll send another switchInfo on port 0, since if no ports\r
- * are connected, we still want to get some response, and have the\r
- * subnet come up.\r
+ /* Need to go over all the ports of the switch, and send a\r
+ * node_info from them. This doesn't include the port 0 of the\r
+ * switch, which hosts the SM.\r
+ * Note: We'll send another switchInfo on port 0, since if no\r
+ * ports are connected, we still want to get some response, and\r
+ * have the subnet come up.\r
*/\r
num_ports = osm_node_get_num_physp(p_node);\r
- for (port_num = 0; port_num < num_ports; port_num++) {\r
+ for (port_num = 1; port_num < num_ports; port_num++) {\r
/* go through the port only if the port is not DOWN */\r
p_ext_physp = osm_node_get_physp_ptr(p_node, port_num);\r
if (p_ext_physp && ib_port_info_get_port_state\r
IB_MAD_ATTR_NODE_INFO, 0,\r
CL_DISP_MSGID_NONE,\r
&context);\r
-\r
if (status != IB_SUCCESS)\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"ERR 3312: "\r
- "Request for NodeInfo failed\n");\r
+ "Request for NodeInfo failed (%s)\n",\r
+ ib_get_err_str(status));\r
}\r
}\r
break;\r
ib_get_err_str(ret));\r
}\r
\r
-/**********************************************************************\r
- During a light sweep, check each node to see if the node description\r
- is valid and if not issue a ND query.\r
-**********************************************************************/\r
-static void state_mgr_get_node_desc(IN cl_map_item_t * obj, IN void *context)\r
+static void state_mgr_update_node_desc(IN cl_map_item_t * obj, IN void *context)\r
{\r
osm_madw_context_t mad_context;\r
osm_node_t *p_node = (osm_node_t *) obj;\r
\r
CL_ASSERT(p_node);\r
\r
- if (p_node->print_desc\r
- && strcmp(p_node->print_desc, OSM_NODE_DESC_UNKNOWN))\r
- /* if ND is valid, do nothing */\r
- goto exit;\r
-\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
- "ERR 3319: Unknown node description for node GUID "\r
- "0x%016" PRIx64 ". Reissuing ND query\n",\r
+ OSM_LOG(sm->p_log, OSM_LOG_DEBUG,\r
+ "Updating NodeDesc for 0x%016" PRIx64 "\n",\r
cl_ntoh64(osm_node_get_node_guid(p_node)));\r
\r
/* get a physp to request from. */\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
+void osm_update_node_desc(IN osm_opensm_t *osm)\r
+{\r
+ CL_PLOCK_ACQUIRE(&osm->lock);\r
+ cl_qmap_apply_func(&osm->subn.node_guid_tbl, state_mgr_update_node_desc,\r
+ &osm->sm);\r
+ CL_PLOCK_RELEASE(&osm->lock);\r
+}\r
+\r
+/**********************************************************************\r
+ During a light sweep, check each node to see if the node description\r
+ is valid and if not issue a ND query.\r
+**********************************************************************/\r
+static void state_mgr_get_node_desc(IN cl_map_item_t * obj, IN void *context)\r
+{\r
+ osm_node_t *p_node = (osm_node_t *) obj;\r
+ osm_sm_t *sm = context;\r
+\r
+ OSM_LOG_ENTER(sm->p_log);\r
+\r
+ CL_ASSERT(p_node);\r
+\r
+ if (p_node->print_desc\r
+ && strcmp(p_node->print_desc, OSM_NODE_DESC_UNKNOWN))\r
+ /* if ND is valid, do nothing */\r
+ goto exit;\r
+\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
+ "ERR 3319: Unknown node description for node GUID "\r
+ "0x%016" PRIx64 ". Reissuing ND query\n",\r
+ cl_ntoh64(osm_node_get_node_guid(p_node)));\r
+\r
+ state_mgr_update_node_desc(obj, context);\r
+\r
+exit:\r
+ OSM_LOG_EXIT(sm->p_log);\r
+}\r
+\r
/**********************************************************************\r
Initiates a lightweight sweep of the subnet.\r
Used during normal sweeps after the subnet is up.\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3315: "\r
"Unknown remote side for node 0x%016"\r
PRIx64\r
- "(%s) port %u. Adding to light sweep sampling list\n",\r
+ " (%s) port %u. Adding to light sweep sampling list\n",\r
cl_ntoh64(osm_node_get_node_guid\r
(p_node)),\r
p_node->print_desc, port_num);\r
/* details of the notice */\r
notice.generic_type = 0x83; /* is generic subn mgt type */\r
ib_notice_set_prod_type_ho(¬ice, 4); /* A Class Manager generator */\r
- /* endport becomes to be reachable */\r
+ /* endport becomes reachable */\r
notice.g_or_v.generic.trap_num = CL_HTON16(64);\r
/* The sm_base_lid is saved in network order already. */\r
notice.issuer_lid = sm->p_subn->sm_base_lid;\r
osm_port_get_lid_range_ho(p_port, &min_lid_ho, &max_lid_ho);\r
OSM_LOG(sm->p_log, OSM_LOG_INFO,\r
"Discovered new port with GUID:0x%016" PRIx64\r
- " LID range [%u,%u] of node:%s\n",\r
+ " LID range [%u,%u] of node: %s\n",\r
cl_ntoh64(port_gid.unicast.interface_id),\r
min_lid_ho, max_lid_ho,\r
p_port->p_node ? p_port->p_node->\r
\r
if (memcmp(sw->lft, sw->new_lft, sw->max_lid_ho + 1))\r
osm_log(log, OSM_LOG_ERROR, "ERR 331D: "\r
- "LFT of switch 0x%016" PRIx64 " is not up to date\n",\r
- cl_ntoh64(sw->p_node->node_info.node_guid));\r
+ "LFT of switch 0x%016" PRIx64 " (%s) is not up to date\n",\r
+ cl_ntoh64(sw->p_node->node_info.node_guid),\r
+ sw->p_node->print_desc);\r
else {\r
free(sw->new_lft);\r
sw->new_lft = NULL;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int wait_for_pending_transactions(osm_stats_t * stats)\r
{\r
#ifdef HAVE_LIBPTHREAD\r
if (wait_for_pending_transactions(&sm->p_subn->p_osm->stats))\r
return;\r
if (!sm->p_subn->force_heavy_sweep) {\r
+ if (sm->p_subn->opt.sa_db_dump)\r
+ osm_sa_db_file_dump(sm->p_subn->p_osm);\r
OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE,\r
"LIGHT SWEEP COMPLETE");\r
return;\r
}\r
\r
/* go to heavy sweep */\r
-_repeat_discovery:\r
+repeat_discovery:\r
\r
/* First of all - unset all flags */\r
sm->p_subn->force_heavy_sweep = FALSE;\r
wait_for_pending_transactions(&sm->p_subn->p_osm->stats))\r
return;\r
\r
- /* discovery completed - check other sm presense */\r
+ /* discovery completed - check other sm presence */\r
if (sm->master_sm_found) {\r
/*\r
* Call the sm_state_mgr with signal\r
\r
/* if new sweep requested - don't bother with the rest */\r
if (sm->p_subn->force_heavy_sweep)\r
- goto _repeat_discovery;\r
+ goto repeat_discovery;\r
\r
OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "HEAVY SWEEP COMPLETE");\r
\r
state_mgr_up_msg(sm);\r
sm->p_subn->first_time_master_sweep = FALSE;\r
\r
- if (osm_log_is_active(sm->p_log, OSM_LOG_VERBOSE))\r
+ if (osm_log_is_active(sm->p_log, OSM_LOG_VERBOSE) ||\r
+ sm->p_subn->opt.sa_db_dump)\r
osm_sa_db_file_dump(sm->p_subn->p_osm);\r
}\r
\r
case OSM_SIGNAL_SWEEP:\r
do_sweep(sm);\r
break;\r
-\r
case OSM_SIGNAL_IDLE_TIME_PROCESS_REQUEST:\r
do_process_mgrp_queue(sm);\r
break;\r
-\r
default:\r
CL_ASSERT(FALSE);\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3320: "\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2008 Xsigo Systems Inc. All rights reserved.\r
* Copyright (c) 2009 System Fabric Works, Inc. All rights reserved.\r
{ "max_wire_smps", OPT_OFFSET(max_wire_smps), opts_parse_uint32, NULL, 1 },\r
{ "console", OPT_OFFSET(console), opts_parse_charp, NULL, 0 },\r
{ "console_port", OPT_OFFSET(console_port), opts_parse_uint16, NULL, 0 },\r
- { "transaction_timeout", OPT_OFFSET(transaction_timeout), opts_parse_uint32, NULL, 1 },\r
- { "transaction_retries", OPT_OFFSET(transaction_retries), opts_parse_uint32, NULL, 1 },\r
+ { "transaction_timeout", OPT_OFFSET(transaction_timeout), opts_parse_uint32, NULL, 0 },\r
+ { "transaction_retries", OPT_OFFSET(transaction_retries), opts_parse_uint32, NULL, 0 },\r
{ "max_msg_fifo_timeout", OPT_OFFSET(max_msg_fifo_timeout), opts_parse_uint32, NULL, 1 },\r
{ "sm_priority", OPT_OFFSET(sm_priority), opts_parse_uint8, opts_setup_sm_priority, 1 },\r
{ "lmc", OPT_OFFSET(lmc), opts_parse_uint8, NULL, 1 },\r
{ "force_heavy_sweep", OPT_OFFSET(force_heavy_sweep), opts_parse_boolean, NULL, 1 },\r
{ "port_prof_ignore_file", OPT_OFFSET(port_prof_ignore_file), opts_parse_charp, NULL, 0 },\r
{ "hop_weights_file", OPT_OFFSET(hop_weights_file), opts_parse_charp, NULL, 0 },\r
+ { "dimn_ports_file", OPT_OFFSET(dimn_ports_file), opts_parse_charp, NULL, 0 },\r
{ "port_profile_switch_nodes", OPT_OFFSET(port_profile_switch_nodes), opts_parse_boolean, NULL, 1 },\r
{ "sweep_on_trap", OPT_OFFSET(sweep_on_trap), opts_parse_boolean, NULL, 1 },\r
{ "routing_engine", OPT_OFFSET(routing_engine_names), opts_parse_charp, NULL, 0 },\r
{ "connect_roots", OPT_OFFSET(connect_roots), opts_parse_boolean, NULL, 1 },\r
- { "use_ucast_cache", OPT_OFFSET(use_ucast_cache), opts_parse_boolean, NULL, 1 },\r
+ { "use_ucast_cache", OPT_OFFSET(use_ucast_cache), opts_parse_boolean, NULL, 0 },\r
{ "log_file", OPT_OFFSET(log_file), opts_parse_charp, NULL, 0 },\r
{ "log_max_size", OPT_OFFSET(log_max_size), opts_parse_uint32, opts_setup_log_max_size, 1 },\r
{ "log_flags", OPT_OFFSET(log_flags), opts_parse_uint8, opts_setup_log_flags, 1 },\r
{ "ids_guid_file", OPT_OFFSET(ids_guid_file), opts_parse_charp, NULL, 0 },\r
{ "guid_routing_order_file", OPT_OFFSET(guid_routing_order_file), opts_parse_charp, NULL, 0 },\r
{ "sa_db_file", OPT_OFFSET(sa_db_file), opts_parse_charp, NULL, 0 },\r
+ { "sa_db_dump", OPT_OFFSET(sa_db_dump), opts_parse_boolean, NULL, 1 },\r
{ "do_mesh_analysis", OPT_OFFSET(do_mesh_analysis), opts_parse_boolean, NULL, 1 },\r
{ "exit_on_fatal", OPT_OFFSET(exit_on_fatal), opts_parse_boolean, NULL, 1 },\r
{ "honor_guid2lid_file", OPT_OFFSET(honor_guid2lid_file), opts_parse_boolean, NULL, 1 },\r
{ "daemon", OPT_OFFSET(daemon), opts_parse_boolean, NULL, 0 },\r
{ "sm_inactive", OPT_OFFSET(sm_inactive), opts_parse_boolean, NULL, 1 },\r
{ "babbling_port_policy", OPT_OFFSET(babbling_port_policy), opts_parse_boolean, NULL, 1 },\r
+ { "use_optimized_slvl", OPT_OFFSET(use_optimized_slvl), opts_parse_boolean, NULL, 1 },\r
#ifdef ENABLE_OSM_PERF_MGR\r
{ "perfmgr", OPT_OFFSET(perfmgr), opts_parse_boolean, NULL, 0 },\r
{ "perfmgr_redir", OPT_OFFSET(perfmgr_redir), opts_parse_boolean, NULL, 0 },\r
{ "event_db_dump_file", OPT_OFFSET(event_db_dump_file), opts_parse_charp, NULL, 0 },\r
#endif /* ENABLE_OSM_PERF_MGR */\r
{ "event_plugin_name", OPT_OFFSET(event_plugin_name), opts_parse_charp, NULL, 0 },\r
+ { "event_plugin_options", OPT_OFFSET(event_plugin_options), opts_parse_charp, NULL, 0 },\r
{ "node_name_map_name", OPT_OFFSET(node_name_map_name), opts_parse_charp, NULL, 0 },\r
{ "qos_max_vls", OPT_OFFSET(qos_options.max_vls), opts_parse_uint32, NULL, 1 },\r
{ "qos_high_limit", OPT_OFFSET(qos_options.high_limit), opts_parse_int32, NULL, 1 },\r
{ "consolidate_ipv6_snm_req", OPT_OFFSET(consolidate_ipv6_snm_req), opts_parse_boolean, NULL, 1 },\r
{ "lash_start_vl", OPT_OFFSET(lash_start_vl), opts_parse_uint8, NULL, 1 },\r
{ "sm_sl", OPT_OFFSET(sm_sl), opts_parse_uint8, NULL, 1 },\r
+ { "log_prefix", OPT_OFFSET(log_prefix), opts_parse_charp, NULL, 1 },\r
{0}\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int compar_mgids(const void *m1, const void *m2)\r
{\r
return memcmp(m1, m2, sizeof(ib_gid_t));\r
cl_fmap_init(&p_subn->mgrp_mgid_tbl, compar_mgids);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_subn_destroy(IN osm_subn_t * p_subn)\r
{\r
int i;\r
osm_switch_t *p_sw, *p_next_sw;\r
osm_remote_sm_t *p_rsm, *p_next_rsm;\r
osm_prtn_t *p_prtn, *p_next_prtn;\r
- osm_mgrp_t *p_mgrp;\r
osm_infr_t *p_infr, *p_next_infr;\r
\r
/* it might be a good idea to de-allocate all known objects */\r
cl_fmap_remove_all(&p_subn->mgrp_mgid_tbl);\r
\r
for (i = 0; i <= p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO;\r
- i++) {\r
- p_mgrp = p_subn->mgroups[i];\r
- p_subn->mgroups[i] = NULL;\r
- if (p_mgrp)\r
- osm_mgrp_delete(p_mgrp);\r
- }\r
+ i++)\r
+ if (p_subn->mboxes[i])\r
+ osm_mgrp_box_delete(p_subn->mboxes[i]);\r
\r
p_next_infr = (osm_infr_t *) cl_qlist_head(&p_subn->sa_infr_list);\r
while (p_next_infr !=\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn, IN osm_opensm_t * p_osm,\r
IN const osm_subn_opt_t * p_opt)\r
{\r
OSM_SUBNET_VECTOR_MIN_SIZE,\r
OSM_SUBNET_VECTOR_GROW_SIZE);\r
if (status != CL_SUCCESS)\r
- return (status);\r
+ return status;\r
\r
status = cl_ptr_vector_set_capacity(&p_subn->port_lid_tbl,\r
OSM_SUBNET_VECTOR_CAPACITY);\r
if (status != CL_SUCCESS)\r
- return (status);\r
+ return status;\r
\r
/*\r
LID zero is not valid. NULL out this entry for the\r
return IB_SUCCESS;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_port_t *osm_get_port_by_mad_addr(IN osm_log_t * p_log,\r
IN const osm_subn_t * p_subn,\r
IN osm_mad_addr_t * p_mad_addr)\r
{\r
- const cl_ptr_vector_t *p_port_lid_tbl;\r
- osm_port_t *p_port = NULL;\r
-\r
- /* Find the port gid of the request in the subnet */\r
- p_port_lid_tbl = &p_subn->port_lid_tbl;\r
-\r
- CL_ASSERT(cl_ptr_vector_get_size(p_port_lid_tbl) < 0x10000);\r
-\r
- if ((uint16_t) cl_ptr_vector_get_size(p_port_lid_tbl) >\r
- cl_ntoh16(p_mad_addr->dest_lid)) {\r
- p_port =\r
- cl_ptr_vector_get(p_port_lid_tbl,\r
- cl_ntoh16(p_mad_addr->dest_lid));\r
- } else {\r
- /* The dest_lid is not in the subnet table - this is an error */\r
+ osm_port_t *port = osm_get_port_by_lid(p_subn, p_mad_addr->dest_lid);\r
+ if (!port)\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 7504: "\r
"Lid is out of range: %u\n",\r
cl_ntoh16(p_mad_addr->dest_lid));\r
- }\r
\r
- return p_port;\r
+ return port;\r
}\r
\r
ib_api_status_t osm_get_gid_by_mad_addr(IN osm_log_t * p_log,\r
if (p_gid == NULL) {\r
OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 7505: "\r
"Provided output GID is NULL\n");\r
- return (IB_INVALID_PARAMETER);\r
+ return IB_INVALID_PARAMETER;\r
}\r
\r
p_port = osm_get_port_by_mad_addr(p_log, p_subn, p_mad_addr);\r
return p_port->p_physp;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_switch_t *osm_get_switch_by_guid(IN const osm_subn_t * p_subn,\r
IN uint64_t guid)\r
{\r
return p_switch;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_node_t *osm_get_node_by_guid(IN osm_subn_t const *p_subn, IN uint64_t guid)\r
{\r
osm_node_t *p_node;\r
return p_node;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_port_t *osm_get_port_by_guid(IN osm_subn_t const *p_subn, IN ib_net64_t guid)\r
{\r
osm_port_t *p_port;\r
return p_port;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-osm_port_t *osm_get_port_by_lid(IN osm_subn_t const * subn, IN ib_net16_t lid)\r
+osm_port_t *osm_get_port_by_lid_ho(IN osm_subn_t const * subn, IN uint16_t lid)\r
{\r
- lid = cl_ntoh16(lid);\r
if (lid < cl_ptr_vector_get_size(&subn->port_lid_tbl))\r
return cl_ptr_vector_get(&subn->port_lid_tbl, lid);\r
return NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+osm_mgrp_t *osm_get_mgrp_by_mgid(IN osm_subn_t * subn, IN ib_gid_t * mgid)\r
+{\r
+ osm_mgrp_t *mgrp;\r
+\r
+ mgrp= (osm_mgrp_t *)cl_fmap_get(&subn->mgrp_mgid_tbl, mgid);\r
+ if (mgrp != (osm_mgrp_t *)cl_fmap_end(&subn->mgrp_mgid_tbl))\r
+ return mgrp;\r
+ return NULL;\r
+}\r
+\r
static void subn_set_default_qos_options(IN osm_qos_options_t * opt)\r
{\r
opt->max_vls = OSM_DEFAULT_QOS_MAX_VLS;\r
memcpy(f, opt, sizeof(*f));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt)\r
{\r
memset(p_opt, 0, sizeof(osm_subn_opt_t));\r
p_opt->daemon = FALSE;\r
p_opt->sm_inactive = FALSE;\r
p_opt->babbling_port_policy = FALSE;\r
+ p_opt->use_optimized_slvl = FALSE;\r
#ifdef ENABLE_OSM_PERF_MGR\r
p_opt->perfmgr = FALSE;\r
p_opt->perfmgr_redir = TRUE;\r
#endif /* ENABLE_OSM_PERF_MGR */\r
\r
p_opt->event_plugin_name = NULL;\r
+ p_opt->event_plugin_options = NULL;\r
p_opt->node_name_map_name = NULL;\r
\r
p_opt->dump_files_dir = getenv("OSM_TMP_DIR");\r
if (!p_opt->dump_files_dir || !(*p_opt->dump_files_dir))\r
p_opt->dump_files_dir = OSM_DEFAULT_TMP_DIR;\r
- p_opt->dump_files_dir = strdup_expand(p_opt->dump_files_dir);\r
- p_opt->log_file = strdup_expand(OSM_DEFAULT_LOG_FILE);\r
+ p_opt->dump_files_dir = strdup(p_opt->dump_files_dir);\r
+ p_opt->log_file = strdup(OSM_DEFAULT_LOG_FILE);\r
p_opt->log_max_size = 0;\r
- p_opt->partition_config_file = strdup_expand(OSM_DEFAULT_PARTITION_CONFIG_FILE);\r
+ p_opt->partition_config_file = strdup(OSM_DEFAULT_PARTITION_CONFIG_FILE);\r
p_opt->no_partition_enforcement = FALSE;\r
p_opt->qos = FALSE;\r
- p_opt->qos_policy_file = strdup_expand(OSM_DEFAULT_QOS_POLICY_FILE);\r
+ p_opt->qos_policy_file = strdup(OSM_DEFAULT_QOS_POLICY_FILE);\r
p_opt->accum_log_file = TRUE;\r
p_opt->port_prof_ignore_file = NULL;\r
p_opt->hop_weights_file = NULL;\r
+ p_opt->dimn_ports_file = NULL;\r
p_opt->port_profile_switch_nodes = FALSE;\r
p_opt->sweep_on_trap = TRUE;\r
p_opt->use_ucast_cache = FALSE;\r
p_opt->ids_guid_file = NULL;\r
p_opt->guid_routing_order_file = NULL;\r
p_opt->sa_db_file = NULL;\r
+ p_opt->sa_db_dump = FALSE;\r
p_opt->do_mesh_analysis = FALSE;\r
p_opt->exit_on_fatal = TRUE;\r
p_opt->enable_quirks = FALSE;\r
p_opt->no_clients_rereg = FALSE;\r
- p_opt->prefix_routes_file = strdup_expand(OSM_DEFAULT_PREFIX_ROUTES_FILE);\r
+ p_opt->prefix_routes_file = strdup(OSM_DEFAULT_PREFIX_ROUTES_FILE);\r
p_opt->consolidate_ipv6_snm_req = FALSE;\r
p_opt->lash_start_vl = 0;\r
p_opt->sm_sl = OSM_DEFAULT_SL;\r
+ p_opt->log_prefix = NULL;\r
subn_init_qos_options(&p_opt->qos_options, NULL);\r
subn_init_qos_options(&p_opt->qos_ca_options, NULL);\r
subn_init_qos_options(&p_opt->qos_sw0_options, NULL);\r
subn_init_qos_options(&p_opt->qos_rtr_options, NULL);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static char *clean_val(char *val)\r
{\r
char *p = val;\r
return val;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int subn_dump_qos_options(FILE * file, const char *set_name,\r
const char *prefix, osm_qos_options_t * opt)\r
{\r
prefix, opt->vlarb_low, prefix, opt->sl2vl);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t append_prefix_route(IN osm_subn_t * p_subn,\r
uint64_t prefix, uint64_t guid)\r
{\r
return (errors == 0) ? IB_SUCCESS : IB_ERROR;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void subn_verify_max_vls(unsigned *max_vls, const char *prefix, unsigned dflt)\r
{\r
if (!*max_vls || *max_vls > 15) {\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_subn_parse_conf_file(char *file_name, osm_subn_opt_t * p_opts)\r
{\r
char line[1024];\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)\r
{\r
fprintf(out,\r
"hop_weights_file %s\n\n",\r
p_opts->hop_weights_file ? p_opts->hop_weights_file : null_str);\r
\r
+ fprintf(out,\r
+ "# The file holding non-default port order per switch for DOR routing \n"\r
+ "dimn_ports_file %s\n\n",\r
+ p_opts->dimn_ports_file ? p_opts->dimn_ports_file : null_str);\r
+\r
fprintf(out,\r
"# Routing engine\n"\r
"# Multiple routing engines can be specified separated by\n"\r
"# SA database file name\nsa_db_file %s\n\n",\r
p_opts->sa_db_file ? p_opts->sa_db_file : null_str);\r
\r
+ fprintf(out,\r
+ "# If TRUE causes OpenSM to dump SA database at the end of\n"\r
+ "# every light sweep, regardless of the verbosity level\n"\r
+ "sa_db_dump %s\n\n",\r
+ p_opts->sa_db_dump ? "TRUE" : "FALSE");\r
+\r
fprintf(out,\r
"#\n# HANDOVER - MULTIPLE SMs OPTIONS\n#\n"\r
"# SM priority used for deciding who is the master\n"\r
"max_wire_smps %u\n\n"\r
"# The maximum time in [msec] allowed for a transaction to complete\n"\r
"transaction_timeout %u\n\n"\r
- " The maximum number of retries allowed for a transaction to complete\n"\r
+ "# The maximum number of retries allowed for a transaction to complete\n"\r
"transaction_retries %u\n\n"\r
"# Maximal time in [msec] a message can stay in the incoming message queue.\n"\r
"# If there is more than one message in the queue and the last message\n"\r
"# SM Inactive\n"\r
"sm_inactive %s\n\n"\r
"# Babbling Port Policy\n"\r
- "babbling_port_policy %s\n\n",\r
+ "babbling_port_policy %s\n\n"\r
+ "# Use Optimized SLtoVLMapping programming if supported by device\n"\r
+ "use_optimized_slvl %s\n\n",\r
p_opts->daemon ? "TRUE" : "FALSE",\r
p_opts->sm_inactive ? "TRUE" : "FALSE",\r
- p_opts->babbling_port_policy ? "TRUE" : "FALSE");\r
+ p_opts->babbling_port_policy ? "TRUE" : "FALSE",\r
+ p_opts->use_optimized_slvl ? "TRUE" : "FALSE");\r
\r
#ifdef ENABLE_OSM_PERF_MGR\r
fprintf(out,\r
\r
fprintf(out,\r
"#\n# Event Plugin Options\n#\n"\r
- "event_plugin_name %s\n\n", p_opts->event_plugin_name ?\r
- p_opts->event_plugin_name : null_str);\r
+ "# Event plugin name(s)\n"\r
+ "event_plugin_name %s\n\n"\r
+ "# Options string that would be passed to the plugin(s)\n"\r
+ "event_plugin_options %s\n\n",\r
+ p_opts->event_plugin_name ?\r
+ p_opts->event_plugin_name : null_str,\r
+ p_opts->event_plugin_options ?\r
+ p_opts->event_plugin_options : null_str);\r
\r
fprintf(out,\r
"#\n# Node name map for mapping node's to more descriptive node descriptions\n"\r
"consolidate_ipv6_snm_req %s\n\n",\r
p_opts->consolidate_ipv6_snm_req ? "TRUE" : "FALSE");\r
\r
+ fprintf(out, "# Log prefix\nlog_prefix %s\n\n", p_opts->log_prefix);\r
+\r
/* optional string attributes ... */\r
\r
return 0;\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
return is_change_detected;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_si_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
#include <iba/ib_types.h>\r
#include <opensm/osm_switch.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
cl_status_t osm_switch_set_hops(IN osm_switch_t * p_sw, IN uint16_t lid_ho,\r
IN uint8_t port_num, IN uint8_t num_hops)\r
{\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_switch_delete(IN OUT osm_switch_t ** pp_sw)\r
{\r
osm_switch_t *p_sw = *pp_sw;\r
osm_mcast_tbl_destroy(&p_sw->mcast_tbl);\r
if (p_sw->p_prof)\r
free(p_sw->p_prof);\r
+ if (p_sw->dimn_ports)\r
+ free(p_sw->dimn_ports);\r
if (p_sw->lft)\r
free(p_sw->lft);\r
if (p_sw->new_lft)\r
*pp_sw = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
osm_switch_t *osm_switch_new(IN osm_node_t * p_node,\r
IN const osm_madw_t * p_madw)\r
{\r
return NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osm_switch_get_lft_block(IN const osm_switch_t * p_sw,\r
IN uint16_t block_id, OUT uint8_t * p_block)\r
{\r
return TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static struct osm_remote_node *\r
switch_find_guid_common(IN const osm_switch_t * p_sw,\r
IN struct osm_remote_guids_count *r,\r
return switch_find_guid_common(p_sw, r, port_num, 0, 1);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
uint8_t osm_switch_recommend_path(IN const osm_switch_t * p_sw,\r
IN osm_port_t * p_port, IN uint16_t lid_ho,\r
IN unsigned start_from,\r
\r
/* port number starts with one and num_ports is 1 + num phys ports */\r
for (i = start_from; i < start_from + num_ports; i++) {\r
- port_num = i%num_ports;\r
+ port_num = osm_switch_get_dimn_port(p_sw, i % num_ports);\r
if (!port_num ||\r
osm_switch_get_hop_count(p_sw, base_lid, port_num) !=\r
least_hops)\r
return best_port;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_switch_clear_hops(IN osm_switch_t * p_sw)\r
{\r
unsigned i;\r
memset(p_sw->hops[i], OSM_NO_PATH, p_sw->num_ports);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int alloc_lft(IN osm_switch_t * p_sw, uint16_t lids)\r
{\r
uint16_t lft_size;\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int osm_switch_prepare_path_rebuild(IN osm_switch_t * p_sw, IN uint16_t max_lids)\r
{\r
uint8_t **hops;\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
uint8_t osm_switch_get_port_least_hops(IN const osm_switch_t * p_sw,\r
IN const osm_port_t * p_port)\r
{\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
uint8_t osm_switch_recommend_mcast_path(IN osm_switch_t * p_sw,\r
IN osm_port_t * p_port,\r
IN uint16_t mlid_ho,\r
/*\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
*\r
**********************************************************************/\r
\r
-typedef struct osm_trap_agingracker_context {\r
- osm_log_t *p_log;\r
- osm_physp_t *p_physp;\r
-} osm_trap_aging_tracker_context_t;\r
-\r
-/**********************************************************************\r
- **********************************************************************/\r
static osm_physp_t *get_physp_by_lid_and_num(IN osm_sm_t * sm,\r
- IN uint16_t lid, IN uint8_t num)\r
+ IN ib_net16_t lid, IN uint8_t num)\r
{\r
- cl_ptr_vector_t *p_vec = &(sm->p_subn->port_lid_tbl);\r
- osm_port_t *p_port;\r
-\r
- if (lid > cl_ptr_vector_get_size(p_vec))\r
- return NULL;\r
-\r
- p_port = (osm_port_t *) cl_ptr_vector_get(p_vec, lid);\r
+ osm_port_t *p_port = osm_get_port_by_lid(sm->p_subn, lid);\r
if (!p_port)\r
return NULL;\r
\r
return osm_node_get_physp_ptr(p_port->p_node, num);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-uint64_t\r
-osm_trap_rcv_aging_tracker_callback(IN uint64_t key,\r
- IN uint32_t num_regs, IN void *context)\r
+static uint64_t aging_tracker_callback(IN uint64_t key, IN uint32_t num_regs,\r
+ IN void *context)\r
{\r
osm_sm_t *sm = context;\r
- uint16_t lid;\r
+ ib_net16_t lid;\r
uint8_t port_num;\r
osm_physp_t *p_physp;\r
\r
/* We got an exit flag - do nothing */\r
return 0;\r
\r
- lid = cl_ntoh16((uint16_t) ((key & 0x0000FFFF00000000ULL) >> 32));\r
+ lid = (ib_net16_t) ((key & 0x0000FFFF00000000ULL) >> 32);\r
port_num = (uint8_t) ((key & 0x00FF000000000000ULL) >> 48);\r
\r
p_physp = get_physp_by_lid_and_num(sm, lid, port_num);\r
if (!p_physp)\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Cannot find port num:%u with lid:%u\n",\r
- port_num, lid);\r
+ port_num, cl_ntoh16(lid));\r
/* make sure the physp is still valid */\r
/* If the health port was false - set it to true */\r
else if (!osm_physp_is_healthy(p_physp)) {\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Clearing health bit of port num:%u with lid:%u\n",\r
- port_num, lid);\r
+ port_num, cl_ntoh16(lid));\r
\r
/* Clear its health bit */\r
osm_physp_set_health(p_physp, TRUE);\r
return crc;\r
}\r
\r
-/********************************************************************\r
- ********************************************************************/\r
-\r
/* The key is created in the following manner:\r
port_num lid crc\r
\______/ \___/ \___/\r
16b 16b 32b\r
*/\r
-static void\r
-trap_get_key(IN uint16_t lid, IN uint8_t port_num,\r
- IN ib_mad_notice_attr_t * p_ntci, OUT uint64_t * trap_key)\r
+static uint64_t trap_get_key(IN uint16_t lid, IN uint8_t port_num,\r
+ IN ib_mad_notice_attr_t * p_ntci)\r
{\r
- uint32_t crc = 0;\r
-\r
- CL_ASSERT(trap_key);\r
-\r
- crc = trap_calc_crc32(p_ntci, sizeof(ib_mad_notice_attr_t));\r
- *trap_key = ((uint64_t) port_num << 48) | ((uint64_t) lid << 32) | crc;\r
+ uint32_t crc = trap_calc_crc32(p_ntci, sizeof(ib_mad_notice_attr_t));\r
+ return ((uint64_t) port_num << 48) | ((uint64_t) lid << 32) | crc;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int print_num_received(IN uint32_t num_received)\r
{\r
uint32_t i;\r
uint8_t payload[IB_SMP_DATA_SIZE];\r
osm_madw_context_t context;\r
ib_port_info_t *pi = (ib_port_info_t *)payload;\r
- int ret;\r
\r
/* select the nearest port to master opensm */\r
if (p->p_remote_physp &&\r
/* If trap 131, might want to disable peer port if available */\r
/* but peer port has been observed not to respond to SM requests */\r
\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3810: "\r
- "Disabling physical port 0x%016" PRIx64 " num:%u\n",\r
- cl_ntoh64(osm_physp_get_port_guid(p)), p->port_num);\r
-\r
memcpy(payload, &p->port_info, sizeof(ib_port_info_t));\r
\r
/* Set port to disabled/down */\r
context.pi_context.light_sweep = FALSE;\r
context.pi_context.active_transition = FALSE;\r
\r
- ret = osm_req_set(sm, osm_physp_get_dr_path_ptr(p),\r
- payload, sizeof(payload), IB_MAD_ATTR_PORT_INFO,\r
- cl_hton32(osm_physp_get_port_num(p)),\r
- CL_DISP_MSGID_NONE, &context);\r
- if (ret)\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3811: "\r
- "Request to set PortInfo failed\n");\r
-\r
- return ret;\r
+ return osm_req_set(sm, osm_physp_get_dr_path_ptr(p),\r
+ payload, sizeof(payload), IB_MAD_ATTR_PORT_INFO,\r
+ cl_hton32(osm_physp_get_port_num(p)),\r
+ CL_DISP_MSGID_NONE, &context);\r
}\r
\r
static void log_trap_info(osm_log_t *p_log, ib_mad_notice_attr_t *p_ntci,\r
cl_ntoh16(source_lid), cl_ntoh64(trans_id));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-static void\r
-trap_rcv_process_request(IN osm_sm_t * sm, IN const osm_madw_t * const p_madw)\r
+static int shutup_noisy_port(osm_sm_t *sm, ib_net16_t lid, uint8_t port,\r
+ unsigned num)\r
+{\r
+ osm_physp_t *p = get_physp_by_lid_and_num(sm, lid, port);\r
+ if (!p) {\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3805: "\r
+ "Failed to find physical port by lid:%u num:%u\n",\r
+ cl_ntoh16(lid), port);\r
+ return -1;\r
+ }\r
+\r
+ /* When babbling port policy option is enabled and\r
+ Threshold for disabling a "babbling" port is exceeded */\r
+ if (sm->p_subn->opt.babbling_port_policy && num >= 250) {\r
+ OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
+ "Disabling noisy physical port 0x%016" PRIx64\r
+ ": lid %u, num %u\n",\r
+ cl_ntoh64(osm_physp_get_port_guid(p)),\r
+ cl_ntoh16(lid), port);\r
+ if (disable_port(sm, p))\r
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3811: "\r
+ "Failed to disable.\n");\r
+ else\r
+ return 1;\r
+ }\r
+\r
+ /* check if the current state of the p_physp is healthy. If\r
+ it is - then this is a first change of state. Run a heavy sweep. */\r
+ if (osm_physp_is_healthy(p)) {\r
+ OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
+ "Marking unhealthy physical port by lid:%u num:%u\n",\r
+ cl_ntoh16(lid), port);\r
+ osm_physp_set_health(p, FALSE);\r
+ return 2;\r
+ }\r
+ return 0;\r
+}\r
+\r
+static void trap_rcv_process_request(IN osm_sm_t * sm,\r
+ IN const osm_madw_t * p_madw)\r
{\r
uint8_t payload[sizeof(ib_mad_notice_attr_t)];\r
ib_smp_t *p_smp;\r
uint64_t trap_key;\r
uint32_t num_received;\r
osm_physp_t *p_physp;\r
- cl_ptr_vector_t *p_tbl;\r
osm_port_t *p_port;\r
ib_net16_t source_lid = 0;\r
boolean_t is_gsi = TRUE;\r
physp_change_trap = TRUE;\r
/* The source_lid should be based on the source_lid from the trap */\r
source_lid = p_ntci->data_details.ntc_129_131.lid;\r
- }\r
-\r
- /* If physp_change_trap is TRUE - the key will include the port number.\r
- If not - the port_number in the key will be zero. */\r
- if (physp_change_trap == TRUE) {\r
port_num = p_ntci->data_details.ntc_129_131.port_num;\r
- trap_get_key(source_lid, port_num, p_ntci, &trap_key);\r
- } else\r
- trap_get_key(source_lid, 0, p_ntci, &trap_key);\r
+ }\r
\r
/* try to find it in the aging tracker */\r
- num_received =\r
- cl_event_wheel_num_regs(&sm->trap_aging_tracker,\r
- trap_key);\r
+ trap_key = trap_get_key(source_lid, port_num, p_ntci);\r
+ num_received = cl_event_wheel_num_regs(&sm->trap_aging_tracker,\r
+ trap_key);\r
\r
/* Now we know how many times it provided this trap */\r
if (num_received > 10) {\r
if (print_num_received(num_received))\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3804: "\r
+ OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Received trap %u times consecutively\n",\r
num_received);\r
/*\r
* we mark it as unhealthy.\r
*/\r
if (physp_change_trap == TRUE) {\r
- /* get the port */\r
- p_physp = get_physp_by_lid_and_num(sm,\r
- cl_ntoh16\r
- (p_ntci->\r
- data_details.\r
- ntc_129_131.\r
- lid),\r
- port_num);\r
-\r
- if (!p_physp)\r
- OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
- "ERR 3805: "\r
- "Failed to find physical port by lid:%u num:%u\n",\r
- cl_ntoh16(p_ntci->data_details.\r
- ntc_129_131.lid),\r
- p_ntci->data_details.\r
- ntc_129_131.port_num);\r
- else {\r
- /* When babbling port policy option is enabled and\r
- Threshold for disabling a "babbling" port is exceeded */\r
- if (sm->p_subn->opt.\r
- babbling_port_policy\r
- && num_received >= 250\r
- && disable_port(sm, p_physp) == 0)\r
- goto Exit;\r
-\r
- OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
- "Marking unhealthy physical port by lid:%u num:%u\n",\r
- cl_ntoh16(p_ntci->data_details.\r
- ntc_129_131.lid),\r
- p_ntci->data_details.\r
- ntc_129_131.port_num);\r
- /* check if the current state of the p_physp is healthy. If\r
- it is - then this is a first change of state. Run a heavy sweep.\r
- if it is not - no need to mark it again - just restart the timer. */\r
- if (osm_physp_is_healthy(p_physp)) {\r
- osm_physp_set_health(p_physp,\r
- FALSE);\r
- /* Make sure we sweep again - force a heavy sweep. */\r
- /* The sweep should be done only after the re-registration, or\r
- else we'll be losing track of the timer. */\r
- run_heavy_sweep = TRUE;\r
- }\r
- /* If we are marking the port as unhealthy - we want to\r
- keep this for a longer period of time than the\r
- OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT. Use the\r
- OSM_DEFAULT_UNHEALTHY_TIMEOUT */\r
- event_wheel_timeout =\r
- OSM_DEFAULT_UNHEALTHY_TIMEOUT;\r
- }\r
+ int ret = shutup_noisy_port(sm, source_lid,\r
+ port_num,\r
+ num_received);\r
+ if (ret == 1) /* port disabled */\r
+ goto Exit;\r
+ else if (ret == 2) /* unhealthy - run sweep */\r
+ run_heavy_sweep = TRUE;\r
+ /* in any case increase timeout interval */\r
+ event_wheel_timeout =\r
+ OSM_DEFAULT_UNHEALTHY_TIMEOUT;\r
}\r
}\r
\r
/* If physp_change_trap is TRUE - then use a callback to unset\r
the healthy bit. If not - no need to use a callback. */\r
if (physp_change_trap == TRUE)\r
- cl_event_wheel_reg(&sm->trap_aging_tracker, trap_key, cl_get_time_stamp() + event_wheel_timeout, osm_trap_rcv_aging_tracker_callback, /* no callback */\r
- sm /* no context */ );\r
+ cl_event_wheel_reg(&sm->trap_aging_tracker, trap_key,\r
+ cl_get_time_stamp() + event_wheel_timeout,\r
+ aging_tracker_callback, sm);\r
else\r
- cl_event_wheel_reg(&sm->trap_aging_tracker, trap_key, cl_get_time_stamp() + event_wheel_timeout, NULL, /* no callback */\r
- NULL /* no context */ );\r
+ cl_event_wheel_reg(&sm->trap_aging_tracker, trap_key,\r
+ cl_get_time_stamp() + event_wheel_timeout,\r
+ NULL, NULL);\r
\r
/* If was already registered do nothing more */\r
if (num_received > 10 && run_heavy_sweep == FALSE) {\r
if (print_num_received(num_received))\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
- "Continuously received this trap %u times. Ignoring\n",\r
- num_received);\r
+ "Ignoring noisy traps.\n");\r
goto Exit;\r
}\r
}\r
\r
/* Check for node description update. IB Spec v1.2.1 pg 823 */\r
- if (ib_notice_is_generic(p_ntci) &&\r
- cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 &&\r
+ if (!ib_notice_is_generic(p_ntci))\r
+ goto check_sweep;\r
+ if (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 &&\r
p_ntci->data_details.ntc_144.local_changes & TRAP_144_MASK_OTHER_LOCAL_CHANGES &&\r
p_ntci->data_details.ntc_144.change_flgs & TRAP_144_MASK_NODE_DESCRIPTION_CHANGE) {\r
OSM_LOG(sm->p_log, OSM_LOG_INFO, "Trap 144 Node description update\n");\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"ERR 3812: No physical port found for "\r
"trap 144: \"node description update\"\n");\r
- }\r
+ goto check_sweep;\r
+ } else if (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145)\r
+ /* this assumes that trap 145 content is not broken? */\r
+ p_physp->p_node->node_info.sys_guid =\r
+ p_ntci->data_details.ntc_145.new_sys_guid;\r
\r
+check_sweep:\r
/* do a sweep if we received a trap */\r
if (sm->p_subn->opt.sweep_on_trap) {\r
/* if this is trap number 128 or run_heavy_sweep is TRUE -\r
update the force_heavy_sweep flag of the subnet.\r
- Sweep also on traps 144/145 - these traps signal a change of\r
- certain port capabilities/system image guid.\r
+ Sweep also on traps 144 - these traps signal a change of\r
+ certain port capabilities.\r
TODO: In the future this can be changed to just getting\r
PortInfo on this port instead of sweeping the entire subnet. */\r
if (ib_notice_is_generic(p_ntci) &&\r
(cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 128 ||\r
cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 ||\r
- cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145 ||\r
run_heavy_sweep)) {\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Forcing heavy sweep. Received trap:%u\n",\r
sizeof(ib_gid_t));\r
} else {\r
/* Need to use the IssuerLID */\r
- p_tbl = &sm->p_subn->port_lid_tbl;\r
-\r
- CL_ASSERT(cl_ptr_vector_get_size(p_tbl) < 0x10000);\r
-\r
- if ((uint16_t) cl_ptr_vector_get_size(p_tbl) <=\r
- cl_ntoh16(source_lid)) {\r
- /* the source lid is out of range */\r
- OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
- "source lid is out of range:%u\n",\r
- cl_ntoh16(source_lid));\r
-\r
- goto Exit;\r
- }\r
- p_port = cl_ptr_vector_get(p_tbl, cl_ntoh16(source_lid));\r
- if (p_port == 0) {\r
- /* We have the lid - but no corresponding port */\r
+ p_port = osm_get_port_by_lid(sm->p_subn, source_lid);\r
+ if (!p_port) {\r
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,\r
"Cannot find port corresponding to lid:%u\n",\r
cl_ntoh16(source_lid));\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
-**********************************************************************/\r
-static void\r
-trap_rcv_process_response(IN osm_sm_t * sm,\r
- IN const osm_madw_t * const p_madw)\r
+static void trap_rcv_process_response(IN osm_sm_t * sm,\r
+ IN const osm_madw_t * p_madw)\r
{\r
\r
OSM_LOG_ENTER(sm->p_log);\r
OSM_LOG_EXIT(sm->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_trap_rcv_process(IN void *context, IN void *data)\r
{\r
osm_sm_t *sm = context;\r
/*\r
* Copyright (c) 2008-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2008,2009 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2008-2009 Mellanox Technologies LTD. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
cache_port_t ports[0];\r
} cache_switch_t;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static uint16_t cache_sw_get_base_lid_ho(cache_switch_t * p_sw)\r
{\r
return p_sw->ports[0].remote_lid_ho;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static boolean_t cache_sw_is_leaf(cache_switch_t * p_sw)\r
{\r
return p_sw->ports[0].is_leaf;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void cache_sw_set_leaf(cache_switch_t * p_sw)\r
{\r
p_sw->ports[0].is_leaf = TRUE;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static cache_switch_t *cache_sw_new(uint16_t lid_ho, unsigned num_ports)\r
{\r
cache_switch_t *p_cache_sw = malloc(sizeof(cache_switch_t) +\r
return p_cache_sw;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void cache_sw_destroy(cache_switch_t * p_sw)\r
{\r
if (!p_sw)\r
free(p_sw);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static cache_switch_t *cache_get_sw(osm_ucast_mgr_t * p_mgr, uint16_t lid_ho)\r
{\r
cache_switch_t *p_cache_sw = (cache_switch_t *)\r
return p_cache_sw;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void cache_add_sw_link(osm_ucast_mgr_t * p_mgr, osm_physp_t *p,\r
uint16_t remote_lid_ho, boolean_t is_ca)\r
{\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void cache_cleanup_switches(osm_ucast_mgr_t * p_mgr)\r
{\r
cache_switch_t *p_sw;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void\r
cache_check_link_change(osm_ucast_mgr_t * p_mgr,\r
osm_physp_t * p_physp_1, osm_physp_t * p_physp_2)\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void cache_remove_port(osm_ucast_mgr_t * p_mgr, uint16_t lid_ho,\r
uint8_t port_num, uint16_t remote_lid_ho,\r
boolean_t is_ca)\r
OSM_LOG_EXIT(p_mgr->p_log);\r
} /* cache_remove_port() */\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void\r
cache_restore_ucast_info(osm_ucast_mgr_t * p_mgr,\r
cache_switch_t * p_cache_sw, osm_switch_t * p_sw)\r
p_cache_sw->hops = NULL;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void ucast_cache_dump(osm_ucast_mgr_t * p_mgr)\r
{\r
cache_switch_t *p_sw;\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
void osm_ucast_cache_invalidate(osm_ucast_mgr_t * p_mgr)\r
{\r
cache_switch_t *p_sw;\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void ucast_cache_validate(osm_ucast_mgr_t * p_mgr)\r
{\r
cache_switch_t *p_cache_sw;\r
OSM_LOG_EXIT(p_mgr->p_log);\r
} /* osm_ucast_cache_validate() */\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
void osm_ucast_cache_check_new_link(osm_ucast_mgr_t * p_mgr,\r
osm_node_t * p_node_1, uint8_t port_num_1,\r
osm_node_t * p_node_2, uint8_t port_num_2)\r
OSM_LOG_EXIT(p_mgr->p_log);\r
} /* osm_ucast_cache_check_new_link() */\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
void osm_ucast_cache_add_link(osm_ucast_mgr_t * p_mgr,\r
osm_physp_t * p_physp1, osm_physp_t * p_physp2)\r
{\r
OSM_LOG_EXIT(p_mgr->p_log);\r
} /* osm_ucast_cache_add_link() */\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
void osm_ucast_cache_add_node(osm_ucast_mgr_t * p_mgr, osm_node_t * p_node)\r
{\r
uint16_t lid_ho;\r
OSM_LOG_EXIT(p_mgr->p_log);\r
} /* osm_ucast_cache_add_node() */\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
int osm_ucast_cache_process(osm_ucast_mgr_t * p_mgr)\r
{\r
cl_qmap_t *tbl = &p_mgr->p_subn->sw_guid_tbl;\r
\r
return 0;\r
}\r
-\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* Copyright (c) 2006-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2008,2009 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2006,2008-2009 Mellanox Technologies LTD. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
* as it is much faster.\r
*\r
* Important note:\r
- * This function and __osm_ftree_bubble_sort_down must NOT be factorized.\r
+ * This function and bubble_sort_down must NOT be factorized.\r
* Although most of the code is the same and a function pointer could be used\r
* for the compareason function, it would prevent the compareason function to be inlined\r
* and cost a great deal to performances.\r
\r
/*\r
* Function: Sorts an array of port group. Order is decide through\r
- * __osm_ftree_port_group_compare_load_down ( up counters, least load remote switch, biggest GUID)\r
+ * port_group_compare_load_down ( up counters, least load remote switch, biggest GUID)\r
* Given : A port group array and its length. Each port group points to a remote switch (not a HCA)\r
* As the list is mostly sorted, we used a bubble sort instead of qsort\r
* as it is much faster.\r
*\r
* Important note:\r
- * This function and __osm_ftree_bubble_sort_up must NOT be factorized.\r
+ * This function and bubble_sort_up must NOT be factorized.\r
* Although most of the code is the same and a function pointer could be used\r
* for the compareason function, it would prevent the compareason function to be inlined\r
* and cost a great deal to performances.\r
/***************************************************\r
***************************************************/\r
\r
+static void fabric_route_roots(IN ftree_fabric_t * p_ftree)\r
+{\r
+ uint16_t lid;\r
+ uint8_t port_num;\r
+ osm_port_t *p_port;\r
+ ftree_sw_t *p_sw;\r
+ ftree_sw_t *p_leaf_sw;\r
+\r
+ OSM_LOG_ENTER(&p_ftree->p_osm->log);\r
+\r
+ /*\r
+ * We need a switch that will accomodate all the down/up turns in\r
+ * the fabric. Having these turn in a single place in the fabric\r
+ * will not create credit loops.\r
+ * So we need to select this switch.\r
+ * The idea here is to chose leaf with the highest index. I don't\r
+ * have any theory to back me up on this. It's just a general thought\r
+ * that this way the switch that might be a bottleneck for many mcast\r
+ * groups will be far away from the OpenSM, so it will draw the\r
+ * multicast traffic away from the SM.\r
+ */\r
+\r
+ p_leaf_sw = p_ftree->leaf_switches[p_ftree->leaf_switches_num-1];\r
+\r
+ /*\r
+ * Now go over all the switches in the fabric that\r
+ * have lower rank, and route the missing LIDs to\r
+ * the selected leaf switch.\r
+ * In short, this leaf switch now poses a target\r
+ * for all those missing LIDs.\r
+ */\r
+\r
+ for (p_sw = (ftree_sw_t *) cl_qmap_head(&p_ftree->sw_tbl);\r
+ p_sw != (ftree_sw_t *) cl_qmap_end(&p_ftree->sw_tbl);\r
+ p_sw = (ftree_sw_t *) cl_qmap_next(&p_sw->map_item)) {\r
+\r
+ if (p_sw->rank >= p_ftree->leaf_switch_rank)\r
+ continue;\r
+\r
+ for (lid = 1; lid <= p_leaf_sw->p_osm_sw->max_lid_ho; lid ++) {\r
+\r
+ if (p_sw->p_osm_sw->new_lft[lid] != OSM_NO_PATH ||\r
+ p_leaf_sw->hops[lid] == OSM_NO_PATH)\r
+ continue;\r
+\r
+ p_port = osm_get_port_by_lid_ho(&p_ftree->p_osm->subn,\r
+ lid);\r
+\r
+ /* we're interested only in switches */\r
+ if (!p_port || !p_port->p_node->sw)\r
+ continue;\r
+\r
+ /*\r
+ * the missing LID will be routed through the same\r
+ * port that routes to the selected leaf switch\r
+ */\r
+ port_num = p_sw->p_osm_sw->new_lft[p_leaf_sw->base_lid];\r
+\r
+ OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_DEBUG,\r
+ "Switch %s: setting path to LID %u "\r
+ "through port %u\n",\r
+ tuple_to_str(p_sw->tuple), lid, port_num);\r
+\r
+ /* set local lft */\r
+ p_sw->p_osm_sw->new_lft[lid] = port_num;\r
+\r
+ /*\r
+ * Set local min hop table.\r
+ * The distance to the target LID is a distance\r
+ * to the selected leaf switch plus the distance\r
+ * from the leaf to the target LID.\r
+ */\r
+ sw_set_hops(p_sw, lid, port_num,\r
+ p_sw->hops[p_leaf_sw->base_lid] +\r
+ p_leaf_sw->hops[lid], TRUE);\r
+ }\r
+ }\r
+\r
+ OSM_LOG_EXIT(&p_ftree->p_osm->log);\r
+} /* fabric_route_roots() */\r
+\r
+/***************************************************/\r
+\r
static int fabric_populate_nodes(IN ftree_fabric_t * p_ftree)\r
{\r
osm_node_t *p_osm_node;\r
if (res)\r
goto Exit;\r
\r
- OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
+ OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,\r
"FatTree max switch rank is %u\n", p_ftree->max_switch_rank);\r
\r
Exit:\r
p_ftree->leaf_switch_rank = p_sw->rank;\r
}\r
\r
- OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
+ OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,\r
"FatTree leaf switch rank is %u\n", p_ftree->leaf_switch_rank);\r
OSM_LOG_EXIT(&p_ftree->p_osm->log);\r
} /* fabric_set_leaf_rank() */\r
fabric_clear(p_ftree);\r
\r
if (p_ftree->p_osm->subn.opt.lmc > 0) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"LMC > 0 is not supported by fat-tree routing.\n"\r
"Falling back to default routing\n");\r
status = -1;\r
}\r
\r
if (cl_qmap_count(&p_ftree->p_osm->subn.sw_guid_tbl) < 2) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric has %u switches - topology is not fat-tree.\n"\r
"Falling back to default routing\n",\r
cl_qmap_count(&p_ftree->p_osm->subn.sw_guid_tbl));\r
\r
if ((cl_qmap_count(&p_ftree->p_osm->subn.node_guid_tbl) -\r
cl_qmap_count(&p_ftree->p_osm->subn.sw_guid_tbl)) < 2) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric has %u nodes (%u switches) - topology is not fat-tree.\n"\r
"Falling back to default routing\n",\r
cl_qmap_count(&p_ftree->p_osm->subn.node_guid_tbl),\r
OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,\r
"Populating FatTree Switch and CA tables\n");\r
if (fabric_populate_nodes(p_ftree) != 0) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric topology is not fat-tree - "\r
"falling back to default routing\n");\r
status = -1;\r
OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,\r
"Reading guid files provided by user\n");\r
if (fabric_read_guid_files(p_ftree) != 0) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Failed reading guid files - "\r
"falling back to default routing\n");\r
status = -1;\r
}\r
\r
if (cl_qmap_count(&p_ftree->hca_tbl) < 2) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
- "Fabric has %u CAa - topology is not fat-tree.\n"\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
+ "Fabric has %u CAs - topology is not fat-tree.\n"\r
"Falling back to default routing\n",\r
cl_qmap_count(&p_ftree->hca_tbl));\r
status = -1;\r
whole tree rank after filling ports and marking CNs. */\r
OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE, "Ranking FatTree\n");\r
if (fabric_rank(p_ftree) != 0) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Failed ranking the tree\n");\r
status = -1;\r
goto Exit;\r
OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,\r
"Populating CA & switch ports\n");\r
if (fabric_populate_ports(p_ftree) != 0) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric topology is not a fat-tree\n");\r
status = -1;\r
goto Exit;\r
} else if (p_ftree->cn_num == 0) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric has no valid compute nodes\n");\r
status = -1;\r
goto Exit;\r
\r
if (fabric_get_rank(p_ftree) > FAT_TREE_MAX_RANK ||\r
fabric_get_rank(p_ftree) < FAT_TREE_MIN_RANK) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric rank is %u (should be between %u and %u)\n",\r
fabric_get_rank(p_ftree), FAT_TREE_MIN_RANK,\r
FAT_TREE_MAX_RANK);\r
As a by-product, this function also runs basic topology\r
validation - it checks that all the CNs are at the same rank. */\r
if (fabric_mark_leaf_switches(p_ftree)) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric topology is not a fat-tree\n");\r
status = -1;\r
goto Exit;\r
switches at the same leaf rank w/o CNs, if this is the order of indexing.\r
In any case, the first and the last switches in the array are REAL leafs. */\r
if (fabric_create_leaf_switch_array(p_ftree)) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric topology is not a fat-tree\n");\r
status = -1;\r
goto Exit;\r
guid file hasn't been provided by user */\r
if (!fabric_roots_provided(p_ftree) &&\r
!fabric_validate_topology(p_ftree)) {\r
- osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,\r
+ osm_log(&p_ftree->p_osm->log, OSM_LOG_INFO,\r
"Fabric topology is not a fat-tree\n");\r
status = -1;\r
goto Exit;\r
"Filling switch forwarding tables for switch-to-switch paths\n");\r
fabric_route_to_switches(p_ftree);\r
\r
+ if (p_ftree->p_osm->subn.opt.connect_roots) {\r
+ OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,\r
+ "Connecting switches that are unreachable within "\r
+ "Up/Down rules\n");\r
+ fabric_route_roots(p_ftree);\r
+ }\r
+\r
/* for each switch, set its fwd table */\r
cl_qmap_apply_func(&p_ftree->sw_tbl, set_sw_fwd_table, (void *)p_ftree);\r
\r
memset(p_sw->new_lft, OSM_NO_PATH, p_sw->lft_size);\r
\r
for (lid = 1; lid <= max_lid_ho; lid++) {\r
- port = cl_ptr_vector_get(&p_subn->port_lid_tbl, lid);\r
+ port = osm_get_port_by_lid_ho(p_subn, lid);\r
if (!port)\r
continue;\r
\r
\r
p_lash->p_osm = p_osm;\r
\r
- return (p_lash);\r
+ return p_lash;\r
}\r
\r
static void lash_delete(void *context)\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
+#include <ctype.h>\r
#include <iba/ib_types.h>\r
#include <complib/cl_qmap.h>\r
#include <complib/cl_debug.h>\r
#include <opensm/osm_msgdef.h>\r
#include <opensm/osm_opensm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_ucast_mgr_construct(IN osm_ucast_mgr_t * p_mgr)\r
{\r
memset(p_mgr, 0, sizeof(*p_mgr));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_ucast_mgr_destroy(IN osm_ucast_mgr_t * p_mgr)\r
{\r
CL_ASSERT(p_mgr);\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_ucast_mgr_init(IN osm_ucast_mgr_t * p_mgr, IN osm_sm_t * sm)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
cl_qmap_init(&p_mgr->cache_sw_tbl);\r
\r
OSM_LOG_EXIT(p_mgr->p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
/**********************************************************************\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void ucast_mgr_process_neighbor(IN osm_ucast_mgr_t * p_mgr,\r
IN osm_switch_t * p_this_sw,\r
IN osm_switch_t * p_remote_sw,\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static struct osm_remote_node *find_and_add_remote_sys(osm_switch_t * sw,\r
uint8_t port,\r
boolean_t dor, struct\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void alloc_ports_priv(osm_ucast_mgr_t * mgr)\r
{\r
cl_qmap_t *port_tbl = &mgr->p_subn->port_guid_tbl;\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void ucast_mgr_process_neighbors(IN cl_map_item_t * p_map_item,\r
IN void *context)\r
{\r
OSM_LOG_EXIT(p_mgr->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int set_hop_wf(void *ctx, uint64_t guid, char *p)\r
{\r
osm_ucast_mgr_t *m = ctx;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
+static int set_dimn_ports(void *ctx, uint64_t guid, char *p)\r
+{\r
+ osm_subn_t *p_subn = ctx;\r
+ osm_node_t *node = osm_get_node_by_guid(p_subn, cl_hton64(guid));\r
+ osm_switch_t *sw;\r
+ uint8_t *dimn_ports = NULL;\r
+ uint8_t port;\r
+ unsigned int *ports = NULL;\r
+ const int bpw = sizeof(*ports)*8;\r
+ int words;\r
+ int i = 1; /* port 0 maps to port 0 */\r
+\r
+ if (!node || !(sw = node->sw)) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_VERBOSE,\r
+ "switch with guid 0x%016" PRIx64 " is not found\n",\r
+ guid);\r
+ return 0;\r
+ }\r
+\r
+ if (sw->dimn_ports) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_VERBOSE,\r
+ "switch with guid 0x%016" PRIx64 " already listed\n",\r
+ guid);\r
+ return 0;\r
+ }\r
+\r
+ dimn_ports = malloc(sizeof(*dimn_ports)*sw->num_ports);\r
+ if (!dimn_ports) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_ERROR,\r
+ "ERR 3A07: cannot allocate memory for dimn_ports\n");\r
+ return -1;\r
+ }\r
+ memset(dimn_ports, 0, sizeof(*dimn_ports)*sw->num_ports);\r
+\r
+ /* the ports array is for record keeping of which ports have\r
+ * been seen */\r
+ words = (sw->num_ports + bpw - 1)/bpw;\r
+ ports = malloc(words*sizeof(*ports));\r
+ if (!ports) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_ERROR,\r
+ "ERR 3A08: cannot allocate memory for ports\n");\r
+ return -1;\r
+ }\r
+ memset(ports, 0, words*sizeof(*ports));\r
+\r
+ while ((*p != '\0') && (*p != '#')) {\r
+ char *e;\r
+\r
+ port = strtoul(p, &e, 0);\r
+ if ((p == e) || (port == 0) || (port >= sw->num_ports) ||\r
+ !osm_node_get_physp_ptr(node, port)) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_VERBOSE,\r
+ "bad port %d specified for guid 0x%016" PRIx64 "\n",\r
+ port, guid);\r
+ free(dimn_ports);\r
+ free(ports);\r
+ return 0;\r
+ }\r
+\r
+ if (ports[port/bpw] & (1u << (port%bpw))) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_VERBOSE,\r
+ "port %d already specified for guid 0x%016" PRIx64 "\n",\r
+ port, guid);\r
+ free(dimn_ports);\r
+ free(ports);\r
+ return 0;\r
+ }\r
+\r
+ ports[port/bpw] |= (1u << (port%bpw));\r
+ dimn_ports[i++] = port;\r
+\r
+ p = e;\r
+ while (isspace(*p)) {\r
+ p++;\r
+ }\r
+ }\r
+\r
+ if (i > 1) {\r
+ for (port = 1; port < sw->num_ports; port++) {\r
+ /* fill out the rest of the dimn_ports array\r
+ * in sequence using the remaining unspecified\r
+ * ports.\r
+ */\r
+ if (!(ports[port/bpw] & (1u << (port%bpw)))) {\r
+ dimn_ports[i++] = port;\r
+ }\r
+ }\r
+ sw->dimn_ports = dimn_ports;\r
+ } else {\r
+ free(dimn_ports);\r
+ }\r
+\r
+ free(ports);\r
+ return 0;\r
+}\r
+\r
int osm_ucast_mgr_build_lid_matrices(IN osm_ucast_mgr_t * p_mgr)\r
{\r
uint32_t i;\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int ucast_mgr_setup_all_switches(osm_subn_t * p_subn)\r
{\r
osm_switch_t *p_sw;\r
\r
for (p_sw = (osm_switch_t *) cl_qmap_head(&p_subn->sw_guid_tbl);\r
p_sw != (osm_switch_t *) cl_qmap_end(&p_subn->sw_guid_tbl);\r
- p_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item))\r
+ p_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item)) {\r
if (osm_switch_prepare_path_rebuild(p_sw, lids)) {\r
OSM_LOG(&p_subn->p_osm->log, OSM_LOG_ERROR, "ERR 3A0B: "\r
"cannot setup switch 0x%016" PRIx64 "\n",\r
(p_sw->p_node)));\r
return -1;\r
}\r
+ if (p_sw->dimn_ports) {\r
+ free(p_sw->dimn_ports);\r
+ p_sw->dimn_ports = NULL;\r
+ }\r
+ }\r
+\r
+ if (p_subn->opt.dimn_ports_file) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_DEBUG,\r
+ "Fetching dimension ports file \'%s\'\n",\r
+ p_subn->opt.dimn_ports_file);\r
+ if (parse_node_map(p_subn->opt.dimn_ports_file,\r
+ set_dimn_ports, p_subn)) {\r
+ OSM_LOG(&p_subn->p_osm->log, OSM_LOG_ERROR, "ERR 3A05: "\r
+ "cannot parse dimn_ports_file \'%s\'\n",\r
+ p_subn->opt.dimn_ports_file);\r
+ }\r
+ }\r
\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int add_guid_to_order_list(void *ctx, uint64_t guid, char *p)\r
{\r
osm_ucast_mgr_t *m = ctx;\r
\r
for (i = 0; i < num; i++)\r
add_sw_endports_to_order_list(s[i], m);\r
+ free(s);\r
}\r
\r
static int ucast_mgr_build_lfts(osm_ucast_mgr_t * p_mgr)\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void ucast_mgr_set_fwd_top(IN cl_map_item_t * p_map_item,\r
IN void *cxt)\r
{\r
ucast_mgr_pipeline_fwd_tbl(p_mgr);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int ucast_mgr_route(struct osm_routing_engine *r, osm_opensm_t * osm)\r
{\r
int ret;\r
/*\r
* Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
unsigned visited;\r
};\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/* This function returns direction based on rank and guid info of current &\r
remote ports */\r
static updn_switch_dir_t updn_get_dir(unsigned cur_rank, unsigned rem_rank,\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/* NOTE : PLS check if we need to decide that the first */\r
/* rank is a SWITCH for BFS purpose */\r
static int updn_subn_rank(IN updn_t * p_updn)\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/* hack: preserve min hops entries to any other root switches */\r
-static void updn_clear_non_root_hops(updn_t * p_updn, osm_switch_t * p_sw)\r
+static void updn_clear_non_root_hops(updn_t * updn, osm_switch_t * sw)\r
{\r
- osm_port_t *p_port;\r
+ osm_port_t *port;\r
unsigned i;\r
\r
- for (i = 0; i < p_sw->num_hops; i++)\r
- if (p_sw->hops[i]) {\r
- p_port =\r
- cl_ptr_vector_get(&p_updn->p_osm->subn.port_lid_tbl,\r
- i);\r
- if (!p_port || !p_port->p_node->sw\r
- || ((struct updn_node *)p_port->p_node->sw->priv)->\r
+ for (i = 0; i < sw->num_hops; i++)\r
+ if (sw->hops[i]) {\r
+ port = osm_get_port_by_lid_ho(&updn->p_osm->subn, i);\r
+ if (!port || !port->p_node->sw\r
+ || ((struct updn_node *)port->p_node->sw->priv)->\r
rank != 0)\r
- memset(p_sw->hops[i], 0xff, p_sw->num_ports);\r
+ memset(sw->hops[i], 0xff, sw->num_ports);\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int updn_set_min_hop_table(IN updn_t * p_updn)\r
{\r
osm_subn_t *p_subn = &p_updn->p_osm->subn;\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static int updn_build_lid_matrices(IN updn_t * p_updn)\r
{\r
int status;\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static struct updn_node *create_updn_node(osm_switch_t * sw)\r
{\r
struct updn_node *u;\r
free(u);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/* Find Root nodes automatically by Min Hop Table info */\r
static void updn_find_root_nodes_by_min_hop(OUT updn_t * p_updn)\r
{\r
return;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void dump_roots(cl_map_item_t *item, FILE *file, void *cxt)\r
{\r
osm_switch_t *sw = (osm_switch_t *)item;\r
return ret;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void updn_delete(void *context)\r
{\r
free(context);\r
/*\r
+ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2006,2009 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <opensm/osm_log.h>\r
#include <opensm/osm_helper.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw)\r
{\r
ib_api_status_t status;\r
OSM_LOG_EXIT(p_vl->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vl15_construct(IN osm_vl15_t * p_vl)\r
{\r
memset(p_vl, 0, sizeof(*p_vl));\r
cl_thread_construct(&p_vl->poller);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vl15_destroy(IN osm_vl15_t * p_vl, IN struct osm_mad_pool *p_pool)\r
{\r
osm_madw_t *p_madw;\r
OSM_LOG_EXIT(p_vl->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osm_vl15_init(IN osm_vl15_t * p_vl, IN osm_vendor_t * p_vend,\r
IN osm_log_t * p_log, IN osm_stats_t * p_stats,\r
IN int32_t max_wire_smps)\r
"opensm poller");\r
Exit:\r
OSM_LOG_EXIT(p_log);\r
- return (status);\r
+ return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vl15_poll(IN osm_vl15_t * p_vl)\r
{\r
OSM_LOG_ENTER(p_vl->p_log);\r
OSM_LOG_EXIT(p_vl->p_log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osm_vl15_post(IN osm_vl15_t * p_vl, IN osm_madw_t * p_madw)\r
{\r
OSM_LOG_ENTER(p_vl->p_log);\r
* Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ * Copyright (c) 2010 HNR Consulting. All rights reserved.\r
+ * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
* licenses. You may choose to be licensed under the terms of the GNU\r
#include <opensm/osm_helper.h>\r
#include <opensm/osm_sm.h>\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
/*\r
* WE ONLY RECEIVE GET or SET responses\r
*/\r
cl_plock_excl_acquire(sm->p_lock);\r
p_port = osm_get_port_by_guid(sm->p_subn, port_guid);\r
if (!p_port) {\r
- cl_plock_release(sm->p_lock);\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3F06: "\r
"No port object for port with GUID 0x%" PRIx64\r
"\n\t\t\t\tfor parent node GUID 0x%" PRIx64\r
- ", TID 0x%" PRIx64 "\n",\r
- cl_ntoh64(port_guid),\r
+ ", TID 0x%" PRIx64 "\n", cl_ntoh64(port_guid),\r
cl_ntoh64(node_guid), cl_ntoh64(p_smp->trans_id));\r
goto Exit;\r
}\r
goto Exit;\r
}\r
\r
- osm_dump_vl_arb_table(sm->p_log,\r
- port_guid, block_num,\r
- port_num, p_vla_tbl, OSM_LOG_DEBUG);\r
-\r
if ((block_num < 1) || (block_num > 4)) {\r
OSM_LOG(sm->p_log, OSM_LOG_ERROR,\r
"Got invalid block number 0x%X\n", block_num);\r
goto Exit;\r
}\r
+\r
+ osm_dump_vl_arb_table(sm->p_log, port_guid, block_num, port_num,\r
+ p_vla_tbl, OSM_LOG_DEBUG);\r
osm_physp_set_vla_tbl(p_physp, p_vla_tbl, block_num);\r
\r
Exit:\r
static int collision = 0;\r
static int init_st = 0;\r
\r
-static void stat_col()\r
+static void stat_col(void)\r
{\r
- FILE *f = fopen("/var/log/osm_st_col", "w");\r
+ FILE *f = fopen(OSM_DEFAULT_TMP_DIR "osm_st_col", "w");\r
fprintf(f, "collision: %d\n", collision);\r
fclose(f);\r
}\r
\r
VENDOR_LIBS=$(TARGETPATH)\*\osmv_openib.lib \\r
$(LIBPATH)\*\libibmad.lib \\r
- $(LIBPATH)\*\libibumad.lib \\r
- $(LIBPATH)\*\libibverbs.lib \\r
- $(LIBPATH)\*\winverbs.lib \r
+ $(LIBPATH)\*\libibumad.lib\r
\r
VENDOR_LIBSD=$(TARGETPATH)\*\osmv_openib.lib \\r
$(LIBPATH)\*\libibmadd.lib \\r
- $(LIBPATH)\*\libibumadd.lib \\r
- $(LIBPATH)\*\libibverbsd.lib \\r
- $(LIBPATH)\*\winverbsd.lib\r
+ $(LIBPATH)\*\libibumadd.lib\r
\r
VENDOR_IF=OSM_VENDOR_INTF_OPENIB\r
\r
#define OSMT_DEFAULT_TRAP_WAIT_TIMEOUT_SEC 10\r
#define INVALID_GUID (0xFFFFFFFFFFFFFFFFULL)\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
boolean_t osmt_is_debug(void)\r
{\r
#if defined( _DEBUG_ )\r
#endif /* defined( _DEBUG_ ) */\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void show_usage()\r
{\r
printf\r
" the transaction timeout with the -t option\n\n");\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void print_all_guids(IN osmtest_t * p_osmt)\r
{\r
ib_api_status_t status;\r
cl_hton64(attr_array[i].port_guid));\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t port_guid)\r
{\r
ib_api_status_t status;\r
return 0;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
int main(int argc, char *argv[])\r
{\r
static osmtest_t osm_test;\r
int32_t vendor_debug = 0;\r
char flow_name[64];\r
uint32_t next_option;\r
+ const char *const short_option = \r
#ifdef __WIN__\r
- const char *const short_option = "?f:l:m:M:d:g:s:t:i:pcvVh";\r
-#else\r
- const char *const short_option = "f:l:m:M:d:g:s:t:i:pcvVh";\r
+ "?"\r
#endif\r
+ "f:l:m:M:d:g:s:t:i:pcvVh";\r
\r
/*\r
* In the array below, the 2nd parameter specified the number\r
/*\r
+ * Copyright (c) 2009 Voltaire, Inc. All rights reserved.\r
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
/*\r
* Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2005,2008 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
*\r
* This software is available to you under a choice of one of two\r
#include <complib/cl_list.h>\r
#include "osmtest.h"\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static void __osmt_print_all_multicast_records(IN osmtest_t * const p_osmt)\r
{\r
uint32_t i;\r
\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
static cl_status_t\r
__match_mgids(IN const void *const p_object, IN void *context)\r
{\r
return CL_NOT_FOUND;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t osmt_query_mcast(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
/* given a multicast request send and wait for response. */\r
ib_api_status_t\r
osmt_send_mcast_request(IN osmtest_t * const p_osmt,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
void osmt_init_mc_query_rec(IN osmtest_t * const p_osmt,\r
IN OUT ib_member_rec_t * p_mc_req)\r
{\r
#include <complib/cl_debug.h>\r
#include "osmtest.h"\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
\r
ib_api_status_t\r
osmt_register_service(IN osmtest_t * const p_osmt,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_register_service_with_full_key(IN osmtest_t * const p_osmt,\r
IN ib_net64_t service_id,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_register_service_with_data(IN osmtest_t * const p_osmt,\r
IN ib_net64_t service_id,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_get_service_by_id_and_name(IN osmtest_t * const p_osmt,\r
IN uint32_t rec_num,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_get_service_by_id(IN osmtest_t * const p_osmt,\r
IN uint32_t rec_num,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_get_service_by_name_and_key(IN osmtest_t * const p_osmt,\r
IN char *sr_name,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_get_service_by_name(IN osmtest_t * const p_osmt,\r
IN char *sr_name,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
#ifdef VENDOR_RMPP_SUPPORT\r
ib_api_status_t\r
osmt_get_all_services_and_check_names(IN osmtest_t * const p_osmt,\r
}\r
#endif\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
ib_api_status_t\r
osmt_delete_service_by_name(IN osmtest_t * const p_osmt,\r
IN uint8_t IsServiceExist,\r
return status;\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
-\r
/*\r
* Run a complete service records flow:\r
* - register a service\r
#include <complib/cl_debug.h>\r
#include "osmtest.h"\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_write_vl_arb_table(IN osmtest_t * const p_osmt,\r
IN FILE * fh,\r
/*\r
* Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.\r
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved.\r
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
* Copyright (c) 2009 HNR Consulting. All rights reserved.\r
*\r
"IB_SA_MAD_STATUS_INSUF_COMPS";\r
static const char generic_or_str[] = " | ";\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
const char *ib_get_mad_status_str(IN const ib_mad_t * const p_mad)\r
{\r
static char line[512];\r
return (line);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void subnet_construct(IN subnet_t * const p_subn)\r
{\r
cl_qmap_init(&p_subn->link_tbl);\r
cl_qmap_init(&p_subn->path_tbl);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
cl_status_t subnet_init(IN subnet_t * const p_subn)\r
{\r
cl_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osmtest_construct(IN osmtest_t * const p_osmt)\r
{\r
memset(p_osmt, 0, sizeof(*p_osmt));\r
subnet_construct(&p_osmt->exp_subn);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osmtest_destroy(IN osmtest_t * const p_osmt)\r
{\r
cl_map_item_t *p_item, *p_next_item;\r
osm_log_destroy(&p_osmt->log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_init(IN osmtest_t * const p_osmt,\r
IN const osmtest_opt_t * const p_opt,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
void osmtest_query_res_cb(IN osmv_query_res_t * p_rec)\r
{\r
osmtest_req_context_t *const p_ctxt =\r
OSM_LOG_EXIT(&p_osmt->log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_get_all_recs(IN osmtest_t * const p_osmt,\r
IN ib_net16_t const attr_id,\r
\r
p_context->p_osmt = p_osmt;\r
user.attr_id = attr_id;\r
- user.attr_offset = ib_get_attr_offset(attr_size);\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) attr_size);\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
req.timeout_ms = p_osmt->opt.transaction_timeout;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osmtest_validate_sa_class_port_info(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_get_node_rec(IN osmtest_t * const p_osmt,\r
IN ib_net64_t const node_guid,\r
p_context->p_osmt = p_osmt;\r
user.comp_mask = IB_NR_COMPMASK_NODEGUID;\r
user.attr_id = IB_MAD_ATTR_NODE_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
p_context->p_osmt = p_osmt;\r
user.comp_mask = IB_NR_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_NODE_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_get_path_rec_by_guid_pair(IN osmtest_t * const p_osmt,\r
IN ib_net64_t sguid,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_get_path_rec_by_gid_pair(IN osmtest_t * const p_osmt,\r
IN ib_gid_t sgid,\r
}\r
\r
#if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_get_multipath_rec(IN osmtest_t * const p_osmt,\r
IN osmv_multipath_req_t * p_request,\r
}\r
#endif\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_get_port_rec(IN osmtest_t * const p_osmt,\r
IN ib_net16_t const lid,\r
p_context->p_osmt = p_osmt;\r
user.comp_mask = IB_PIR_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_PORTINFO_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_get_port_rec_by_num(IN osmtest_t * const p_osmt,\r
IN ib_net16_t const lid,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_stress_port_recs_large(IN osmtest_t * const p_osmt,\r
OUT uint32_t * const p_num_recs,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_stress_node_recs_large(IN osmtest_t * const p_osmt,\r
OUT uint32_t * const p_num_recs,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_stress_path_recs_large(IN osmtest_t * const p_osmt,\r
OUT uint32_t * const p_num_recs,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_stress_path_recs_by_guid(IN osmtest_t * const p_osmt,\r
OUT uint32_t * const p_num_recs,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_stress_port_recs_small(IN osmtest_t * const p_osmt,\r
OUT uint32_t * const p_num_recs,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_get_local_port_lmc(IN osmtest_t * const p_osmt,\r
IN ib_net16_t lid, OUT uint8_t * const p_lmc)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_write_port_info(IN osmtest_t * const p_osmt,\r
IN FILE * fh,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_write_path_info(IN osmtest_t * const p_osmt,\r
IN FILE * fh, IN const ib_path_rec_t * const p_rec)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_write_node_info(IN osmtest_t * const p_osmt,\r
IN FILE * fh, IN const ib_node_record_t * const p_rec)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_write_link(IN osmtest_t * const p_osmt,\r
IN FILE * fh, IN const ib_link_record_t * const p_rec)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_write_all_link_recs(IN osmtest_t * const p_osmt, IN FILE * fh)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_get_path_rec_by_lid_pair(IN osmtest_t * const p_osmt,\r
IN ib_net16_t slid,\r
\r
#endif\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_create_inventory_file(IN osmtest_t * const p_osmt)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_stress_large_rmpp_pr(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_stress_large_rmpp(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_stress_small_rmpp(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_stress_path_recs_by_lid(IN osmtest_t * const p_osmt,\r
OUT uint32_t * const p_num_recs,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_stress_get_pr(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void\r
osmtest_prepare_db_generic(IN osmtest_t * const p_osmt,\r
IN cl_qmap_t * const p_tbl)\r
OSM_LOG_EXIT(&p_osmt->log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static void osmtest_prepare_db(IN osmtest_t * const p_osmt)\r
{\r
OSM_LOG_ENTER(&p_osmt->log);\r
OSM_LOG_EXIT(&p_osmt->log);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_check_missing_nodes(IN osmtest_t * const p_osmt)\r
{\r
const node_t *p_node;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_check_missing_ports(IN osmtest_t * const p_osmt)\r
{\r
const port_t *p_port;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_check_missing_paths(IN osmtest_t * const p_osmt)\r
{\r
const path_t *p_path;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
inline uint32_t osmtest_path_rec_key_get(IN const ib_path_rec_t * const p_rec)\r
{\r
return (p_rec->dlid << 16 | p_rec->slid);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static boolean_t\r
osmtest_path_rec_kay_is_valid(IN osmtest_t * const p_osmt,\r
IN const path_t * const p_path)\r
return (TRUE);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_path_data(IN osmtest_t * const p_osmt,\r
IN path_t * const p_path,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_node_data(IN osmtest_t * const p_osmt,\r
IN node_t * const p_node,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_node_rec(IN osmtest_t * const p_osmt,\r
IN const ib_node_record_t * const p_rec)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_port_data(IN osmtest_t * const p_osmt,\r
IN port_t * const p_port,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_port_rec(IN osmtest_t * const p_osmt,\r
IN const ib_portinfo_record_t * const p_rec)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_path_rec(IN osmtest_t * const p_osmt,\r
IN const ib_path_rec_t * const p_rec)\r
#ifdef VENDOR_RMPP_SUPPORT\r
ib_net64_t portguid = 0;\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_all_node_recs(IN osmtest_t * const p_osmt)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_all_guidinfo_recs(IN osmtest_t * const p_osmt)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_all_path_recs(IN osmtest_t * const p_osmt)\r
{\r
if (to_lid)\r
user.comp_mask |= IB_LR_COMPMASK_TO_LID;\r
user.attr_id = IB_MAD_ATTR_LINK_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
p_context->p_osmt = p_osmt;\r
user.comp_mask = IB_GIR_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_GUIDINFO_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
p_context->p_osmt = p_osmt;\r
user.comp_mask = IB_PKEY_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_PKEY_TBL_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
if (lid)\r
user.comp_mask = IB_SWIR_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_SWITCH_INFO_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
if (lid)\r
user.comp_mask = IB_LFTR_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_LFT_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
if (lid)\r
user.comp_mask = IB_MFTR_COMPMASK_LID;\r
user.attr_id = IB_MAD_ATTR_MFT_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
user.p_attr = &record;\r
\r
req.query_type = OSMV_QUERY_USER_DEFINED;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_sminfo_record_request(IN osmtest_t * const p_osmt,\r
IN uint8_t method,\r
\r
p_context->p_osmt = p_osmt;\r
user.attr_id = IB_MAD_ATTR_SMINFO_RECORD;\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
p_sm_info_opt = p_options;\r
if (p_sm_info_opt->sm_guid != 0) {\r
record.sm_info.guid = p_sm_info_opt->sm_guid;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_informinfo_request(IN osmtest_t * const p_osmt,\r
IN ib_net16_t attr_id,\r
p_context->p_osmt = p_osmt;\r
user.attr_id = attr_id;\r
if (attr_id == IB_MAD_ATTR_INFORM_INFO_RECORD) {\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
p_inform_info_rec_opt = p_options;\r
if (p_inform_info_rec_opt->subscriber_gid.unicast.prefix != 0 &&\r
p_inform_info_rec_opt->subscriber_gid.unicast.\r
user.comp_mask |= IB_IIR_COMPMASK_ENUM;\r
user.p_attr = &record;\r
} else {\r
- user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));\r
+ user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));\r
/* comp mask bits below are for InformInfoRecord rather than InformInfo */\r
/* as currently no comp mask bits defined for InformInfo!!! */\r
user.comp_mask = IB_IIR_COMPMASK_SUBSCRIBE;\r
}\r
#endif\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_path_rec_lid_pair(IN osmtest_t * const p_osmt,\r
IN path_t * const p_path)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_node_rec_lid(IN osmtest_t * const p_osmt,\r
IN ib_net16_t const lid,\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_port_rec_lid(IN osmtest_t * const p_osmt,\r
IN port_t * const p_port)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_path_rec_guid_pair(IN osmtest_t * const p_osmt,\r
IN const osmv_guid_pair_t *\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_path_recs(IN osmtest_t * const p_osmt)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_node_recs(IN osmtest_t * const p_osmt)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_validate_single_port_recs(IN osmtest_t * const p_osmt)\r
{\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_validate_against_db(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static const osmtest_token_t *str_get_token(IN char *const p_str)\r
{\r
const osmtest_token_t *p_tok;\r
}\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_parse_node(IN osmtest_t * const p_osmt,\r
IN FILE * const fh, IN OUT uint32_t * const p_line_num)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_parse_port(IN osmtest_t * const p_osmt,\r
IN FILE * const fh, IN OUT uint32_t * const p_line_num)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_parse_path(IN osmtest_t * const p_osmt,\r
IN FILE * const fh, IN OUT uint32_t * const p_line_num)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t\r
osmtest_parse_link(IN osmtest_t * const p_osmt,\r
IN FILE * const fh, IN OUT uint32_t * const p_line_num)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
static ib_api_status_t osmtest_create_db(IN osmtest_t * const p_osmt)\r
{\r
FILE *fh;\r
return (choice - 1);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t\r
osmtest_bind(IN osmtest_t * p_osmt,\r
IN uint16_t max_lid, IN ib_net64_t guid OPTIONAL)\r
return (status);\r
}\r
\r
-/**********************************************************************\r
- **********************************************************************/\r
ib_api_status_t osmtest_run(IN osmtest_t * const p_osmt)\r
{\r
ib_api_status_t status = IB_SUCCESS;\r
#define VER_FILETYPE VFT_APP\r
#define VER_FILESUBTYPE VFT2_UNKNOWN\r
#ifdef _DEBUG_\r
-#define VER_FILEDESCRIPTION_STR "OpenSM Test Application 3.3.3 (Debug)"\r
+#define VER_FILEDESCRIPTION_STR "OpenSM Test Application 3.3.6 (Debug)"\r
#define VER_INTERNALNAME_STR "osmtest.exe"\r
#define VER_ORIGINALFILENAME_STR "osmtest.exe"\r
#else\r
-#define VER_FILEDESCRIPTION_STR "OpenSM Test Application 3.3.3"\r
+#define VER_FILEDESCRIPTION_STR "OpenSM Test Application 3.3.6"\r
#define VER_INTERNALNAME_STR "osmtest.exe"\r
#define VER_ORIGINALFILENAME_STR "osmtest.exe"\r
#endif\r