From: eitan Date: Wed, 8 Mar 2006 08:29:25 +0000 (+0000) Subject: [OpenSM] - Update according to linux gen2 trunk X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=df488ec1926e1852a37f6a432df51a2466d1bd4c;p=~shefty%2Frdma-win.git [OpenSM] - Update according to linux gen2 trunk git-svn-id: svn://openib.tc.cornell.edu/gen1@232 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/opensm/user/include/iba/ib_types.h b/trunk/ulp/opensm/user/include/iba/ib_types.h index eb1e11d2..e8c4be31 100644 --- a/trunk/ulp/opensm/user/include/iba/ib_types.h +++ b/trunk/ulp/opensm/user/include/iba/ib_types.h @@ -394,7 +394,7 @@ BEGIN_C_DECLS * * SOURCE */ -#define IB_PKEY_BASE_MASK (CL_NTOH16(0x7FFF)) +#define IB_PKEY_BASE_MASK (CL_HTON16(0x7FFF)) /*********/ /****d* IBA Base: Constants/IB_PKEY_TYPE_MASK @@ -409,6 +409,18 @@ BEGIN_C_DECLS #define IB_PKEY_TYPE_MASK (CL_NTOH16(0x8000)) /*********/ +/****d* IBA Base: Constants/IB_DEFAULT_PARTIAL_PKEY +* NAME +* IB_DEFAULT_PARTIAL_PKEY +* +* DESCRIPTION +* 0x7FFF in network order +* +* SOURCE +*/ +#define IB_DEFAULT_PARTIAL_PKEY (CL_HTON16(0x7FFF)) +/**********/ + /****d* IBA Base: Constants/IB_MCLASS_SUBN_LID * NAME * IB_MCLASS_SUBN_LID @@ -1123,6 +1135,18 @@ ib_class_is_vendor_specific( #define IB_MAD_ATTR_SMINFO_RECORD (CL_NTOH16(0x0018)) /**********/ +/****d* IBA Base: Constants/IB_MAD_ATTR_GUIDINFO_RECORD +* NAME +* IB_MAD_ATTR_GUIDINFO_RECORD +* +* DESCRIPTION +* GuidInfoRecord attribute (15.2.5) +* +* SOURCE +*/ +#define IB_MAD_ATTR_GUIDINFO_RECORD (CL_NTOH16(0x0030)) +/**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_VENDOR_DIAG * NAME * IB_MAD_ATTR_VENDOR_DIAG @@ -1134,6 +1158,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_VENDOR_DIAG (CL_NTOH16(0x0030)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_LED_INFO * NAME * IB_MAD_ATTR_LED_INFO @@ -1145,6 +1170,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_LED_INFO (CL_NTOH16(0x0031)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_RECORD * NAME * IB_MAD_ATTR_SERVICE_RECORD @@ -1156,6 +1182,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_SERVICE_RECORD (CL_NTOH16(0x0031)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_LFT_RECORD * NAME * IB_MAD_ATTR_LFT_RECORD @@ -1167,6 +1194,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_LFT_RECORD (CL_NTOH16(0x0015)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_PKEYTBL_RECORD * NAME * IB_MAD_ATTR_PKEYTBL_RECORD @@ -1178,6 +1206,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_PKEY_TBL_RECORD (CL_NTOH16(0x0033)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_PATH_RECORD * NAME * IB_MAD_ATTR_PATH_RECORD @@ -1189,6 +1218,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_PATH_RECORD (CL_NTOH16(0x0035)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_VLARB_RECORD * NAME * IB_MAD_ATTR_VLARB_RECORD @@ -1200,6 +1230,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_VLARB_RECORD (CL_NTOH16(0x0036)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_RECORD * NAME * IB_MAD_ATTR_SLVL_RECORD @@ -1211,6 +1242,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_SLVL_RECORD (CL_NTOH16(0x0013)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_MCMEMBER_RECORD * NAME * IB_MAD_ATTR_MCMEMBER_RECORD @@ -1222,6 +1254,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_MCMEMBER_RECORD (CL_NTOH16(0x0038)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_TRACE_RECORD * NAME * IB_MAD_ATTR_MTRACE_RECORD @@ -1233,6 +1266,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_TRACE_RECORD (CL_NTOH16(0x0039)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_MULTIPATH_RECORD * NAME * IB_MAD_ATTR_MULTIPATH_RECORD @@ -1244,6 +1278,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_MULTIPATH_RECORD (CL_NTOH16(0x003A)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD * NAME * IB_MAD_ATTR_SVC_ASSOCIATION_RECORD @@ -1255,6 +1290,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_NTOH16(0x003B)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_IO_UNIT_INFO * NAME * IB_MAD_ATTR_IO_UNIT_INFO @@ -1266,6 +1302,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_IO_UNIT_INFO (CL_NTOH16(0x0010)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_IO_CONTROLLER_PROFILE * NAME * IB_MAD_ATTR_IO_CONTROLLER_PROFILE @@ -1277,6 +1314,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_IO_CONTROLLER_PROFILE (CL_NTOH16(0x0011)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_ENTRIES * NAME * IB_MAD_ATTR_SERVICE_ENTRIES @@ -1288,6 +1326,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_SERVICE_ENTRIES (CL_NTOH16(0x0012)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT * NAME * IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT @@ -1299,6 +1338,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT (CL_NTOH16(0x0020)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_PREPARE_TO_TEST * NAME * IB_MAD_ATTR_PREPARE_TO_TEST @@ -1310,6 +1350,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_PREPARE_TO_TEST (CL_NTOH16(0x0021)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_ONCE * NAME * IB_MAD_ATTR_TEST_DEVICE_ONCE @@ -1321,6 +1362,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_TEST_DEVICE_ONCE (CL_NTOH16(0x0022)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_LOOP * NAME * IB_MAD_ATTR_TEST_DEVICE_LOOP @@ -1332,6 +1374,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_TEST_DEVICE_LOOP (CL_NTOH16(0x0023)) /**********/ + /****d* IBA Base: Constants/IB_MAD_ATTR_DIAG_CODE * NAME * IB_MAD_ATTR_DIAG_CODE @@ -1355,6 +1398,7 @@ ib_class_is_vendor_specific( */ #define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_NTOH16(0x003B)) /**********/ + /****d* IBA Base: Constants/IB_NODE_TYPE_CA * NAME * IB_NODE_TYPE_CA @@ -1366,6 +1410,7 @@ ib_class_is_vendor_specific( */ #define IB_NODE_TYPE_CA 0x01 /**********/ + /****d* IBA Base: Constants/IB_NODE_TYPE_SWITCH * NAME * IB_NODE_TYPE_SWITCH @@ -1377,6 +1422,7 @@ ib_class_is_vendor_specific( */ #define IB_NODE_TYPE_SWITCH 0x02 /**********/ + /****d* IBA Base: Constants/IB_NODE_TYPE_ROUTER * NAME * IB_NODE_TYPE_ROUTER @@ -1400,6 +1446,7 @@ ib_class_is_vendor_specific( */ #define IB_NOTICE_NODE_TYPE_CA (CL_NTOH32(0x000001)) /**********/ + /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SWITCH * NAME * IB_NOTICE_NODE_TYPE_SWITCH @@ -1411,6 +1458,7 @@ ib_class_is_vendor_specific( */ #define IB_NOTICE_NODE_TYPE_SWITCH (CL_NTOH32(0x000002)) /**********/ + /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_ROUTER * NAME * IB_NOTICE_NODE_TYPE_ROUTER @@ -1422,6 +1470,7 @@ ib_class_is_vendor_specific( */ #define IB_NOTICE_NODE_TYPE_ROUTER (CL_NTOH32(0x000003)) /**********/ + /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SUBN_MGMT * NAME * IB_NOTICE_NODE_TYPE_SUBN_MGMT @@ -2162,18 +2211,22 @@ typedef struct _ib_path_rec #define IB_VLA_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) #define IB_VLA_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<1)) #define IB_VLA_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<2)) + /* SLtoVL Mapping Record Masks */ #define IB_SLVL_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) #define IB_SLVL_COMPMASK_IN_PORT (CL_HTON64(((uint64_t)1)<<1)) #define IB_SLVL_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<2)) + /* P_Key Table Record Masks */ #define IB_PKEY_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) #define IB_PKEY_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1)) #define IB_PKEY_COMPMASK_PORT (CL_HTON64(((uint64_t)1)<<2)) -/* LFT Record MASKS */ + +/* LFT Record Masks */ #define IB_LFTR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) #define IB_LFTR_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1)) -/* ModeInfo Record MASKS */ + +/* NodeInfo Record Masks */ #define IB_NR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) #define IB_NR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<1)) #define IB_NR_COMPMASK_BASEVERSION (CL_HTON64(((uint64_t)1)<<2)) @@ -2189,6 +2242,7 @@ typedef struct _ib_path_rec #define IB_NR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<12)) #define IB_NR_COMPMASK_VENDID (CL_HTON64(((uint64_t)1)<<13)) #define IB_NR_COMPMASK_NODEDESC (CL_HTON64(((uint64_t)1)<<14)) + /* Service Record Component Mask Sec 15.2.5.14 Ver 1.1*/ #define IB_SR_COMPMASK_SID (CL_HTON64(((uint64_t)1)<<0)) #define IB_SR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<1)) @@ -2227,6 +2281,7 @@ typedef struct _ib_path_rec #define IB_SR_COMPMASK_SDATA32_3 (CL_HTON64(((uint64_t)1)<<34)) #define IB_SR_COMPMASK_SDATA64_0 (CL_HTON64(((uint64_t)1)<<35)) #define IB_SR_COMPMASK_SDATA64_1 (CL_HTON64(((uint64_t)1)<<36)) + /* Port Info Record Component Masks */ #define IB_PIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) #define IB_PIR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<1)) @@ -2277,6 +2332,7 @@ typedef struct _ib_path_rec #define IB_PIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<46)) #define IB_PIR_COMPMASK_LOCALPHYERR (CL_HTON64(((uint64_t)1)<<47)) #define IB_PIR_COMPMASK_OVERRUNERR (CL_HTON64(((uint64_t)1)<<48)) + /* Multicast Member Record Component Masks */ #define IB_MCR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<0)) #define IB_MCR_COMPMASK_MGID (CL_HTON64(((uint64_t)1)<<0)) @@ -2298,6 +2354,20 @@ typedef struct _ib_path_rec #define IB_MCR_COMPMASK_JOIN_STATE (CL_HTON64(((uint64_t)1)<<16)) #define IB_MCR_COMPMASK_PROXY (CL_HTON64(((uint64_t)1)<<17)) +/* GUID Info Record Component Masks */ +#define IB_GIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) +#define IB_GIR_COMPMASK_BLOCKNUM (CL_HTON64(((uint64_t)1)<<1)) +#define IB_GIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2)) +#define IB_GIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<3)) +#define IB_GIR_COMPMASK_GID0 (CL_HTON64(((uint64_t)1)<<4)) +#define IB_GIR_COMPMASK_GID1 (CL_HTON64(((uint64_t)1)<<5)) +#define IB_GIR_COMPMASK_GID2 (CL_HTON64(((uint64_t)1)<<6)) +#define IB_GIR_COMPMASK_GID3 (CL_HTON64(((uint64_t)1)<<7)) +#define IB_GIR_COMPMASK_GID4 (CL_HTON64(((uint64_t)1)<<8)) +#define IB_GIR_COMPMASK_GID5 (CL_HTON64(((uint64_t)1)<<9)) +#define IB_GIR_COMPMASK_GID6 (CL_HTON64(((uint64_t)1)<<10)) +#define IB_GIR_COMPMASK_GID7 (CL_HTON64(((uint64_t)1)<<11)) + /****f* IBA Base: Types/ib_path_rec_init_local * NAME * ib_path_rec_init_local @@ -3974,6 +4044,33 @@ ib_port_info_get_vl_cap( * * SEE ALSO *********/ +/****f* IBA Base: Types/ib_port_info_get_init_type +* NAME +* ib_port_info_get_init_type +* +* DESCRIPTION +* Gets the init type of a port. +* +* SYNOPSIS +*/ +OSM_INLINE uint8_t AL_API +ib_port_info_get_init_type( + IN const ib_port_info_t* const p_pi) +{ + return (uint8_t) (p_pi->vl_cap & 0x0F); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* RETURN VALUES +* InitType field +* +* NOTES +* +* SEE ALSO +*********/ /****f* IBA Base: Types/ib_port_info_get_op_vls * NAME * ib_port_info_get_op_vls @@ -4316,59 +4413,76 @@ AL_INLINE uint8_t AL_API ib_port_info_compute_rate( IN const ib_port_info_t* const p_pi ) { + uint8_t rate = 0; + switch (ib_port_info_get_link_speed_active(p_pi)) { case IB_LINK_SPEED_ACTIVE_2_5: switch(p_pi->link_width_active) { case IB_LINK_WIDTH_ACTIVE_1X: - return IB_PATH_RECORD_RATE_2_5_GBS; + rate = IB_PATH_RECORD_RATE_2_5_GBS; + break; case IB_LINK_WIDTH_ACTIVE_4X: - return IB_PATH_RECORD_RATE_10_GBS; + rate = IB_PATH_RECORD_RATE_10_GBS; + break; case IB_LINK_WIDTH_ACTIVE_12X: - return IB_PATH_RECORD_RATE_30_GBS; + rate = IB_PATH_RECORD_RATE_30_GBS; + break; default: - return IB_PATH_RECORD_RATE_2_5_GBS; + rate = IB_PATH_RECORD_RATE_2_5_GBS; + break; } break; case IB_LINK_SPEED_ACTIVE_5: switch (p_pi->link_width_active) { case IB_LINK_WIDTH_ACTIVE_1X: - return IB_PATH_RECORD_RATE_5_GBS; + rate = IB_PATH_RECORD_RATE_5_GBS; + break; case IB_LINK_WIDTH_ACTIVE_4X: - return IB_PATH_RECORD_RATE_20_GBS; + rate = IB_PATH_RECORD_RATE_20_GBS; + break; case IB_LINK_WIDTH_ACTIVE_12X: - return IB_PATH_RECORD_RATE_60_GBS; + rate = IB_PATH_RECORD_RATE_60_GBS; + break; default: - return IB_PATH_RECORD_RATE_5_GBS; + rate = IB_PATH_RECORD_RATE_5_GBS; + break; } break; case IB_LINK_SPEED_ACTIVE_10: switch (p_pi->link_width_active) { case IB_LINK_WIDTH_ACTIVE_1X: - return IB_PATH_RECORD_RATE_10_GBS; + rate = IB_PATH_RECORD_RATE_10_GBS; + break; case IB_LINK_WIDTH_ACTIVE_4X: - return IB_PATH_RECORD_RATE_40_GBS; + rate = IB_PATH_RECORD_RATE_40_GBS; + break; case IB_LINK_WIDTH_ACTIVE_12X: - return IB_PATH_RECORD_RATE_120_GBS; + rate = IB_PATH_RECORD_RATE_120_GBS; + break; default: - return IB_PATH_RECORD_RATE_10_GBS; + rate = IB_PATH_RECORD_RATE_10_GBS; + break; } break; default: - return IB_PATH_RECORD_RATE_2_5_GBS; + rate = IB_PATH_RECORD_RATE_2_5_GBS; + break; } + + return rate; } /* * PARAMETERS @@ -4401,11 +4515,11 @@ ib_path_get_ipd( switch(local_link_width_supported) { - //link_width_supported = 1: 1x + /* link_width_supported = 1: 1x */ case 1: break; - //link_width_supported = 3: 1x or 4x + /* link_width_supported = 3: 1x or 4x */ case 3: switch(path_rec_rate & 0x3F) { @@ -4417,7 +4531,7 @@ ib_path_get_ipd( } break; - //link_width_supported = 11: 1x or 4x or 12x + /* link_width_supported = 11: 1x or 4x or 12x */ case 11: switch(path_rec_rate & 0x3F) { @@ -4454,7 +4568,6 @@ ib_path_get_ipd( * SEE ALSO *********/ - /****f* IBA Base: Types/ib_port_info_get_mtu_cap * NAME * ib_port_info_get_mtu_cap @@ -4543,6 +4656,65 @@ ib_port_info_set_neighbor_mtu( * SEE ALSO *********/ +/****f* IBA Base: Types/ib_port_info_get_master_smsl +* NAME +* ib_port_info_get_master_smsl +* +* DESCRIPTION +* Returns the encoded value for the Master SMSL at this port. +* +* SYNOPSIS +*/ +OSM_INLINE uint8_t AL_API +ib_port_info_get_master_smsl( + IN const ib_port_info_t* const p_pi ) +{ + return (uint8_t) (p_pi->mtu_smsl & 0x0F); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* RETURN VALUES +* Returns the encoded value for the Master SMSL at this port. +* +* NOTES +* +* SEE ALSO +*********/ +/****f* IBA Base: Types/ib_port_info_set_master_smsl +* NAME +* ib_port_info_set_master_smsl +* +* DESCRIPTION +* Sets the Master SMSL value in the PortInfo attribute. +* +* SYNOPSIS +*/ +AL_INLINE void AL_API +ib_port_info_set_master_smsl( + IN ib_port_info_t* const p_pi, + IN const uint8_t smsl ) +{ + p_pi->mtu_smsl = (uint8_t)((p_pi->mtu_smsl & 0xF0) | smsl ); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* mtu +* [in] Encoded Master SMSL value to set +* +* RETURN VALUES +* None. +* +* NOTES +* +* SEE ALSO +*********/ + /****f* IBA Base: Types/ib_port_info_set_timeout * NAME * ib_port_info_set_timeout @@ -4780,7 +4952,7 @@ ib_port_info_set_vl_stall_count( * * SYNOPSIS */ -AL_INLINE uint8_t AL_API +OSM_INLINE uint8_t AL_API ib_port_info_get_vl_stall_count( IN const ib_port_info_t* const p_pi ) { @@ -4980,6 +5152,60 @@ ib_port_info_set_mpb( * * SEE ALSO *********/ +/****f* IBA Base: Types/ib_port_info_get_local_phy_err_thd +* NAME +* ib_port_info_get_local_phy_err_thd +* +* DESCRIPTION +* Returns the Phy Link Threshold +* +* SYNOPSIS +*/ +OSM_INLINE uint8_t AL_API +ib_port_info_get_local_phy_err_thd( + IN const ib_port_info_t* const p_pi ) +{ + return (uint8_t)( (p_pi->error_threshold & 0xF0) >> 4); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* RETURN VALUES +* Returns the Phy Link error threshold assigned to this port. +* +* NOTES +* +* SEE ALSO +*********/ +/****f* IBA Base: Types/ib_port_info_get_overrun_err_thd +* NAME +* ib_port_info_get_local_overrun_err_thd +* +* DESCRIPTION +* Returns the Credits Overrun Errors Threshold +* +* SYNOPSIS +*/ +OSM_INLINE uint8_t AL_API +ib_port_info_get_overrun_err_thd( + IN const ib_port_info_t* const p_pi ) +{ + return (uint8_t)(p_pi->error_threshold & 0x0F); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* RETURN VALUES +* Returns the Credits Overrun errors threshold assigned to this port. +* +* NOTES +* +* SEE ALSO +*********/ /****f* IBA Base: Types/ib_port_info_set_phy_and_overrun_err_thd * NAME @@ -5241,6 +5467,17 @@ typedef struct _ib_guid_info #include /************/ +#include +typedef struct _ib_guidinfo_record +{ + ib_net16_t lid; + uint8_t block_num; + uint8_t resv; + uint32_t reserved; + ib_guid_info_t guid_info; +} PACK_SUFFIX ib_guidinfo_record_t; +#include + #define IB_NUM_PKEY_ELEMENTS_IN_BLOCK 32 /****s* IBA Base: Types/ib_pkey_table_t * NAME diff --git a/trunk/ulp/opensm/user/include/opensm/osm_base.h b/trunk/ulp/opensm/user/include/opensm/osm_base.h index cafde5e7..07b45e88 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_base.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_base.h @@ -93,18 +93,6 @@ BEGIN_C_DECLS * Steve King, Intel * *********/ -/****s* OpenSM: Base/OSM_VERSION -* NAME -* OSM_VERSION -* -* DESCRIPTION -* The version String for OpenSM -* -* SYNOPSIS -*/ -#define OSM_VERSION "OpenSM Rev:openib-1.1.0" -/********/ - /****s* OpenSM: Base/OSM_DEFAULT_M_KEY * NAME * OSM_DEFAULT_M_KEY @@ -126,7 +114,7 @@ BEGIN_C_DECLS * * SYNOPSIS */ -#define OSM_DEFAULT_SM_KEY 0 +#define OSM_DEFAULT_SM_KEY 1 /********/ /****s* OpenSM: Base/OSM_DEFAULT_LMC @@ -173,11 +161,11 @@ BEGIN_C_DECLS * * DESCRIPTION * Default SM priority value used by the OpenSM, -* as defined in the SMInfo attribute. 0 is the highest priority. +* as defined in the SMInfo attribute. 0 is the lowest priority. * * SYNOPSIS */ -#define OSM_DEFAULT_SM_PRIORITY 0 +#define OSM_DEFAULT_SM_PRIORITY 1 /********/ /****d* OpenSM: Base/OSM_DEFAULT_TMP_DIR @@ -225,7 +213,7 @@ BEGIN_C_DECLS * SYNOPSIS */ #ifdef __WIN__ -#define OSM_DEFAULT_LOG_FILE strcat(GetOsmPath(),"osm.log") +#define OSM_DEFAULT_LOG_FILE strcat(GetOsmPath(), "osm.log") #else #define OSM_DEFAULT_LOG_FILE "/var/log/osm.log" #endif @@ -251,7 +239,7 @@ BEGIN_C_DECLS * * SYNOPSIS */ -#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 100 +#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200 /***********/ /****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT @@ -376,7 +364,7 @@ BEGIN_C_DECLS * * SYNOPSIS */ -#define OSM_DEFAULT_SMP_MAX_ON_WIRE 1 +#define OSM_DEFAULT_SMP_MAX_ON_WIRE 4 /***********/ /****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_RCV_SIZE @@ -583,8 +571,10 @@ typedef enum _osm_sm_state OSM_SM_STATE_PROCESS_REQUEST_WAIT, OSM_SM_STATE_PROCESS_REQUEST_DONE, OSM_SM_STATE_MASTER_OR_HIGHER_SM_DETECTED, + OSM_SM_STATE_SET_PKEY, + OSM_SM_STATE_SET_PKEY_WAIT, + OSM_SM_STATE_SET_PKEY_DONE, OSM_SM_STATE_MAX - } osm_sm_state_t; /***********/ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_console.h b/trunk/ulp/opensm/user/include/opensm/osm_console.h new file mode 100644 index 00000000..b63f8b7e --- /dev/null +++ b/trunk/ulp/opensm/user/include/opensm/osm_console.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +#ifndef _OSM_CONSOLE_H_ +#define _OSM_CONSOLE_H_ + +#include +#include +#include + +#ifdef __cplusplus +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else /* !__cplusplus */ +# define BEGIN_C_DECLS +# define END_C_DECLS +#endif /* __cplusplus */ + +BEGIN_C_DECLS + +void osm_console(osm_opensm_t *p_osm); + +END_C_DECLS + +#endif /* _OSM_CONSOLE_H_ */ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_helper.h b/trunk/ulp/opensm/user/include/opensm/osm_helper.h index de351004..300bd199 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_helper.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_helper.h @@ -219,14 +219,12 @@ osm_dump_node_record( IN const ib_node_record_t* const p_nr, IN const osm_log_level_t log_level ); - void osm_dump_mc_record( IN osm_log_t* const p_log, IN const ib_member_rec_t* const p_mcmr, IN const osm_log_level_t log_level ); - void osm_dump_link_record( IN osm_log_t* const p_log, @@ -245,6 +243,12 @@ osm_dump_portinfo_record( IN const ib_portinfo_record_t* const p_pir, IN const osm_log_level_t log_level ); +void +osm_dump_guidinfo_record( + IN osm_log_t* const p_log, + IN const ib_guidinfo_record_t* const p_gir, + IN const osm_log_level_t log_level ); + void osm_dump_inform_info( IN osm_log_t* const p_log, diff --git a/trunk/ulp/opensm/user/include/opensm/osm_lin_fwd_tbl.h b/trunk/ulp/opensm/user/include/opensm/osm_lin_fwd_tbl.h index 7d3a6743..31fb18f4 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_lin_fwd_tbl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_lin_fwd_tbl.h @@ -338,6 +338,7 @@ osm_lin_fwd_tbl_set_block( { uint16_t lid_start; uint16_t num_lids; + CL_ASSERT( p_tbl ); CL_ASSERT( p_block ); diff --git a/trunk/ulp/opensm/user/include/opensm/osm_log.h b/trunk/ulp/opensm/user/include/opensm/osm_log.h index 869297e6..e5a324e6 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_log.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_log.h @@ -67,37 +67,18 @@ BEGIN_C_DECLS -#ifndef PRIx64 -#if __WORDSIZE == 64 -#define PRId64 "I64d" -#define PRIx64 "I64x" -#define PRIo64 "I64o" -#define PRIu64 "I64u" -#else // __WORDSIZE -#define PRId64 "I64d" -#define PRIx64 "I64x" -#define PRIo64 "I64o" -#define PRIu64 "I64u" - -#endif //__WORDSIZE -#endif // PRIx64 - - - #define LOG_ENTRY_SIZE_MAX 4096 #define BUF_SIZE LOG_ENTRY_SIZE_MAX -#define OSM_LOG_DEFINE_FUNC( NAME ) \ - static const char osm_log_func_name[] = #NAME +#define __func__ __FUNCTION__ #define OSM_LOG_ENTER( OSM_LOG_PTR, NAME ) \ - OSM_LOG_DEFINE_FUNC( NAME ); \ osm_log( OSM_LOG_PTR, OSM_LOG_FUNCS, \ - "%s: [\n", osm_log_func_name ); + "%s: [\n", __func__); #define OSM_LOG_EXIT( OSM_LOG_PTR ) \ osm_log( OSM_LOG_PTR, OSM_LOG_FUNCS, \ - "%s: ]\n", osm_log_func_name ); + "%s: ]\n", __func__); /****h* OpenSM/Log * NAME @@ -247,10 +228,10 @@ osm_log_init( else { if (accum_log_file) - p_log->out_port = fopen(log_file,"a+"); + p_log->out_port = fopen(log_file, "a+"); else - p_log->out_port = fopen(log_file,"w+"); - + p_log->out_port = fopen(log_file, "w+"); + if (!p_log->out_port) { if (accum_log_file) @@ -416,7 +397,7 @@ osm_log_raw( __exp__,__FILE__, __LINE__); \ cl_plock_excl_acquire( __exp__ ); \ if (DBG_CL_LOCK) \ - printf("cl_plock_excl_acquire: Acquired %p file %s, line %d\n", \ + printf("cl_plock_excl_acquire: Acquired %p file %s, line %d\n", \ __exp__,__FILE__, __LINE__); \ } @@ -427,7 +408,7 @@ osm_log_raw( __exp__,__FILE__, __LINE__); \ cl_plock_acquire( __exp__ ); \ if (DBG_CL_LOCK) \ - printf("cl_plock_acquire: Acquired %p file %s, line %d\n", \ + printf("cl_plock_acquire: Acquired %p file %s, line %d\n", \ __exp__,__FILE__, __LINE__); \ } @@ -457,11 +438,11 @@ osm_log_raw( #define CL_SPINLOCK_ACQUIRE( __exp__ ) \ { \ if (DBG_CL_SPINLOCK) \ - printf("cl_spinlock_acquire: Acquire %p file %s, line %d\n", \ + printf("cl_spinlock_acquire: Acquiring %p file %s, line %d\n", \ __exp__,__FILE__, __LINE__); \ cl_spinlock_acquire( __exp__ ); \ if (DBG_CL_SPINLOCK) \ - printf("cl_spinlock_acquire: Acquired %p file %s, line %d\n", \ + printf("cl_spinlock_acquire: Acquired %p file %s, line %d\n", \ __exp__,__FILE__, __LINE__); \ } diff --git a/trunk/ulp/opensm/user/include/opensm/osm_madw.h b/trunk/ulp/opensm/user/include/opensm/osm_madw.h index 3da00570..c5ac28de 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_madw.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_madw.h @@ -312,6 +312,7 @@ typedef struct _osm_vla_context boolean_t set_method; } osm_vla_context_t; /*********/ +#ifndef OSM_VENDOR_INTF_OPENIB /****s* OpenSM: MAD Wrapper/osm_arbitrary_context_t * NAME * osm_sa_context_t @@ -327,7 +328,7 @@ typedef struct _osm_arbitrary_context void* context2; } osm_arbitrary_context_t; /*********/ - +#endif /****s* OpenSM: MAD Wrapper/osm_madw_context_t * NAME * osm_madw_context_t @@ -348,7 +349,9 @@ typedef union _osm_madw_context osm_smi_context_t smi_context; osm_slvl_context_t slvl_context; osm_pkey_context_t pkey_context; - osm_arbitrary_context_t arb_context; +#ifndef OSM_VENDOR_INTF_OPENIB + osm_arbitrary_context_t arb_context; +#endif } osm_madw_context_t; /*********/ @@ -877,6 +880,7 @@ osm_madw_get_slvl_context_ptr( * * SEE ALSO *********/ + /****f* OpenSM: MAD Wrapper/osm_madw_get_vla_context_ptr * NAME * osm_madw_get_vla_context_ptr @@ -904,6 +908,8 @@ osm_madw_get_vla_context_ptr( * * SEE ALSO *********/ + +#ifndef OSM_VENDOR_INTF_OPENIB /****f* OpenSM: MAD Wrapper/osm_madw_get_arbitrary_context_ptr * NAME * osm_madw_get_arbitrary_context_ptr @@ -931,6 +937,7 @@ osm_madw_get_arbitrary_context_ptr( * * SEE ALSO *********/ +#endif /****f* OpenSM: MAD Wrapper/osm_madw_get_vend_ptr * NAME diff --git a/trunk/ulp/opensm/user/include/opensm/osm_msgdef.h b/trunk/ulp/opensm/user/include/opensm/osm_msgdef.h index 665782e1..b6a7946a 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_msgdef.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_msgdef.h @@ -188,6 +188,7 @@ enum OSM_MSG_MAD_PKEY, OSM_MSG_MAD_VL_ARB, OSM_MSG_MAD_SLVL, + OSM_MSG_MAD_GUIDINFO_RECORD, OSM_MSG_MAX }; diff --git a/trunk/ulp/opensm/user/include/opensm/osm_opensm.h b/trunk/ulp/opensm/user/include/opensm/osm_opensm.h index d3dce382..a2362156 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_opensm.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_opensm.h @@ -415,7 +415,7 @@ IN osm_opensm_t* const p_osm); * * SEE ALSO *********/ -#endif +#endif /* __WIN__ */ END_C_DECLS diff --git a/trunk/ulp/opensm/user/include/opensm/osm_pkey.h b/trunk/ulp/opensm/user/include/opensm/osm_pkey.h index b2d405a0..c30b14dd 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_pkey.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_pkey.h @@ -161,7 +161,7 @@ void osm_pkey_tbl_destroy( * osm_pkey_get_num_blocks * * DESCRIPTION -* Obtain the pointer to the IB PKey table block stored in the object +* Obtain the number of blocks in IB PKey table * * SYNOPSIS */ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_pkey_mgr.h b/trunk/ulp/opensm/user/include/opensm/osm_pkey_mgr.h new file mode 100644 index 00000000..0c1c170a --- /dev/null +++ b/trunk/ulp/opensm/user/include/opensm/osm_pkey_mgr.h @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +/* + * Abstract: + * Declaration of osm_pkey_mgr_t. + * This object represents the P_Key Manager object. + * This object is part of the OpenSM family of objects. + * + * Environment: + * Linux User Mode + * + * $Revision: 1.4 $ + */ + + +#ifndef _OSM_PKEY_MGR_H_ +#define _OSM_PKEY_MGR_H_ + +#include +#include +#include +#include + +#ifdef __cplusplus +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else /* !__cplusplus */ +# define BEGIN_C_DECLS +# define END_C_DECLS +#endif /* __cplusplus */ + +BEGIN_C_DECLS + +/****h* OpenSM/P_Key Manager +* NAME +* P_Key Manager +* +* DESCRIPTION +* The P_Key Manager object manage the p_key tables of all +* objects in the subnet +* +* AUTHOR +* Ofer Gigi, Mellanox +* +*********/ +/****s* OpenSM: P_Key Manager/osm_pkey_mgr_t +* NAME +* osm_pkey_mgr_t +* +* DESCRIPTION +* p_Key Manager structure. +* +* +* SYNOPSIS +*/ + +typedef struct _osm_pkey_mgr +{ + osm_subn_t *p_subn; + osm_log_t *p_log; + osm_req_t *p_req; + cl_plock_t *p_lock; + +} osm_pkey_mgr_t; + +/* +* FIELDS +* p_subn +* Pointer to the Subnet object for this subnet. +* +* p_log +* Pointer to the log object. +* +* p_req +* Pointer to the Request object. +* +* p_lock +* Pointer to the serializing lock. +* +* SEE ALSO +* P_Key Manager object +*********/ + +/****** OpenSM: P_Key Manager/osm_pkey_mgr_construct +* NAME +* osm_pkey_mgr_construct +* +* DESCRIPTION +* This function constructs a P_Key Manager object. +* +* SYNOPSIS +*/ +void +osm_pkey_mgr_construct( + IN osm_pkey_mgr_t* const p_mgr ); +/* +* PARAMETERS +* p_mgr +* [in] Pointer to a P_Key Manager object to construct. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Allows calling osm_pkey_mgr_init, osm_pkey_mgr_destroy +* +* Calling osm_pkey_mgr_construct is a prerequisite to calling any other +* method except osm_pkey_mgr_init. +* +* SEE ALSO +* P_Key Manager object, osm_pkey_mgr_init, +* osm_pkey_mgr_destroy +*********/ + +/****f* OpenSM: P_Key Manager/osm_pkey_mgr_destroy +* NAME +* osm_pkey_mgr_destroy +* +* DESCRIPTION +* The osm_pkey_mgr_destroy function destroys the object, releasing +* all resources. +* +* SYNOPSIS +*/ +void +osm_pkey_mgr_destroy( + IN osm_pkey_mgr_t* const p_mgr ); +/* +* PARAMETERS +* p_mgr +* [in] Pointer to the object to destroy. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Performs any necessary cleanup of the specified +* P_Key Manager object. +* Further operations should not be attempted on the destroyed object. +* This function should only be called after a call to +* osm_pkey_mgr_construct or osm_pkey_mgr_init. +* +* SEE ALSO +* P_Key Manager object, osm_pkey_mgr_construct, +* osm_pkey_mgr_init +*********/ + +/****f* OpenSM: P_Key Manager/osm_pkey_mgr_init +* NAME +* osm_pkey_mgr_init +* +* DESCRIPTION +* The osm_pkey_mgr_init function initializes a +* P_Key Manager object for use. +* +* SYNOPSIS +*/ +ib_api_status_t +osm_pkey_mgr_init( + IN osm_pkey_mgr_t* const p_mgr, + IN osm_subn_t* const p_subn, + IN osm_log_t* const p_log, + IN osm_req_t* const p_req, + IN cl_plock_t* const p_lock ); +/* +* PARAMETERS +* p_mgr +* [in] Pointer to an osm_pkey_mgr_t object to initialize. +* +* p_subn +* [in] Pointer to the Subnet object for this subnet. +* +* p_log +* [in] Pointer to the log object. +* +* p_req +* [in] Pointer to an osm_req_t object. +* +* p_lock +* [in] Pointer to the OpenSM serializing lock. +* +* RETURN VALUES +* IB_SUCCESS if the P_Key Manager object was initialized +* successfully. +* +* NOTES +* Allows calling other P_Key Manager methods. +* +* SEE ALSO +* P_Key Manager object, osm_pkey_mgr_construct, +* osm_pkey_mgr_destroy +*********/ + +/****f* OpenSM: P_Key Manager/osm_pkey_mgr_process +* NAME +* osm_pkey_mgr_process +* +* DESCRIPTION +* This function enforce pkey rules on the SM DB. +* +* SYNOPSIS +*/ +osm_signal_t +osm_pkey_mgr_process( + IN const osm_pkey_mgr_t* const p_mgr ); +/* +* PARAMETERS +* p_mgr +* [in] Pointer to an osm_pkey_mgr_t object. +* +* RETURN VALUES +* None +* +* NOTES +* Current Operations: +* - Inserts IB_DEFAULT_PKEY to all node objects that don't have +* IB_DEFAULT_PARTIAL_PKEY or IB_DEFAULT_PKEY as part +* of their p_key table +* +* SEE ALSO +* P_Key Manager +*********/ + +END_C_DECLS + +#endif /* _OSM_PKEY_MGR_H_ */ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_port.h b/trunk/ulp/opensm/user/include/opensm/osm_port.h index 21cf041a..244cb285 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_port.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_port.h @@ -343,7 +343,7 @@ osm_physp_is_healthy( * Returns TRUE if the Physical Port has been maked as healthy * FALSE otherwise. * All physical ports are initialized as "healthy" but may be marked -* otherwise if a received trap claims otherwise. +* otherwise if a received trap claims otherwise. * * NOTES * @@ -453,6 +453,46 @@ osm_physp_set_port_info( * Port, Physical Port *********/ +/****f* OpenSM: Physical Port/osm_physp_trim_base_lid_to_valid_range +* NAME +* osm_physp_trim_base_lid_to_valid_range +* +* DESCRIPTION +* Validates the base LID in the Physical Port object +* and resets it if the base LID is invalid. +* +* SYNOPSIS +*/ +static inline ib_net16_t +osm_physp_trim_base_lid_to_valid_range( + IN osm_physp_t* const p_physp ) +{ + ib_net16_t orig_lid = 0; + + CL_ASSERT( osm_physp_is_valid( p_physp ) ); + if ( ( cl_ntoh16( p_physp->port_info.base_lid ) > IB_LID_UCAST_END_HO ) || + ( cl_ntoh16( p_physp->port_info.base_lid ) < IB_LID_UCAST_START_HO ) ) + { + orig_lid = p_physp->port_info.base_lid; + p_physp->port_info.base_lid = 0; + } + return orig_lid; +} +/* +* PARAMETERS +* p_physp +* [in] Pointer to an osm_physp_t object. +* +* RETURN VALUES +* Returns 0 if the base LID in the Physical port object is valid. +* Returns original invalid LID otherwise. +* +* NOTES +* +* SEE ALSO +* Port, Physical Port +*********/ + /****f* OpenSM: Physical Port/osm_physp_set_pkey_tbl * NAME * osm_physp_set_pkey_tbl @@ -1303,9 +1343,9 @@ osm_port_destroy( * SEE ALSO * Port, osm_port_init, osm_port_destroy, osm_port_is_inited *********/ -/****f* OpenSM: Port/osm_port_destroy +/****f* OpenSM: Port/osm_port_delete * NAME -* osm_port_destroy +* osm_port_delete * * DESCRIPTION * This function destroys and deallocates a Port object. diff --git a/trunk/ulp/opensm/user/include/opensm/osm_port_profile.h b/trunk/ulp/opensm/user/include/opensm/osm_port_profile.h index de208502..831f3482 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_port_profile.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_port_profile.h @@ -108,9 +108,9 @@ typedef struct _osm_port_profile * SEE ALSO *********/ -/****f* OpenSM: Port Profile/osm_port_pro_construct +/****f* OpenSM: Port Profile/osm_port_prof_construct * NAME -* osm_port_pro_construct +* osm_port_prof_construct * * DESCRIPTION * @@ -118,15 +118,15 @@ typedef struct _osm_port_profile * SYNOPSIS */ static inline void -osm_port_pro_construct( - IN osm_port_profile_t* const p_pro ) +osm_port_prof_construct( + IN osm_port_profile_t* const p_prof ) { - CL_ASSERT( p_pro ); - cl_memclr( p_pro, sizeof(*p_pro) ); + CL_ASSERT( p_prof ); + cl_memclr( p_prof, sizeof(*p_prof) ); } /* * PARAMETERS -* p_pro +* p_prof * [in] Pointer to the Port Profile object to construct. * * RETURN VALUE @@ -137,9 +137,9 @@ osm_port_pro_construct( * SEE ALSO *********/ -/****f* OpenSM: Port Profile/osm_port_pro_path_count_inc +/****f* OpenSM: Port Profile/osm_port_prof_path_count_inc * NAME -* osm_port_pro_path_count_inc +* osm_port_prof_path_count_inc * * DESCRIPTION * Increments the count of the number of paths going through this port. @@ -148,11 +148,11 @@ osm_port_pro_construct( * SYNOPSIS */ static inline void -osm_port_pro_path_count_inc( - IN osm_port_profile_t* const p_pro ) +osm_port_prof_path_count_inc( + IN osm_port_profile_t* const p_prof ) { - CL_ASSERT( p_pro ); - p_pro->num_paths++; + CL_ASSERT( p_prof ); + p_prof->num_paths++; } /* * PARAMETERS @@ -167,9 +167,9 @@ osm_port_pro_path_count_inc( * SEE ALSO *********/ -/****f* OpenSM: Port Profile/osm_port_pro_path_count_get +/****f* OpenSM: Port Profile/osm_port_prof_path_count_get * NAME -* osm_port_pro_path_count_get +* osm_port_prof_path_count_get * * DESCRIPTION * Returns the count of the number of paths going through this port. @@ -177,10 +177,10 @@ osm_port_pro_path_count_inc( * SYNOPSIS */ static inline uint32_t -osm_port_pro_path_count_get( - IN const osm_port_profile_t* const p_pro ) +osm_port_prof_path_count_get( + IN const osm_port_profile_t* const p_prof ) { - return( p_pro->num_paths ); + return( p_prof->num_paths ); } /* * PARAMETERS @@ -196,22 +196,22 @@ osm_port_pro_path_count_get( *********/ -/****f* OpenSM: Port Profile Opt/osm_port_pro_is_ignored_port +/****f* OpenSM: Port Profile Opt/osm_port_prof_is_ignored_port * NAME -* osm_port_pro_is_ignored_port +* osm_port_prof_is_ignored_port * * DESCRIPTION * Check to see if this port is to be ignored in path counting. -* This is done by examining the optional list of port_pro_ignore_guids. +* This is done by examining the optional list of port_prof_ignore_guids. * * SYNOPSIS */ static inline boolean_t -osm_port_pro_is_ignored_port( +osm_port_prof_is_ignored_port( IN const osm_subn_t *p_subn, IN uint64_t port_guid, IN uint8_t port_num) { - const cl_map_t *p_map = &(p_subn->opt.port_pro_ignore_guids); + const cl_map_t *p_map = &(p_subn->opt.port_prof_ignore_guids); const void *p_obj = cl_map_get(p_map, port_guid); size_t res; // HACK: we currently support ignoring ports 0 - 31 @@ -237,9 +237,9 @@ osm_port_pro_is_ignored_port( * SEE ALSO *********/ -/****f* OpenSM: Port Profile Opt/osm_port_pro_set_ignored_port +/****f* OpenSM: Port Profile Opt/osm_port_prof_set_ignored_port * NAME -* osm_port_pro_set_ignored_port +* osm_port_prof_set_ignored_port * * DESCRIPTION * Set the ignored property of the port. @@ -247,11 +247,11 @@ osm_port_pro_is_ignored_port( * SYNOPSIS */ static inline void -osm_port_pro_set_ignored_port( +osm_port_prof_set_ignored_port( IN osm_subn_t *p_subn, IN uint64_t port_guid, IN uint8_t port_num) { - cl_map_t *p_map = &(p_subn->opt.port_pro_ignore_guids); + cl_map_t *p_map = &(p_subn->opt.port_prof_ignore_guids); const void *p_obj = cl_map_get(p_map, port_guid); size_t value = 0; // HACK: we currently support ignoring ports 0 - 31 @@ -262,7 +262,7 @@ osm_port_pro_set_ignored_port( } value = value | (1 << port_num); - cl_map_insert(&(p_subn->opt.port_pro_ignore_guids), + cl_map_insert(&(p_subn->opt.port_prof_ignore_guids), port_guid, (void *)value); } diff --git a/trunk/ulp/opensm/user/include/opensm/osm_req.h b/trunk/ulp/opensm/user/include/opensm/osm_req.h index 43c3aa4b..2260fe44 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_req.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_req.h @@ -305,7 +305,7 @@ osm_req_set( IN const osm_req_t* const p_req, IN const osm_dr_path_t* const p_path, IN const uint8_t* const p_payload, - IN const size_t payload_size, + IN const size_t payload_size, IN const uint16_t attr_id, IN const uint32_t attr_mod, IN const cl_disp_msgid_t err_msg, diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa.h b/trunk/ulp/opensm/user/include/opensm/osm_sa.h index afd79c9c..db531216 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa.h @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -151,6 +152,8 @@ typedef struct _osm_sa osm_nr_rcv_ctrl_t nr_rcv_ctrl; osm_pir_rcv_t pir_rcv; osm_pir_rcv_ctrl_t pir_rcv_ctrl; + osm_gir_rcv_t gir_rcv; + osm_gir_rcv_ctrl_t gir_rcv_ctrl; osm_lr_rcv_t lr_rcv; osm_lr_rcv_ctrl_t lr_rcv_ctrl; osm_pr_rcv_t pr_rcv; diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_class_port_info_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_class_port_info_ctrl.h index 2a558b32..e7922bf4 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_class_port_info_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_class_port_info_ctrl.h @@ -34,8 +34,8 @@ /* * Abstract: - * Declaration of osm_pr_rcv_ctrl_t. - * This object represents a controller that receives the IBA NodeInfo + * Declaration of osm_cpi_rcv_ctrl_t. + * This object represents a controller that receives the IBA ClassPortInfo * attribute from a node. * This object is part of the OpenSM family of objects. * diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_guidinfo_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_guidinfo_record.h new file mode 100644 index 00000000..7e30eb45 --- /dev/null +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_guidinfo_record.h @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +/* + * Abstract: + * Declaration of osm_gir_rcv_t. + * This object represents the GUIDInfo Record Receiver object. + * This object is part of the OpenSM family of objects. + * + * Environment: + * Linux User Mode + * + */ + + +#ifndef _OSM_GIR_RCV_H_ +#define _OSM_GIR_RCV_H_ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else /* !__cplusplus */ +# define BEGIN_C_DECLS +# define END_C_DECLS +#endif /* __cplusplus */ + +BEGIN_C_DECLS + +/****h* OpenSM/GUIDInfo Record Receiver +* NAME +* GUIDInfo Record Receiver +* +* DESCRIPTION +* The GUIDInfo Record Receiver object encapsulates the information +* needed to receive the GUIDInfoRecord attribute from a node. +* +* The GUIDInfo Record Receiver object is thread safe. +* +* This object should be treated as opaque and should be +* manipulated only through the provided functions. +* +* AUTHOR +* Hal Rosenstock, Voltaire +* +*********/ +/****s* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_t +* NAME +* osm_gir_rcv_t +* +* DESCRIPTION +* GUIDInfo Record Receiver structure. +* +* This object should be treated as opaque and should +* be manipulated only through the provided functions. +* +* SYNOPSIS +*/ +typedef struct _osm_gir_rcv +{ + const osm_subn_t *p_subn; + osm_sa_resp_t *p_resp; + osm_mad_pool_t *p_mad_pool; + osm_log_t *p_log; + cl_plock_t *p_lock; + cl_qlock_pool_t pool; + +} osm_gir_rcv_t; +/* +* FIELDS +* p_subn +* Pointer to the Subnet object for this subnet. +* +* p_resp +* Pointer to the SA reponder. +* +* p_mad_pool +* Pointer to the mad pool. +* +* p_log +* Pointer to the log object. +* +* p_lock +* Pointer to the serializing lock. +* +* pool +* Pool of linkable GUIDInfo Record objects used to generate +* the query response. +* +* SEE ALSO +* +*********/ + +/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_construct +* NAME +* osm_gir_rcv_construct +* +* DESCRIPTION +* This function constructs a GUIDInfo Record Receiver object. +* +* SYNOPSIS +*/ +void +osm_gir_rcv_construct( + IN osm_gir_rcv_t* const p_rcv ); +/* +* PARAMETERS +* p_rcv +* [in] Pointer to a GUIDInfo Record Receiver object to construct. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Allows calling osm_gir_rcv_init, osm_gir_rcv_destroy +* +* Calling osm_gir_rcv_construct is a prerequisite to calling any other +* method except osm_gir_rcv_init. +* +* SEE ALSO +* GUIDInfo Record Receiver object, osm_gir_rcv_init, +* osm_gir_rcv_destroy +*********/ + +/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_destroy +* NAME +* osm_gir_rcv_destroy +* +* DESCRIPTION +* The osm_gir_rcv_destroy function destroys the object, releasing +* all resources. +* +* SYNOPSIS +*/ +void +osm_gir_rcv_destroy( + IN osm_gir_rcv_t* const p_rcv ); +/* +* PARAMETERS +* p_rcv +* [in] Pointer to the object to destroy. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Performs any necessary cleanup of the specified +* GUIDInfo Record Receiver object. +* Further operations should not be attempted on the destroyed object. +* This function should only be called after a call to +* osm_gir_rcv_construct or osm_gir_rcv_init. +* +* SEE ALSO +* GUIDInfo Record Receiver object, osm_gir_rcv_construct, +* osm_gir_rcv_init +*********/ + +/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_init +* NAME +* osm_gir_rcv_init +* +* DESCRIPTION +* The osm_gir_rcv_init function initializes a +* GUIDInfo Record Receiver object for use. +* +* SYNOPSIS +*/ +ib_api_status_t +osm_gir_rcv_init( + IN osm_gir_rcv_t* const p_rcv, + IN osm_sa_resp_t* const p_resp, + IN osm_mad_pool_t* const p_mad_pool, + IN const osm_subn_t* const p_subn, + IN osm_log_t* const p_log, + IN cl_plock_t* const p_lock ); +/* +* PARAMETERS +* p_rcv +* [in] Pointer to an osm_gir_rcv_t object to initialize. +* +* p_req +* [in] Pointer to an osm_req_t object. +* +* p_subn +* [in] Pointer to the Subnet object for this subnet. +* +* p_log +* [in] Pointer to the log object. +* +* p_lock +* [in] Pointer to the OpenSM serializing lock. +* +* RETURN VALUES +* CL_SUCCESS if the GUIDInfo Record Receiver object was initialized +* successfully. +* +* NOTES +* Allows calling other GUIDInfo Record Receiver methods. +* +* SEE ALSO +* GUIDInfo Record Receiver object, osm_gir_rcv_construct, +* osm_gir_rcv_destroy +*********/ + +/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_process +* NAME +* osm_gir_rcv_process +* +* DESCRIPTION +* Process the GUIDInfoRecord attribute. +* +* SYNOPSIS +*/ +void +osm_gir_rcv_process( + IN osm_gir_rcv_t* const p_rcv, + IN const osm_madw_t* const p_madw ); +/* +* PARAMETERS +* p_rcv +* [in] Pointer to an osm_gir_rcv_t object. +* +* p_madw +* [in] Pointer to the MAD Wrapper containing the MAD +* that contains the node's GUIDInfoRecord attribute. +* +* RETURN VALUES +* CL_SUCCESS if the GUIDInfoRecord processing was successful. +* +* NOTES +* This function processes a GUIDInfoRecord attribute. +* +* SEE ALSO +* GUIDInfo Record Receiver, GUIDInfo Record Response Controller +*********/ + +END_C_DECLS + +#endif /* _OSM_GIR_RCV_H_ */ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_guidinfo_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_guidinfo_record_ctrl.h new file mode 100644 index 00000000..4fd4f77b --- /dev/null +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_guidinfo_record_ctrl.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +/* + * Abstract: + * Declaration of osm_sa_gir_rec_rcv_ctrl_t. + * This object represents a controller that receives the IBA GUID Info + * record query from SA client. + * This object is part of the OpenSM family of objects. + * + * Environment: + * Linux User Mode + * + */ + + +#ifndef _OSM_GIR_CTRL_H_ +#define _OSM_GIR_CTRL_H_ + + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else /* !__cplusplus */ +# define BEGIN_C_DECLS +# define END_C_DECLS +#endif /* __cplusplus */ + +BEGIN_C_DECLS + +/****h* OpenSM/GUID Info Record Receive Controller +* NAME +* GUID Info Record Receive Controller +* +* DESCRIPTION +* The GUID Info Record Receive Controller object encapsulates +* the information needed to handle GUID Info record query from SA client. +* +* The GUID Info Record Receive Controller object is thread safe. +* +* This object should be treated as opaque and should be +* manipulated only through the provided functions. +* +* AUTHOR +* Hal Rosenstock, Voltaire +* +*********/ +/****s* OpenSM: GUID Info Record Receive Controller/osm_gir_rcv_ctrl_t +* NAME +* osm_gir_rcv_ctrl_t +* +* DESCRIPTION +* GUID Info Record Receive Controller structure. +* +* This object should be treated as opaque and should +* be manipulated only through the provided functions. +* +* SYNOPSIS +*/ +typedef struct _osm_gir_rcv_ctrl +{ + osm_gir_rcv_t *p_rcv; + osm_log_t *p_log; + cl_dispatcher_t *p_disp; + cl_disp_reg_handle_t h_disp; + +} osm_gir_rcv_ctrl_t; +/* +* FIELDS +* p_rcv +* Pointer to the GUID Info Record Receiver object. +* +* p_log +* Pointer to the log object. +* +* p_disp +* Pointer to the Dispatcher. +* +* h_disp +* Handle returned from dispatcher registration. +* +* SEE ALSO +* GUID Info Record Receive Controller object +* GUID Info Record Receiver object +*********/ + +/****f* OpenSM: GUID Info Record Receive Controller/osm_gir_rec_rcv_ctrl_construct +* NAME +* osm_gir_rcv_ctrl_construct +* +* DESCRIPTION +* This function constructs a GUID Info Record Receive Controller object. +* +* SYNOPSIS +*/ +void osm_gir_rcv_ctrl_construct( + IN osm_gir_rcv_ctrl_t* const p_ctrl ); +/* +* PARAMETERS +* p_ctrl +* [in] Pointer to a GUID Info Record Receive Controller +* object to construct. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Allows calling osm_gir_rcv_ctrl_init, osm_gir_rcv_ctrl_destroy +* +* Calling osm_gir_rcv_ctrl_construct is a prerequisite to calling any other +* method except osm_gir_rcv_ctrl_init. +* +* SEE ALSO +* GUID Info Record Receive Controller object, osm_gir_rcv_ctrl_init, +* osm_gir_rcv_ctrl_destroy +*********/ + +/****f* OpenSM: GUID Info Record Receive Controller/osm_gir_rcv_ctrl_destroy +* NAME +* osm_gir_rcv_ctrl_destroy +* +* DESCRIPTION +* The osm_gir_rcv_ctrl_destroy function destroys the object, releasing +* all resources. +* +* SYNOPSIS +*/ +void osm_gir_rcv_ctrl_destroy( + IN osm_gir_rcv_ctrl_t* const p_ctrl ); +/* +* PARAMETERS +* p_ctrl +* [in] Pointer to the object to destroy. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Performs any necessary cleanup of the specified +* GUIDInfo Record Receive Controller object. +* Further operations should not be attempted on the destroyed object. +* This function should only be called after a call to +* osm_gir_rcv_ctrl_construct or osm_gir_rcv_ctrl_init. +* +* SEE ALSO +* GUIDInfo Record Receive Controller object, osm_gir_rcv_ctrl_construct, +* osm_gir_rcv_ctrl_init +*********/ + +/****f* OpenSM: GUID Info Record Receive Controller/osm_gir_rcv_ctrl_init +* NAME +* osm_gir_rcv_ctrl_init +* +* DESCRIPTION +* The osm_gir_rcv_ctrl_init function initializes a +* GUID Info Record Receive Controller object for use. +* +* SYNOPSIS +*/ +ib_api_status_t osm_gir_rcv_ctrl_init( + IN osm_gir_rcv_ctrl_t* const p_ctrl, + IN osm_gir_rcv_t* const p_rcv, + IN osm_log_t* const p_log, + IN cl_dispatcher_t* const p_disp ); +/* +* PARAMETERS +* p_ctrl +* [in] Pointer to an osm_gir_rcv_ctrl_t object to initialize. +* +* p_rcv +* [in] Pointer to an osm_gir_rcv_t object. +* +* p_log +* [in] Pointer to the log object. +* +* p_disp +* [in] Pointer to the OpenSM central Dispatcher. +* +* RETURN VALUES +* CL_SUCCESS if the GUID Info Record Receive Controller object was initialized +* successfully. +* +* NOTES +* Allows calling other GUID Info Record Receive Controller methods. +* +* SEE ALSO +* GUID Info Record Receive Controller object, osm_gir_rcv_ctrl_construct, +* osm_gir_rcv_ctrl_destroy +*********/ + +END_C_DECLS + +#endif /* _OSM_GIR_CTRL_H_ */ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record.h index 694e28c3..4f8bc440 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record.h @@ -269,7 +269,7 @@ void osm_lr_rcv_process( * This function processes a Link Record attribute. * * SEE ALSO -* Link Record Receiver, Node Info Response Controller +* Link Record Receiver, Link Record Response Controller *********/ END_C_DECLS diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record_ctrl.h index 60615f88..198387ae 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_link_record_ctrl.h @@ -65,15 +65,15 @@ BEGIN_C_DECLS -/****h* OpenSM/Link Recrod Receive Controller +/****h* OpenSM/Link Record Receive Controller * NAME -* Link Recrod Receive Controller +* Link Record Receive Controller * * DESCRIPTION -* The Link Recrod Receive Controller object encapsulates -* the information needed to receive the NodeInfo attribute from a node. +* The Link Record Receive Controller object encapsulates +* the information needed to receive the LinkRecord attribute from a node. * -* The Link Recrod Receive Controller object is thread safe. +* The Link Record Receive Controller object is thread safe. * * This object should be treated as opaque and should be * manipulated only through the provided functions. @@ -82,12 +82,12 @@ BEGIN_C_DECLS * Ranjit Pandit, Intel * *********/ -/****s* OpenSM: Link Recrod Receive Controller/osm_lr_rcv_ctrl_t +/****s* OpenSM: Link Record Receive Controller/osm_lr_rcv_ctrl_t * NAME * osm_lr_rcv_ctrl_t * * DESCRIPTION -* Link Recrod Receive Controller structure. +* Link Record Receive Controller structure. * * This object should be treated as opaque and should * be manipulated only through the provided functions. @@ -105,7 +105,7 @@ typedef struct _osm_lr_rcv_ctrl /* * FIELDS * p_rcv -* Pointer to the Link Recrod Receiver object. +* Pointer to the Link Record Receiver object. * * p_log * Pointer to the log object. @@ -121,12 +121,12 @@ typedef struct _osm_lr_rcv_ctrl * Link Record Receiver object *********/ -/****f* OpenSM: Link Recrod Receive Controller/osm_lr_rcv_ctrl_construct +/****f* OpenSM: Link Record Receive Controller/osm_lr_rcv_ctrl_construct * NAME * osm_lr_rcv_ctrl_construct * * DESCRIPTION -* This function constructs a Link Recrod Receive Controller object. +* This function constructs a Link Record Receive Controller object. * * SYNOPSIS */ @@ -135,7 +135,7 @@ void osm_lr_rcv_ctrl_construct( /* * PARAMETERS * p_ctrl -* [in] Pointer to a Link Recrod Receive Controller +* [in] Pointer to a Link Record Receive Controller * object to construct. * * RETURN VALUE @@ -149,11 +149,11 @@ void osm_lr_rcv_ctrl_construct( * method except osm_lr_rcv_ctrl_init. * * SEE ALSO -* Link Recrod Receive Controller object, osm_lr_rcv_ctrl_init, +* Link Record Receive Controller object, osm_lr_rcv_ctrl_init, * osm_lr_rcv_ctrl_destroy, osm_lr_rcv_ctrl_is_inited *********/ -/****f* OpenSM: Link Recrod Receive Controller/osm_lr_rcv_ctrl_destroy +/****f* OpenSM: Link Record Receive Controller/osm_lr_rcv_ctrl_destroy * NAME * osm_lr_rcv_ctrl_destroy * @@ -175,23 +175,23 @@ void osm_lr_rcv_ctrl_destroy( * * NOTES * Performs any necessary cleanup of the specified -* Link Recrod Receive Controller object. +* Link Record Receive Controller object. * Further operations should not be attempted on the destroyed object. * This function should only be called after a call to * osm_lr_rcv_ctrl_construct or osm_lr_rcv_ctrl_init. * * SEE ALSO -* Link Recrod Receive Controller object, osm_lr_rcv_ctrl_construct, +* Link Record Receive Controller object, osm_lr_rcv_ctrl_construct, * osm_lr_rcv_ctrl_init *********/ -/****f* OpenSM: Link Recrod Receive Controller/osm_lr_rcv_ctrl_init +/****f* OpenSM: Link Record Receive Controller/osm_lr_rcv_ctrl_init * NAME * osm_lr_rcv_ctrl_init * * DESCRIPTION * The osm_lr_rcv_ctrl_init function initializes a -* Link Recrod Receive Controller object for use. +* Link Record Receive Controller object for use. * * SYNOPSIS */ @@ -216,18 +216,18 @@ osm_lr_rcv_ctrl_init( * [in] Pointer to the OpenSM central Dispatcher. * * RETURN VALUES -* CL_SUCCESS if the Link Recrod Receive Controller object was initialized +* CL_SUCCESS if the Link Record Receive Controller object was initialized * successfully. * * NOTES -* Allows calling other Link Recrod Receive Controller methods. +* Allows calling other Link Record Receive Controller methods. * * SEE ALSO -* Link Recrod Receive Controller object, osm_lr_rcv_ctrl_construct, +* Link Record Receive Controller object, osm_lr_rcv_ctrl_construct, * osm_lr_rcv_ctrl_destroy, osm_lr_rcv_ctrl_is_inited *********/ -/****f* OpenSM: Link Recrod Receive Controller/osm_lr_rcv_ctrl_is_inited +/****f* OpenSM: Link Record Receive Controller/osm_lr_rcv_ctrl_is_inited * NAME * osm_lr_rcv_ctrl_is_inited * @@ -252,7 +252,7 @@ boolean_t osm_lr_rcv_ctrl_is_inited( * called before using this function. * * SEE ALSO -* Link Recrod Receive Controller object, osm_lr_rcv_ctrl_construct, +* Link Record Receive Controller object, osm_lr_rcv_ctrl_construct, * osm_lr_rcv_ctrl_init *********/ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_mad_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_mad_ctrl.h index 8107b2e1..35dfd5f5 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_mad_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_mad_ctrl.h @@ -35,8 +35,8 @@ /* * Abstract: * Declaration of osm_sa_mad_ctrl_t. - * This object represents a controller that receives the IBA NodeInfo - * attribute from a node. + * This object represents a controller that receives the IBA SA + * attributes from a node. * This object is part of the OpenSM family of objects. * * Environment: diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record.h index af2d1bf0..ffd6d456 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_mcmr_recv_t. - * This object represents the NodeRecord Receiver object. + * This object represents the MCMemberRecord Receiver object. * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -70,15 +70,15 @@ BEGIN_C_DECLS -/****h* OpenSM/Node Info Receiver +/****h* OpenSM/MCMember Receiver * NAME -* Node Info Receiver +* MCMember Receiver * * DESCRIPTION -* The Node Info Receiver object encapsulates the information -* needed to receive the NodeRecord attribute from a node. +* The MCMember Receiver object encapsulates the information +* needed to receive the MCMemberRecord attribute from a node. * -* The Node Info Receiver object is thread safe. +* The MCMember Receiver object is thread safe. * * This object should be treated as opaque and should be * manipulated only through the provided functions. @@ -87,12 +87,12 @@ BEGIN_C_DECLS * Anil Keshavamurthy, Intel * *********/ -/****s* OpenSM: Node Info Receiver/osm_mcmr_recv_t +/****s* OpenSM: MCMember Receiver/osm_mcmr_recv_t * NAME * osm_mcmr_recv_t * * DESCRIPTION -* Node Info Receiver structure. +* MCMember Receiver structure. * * This object should be treated as opaque and should * be manipulated only through the provided functions. @@ -129,15 +129,15 @@ typedef struct _osm_mcmr * Pointer to the serializing lock. * * SEE ALSO -* Node Info Receiver object +* MCMember Receiver object *********/ -/****f* OpenSM: Node Info Receiver/osm_mcmr_rcv_construct +/****f* OpenSM: MCMember Receiver/osm_mcmr_rcv_construct * NAME * osm_mcmr_rcv_construct * * DESCRIPTION -* This function constructs a Node Info Receiver object. +* This function constructs a MCMember Receiver object. * * SYNOPSIS */ @@ -146,7 +146,7 @@ void osm_mcmr_rcv_construct( /* * PARAMETERS * p_ctrl -* [in] Pointer to a Node Info Receiver object to construct. +* [in] Pointer to a MCMember Receiver object to construct. * * RETURN VALUE * This function does not return a value. @@ -158,11 +158,11 @@ void osm_mcmr_rcv_construct( * method except osm_mcmr_init. * * SEE ALSO -* Node Info Receiver object, osm_mcmr_init, +* MCMember Receiver object, osm_mcmr_init, * osm_mcmr_rcv_destroy *********/ -/****f* OpenSM: Node Info Receiver/osm_mcmr_rcv_destroy +/****f* OpenSM: MCMember Receiver/osm_mcmr_rcv_destroy * NAME * osm_mcmr_rcv_destroy * @@ -184,23 +184,23 @@ void osm_mcmr_rcv_destroy( * * NOTES * Performs any necessary cleanup of the specified -* Node Info Receiver object. +* MCMember Receiver object. * Further operations should not be attempted on the destroyed object. * This function should only be called after a call to * osm_mcmr_rcv_construct or osm_mcmr_init. * * SEE ALSO -* Node Info Receiver object, osm_mcmr_rcv_construct, +* MCMember Receiver object, osm_mcmr_rcv_construct, * osm_mcmr_init *********/ -/****f* OpenSM: Node Info Receiver/osm_mcmr_rcv_init +/****f* OpenSM: MCMember Receiver/osm_mcmr_rcv_init * NAME * osm_mcmr_init * * DESCRIPTION * The osm_mcmr_init function initializes a -* Node Info Receiver object for use. +* MCMember Receiver object for use. * * SYNOPSIS */ @@ -232,23 +232,23 @@ ib_api_status_t osm_mcmr_rcv_init( * [in] Pointer to the OpenSM serializing lock. * * RETURN VALUES -* CL_SUCCESS if the Node Info Receiver object was initialized +* CL_SUCCESS if the MCMember Receiver object was initialized * successfully. * * NOTES -* Allows calling other Node Info Receiver methods. +* Allows calling other MCMember Receiver methods. * * SEE ALSO -* Node Info Receiver object, osm_mcmr_rcv_construct, +* MCMember Receiver object, osm_mcmr_rcv_construct, * osm_mcmr_rcv_destroy *********/ -/****f* OpenSM: Node Info Receiver/osm_mcmr_mcmrocess +/****f* OpenSM: MCMember Receiver/osm_mcmr_mcmrocess * NAME * osm_mcmr_mcmrocess * * DESCRIPTION -* Process the NodeRecord attribute. +* Process the MCMemberRecord attribute. * * SYNOPSIS */ @@ -262,16 +262,16 @@ void osm_mcmr_rcv_process( * * p_madw * [in] Pointer to the MAD Wrapper containing the MAD -* that contains the node's NodeRecord attribute. +* that contains the node's MCMemberRecord attribute. * * RETURN VALUES -* CL_SUCCESS if the NodeRecord processing was successful. +* CL_SUCCESS if the MCMemberRecord processing was successful. * * NOTES -* This function processes a NodeRecord attribute. +* This function processes a MCMemberRecord attribute. * * SEE ALSO -* Node Info Receiver, Node Info Response Controller +* MCMember Receiver, MCMember Response Controller *********/ @@ -291,6 +291,7 @@ osm_mcmr_rcv_create_new_mgrp( IN osm_mcmr_recv_t* const p_mcmr, IN uint64_t comp_mask, IN const ib_member_rec_t* const p_recvd_mcmember_rec, + IN const osm_physp_t* const p_req_physp, OUT osm_mgrp_t **pp_mgrp); /* * PARAMETERS @@ -299,6 +300,10 @@ osm_mcmr_rcv_create_new_mgrp( * p_recvd_mcmember_rec * [in] Received Multicast member record * +* p_req_physp +* [in] The requesting osm_physp_t object. +* NULL if the creation is without a requesting port (e.g - ipoib known mcgroups) +* * pp_mgrp * [out] pointer the osm_mgrp_t object * diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record_ctrl.h index b295c435..6b558f9d 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_mcmember_record_ctrl.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_mcmr_rcv_ctrl_t. - * This object represents a controller that receives the IBA NodeInfo + * This object represents a controller that receives the IBA MCMemberRecord * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -66,15 +66,15 @@ BEGIN_C_DECLS -/****h* OpenSM/Node Info Receive Controller +/****h* OpenSM/MCMember Receive Controller * NAME -* Node Info Receive Controller +* MCMember Receive Controller * * DESCRIPTION -* The Node Info Receive Controller object encapsulates -* the information needed to receive the NodeInfo attribute from a node. +* The MCMember Receive Controller object encapsulates +* the information needed to receive the MCMemberRecord attribute from a node. * -* The Node Info Receive Controller object is thread safe. +* The MCMember Receive Controller object is thread safe. * * This object should be treated as opaque and should be * manipulated only through the provided functions. @@ -83,12 +83,12 @@ BEGIN_C_DECLS * Ranjit Pandit, Intel * *********/ -/****s* OpenSM: Node Info Receive Controller/osm_mcmr_rcv_ctrl_t +/****s* OpenSM: MCMember Receive Controller/osm_mcmr_rcv_ctrl_t * NAME * osm_mcmr_rcv_ctrl_t * * DESCRIPTION -* Node Info Receive Controller structure. +* MCMember Receive Controller structure. * * This object should be treated as opaque and should * be manipulated only through the provided functions. @@ -106,7 +106,7 @@ typedef struct _osm_mcmr_rcv_ctrl /* * FIELDS * p_rcv -* Pointer to the Node Info Receiver object. +* Pointer to the MCMember Receiver object. * * p_log * Pointer to the log object. @@ -118,16 +118,16 @@ typedef struct _osm_mcmr_rcv_ctrl * Handle returned from dispatcher registration. * * SEE ALSO -* Node Info Receive Controller object -* Node Info Receiver object +* MCMember Receive Controller object +* MCMember Receiver object *********/ -/****f* OpenSM: Node Info Receive Controller/osm_mcmr_rcv_ctrl_construct +/****f* OpenSM: MCMember Receive Controller/osm_mcmr_rcv_ctrl_construct * NAME * osm_mcmr_rcv_ctrl_construct * * DESCRIPTION -* This function constructs a Node Info Receive Controller object. +* This function constructs a MCMember Receive Controller object. * * SYNOPSIS */ @@ -136,7 +136,7 @@ void osm_mcmr_rcv_ctrl_construct( /* * PARAMETERS * p_ctrl -* [in] Pointer to a Node Info Receive Controller +* [in] Pointer to a MCMember Receive Controller * object to construct. * * RETURN VALUE @@ -150,11 +150,11 @@ void osm_mcmr_rcv_ctrl_construct( * method except osm_mcmr_rcv_ctrl_init. * * SEE ALSO -* Node Info Receive Controller object, osm_mcmr_rcv_ctrl_init, +* MCMember Receive Controller object, osm_mcmr_rcv_ctrl_init, * osm_mcmr_rcv_ctrl_destroy, osm_mcmr_ctrl_is_inited *********/ -/****f* OpenSM: Node Info Receive Controller/osm_mcmr_rcv_ctrl_destroy +/****f* OpenSM: MCMember Receive Controller/osm_mcmr_rcv_ctrl_destroy * NAME * osm_mcmr_rcv_ctrl_destroy * @@ -176,23 +176,23 @@ void osm_mcmr_rcv_ctrl_destroy( * * NOTES * Performs any necessary cleanup of the specified -* Node Info Receive Controller object. +* MCMember Receive Controller object. * Further operations should not be attempted on the destroyed object. * This function should only be called after a call to * osm_mcmr_rcv_ctrl_construct or osm_mcmr_rcv_ctrl_init. * * SEE ALSO -* Node Info Receive Controller object, osm_mcmr_rcv_ctrl_construct, +* MCMember Receive Controller object, osm_mcmr_rcv_ctrl_construct, * osm_mcmr_rcv_ctrl_init *********/ -/****f* OpenSM: Node Info Receive Controller/osm_mcmr_rcv_ctrl_init +/****f* OpenSM: MCMember Receive Controller/osm_mcmr_rcv_ctrl_init * NAME * osm_mcmr_rcv_ctrl_init * * DESCRIPTION * The osm_mcmr_rcv_ctrl_init function initializes a -* Node Info Receive Controller object for use. +* MCMember Receive Controller object for use. * * SYNOPSIS */ @@ -216,18 +216,18 @@ ib_api_status_t osm_mcmr_rcv_ctrl_init( * [in] Pointer to the OpenSM central Dispatcher. * * RETURN VALUES -* CL_SUCCESS if the Node Info Receive Controller object was initialized +* CL_SUCCESS if the MCMember Receive Controller object was initialized * successfully. * * NOTES -* Allows calling other Node Info Receive Controller methods. +* Allows calling other MCMember Receive Controller methods. * * SEE ALSO -* Node Info Receive Controller object, osm_mcmr_rcv_ctrl_construct, +* MCMember Receive Controller object, osm_mcmr_rcv_ctrl_construct, * osm_mcmr_rcv_ctrl_destroy, osm_mcmr_ctrl_is_inited *********/ -/****f* OpenSM: Node Info Receive Controller/osm_mcmr_ctrl_is_inited +/****f* OpenSM: MCMember Receive Controller/osm_mcmr_ctrl_is_inited * NAME * osm_mcmr_ctrl_is_inited * @@ -252,7 +252,7 @@ boolean_t osm_mcmr_ctrl_is_inited( * called before using this function. * * SEE ALSO -* Node Info Receive Controller object, osm_mcmr_rcv_ctrl_construct, +* MCMember Receive Controller object, osm_mcmr_rcv_ctrl_construct, * osm_mcmr_rcv_ctrl_init *********/ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record.h index 23f65fdc..0ce7ac25 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record.h @@ -125,7 +125,7 @@ typedef struct _osm_pr_rcv * Pointer to the serializing lock. * * pr_pool -* Pool of path record objects used to generate query reponses. +* Pool of path record objects used to generate query responses. * * SEE ALSO * Path Record Receiver object @@ -267,7 +267,7 @@ osm_pr_rcv_process( * This function processes a PathRecord attribute. * * SEE ALSO -* Path Record Receiver, Node Info Response Controller +* Path Record Receiver, Path Record Response Controller *********/ END_C_DECLS diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record_ctrl.h index 4e18ff47..541ee036 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_path_record_ctrl.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_pr_rcv_ctrl_t. - * This object represents a controller that receives the IBA NodeInfo + * This object represents a controller that receives the IBA PathRecord * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -66,15 +66,15 @@ BEGIN_C_DECLS -/****h* OpenSM/Node Info Receive Controller +/****h* OpenSM/Path Record Receive Controller * NAME -* Node Info Receive Controller +* Path Record Receive Controller * * DESCRIPTION -* The Node Info Receive Controller object encapsulates -* the information needed to receive the NodeInfo attribute from a node. +* The Path Record Receive Controller object encapsulates +* the information needed to receive the PathRecord attribute from a node. * -* The Node Info Receive Controller object is thread safe. +* The Path record Receive Controller object is thread safe. * * This object should be treated as opaque and should be * manipulated only through the provided functions. @@ -83,12 +83,12 @@ BEGIN_C_DECLS * Ranjit Pandit, Intel * *********/ -/****s* OpenSM: Node Info Receive Controller/osm_pr_rcv_ctrl_t +/****s* OpenSM: Path Record Receive Controller/osm_pr_rcv_ctrl_t * NAME * osm_pr_rcv_ctrl_t * * DESCRIPTION -* Node Info Receive Controller structure. +* Path Record Receive Controller structure. * * This object should be treated as opaque and should * be manipulated only through the provided functions. @@ -106,7 +106,7 @@ typedef struct _osm_pr_rcv_ctrl /* * FIELDS * p_rcv -* Pointer to the Node Info Receiver object. +* Pointer to the Path Record Receiver object. * * p_log * Pointer to the log object. @@ -118,16 +118,16 @@ typedef struct _osm_pr_rcv_ctrl * Handle returned from dispatcher registration. * * SEE ALSO -* Node Info Receive Controller object -* Node Info Receiver object +* Path Record Receive Controller object +* Path Record Receiver object *********/ -/****f* OpenSM: Node Info Receive Controller/osm_pr_rcv_ctrl_construct +/****f* OpenSM: Path Record Receive Controller/osm_pr_rcv_ctrl_construct * NAME * osm_pr_rcv_ctrl_construct * * DESCRIPTION -* This function constructs a Node Info Receive Controller object. +* This function constructs a Path Record Receive Controller object. * * SYNOPSIS */ @@ -136,7 +136,7 @@ void osm_pr_rcv_ctrl_construct( /* * PARAMETERS * p_ctrl -* [in] Pointer to a Node Info Receive Controller +* [in] Pointer to a Path Record Receive Controller * object to construct. * * RETURN VALUE @@ -150,11 +150,11 @@ void osm_pr_rcv_ctrl_construct( * method except osm_pr_rcv_ctrl_init. * * SEE ALSO -* Node Info Receive Controller object, osm_pr_rcv_ctrl_init, +* Path Record Receive Controller object, osm_pr_rcv_ctrl_init, * osm_pr_rcv_ctrl_destroy, osm_pr_rcv_ctrl_is_inited *********/ -/****f* OpenSM: Node Info Receive Controller/osm_pr_rcv_ctrl_destroy +/****f* OpenSM: Path Record Receive Controller/osm_pr_rcv_ctrl_destroy * NAME * osm_pr_rcv_ctrl_destroy * @@ -176,23 +176,23 @@ void osm_pr_rcv_ctrl_destroy( * * NOTES * Performs any necessary cleanup of the specified -* Node Info Receive Controller object. +* Path Record Receive Controller object. * Further operations should not be attempted on the destroyed object. * This function should only be called after a call to * osm_pr_rcv_ctrl_construct or osm_pr_rcv_ctrl_init. * * SEE ALSO -* Node Info Receive Controller object, osm_pr_rcv_ctrl_construct, +* Path Record Receive Controller object, osm_pr_rcv_ctrl_construct, * osm_pr_rcv_ctrl_init *********/ -/****f* OpenSM: Node Info Receive Controller/osm_pr_rcv_ctrl_init +/****f* OpenSM: Path Record Receive Controller/osm_pr_rcv_ctrl_init * NAME * osm_pr_rcv_ctrl_init * * DESCRIPTION * The osm_pr_rcv_ctrl_init function initializes a -* Node Info Receive Controller object for use. +* Path Record Receive Controller object for use. * * SYNOPSIS */ @@ -216,18 +216,18 @@ ib_api_status_t osm_pr_rcv_ctrl_init( * [in] Pointer to the OpenSM central Dispatcher. * * RETURN VALUES -* CL_SUCCESS if the Node Info Receive Controller object was initialized +* CL_SUCCESS if the Path Record Receive Controller object was initialized * successfully. * * NOTES -* Allows calling other Node Info Receive Controller methods. +* Allows calling other Path Record Receive Controller methods. * * SEE ALSO -* Node Info Receive Controller object, osm_pr_rcv_ctrl_construct, +* Path Record Receive Controller object, osm_pr_rcv_ctrl_construct, * osm_pr_rcv_ctrl_destroy, osm_pr_rcv_ctrl_is_inited *********/ -/****f* OpenSM: Node Info Receive Controller/osm_pr_rcv_ctrl_is_inited +/****f* OpenSM: Path Record Receive Controller/osm_pr_rcv_ctrl_is_inited * NAME * osm_pr_rcv_ctrl_is_inited * @@ -252,7 +252,7 @@ boolean_t osm_pr_rcv_ctrl_is_inited( * called before using this function. * * SEE ALSO -* Node Info Receive Controller object, osm_pr_rcv_ctrl_construct, +* Path Record Receive Controller object, osm_pr_rcv_ctrl_construct, * osm_pr_rcv_ctrl_init *********/ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record.h index 89ad79c1..960b0ee1 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_pir_rcv_t. - * This object represents the NodeRecord Receiver object. + * This object represents the PortInfo Record Receiver object. * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -75,7 +75,7 @@ BEGIN_C_DECLS * * DESCRIPTION * The PortInfo Record Receiver object encapsulates the information -* needed to receive the NodeRecord attribute from a node. +* needed to receive the PortInfoRecord attribute from a node. * * The PortInfo Record Receiver object is thread safe. * @@ -249,7 +249,7 @@ osm_pir_rcv_init( * osm_pir_rcv_process * * DESCRIPTION -* Process the NodeRecord attribute. +* Process the PortInfoRecord attribute. * * SYNOPSIS */ @@ -264,13 +264,13 @@ osm_pir_rcv_process( * * p_madw * [in] Pointer to the MAD Wrapper containing the MAD -* that contains the node's NodeRecord attribute. +* that contains the node's PortInfoRecord attribute. * * RETURN VALUES -* CL_SUCCESS if the NodeRecord processing was successful. +* CL_SUCCESS if the PortInfoRecord processing was successful. * * NOTES -* This function processes a NodeRecord attribute. +* This function processes a PortInfoRecord attribute. * * SEE ALSO * PortInfo Record Receiver, PortInfo Record Response Controller diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record_ctrl.h index 81bea3be..4db1352b 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_portinfo_record_ctrl.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_pir_rcv_ctrl_t. - * This object represents a controller that receives the IBA NodeInfo + * This object represents a controller that receives the IBA PortInfo * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -72,7 +72,7 @@ BEGIN_C_DECLS * * DESCRIPTION * The PortInfo Record Receive Controller object encapsulates -* the information needed to receive the NodeInfo attribute from a node. +* the information needed to receive the PortInfo attribute from a node. * * The PortInfo Record Receive Controller object is thread safe. * diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_response.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_response.h index a7c23694..fcfabe95 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_response.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_response.h @@ -235,7 +235,7 @@ osm_sa_send_error( * [in] Pointer to an osm_sa_resp_t object. * * p_madw -* [in] Original MAD to which the reponse must be sent. +* [in] Original MAD to which the response must be sent. * * sa_status * [in] Status to send in the response. diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_service_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_service_record.h index a5ca56ea..e3d9d828 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_service_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_service_record.h @@ -126,7 +126,7 @@ typedef struct _osm_sr_rcv * Pointer to the serializing lock. * * sr_pool -* Pool of Service Record objects used to generate query reponses. +* Pool of Service Record objects used to generate query responses. * * SEE ALSO * Service Record Receiver object diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record.h index d67977da..e472a19b 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_smir_rcv_t. - * This object represents the NodeRecord Receiver object. + * This object represents the SMInfo Receiver object. * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -69,15 +69,15 @@ BEGIN_C_DECLS -/****h* OpenSM/Node Info Receiver +/****h* OpenSM/SM Info Receiver * NAME -* Node Info Receiver +* SM Info Receiver * * DESCRIPTION -* The Node Info Receiver object encapsulates the information -* needed to receive the NodeRecord attribute from a node. +* The SM Info Receiver object encapsulates the information +* needed to receive the SMInfoRecord attribute from a node. * -* The Node Info Receiver object is thread safe. +* The SM Info Receiver object is thread safe. * * This object should be treated as opaque and should be * manipulated only through the provided functions. @@ -86,12 +86,12 @@ BEGIN_C_DECLS * Ranjit Pandit, Intel * *********/ -/****s* OpenSM: Node Info Receiver/osm_smir_rcv_t +/****s* OpenSM: SM Info Receiver/osm_smir_rcv_t * NAME * osm_smir_rcv_t * * DESCRIPTION -* Node Info Receiver structure. +* SM Info Receiver structure. * * This object should be treated as opaque and should * be manipulated only through the provided functions. @@ -114,15 +114,15 @@ typedef struct _osm_smir * Pointer to the Subnet object for this subnet. * * SEE ALSO -* Node Info Receiver object +* SM Info Receiver object *********/ -/****f* OpenSM: Node Info Receiver/osm_smir_rcv_construct +/****f* OpenSM: SM Info Receiver/osm_smir_rcv_construct * NAME * osm_smir_rcv_construct * * DESCRIPTION -* This function constructs a Node Info Receiver object. +* This function constructs a SM Info Receiver object. * * SYNOPSIS */ @@ -131,7 +131,7 @@ void osm_smir_rcv_construct( /* * PARAMETERS * p_ctrl -* [in] Pointer to a Node Info Receiver object to construct. +* [in] Pointer to a SM Info Receiver object to construct. * * RETURN VALUE * This function does not return a value. @@ -143,10 +143,10 @@ void osm_smir_rcv_construct( * method except osm_smir_rcv_init. * * SEE ALSO -* Node Info Receiver object, osm_smir_rcv_init, osm_smir_rcv_destroy +* SM Info Receiver object, osm_smir_rcv_init, osm_smir_rcv_destroy *********/ -/****f* OpenSM: Node Info Receiver/osm_smir_rcv_destroy +/****f* OpenSM: SM Info Receiver/osm_smir_rcv_destroy * NAME * osm_smir_rcv_destroy * @@ -168,23 +168,23 @@ void osm_smir_rcv_destroy( * * NOTES * Performs any necessary cleanup of the specified -* Node Info Receiver object. +* SM Info Receiver object. * Further operations should not be attempted on the destroyed object. * This function should only be called after a call to * osm_smir_rcv_construct or osm_smir_rcv_init. * * SEE ALSO -* Node Info Receiver object, osm_smir_rcv_construct, +* SM Info Receiver object, osm_smir_rcv_construct, * osm_smir_rcv_init *********/ -/****f* OpenSM: Node Info Receiver/osm_smir_rcv_init +/****f* OpenSM: SM Info Receiver/osm_smir_rcv_init * NAME * osm_smir_rcv_init * * DESCRIPTION * The osm_smir_rcv_init function initializes a -* Node Info Receiver object for use. +* SM Info Receiver object for use. * * SYNOPSIS */ @@ -217,22 +217,22 @@ ib_api_status_t osm_smir_rcv_init( * [in] Pointer to the OpenSM serializing lock. * * RETURN VALUES -* CL_SUCCESS if the Node Info Receiver object was initialized +* CL_SUCCESS if the SM Info Receiver object was initialized * successfully. * * NOTES -* Allows calling other Node Info Receiver methods. +* Allows calling other SM Info Receiver methods. * * SEE ALSO -* Node Info Receiver object, osm_smir_rcv_construct, osm_smir_rcv_destroy +* SM Info Receiver object, osm_smir_rcv_construct, osm_smir_rcv_destroy *********/ -/****f* OpenSM: Node Info Receiver/osm_smir_rcv_process +/****f* OpenSM: SM Info Receiver/osm_smir_rcv_process * NAME * osm_smir_rcv_process * * DESCRIPTION -* Process the NodeRecord attribute. +* Process the SMInfoRecord attribute. * * SYNOPSIS */ @@ -246,16 +246,16 @@ void osm_smir_rcv_process( * * p_madw * [in] Pointer to the MAD Wrapper containing the MAD -* that contains the node's NodeRecord attribute. +* that contains the node's SMInfoRecord attribute. * * RETURN VALUES -* CL_SUCCESS if the NodeRecord processing was successful. +* CL_SUCCESS if the SMInfoRecord processing was successful. * * NOTES -* This function processes a NodeRecord attribute. +* This function processes a SMInfoRecord attribute. * * SEE ALSO -* Node Info Receiver, Node Info Response Controller +* SM Info Receiver, SM Info Response Controller *********/ #if 0 /* diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record_ctrl.h index fd3cd5ea..8b2fc4e6 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_sminfo_record_ctrl.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_smir_ctrl_t. - * This object represents a controller that receives the IBA NodeInfo + * This object represents a controller that receives the IBA SMInfo * attribute from a node. * This object is part of the OpenSM family of objects. * @@ -66,15 +66,15 @@ BEGIN_C_DECLS -/****h* OpenSM/Node Info Receive Controller +/****h* OpenSM/SM Info Receive Controller * NAME -* Node Info Receive Controller +* SM Info Receive Controller * * DESCRIPTION -* The Node Info Receive Controller object encapsulates -* the information needed to receive the NodeInfo attribute from a node. +* The SM Info Receive Controller object encapsulates +* the information needed to receive the SMInfo attribute from a node. * -* The Node Info Receive Controller object is thread safe. +* The SM Info Receive Controller object is thread safe. * * This object should be treated as opaque and should be * manipulated only through the provided functions. @@ -83,12 +83,12 @@ BEGIN_C_DECLS * Ranjit Pandit, Intel * *********/ -/****s* OpenSM: Node Info Receive Controller/osm_smir_ctrl_t +/****s* OpenSM: SM Info Receive Controller/osm_smir_ctrl_t * NAME * osm_smir_ctrl_t * * DESCRIPTION -* Node Info Receive Controller structure. +* SM Info Receive Controller structure. * * This object should be treated as opaque and should * be manipulated only through the provided functions. @@ -106,7 +106,7 @@ typedef struct _osm_smir_ctrl /* * FIELDS * p_rcv -* Pointer to the Node Info Receiver object. +* Pointer to the SM Info Receiver object. * * p_log * Pointer to the log object. @@ -118,16 +118,16 @@ typedef struct _osm_smir_ctrl * Handle returned from dispatcher registration. * * SEE ALSO -* Node Info Receive Controller object -* Node Info Receiver object +* SM Info Receive Controller object +* SM Info Receiver object *********/ -/****f* OpenSM: Node Info Receive Controller/osm_smir_ctrl_construct +/****f* OpenSM: SM Info Receive Controller/osm_smir_ctrl_construct * NAME * osm_smir_ctrl_construct * * DESCRIPTION -* This function constructs a Node Info Receive Controller object. +* This function constructs a SM Info Receive Controller object. * * SYNOPSIS */ @@ -136,7 +136,7 @@ void osm_smir_ctrl_construct( /* * PARAMETERS * p_ctrl -* [in] Pointer to a Node Info Receive Controller +* [in] Pointer to a SM Info Receive Controller * object to construct. * * RETURN VALUE @@ -149,11 +149,11 @@ void osm_smir_ctrl_construct( * method except osm_smir_ctrl_init. * * SEE ALSO -* Node Info Receive Controller object, osm_smir_ctrl_init, +* SM Info Receive Controller object, osm_smir_ctrl_init, * osm_smir_ctrl_destroy *********/ -/****f* OpenSM: Node Info Receive Controller/osm_smir_ctrl_destroy +/****f* OpenSM: SM Info Receive Controller/osm_smir_ctrl_destroy * NAME * osm_smir_ctrl_destroy * @@ -175,23 +175,23 @@ void osm_smir_ctrl_destroy( * * NOTES * Performs any necessary cleanup of the specified -* Node Info Receive Controller object. +* SM Info Receive Controller object. * Further operations should not be attempted on the destroyed object. * This function should only be called after a call to * osm_smir_ctrl_construct or osm_smir_ctrl_init. * * SEE ALSO -* Node Info Receive Controller object, osm_smir_ctrl_construct, +* SM Info Receive Controller object, osm_smir_ctrl_construct, * osm_smir_ctrl_init *********/ -/****f* OpenSM: Node Info Receive Controller/osm_smir_ctrl_init +/****f* OpenSM: SM Info Receive Controller/osm_smir_ctrl_init * NAME * osm_smir_ctrl_init * * DESCRIPTION * The osm_smir_ctrl_init function initializes a -* Node Info Receive Controller object for use. +* SM Info Receive Controller object for use. * * SYNOPSIS */ @@ -215,14 +215,14 @@ ib_api_status_t osm_smir_ctrl_init( * [in] Pointer to the OpenSM central Dispatcher. * * RETURN VALUES -* CL_SUCCESS if the Node Info Receive Controller object was initialized +* CL_SUCCESS if the SM Info Receive Controller object was initialized * successfully. * * NOTES -* Allows calling other Node Info Receive Controller methods. +* Allows calling other SM Info Receive Controller methods. * * SEE ALSO -* Node Info Receive Controller object, osm_smir_ctrl_construct, +* SM Info Receive Controller object, osm_smir_ctrl_construct, * osm_smir_ctrl_destroy *********/ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record.h index 3522d152..18d65471 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record.h @@ -35,7 +35,7 @@ /* * Abstract: * Declaration of osm_vlarb_rec_rcv_t. - * This object represents the NodeRecord Receiver object. + * This object represents the VLArbitration Record Receiver object. * attribute from a node. * This object is part of the OpenSM family of objects. * diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record_ctrl.h b/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record_ctrl.h index 4698e378..fd0cd3f2 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record_ctrl.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sa_vlarb_record_ctrl.h @@ -66,9 +66,9 @@ BEGIN_C_DECLS -/****h* OpenSM/Vlarbitration Record Receive Controller +/****h* OpenSM/VLArbitration Record Receive Controller * NAME -* Vlarbitration Record Receive Controller +* VLArbitration Record Receive Controller * * DESCRIPTION * The VLArbitration Record Receive Controller object encapsulates diff --git a/trunk/ulp/opensm/user/include/opensm/osm_sm.h b/trunk/ulp/opensm/user/include/opensm/osm_sm.h index 78efd12f..0934eaf0 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_sm.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_sm.h @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -158,6 +159,7 @@ typedef struct _osm_sm osm_link_mgr_t link_mgr; osm_state_mgr_t state_mgr; osm_drop_mgr_t drop_mgr; + osm_pkey_mgr_t pkey_mgr; osm_lft_rcv_t lft_rcv; osm_lft_rcv_ctrl_t lft_rcv_ctrl; osm_mft_rcv_t mft_rcv; @@ -537,8 +539,8 @@ osm_sm_wait_for_subnet_up( } /* * PARAMETERS -* p_osm -* [in] Pointer to an osm_opensm_t object. +* p_sm +* [in] Pointer to an osm_sm_t object. * * wait_us * [in] Number of microseconds to wait. diff --git a/trunk/ulp/opensm/user/include/opensm/osm_state_mgr.h b/trunk/ulp/opensm/user/include/opensm/osm_state_mgr.h index 0d836072..17ea7e84 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_state_mgr.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_state_mgr.h @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -109,6 +110,7 @@ typedef struct _osm_state_mgr osm_mcast_mgr_t *p_mcast_mgr; osm_link_mgr_t *p_link_mgr; osm_drop_mgr_t *p_drop_mgr; + osm_pkey_mgr_t *p_pkey_mgr; osm_req_t *p_req; osm_stats_t *p_stats; struct _osm_sm_state_mgr *p_sm_state_mgr; @@ -146,6 +148,9 @@ typedef struct _osm_state_mgr * p_drop_mgr * Pointer to the Drop Manager object. * +* p_pkey_mgr +* Pointer to the P_Key Manager object. +* * p_req * Pointer to the Requester object sending SMPs. * @@ -371,6 +376,7 @@ osm_state_mgr_init( IN osm_mcast_mgr_t* const p_mcast_mgr, IN osm_link_mgr_t* const p_link_mgr, IN osm_drop_mgr_t* const p_drop_mgr, + IN osm_pkey_mgr_t* const p_pkey_mgr, IN osm_req_t* const p_req, IN osm_stats_t* const p_stats, IN struct _osm_sm_state_mgr* const p_sm_state_mgr, @@ -402,6 +408,9 @@ osm_state_mgr_init( * p_drop_mgr * [in] Pointer to the Drop Manager object. * +* p_pkey_mgr +* [in] Pointer to the P_Key Manager object. +* * p_req * [in] Pointer to the Request Controller object. * diff --git a/trunk/ulp/opensm/user/include/opensm/osm_subnet.h b/trunk/ulp/opensm/user/include/opensm/osm_subnet.h index 2ec5a2ab..c8c5e267 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_subnet.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_subnet.h @@ -218,7 +218,8 @@ typedef struct _osm_subn_opt char * dump_files_dir; char * log_file; boolean_t accum_log_file; - cl_map_t port_pro_ignore_guids; + boolean_t console; + cl_map_t port_prof_ignore_guids; boolean_t port_profile_switch_nodes; uint32_t max_port_profile; osm_pfn_ui_extension_t pfn_ui_pre_lid_assign; @@ -231,6 +232,7 @@ typedef struct _osm_subn_opt osm_testability_modes_t testability_mode; boolean_t updn_activate; char * updn_guid_file; + boolean_t exit_on_fatal; } osm_subn_opt_t; /* * FIELDS @@ -321,7 +323,7 @@ typedef struct _osm_subn_opt * If TRUE (default) - the log file will be accumulated. * If FALSE - the log file will be erased before starting current opensm run. * -* port_pro_ignore_guids +* port_prof_ignore_guids * A map of guids to be ignored by port profiling. * * port_profile_switch_nodes @@ -368,6 +370,13 @@ typedef struct _osm_subn_opt * updn_guid_file * Pointer to name of the UPDN guid file given by User * +* exit_on_fatal +* If TRUE (default) - SM will exit on fatal subnet initialization issues. +* If FALSE - SM will not exit. +* Fatal initialization issues: +* a. SM recognizes 2 different nodes with the same guid, or 12x link with +* lane reversal badly configured. +* * SEE ALSO * Subnet object *********/ diff --git a/trunk/ulp/opensm/user/include/opensm/osm_switch.h b/trunk/ulp/opensm/user/include/opensm/osm_switch.h index 320a45b9..ffcfa8ba 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_switch.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_switch.h @@ -125,7 +125,7 @@ typedef struct _osm_switch ib_switch_info_t switch_info; osm_fwd_tbl_t fwd_tbl; osm_lid_matrix_t lmx; - osm_port_profile_t *p_pro; + osm_port_profile_t *p_prof; osm_mcast_tbl_t mcast_tbl; uint32_t discovery_count; @@ -962,13 +962,13 @@ osm_switch_set_path( IN osm_switch_t* const p_sw, IN const uint16_t lid_ho, IN const uint8_t port, - IN const boolean_t ignore_port_pro + IN const boolean_t ignore_port_prof ) { CL_ASSERT( p_sw ); osm_fwd_tbl_set( &p_sw->fwd_tbl, lid_ho, port ); - if (! ignore_port_pro) - osm_port_pro_path_count_inc( &p_sw->p_pro[port] ); + if (! ignore_port_prof) + osm_port_prof_path_count_inc( &p_sw->p_prof[port] ); } /* * PARAMETERS @@ -1253,7 +1253,7 @@ osm_switch_path_count_get( IN const osm_switch_t* const p_sw, IN const uint8_t port_num ) { - return( osm_port_pro_path_count_get( &p_sw->p_pro[port_num] ) ); + return( osm_port_prof_path_count_get( &p_sw->p_prof[port_num] ) ); } /* * PARAMETERS diff --git a/trunk/ulp/opensm/user/include/opensm/osm_version.h b/trunk/ulp/opensm/user/include/opensm/osm_version.h new file mode 100644 index 00000000..e1c4687f --- /dev/null +++ b/trunk/ulp/opensm/user/include/opensm/osm_version.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +#ifndef _OSM_VERSION_H_ +#define _OSM_VERSION_H_ + +#ifdef __cplusplus +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else /* !__cplusplus */ +# define BEGIN_C_DECLS +# define END_C_DECLS +#endif /* __cplusplus */ + +BEGIN_C_DECLS + +/****s* OpenSM: Base/OSM_VERSION +* NAME +* OSM_VERSION +* +* DESCRIPTION +* The version string for OpenSM +* +* SYNOPSIS +*/ +#define OSM_VERSION "OpenSM Rev:openib-1.2.0" +/********/ + +END_C_DECLS + +#endif /* _OSM_VERSION_H_ */ diff --git a/trunk/ulp/opensm/user/include/opensm/st.h b/trunk/ulp/opensm/user/include/opensm/st.h index 2e532980..b2cb8c6c 100644 --- a/trunk/ulp/opensm/user/include/opensm/st.h +++ b/trunk/ulp/opensm/user/include/opensm/st.h @@ -37,6 +37,8 @@ #ifndef ST_INCLUDED #define ST_INCLUDED +#include + #ifdef __cplusplus # define BEGIN_C_DECLS extern "C" { # define END_C_DECLS } @@ -76,11 +78,11 @@ struct st_table { enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE}; st_table *st_init_table(struct st_hash_type *); -st_table *st_init_table_with_size(struct st_hash_type *, int); +st_table *st_init_table_with_size(struct st_hash_type *, size_t); st_table *st_init_numtable(void); -st_table *st_init_numtable_with_size(int); +st_table *st_init_numtable_with_size(size_t); st_table *st_init_strtable(void); -st_table *st_init_strtable_with_size(int); +st_table *st_init_strtable_with_size(size_t); int st_delete(st_table *, st_data_t *, st_data_t *); int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t); int st_insert(st_table *, st_data_t, st_data_t); diff --git a/trunk/ulp/opensm/user/libopensm/osm_helper.c b/trunk/ulp/opensm/user/libopensm/osm_helper.c index bac57b39..40bbcd3b 100644 --- a/trunk/ulp/opensm/user/libopensm/osm_helper.c +++ b/trunk/ulp/opensm/user/libopensm/osm_helper.c @@ -271,7 +271,7 @@ ib_get_sa_method_str( method = method & 0x7f; if( method >= OSM_SA_METHOD_STR_UNKNOWN_VAL ) method = OSM_SA_METHOD_STR_UNKNOWN_VAL; - /* it is a response - use the reponse table */ + /* it is a response - use the response table */ return( __ib_sa_resp_method_str[method] ); } else @@ -646,7 +646,7 @@ osm_dump_port_info( cl_ntoh16( p_pi->q_key_violations ), p_pi->guid_cap, ib_port_info_get_client_rereg( p_pi ), - ib_port_info_get_timeout(p_pi), + ib_port_info_get_timeout( p_pi ), p_pi->resp_time_value, p_pi->error_threshold ); @@ -661,7 +661,6 @@ osm_dump_port_info( /********************************************************************** **********************************************************************/ - void osm_dump_portinfo_record( IN osm_log_t* const p_log, @@ -758,6 +757,49 @@ osm_dump_portinfo_record( } } +/********************************************************************** + **********************************************************************/ +void +osm_dump_guidinfo_record( + IN osm_log_t* const p_log, + IN const ib_guidinfo_record_t* const p_gir, + IN const osm_log_level_t log_level ) +{ + const ib_guid_info_t * const p_gi = &p_gir->guid_info; + + if( osm_log_is_active( p_log, log_level ) ) + { + osm_log( p_log, log_level, + "GUIDInfo Record dump:\n" + "\t\t\t\tRID\n" + "\t\t\t\tLid.....................0x%X\n" + "\t\t\t\tBlockNum................0x%X\n" + "\t\t\t\tReserved................0x%X\n" + "\t\t\t\tGUIDInfo dump\n" + "\t\t\t\tReserved................0x%X\n" + "\t\t\t\tGUID 0..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 1..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 2..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 3..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 4..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 5..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 6..................0x%016" PRIx64 "\n" + "\t\t\t\tGUID 7..................0x%016" PRIx64 "\n", + cl_ntoh16(p_gir->lid), + p_gir->block_num, + p_gir->resv, + cl_ntoh32(p_gir->reserved), + cl_ntoh64(p_gi->guid[0]), + cl_ntoh64(p_gi->guid[1]), + cl_ntoh64(p_gi->guid[2]), + cl_ntoh64(p_gi->guid[3]), + cl_ntoh64(p_gi->guid[4]), + cl_ntoh64(p_gi->guid[5]), + cl_ntoh64(p_gi->guid[6]), + cl_ntoh64(p_gi->guid[7]) + ); + } +} /********************************************************************** **********************************************************************/ @@ -925,11 +967,14 @@ osm_dump_mc_record( "0x%016" PRIx64 "\n" "\t\t\t\tqkey....................0x%X\n" "\t\t\t\tMlid....................0x%X\n" - "\t\t\t\tScopeState..............0x%X\n" - "\t\t\t\tRate....................0x%X\n" "\t\t\t\tMtu.....................0x%X\n" "\t\t\t\tTClass..................0x%X\n" + "\t\t\t\tpkey....................0x%X\n" + "\t\t\t\tRate....................0x%X\n" + "\t\t\t\tPacketLife..............0x%X\n" "\t\t\t\tSLFlowLabelHopLimit.....0x%X\n" + "\t\t\t\tScopeState..............0x%X\n" + "\t\t\t\tProxyJoin...............0x%X\n" "", cl_ntoh64( p_mcmr->mgid.unicast.prefix ), cl_ntoh64( p_mcmr->mgid.unicast.interface_id ), @@ -937,16 +982,18 @@ osm_dump_mc_record( cl_ntoh64( p_mcmr->port_gid.unicast.interface_id ), cl_ntoh32( p_mcmr->qkey ), cl_ntoh16( p_mcmr->mlid ), - p_mcmr->scope_state, - p_mcmr->rate, p_mcmr->mtu, p_mcmr->tclass, - cl_ntoh32( p_mcmr->sl_flow_hop ) + cl_ntoh16( p_mcmr->pkey ), + p_mcmr->rate, + p_mcmr->pkt_life, + cl_ntoh32( p_mcmr->sl_flow_hop ), + p_mcmr->scope_state, + p_mcmr->proxy_join ); } } - /********************************************************************** **********************************************************************/ void @@ -1021,7 +1068,6 @@ osm_dump_service_record( "\t\t\t\tServiceData64.1.........0x%016" PRIx64 "\n" "\t\t\t\tServiceData64.2.........0x%016" PRIx64 "\n" "", - cl_ntoh64( p_sr->service_id ), cl_ntoh64( p_sr->service_gid.unicast.prefix ), cl_ntoh64( p_sr->service_gid.unicast.interface_id ), @@ -1129,7 +1175,6 @@ osm_dump_inform_info( } } - /********************************************************************** **********************************************************************/ void @@ -1176,7 +1221,7 @@ osm_dump_switch_info( "\t\t\t\tdef_mcast_not_port......0x%X\n" "\t\t\t\tlife_state..............0x%X\n" "\t\t\t\tlids_per_port...........0x%X\n" - "\t\t\t\tenforce_cap.............0x%X\n" + "\t\t\t\tpartition_enf_cap.......0x%X\n" "\t\t\t\tflags...................0x%X\n" "", cl_ntoh16( p_si->lin_cap ), @@ -1194,7 +1239,6 @@ osm_dump_switch_info( } } - /********************************************************************** **********************************************************************/ void @@ -1229,7 +1273,6 @@ osm_dump_pkey_block( } } - /********************************************************************** **********************************************************************/ void @@ -1244,6 +1287,7 @@ osm_dump_slvl_map_table( uint8_t i; char buf_line1[1024]; char buf_line2[1024]; + if( osm_log_is_active( p_log, log_level ) ) { buf_line1[0] = '\0'; @@ -1278,6 +1322,7 @@ osm_dump_vl_arb_table( int i; char buf_line1[1024]; char buf_line2[1024]; + if( osm_log_is_active( p_log, log_level ) ) { buf_line1[0] = '\0'; @@ -1336,6 +1381,7 @@ osm_dump_notice( { char buff[1024]; buff[0] = '\0'; + if( osm_log_is_active( p_log, log_level ) ) { if (ib_notice_is_generic(p_ntci)) @@ -1458,9 +1504,7 @@ osm_dump_dr_smp( "\t\t\t\tattr_id.................0x%X (%s)\n" "\t\t\t\tresv....................0x%X\n" "\t\t\t\tattr_mod................0x%X\n" - "\t\t\t\tm_key...................0x%016" PRIx64 "\n" - "\t\t\t\tdr_slid.................0x%X\n" - "\t\t\t\tdr_dlid.................0x%X\n", + "\t\t\t\tm_key...................0x%016" PRIx64 "\n", p_smp->hop_ptr, p_smp->hop_count, cl_ntoh64(p_smp->trans_id), @@ -1468,14 +1512,20 @@ osm_dump_dr_smp( ib_get_sm_attr_str( p_smp->attr_id ), cl_ntoh16(p_smp->resv), cl_ntoh32(p_smp->attr_mod), - cl_ntoh64(p_smp->m_key), - cl_ntoh16(p_smp->dr_slid), - cl_ntoh16(p_smp->dr_dlid) + cl_ntoh64(p_smp->m_key) ); strcat( buf, line ); if (p_smp->mgmt_class == IB_MCLASS_SUBN_DIR) { + sprintf( line, + "\t\t\t\tdr_slid.................0x%X\n" + "\t\t\t\tdr_dlid.................0x%X\n", + cl_ntoh16(p_smp->dr_slid), + cl_ntoh16(p_smp->dr_dlid) + ); + strcat( buf, line ); + strcat( buf, "\n\t\t\t\tInitial path: " ); for( i = 0; i <= p_smp->hop_count; i++ ) @@ -1653,7 +1703,7 @@ osm_dump_smp_dr_path( if( osm_log_is_active( p_log, log_level) ) { - sprintf( buf, "Received a SMP on a %u hop path:" + sprintf( buf, "Received SMP on a %u hop path:" "\n\t\t\t\tInitial path = ", p_smp->hop_count ); for( i = 0; i <= p_smp->hop_count; i++ ) @@ -1699,19 +1749,22 @@ const char* const __osm_sm_state_str[] = "OSM_SM_STATE_SET_LINK_PORTS", /* 19 */ "OSM_SM_STATE_SET_LINK_PORTS_WAIT", /* 20 */ "OSM_SM_STATE_SET_LINK_PORTS_DONE", /* 21 */ - "OSM_SM_STATE_SET_ARMED", /* 19 */ - "OSM_SM_STATE_SET_ARMED_WAIT", /* 20 */ - "OSM_SM_STATE_SET_ARMED_DONE", /* 21 */ - "OSM_SM_STATE_SET_ACTIVE", /* 22 */ - "OSM_SM_STATE_SET_ACTIVE_WAIT", /* 23 */ - "OSM_SM_STATE_LOST_NEGOTIATION", /* 24 */ - "OSM_SM_STATE_STANDBY", /* 25 */ - "OSM_SM_STATE_SUBNET_UP", /* 26 */ - "OSM_SM_STATE_PROCESS_REQUEST", /* 27 */ - "OSM_SM_STATE_PROCESS_REQUEST_WAIT", /* 28 */ - "OSM_SM_STATE_PROCESS_REQUEST_DONE", /* 29 */ - "OSM_SM_STATE_MASTER_OR_HIGHER_SM_DETECTED", /* 30 */ - "UNKNOWN STATE!!" /* 31 */ + "OSM_SM_STATE_SET_ARMED", /* 22 */ + "OSM_SM_STATE_SET_ARMED_WAIT", /* 23 */ + "OSM_SM_STATE_SET_ARMED_DONE", /* 24 */ + "OSM_SM_STATE_SET_ACTIVE", /* 25 */ + "OSM_SM_STATE_SET_ACTIVE_WAIT", /* 26 */ + "OSM_SM_STATE_LOST_NEGOTIATION", /* 27 */ + "OSM_SM_STATE_STANDBY", /* 28 */ + "OSM_SM_STATE_SUBNET_UP", /* 29 */ + "OSM_SM_STATE_PROCESS_REQUEST", /* 30 */ + "OSM_SM_STATE_PROCESS_REQUEST_WAIT", /* 31 */ + "OSM_SM_STATE_PROCESS_REQUEST_DONE", /* 32 */ + "OSM_SM_STATE_MASTER_OR_HIGHER_SM_DETECTED",/* 33 */ + "OSM_SM_STATE_SET_PKEY", /* 34 */ + "OSM_SM_STATE_SET_PKEY_WAIT", /* 35 */ + "OSM_SM_STATE_SET_PKEY_DONE", /* 36 */ + "UNKNOWN STATE!!" /* 37 */ }; const char* const __osm_sm_signal_str[] = @@ -1847,9 +1900,11 @@ osm_get_node_type_str_fixed_width( #define OSM_VENDOR_ID_FUJITSU 0x00E000 #define OSM_VENDOR_ID_FUJITSU2 0x000B5D #define OSM_VENDOR_ID_VOLTAIRE 0x0008F1 -#define OSM_VENDOR_ID_YOTTAYOTTA 0x000453 +#define OSM_VENDOR_ID_YOTTAYOTTA 0x000453 /* Also, Obsidian Research */ #define OSM_VENDOR_ID_PATHSCALE 0x001175 #define OSM_VENDOR_ID_IBM 0x000255 +#define OSM_VENDOR_ID_DIVERGENET 0x00084E +#define OSM_VENDOR_ID_FLEXTRONICS 0x000B8C /********************************************************************** **********************************************************************/ @@ -1867,6 +1922,8 @@ osm_get_manufacturer_str( static const char* yotta_str = "YottaYotta "; static const char* pathscale_str = "PathScale "; static const char* ibm_str = "IBM "; + static const char* divergenet_str = "DivergeNet "; + static const char* flextronics_str = "Flextronics "; static const char* unknown_str = "Unknown "; switch( (uint32_t)(guid_ho >> (5 * 8)) ) @@ -1892,6 +1949,10 @@ osm_get_manufacturer_str( return( pathscale_str ); case OSM_VENDOR_ID_IBM: return( ibm_str ); + case OSM_VENDOR_ID_DIVERGENET: + return( divergenet_str ); + case OSM_VENDOR_ID_FLEXTRONICS: + return( flextronics_str ); default: return( unknown_str ); } diff --git a/trunk/ulp/opensm/user/libopensm/osm_log.c b/trunk/ulp/opensm/user/libopensm/osm_log.c index 113d9671..9034cdf7 100644 --- a/trunk/ulp/opensm/user/libopensm/osm_log.c +++ b/trunk/ulp/opensm/user/libopensm/osm_log.c @@ -101,7 +101,6 @@ osm_log( tim = time_usecs/1000000; usecs = time_usecs % 1000000; localtime_r(&tim, &result); - #endif /* WIN32 */ /* If this is a call to syslog - always print it */ @@ -136,7 +135,6 @@ osm_log( #endif } - /* SYS messages go to the log anyways */ if (p_log->level & verbosity) { diff --git a/trunk/ulp/opensm/user/libopensm/osm_mad_pool.c b/trunk/ulp/opensm/user/libopensm/osm_mad_pool.c index a260adea..e8eb792e 100644 --- a/trunk/ulp/opensm/user/libopensm/osm_mad_pool.c +++ b/trunk/ulp/opensm/user/libopensm/osm_mad_pool.c @@ -107,6 +107,7 @@ osm_mad_pool_init( IN osm_log_t* const p_log ) { ib_api_status_t status; + OSM_LOG_ENTER( p_log, osm_mad_pool_init ); p_pool->p_log = p_log; @@ -124,7 +125,7 @@ osm_mad_pool_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_mad_pool_init: ERR 0702: " - "Grow pool initialization failed (%s).\n", + "Grow pool initialization failed (%s)\n", ib_get_err_str(status) ); goto Exit; } @@ -159,7 +160,7 @@ osm_mad_pool_get( { osm_log( p_pool->p_log, OSM_LOG_ERROR, "osm_mad_pool_get: ERR 0703: " - "Unable to acquire MAD wrapper object.\n" ); + "Unable to acquire MAD wrapper object\n" ); goto Exit; } @@ -174,7 +175,7 @@ osm_mad_pool_get( { osm_log( p_pool->p_log, OSM_LOG_ERROR, "osm_mad_pool_get: ERR 0704: " - "Unable to acquire wire MAD.\n" ); + "Unable to acquire wire MAD\n" ); /* Don't leak wrappers! */ cl_qlock_pool_put( &p_pool->madw_pool, (cl_pool_item_t*)p_madw ); @@ -190,7 +191,7 @@ osm_mad_pool_get( osm_log( p_pool->p_log, OSM_LOG_DEBUG, "osm_mad_pool_get: Acquired p_madw = %p, p_mad = %p, " - "size = %u.\n", p_madw, p_madw->p_mad, total_size ); + "size = %u\n", p_madw, p_madw->p_mad, total_size ); Exit: OSM_LOG_EXIT( p_pool->p_log ); @@ -223,7 +224,7 @@ osm_mad_pool_get_wrapper( { osm_log( p_pool->p_log, OSM_LOG_ERROR, "osm_mad_pool_get_wrapper: ERR 0705: " - "Unable to acquire MAD wrapper object.\n" ); + "Unable to acquire MAD wrapper object\n" ); goto Exit; } @@ -257,7 +258,7 @@ osm_mad_pool_get_wrapper_raw( osm_log( p_pool->p_log, OSM_LOG_DEBUG, "osm_mad_pool_get_wrapper_raw: " - "Getting p_madw = %p.\n", p_madw ); + "Getting p_madw = %p\n", p_madw ); osm_madw_init( p_madw, 0, 0, 0 ); osm_madw_set_mad( p_madw, 0 ); @@ -267,7 +268,6 @@ osm_mad_pool_get_wrapper_raw( return( p_madw ); } - /********************************************************************** **********************************************************************/ void @@ -280,7 +280,7 @@ osm_mad_pool_put( CL_ASSERT( p_madw ); osm_log( p_pool->p_log, OSM_LOG_DEBUG, - "osm_mad_pool_put: Releasing p_madw = %p, p_mad = %p.\n", + "osm_mad_pool_put: Releasing p_madw = %p, p_mad = %p\n", p_madw, p_madw->p_mad ); /* diff --git a/trunk/ulp/opensm/user/libvendor/osm_vendor_mlx_sa.c b/trunk/ulp/opensm/user/libvendor/osm_vendor_mlx_sa.c index f53685db..f432df67 100644 --- a/trunk/ulp/opensm/user/libvendor/osm_vendor_mlx_sa.c +++ b/trunk/ulp/opensm/user/libvendor/osm_vendor_mlx_sa.c @@ -37,6 +37,7 @@ # include #endif /* HAVE_CONFIG_H */ +#include #include #include #include @@ -204,7 +205,7 @@ __osmv_sa_mad_err_cb( /* Obtain the sent context etc */ p_query_req_copy = - (osmv_query_req_t *)(p_madw->context.arb_context.context1); + (osmv_query_req_t *)(p_madw->context.arb_context.context1); /* provide the context of the original request in the result */ query_res.query_context = p_query_req_copy->query_context; diff --git a/trunk/ulp/opensm/user/opensm/SOURCES b/trunk/ulp/opensm/user/opensm/SOURCES index 29324d00..9a10e432 100644 --- a/trunk/ulp/opensm/user/opensm/SOURCES +++ b/trunk/ulp/opensm/user/opensm/SOURCES @@ -44,6 +44,7 @@ SOURCES=\ osm_node_info_rcv_ctrl.c \ osm_opensm.c \ osm_pkey.c \ + osm_pkey_mgr.c \ osm_pkey_rcv.c \ osm_pkey_rcv_ctrl.c \ osm_port.c \ @@ -56,6 +57,8 @@ SOURCES=\ osm_sa.c \ osm_sa_class_port_info.c \ osm_sa_class_port_info_ctrl.c \ + osm_sa_guidinfo_record.c \ + osm_sa_guidinfo_record_ctrl.c \ osm_sa_informinfo.c \ osm_sa_informinfo_ctrl.c \ osm_sa_lft_record.c \ diff --git a/trunk/ulp/opensm/user/opensm/cl_event_wheel.c b/trunk/ulp/opensm/user/opensm/cl_event_wheel.c index 97cceb2b..d657cdf3 100644 --- a/trunk/ulp/opensm/user/opensm/cl_event_wheel.c +++ b/trunk/ulp/opensm/user/opensm/cl_event_wheel.c @@ -37,8 +37,8 @@ #endif /* HAVE_CONFIG_H */ #include -#include #include +#include cl_status_t __event_will_age_before( @@ -184,7 +184,7 @@ __cl_event_wheel_callback( IN void* context ) if (cl_status != CL_SUCCESS) { osm_log (p_event_wheel->p_log, OSM_LOG_ERROR, - "__cl_event_wheel_callback : ERROR 1000: " + "__cl_event_wheel_callback : ERR 6100: " "Failed to start timer\n" ); } } @@ -228,7 +228,7 @@ cl_event_wheel_init( if (cl_status != CL_SUCCESS) { osm_log (p_event_wheel->p_log, OSM_LOG_ERROR, - "cl_event_wheel_init : ERROR 1000: " + "cl_event_wheel_init : ERR 6101: " "Failed to initialize cl_spinlock\n" ); goto Exit; } @@ -243,7 +243,7 @@ cl_event_wheel_init( if (cl_status != CL_SUCCESS) { osm_log (p_event_wheel->p_log, OSM_LOG_ERROR, - "cl_event_wheel_init : ERROR 1000: " + "cl_event_wheel_init : ERR 6102: " "Failed to initialize cl_timer\n" ); goto Exit; } @@ -282,7 +282,7 @@ cl_event_wheel_dump( p_list_item = cl_qlist_head(&p_event_wheel->events_wheel); osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_dump: " - "event_wheel ptr:%p \n", + "event_wheel ptr:%p\n", p_event_wheel); while (p_list_item != cl_qlist_end(&p_event_wheel->events_wheel) ) @@ -290,7 +290,7 @@ cl_event_wheel_dump( p_event = PARENT_STRUCT(p_list_item, cl_event_wheel_reg_info_t, list_item); osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_dump: " - "Found event key:<0x%"PRIx64">, aging time:%" PRIu64".\n", + "Found event key:<0x%"PRIx64">, aging time:%" PRIu64"\n", p_event->key, p_event->aging_time ); p_list_item = cl_qlist_next( p_list_item ); } @@ -320,7 +320,7 @@ cl_event_wheel_destroy( osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_destroy: " - "Found outstanding event key:<0x%"PRIx64">.\n", + "Found outstanding event key:<0x%"PRIx64">\n", p_event->key ); /* remove it from the map */ @@ -351,6 +351,7 @@ cl_event_wheel_reg( { cl_event_wheel_reg_info_t *p_event; uint64_t timeout; + uint32_t to; cl_status_t cl_status = CL_SUCCESS; cl_list_item_t *prev_event_list_item; cl_map_item_t *p_map_item; @@ -394,7 +395,7 @@ cl_event_wheel_reg( osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_reg: " - "Registering event key:0x%"PRIx64" aging in %u [msec].\n", + "Registering event key:0x%"PRIx64" aging in %u [msec]\n", p_event->key, (uint32_t)((p_event->aging_time - cl_get_time_stamp()) / 1000 )); @@ -425,21 +426,22 @@ cl_event_wheel_reg( /* The timeout for the cl_timer_start should be given as uint32_t. if there is an overflow - warn about it. */ + to = (uint32_t)timeout; if ( timeout > (uint32_t)timeout ) { + to = 0xffffffff; /* max 32 bit timer */ osm_log (p_event_wheel->p_log, OSM_LOG_INFO, "cl_event_wheel_reg: " - "timeout requested is too large. Using timeout: %u \n", - (uint32_t)timeout ); + "timeout requested is too large. Using timeout: %u\n", + to ); } /* start the timer to the timeout [msec] */ - cl_status = cl_timer_start(&p_event_wheel->timer, (uint32_t)timeout); - + cl_status = cl_timer_start(&p_event_wheel->timer, to); if (cl_status != CL_SUCCESS) { osm_log (p_event_wheel->p_log, OSM_LOG_ERROR, - "cl_event_wheel_reg : ERROR 1000: " + "cl_event_wheel_reg : ERR 6103: " "Failed to start timer\n" ); goto Exit; } @@ -479,7 +481,7 @@ cl_event_wheel_unreg( osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_unreg: " - "Removing key:0x%"PRIx64".\n", key ); + "Removing key:0x%"PRIx64"\n", key ); CL_SPINLOCK_ACQUIRE( &p_event_wheel->lock ); p_map_item = cl_qmap_get( &p_event_wheel->events_map, key ); @@ -495,7 +497,7 @@ cl_event_wheel_unreg( osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_unreg: " - "Removed key:0x%"PRIx64".\n", key ); + "Removed key:0x%"PRIx64"\n", key ); /* free the item */ cl_free(p_event); @@ -527,7 +529,7 @@ cl_event_wheel_num_regs( /* try to find the key in the map */ osm_log( p_event_wheel->p_log, OSM_LOG_DEBUG, "cl_event_wheel_num_regs: " - "Looking for key:0x%"PRIx64".\n", key ); + "Looking for key:0x%"PRIx64"\n", key ); CL_SPINLOCK_ACQUIRE( &p_event_wheel->lock ); p_map_item = cl_qmap_get( &p_event_wheel->events_map, key ); diff --git a/trunk/ulp/opensm/user/opensm/main.c b/trunk/ulp/opensm/user/opensm/main.c index facbd6f4..245f9484 100644 --- a/trunk/ulp/opensm/user/opensm/main.c +++ b/trunk/ulp/opensm/user/opensm/main.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +62,7 @@ /* This is the global opensm object. One opensm object is required per subnet. - Future versions could support multiple subents by + Future versions could support multiple subnets by instantiating more than one opensm object. */ osm_opensm_t osm; @@ -86,8 +87,8 @@ show_usage(void) " /var/cache/osm/opensm.opts for use next invocation\n" " The cache directory can be changed by the environment\n" " variable OSM_CACHE_DIR\n\n"); - printf( "-g \n" - "--guid \n" + printf( "-g[=]\n" + "--guid[=]\n" " This option specifies the local port GUID value\n" " with which OpenSM should bind. OpenSM may be\n" " bound to 1 port at a time.\n" @@ -110,6 +111,9 @@ show_usage(void) " This option specifies the SM's PRIORITY.\n" " This will effect the handover cases, where master\n" " is chosen by priority and GUID.\n" ); + printf( "-smkey \n" + " This option specifies the SM's SM_Key (64 bits).\n" + " This will effect SM authentication.\n" ); printf( "-r\n" "--reassign_lids\n" " This option causes OpenSM to reassign LIDs to all\n" @@ -129,7 +133,7 @@ show_usage(void) printf( "-o\n" "--once\n" " This option causes OpenSM to configure the subnet\n" - " once, then exit. Ports remain in the ACTIVE state.\n" ); + " once, then exit. Ports remain in the ACTIVE state.\n\n" ); printf( "-s \n" "--sweep \n" " This option specifies the number of seconds between\n" @@ -142,7 +146,7 @@ show_usage(void) " used for transaction timeouts.\n" " Specifying -t 0 disables timeouts.\n" " Without -t, OpenSM defaults to a timeout value of\n" - " 100 milliseconds.\n\n" ); + " 200 milliseconds.\n\n" ); printf( "-maxsmps \n" " This option specifies the number of VL15 SMP MADs\n" " allowed on the wire at any one time.\n" @@ -152,7 +156,7 @@ show_usage(void) " one outstanding SMP.\n\n" ); printf( "-i \n" "-ignore-guids \n" - " This option provides means to define a set of ports\n" + " This option provides the means to define a set of ports\n" " (by guids) that will be ignored by the link load \n" " equalization algorithm.\n\n" ); printf( "-f\n" @@ -165,6 +169,12 @@ show_usage(void) " This option will cause deletion of the log file \n" " (if it previously exists). By default, the log file \n" " is accumulative.\n\n"); + printf( "-y\n" + "--stay_on_fatal\n" + " This option will cause SM not to exit on fatal initialization\n" + " issues: if SM discovers duplicated guids or 12x link with\n" + " lane reversal badly configured.\n" + " By default, the SM will exit on these errors.\n\n"); printf( "-v\n" "--verbose\n" " This option increases the log verbosity level.\n" @@ -206,13 +216,13 @@ show_usage(void) " option to enable as follows:\n" " OPT Description\n" " --- -----------------\n" - " -d0 - Ignore other SM nodes.\n" - " -d1 - Force single threaded dispatching.\n" - " -d2 - Force log flushing after each log message.\n" - " -d3 - Disable multicast support.\n" - " -d4 - Put OpenSM in memory tracking mode.\n" - " -d10.. Put OpenSM in testability mode.\n" - " Without -d, no debug options are enabled.\n\n" ); + " -d0 - Ignore other SM nodes\n" + " -d1 - Force single threaded dispatching\n" + " -d2 - Force log flushing after each log message\n" + " -d3 - Disable multicast support\n" + " -d4 - Put OpenSM in memory tracking mode\n" + " -d10 - Put OpenSM in testability mode\n" + " Without -d, no debug options are enabled\n\n" ); printf( "-h\n" "--help\n" " Display this usage info then exit.\n\n" ); @@ -254,7 +264,7 @@ get_port_guid( status = osm_vendor_get_all_port_attr( p_osm->p_vendor, attr_array, &num_ports ); if( status != IB_SUCCESS ) { - printf( "\nError from osm_opensm_init (%x)\n", status); + printf( "\nError from osm_vendor_get_all_port_attr (%x)\n", status); return( 0 ); } @@ -361,6 +371,7 @@ parse_ignore_guids_file(IN char *guids_file_name, uint64_t port_guid; ib_api_status_t status = IB_SUCCESS; unsigned int port_num; + OSM_LOG_ENTER( &p_osm->log, parse_ignore_guids_file ); fh = fopen( guids_file_name, "r" ); @@ -368,7 +379,7 @@ parse_ignore_guids_file(IN char *guids_file_name, { osm_log( &p_osm->log, OSM_LOG_ERROR, "parse_ignore_guids_file: ERR 0601: " - "Unable to open ignore guids file (%s).\n" ); + "Unable to open ignore guids file (%s)\n" ); status = IB_ERROR; goto Exit; } @@ -386,7 +397,7 @@ parse_ignore_guids_file(IN char *guids_file_name, { osm_log( &p_osm->log, OSM_LOG_ERROR, "parse_ignore_guids_file: ERR 0602: " - "Error in line (%u): %s" , + "Error in line (%u): %s\n" , line_num, line ); status = IB_ERROR; @@ -398,7 +409,7 @@ parse_ignore_guids_file(IN char *guids_file_name, { osm_log( &p_osm->log, OSM_LOG_ERROR, "parse_ignore_guids_file: ERR 0603: " - "Error in line (%u): %s" , + "Error in line (%u): %s\n" , line_num, p_ec ); status = IB_ERROR; @@ -408,7 +419,7 @@ parse_ignore_guids_file(IN char *guids_file_name, if (port_num > 256) { osm_log( &p_osm->log, OSM_LOG_ERROR, - "parse_ignore_guids_file: ERR XXX: " + "parse_ignore_guids_file: ERR 0604: " "Error in line (%u): %s. " "port number is greater than 256 (%d) \n", line_num, p_ec, port_num @@ -417,7 +428,7 @@ parse_ignore_guids_file(IN char *guids_file_name, goto Exit; } /* ok insert it */ - osm_port_pro_set_ignored_port(&p_osm->subn, port_guid, (uint8_t)port_num); + osm_port_prof_set_ignored_port(&p_osm->subn, port_guid, (uint8_t)port_num); osm_log( &p_osm->log, OSM_LOG_DEBUG, "parse_ignore_guids_file: " "Inserted Port: 0x%" PRIx64 " into ignored guids list\n" , @@ -443,6 +454,7 @@ main( { osm_subn_opt_t opt; ib_net64_t guid = 0; + ib_net64_t sm_key = 0; ib_api_status_t status; uint32_t log_flags = OSM_LOG_DEFAULT_LEVEL; int long temp; @@ -454,7 +466,7 @@ main( boolean_t cache_options = FALSE; char *ignore_guids_file_name = NULL; uint32_t val; - const char * const short_option = "i:f:ed:g:l:s:t:a:uvVhorc"; + const char * const short_option = "i:f:ed:g:l:s:t:a:uvVhorcy"; /* In the array below, the 2nd parameter specified the number @@ -481,9 +493,11 @@ main( { "once", 0, NULL, 'o'}, { "reassign_lids", 0, NULL, 'r'}, { "priority", 1, NULL, 'p'}, + { "smkey", 1, NULL, 'k'}, { "updn", 0, NULL, 'u'}, { "add_guid_file", 1, NULL, 'a'}, { "cache-options", 0, NULL, 'c'}, + { "stay_on_fatal", 0, NULL, 'y'}, { NULL, 0, NULL, 0 } /* Required at the end of the array */ }; @@ -553,7 +567,6 @@ main( case 't': opt.transaction_timeout = strtol(optarg, NULL, 0); printf(" Transaction timeout = %d\n", opt.transaction_timeout); - break; case 'n': @@ -573,7 +586,7 @@ main( } else if(dbg_lvl == 1) { - printf(" Debug mode: Force Signale Thread\n"); + printf(" Debug mode: Forcing Single Thread\n"); opt.single_thread = TRUE; } else if(dbg_lvl == 2) @@ -626,7 +639,12 @@ main( case 'e': opt.accum_log_file = FALSE; - printf(" Erasing existing(old) log file\n"); + printf(" Creating new log file\n"); + break; + + case 'y': + opt.exit_on_fatal = FALSE; + printf(" Staying on fatal initialization errors\n"); break; case 'v': @@ -650,6 +668,12 @@ main( printf(" Priority = %d\n", temp); break; + case 'k': + sm_key = cl_hton64( strtoull( optarg, NULL, 16 )); + printf(" SM Key <0x%"PRIx64">\n", cl_hton64( sm_key )); + opt.sm_key = sm_key; + break; + case 'u': opt.updn_activate = TRUE; printf(" Activate UPDN algorithm\n"); @@ -690,7 +714,8 @@ main( /* Done with options description */ printf("-------------------------------------------------\n"); - if (mem_track) __cl_mem_track(TRUE); + if (mem_track) + __cl_mem_track(TRUE); opt.log_flags = (uint8_t)log_flags; @@ -716,7 +741,7 @@ main( If the user didn't specify a GUID on the command line, then get a port GUID value with which to bind. */ - if( guid == 0 || cl_hton64(guid) == cl_hton64(INVALID_GUID)) + if( guid == 0 || cl_hton64(guid) == CL_HTON64(INVALID_GUID)) guid = get_port_guid( &osm, guid ); if ( guid == 0 ) @@ -785,9 +810,9 @@ main( sleep(exitTimeout); */ - if ((osm.mad_pool.mads_out)) + if (osm.mad_pool.mads_out) fprintf(stdout, - "There are still %u mads out. Forcing the exit of the OpenSM application...\n", + "There are still %u MADs out. Forcing the exit of the OpenSM application...\n", osm.mad_pool.mads_out); Exit: diff --git a/trunk/ulp/opensm/user/opensm/osm_console.c b/trunk/ulp/opensm/user/opensm/osm_console.c new file mode 100644 index 00000000..48731ca6 --- /dev/null +++ b/trunk/ulp/opensm/user/opensm/osm_console.c @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +# include +#endif /* HAVE_CONFIG_H */ + +#define _GNU_SOURCE /* for getline */ +#include +#include +#include + +#define OSM_COMMAND_LINE_LEN 120 +#define OSM_COMMAND_PROMPT "$ " + +struct command { + char *name; + void (*help_function)(void); + void (*parse_function)(char **p_last, osm_opensm_t *p_osm); +}; + +static const struct command console_cmds[]; + +static inline char *next_token(char **p_last) +{ + return strtok_r(NULL, " \t\n", p_last); +} + +static void help_command() +{ + int i; + + printf("Supported commands and syntax:\n"); + printf("help []\n"); + /* skip help command */ + for (i = 1; console_cmds[i].name; i++) + console_cmds[i].help_function(); +} + +static void help_loglevel() +{ + printf("loglevel []\n"); +} + +static void help_priority() +{ + printf("priority []\n"); +} + +/* more help routines go here */ + +static void help_parse(char **p_last, osm_opensm_t *p_osm) +{ + char *p_cmd; + int i, found = 0; + + p_cmd = next_token(p_last); + if (!p_cmd) + help_command(); + else { + for (i = 1; console_cmds[i].name; i++) { + if (!strcmp(p_cmd, console_cmds[i].name)) { + found = 1; + console_cmds[i].help_function(); + break; + } + } + if (!found) { + printf("Command %s not found\n\n", p_cmd); + help_command(); + } + } +} + +static void loglevel_parse(char **p_last, osm_opensm_t *p_osm) +{ + char *p_cmd; + int level; + + p_cmd = next_token(p_last); + if (!p_cmd) + printf("Current log level is 0x%x\n", osm_log_get_level(&p_osm->log)); + else { + /* Handle x, 0x, and decimal specification of log level */ + if (!strncmp(p_cmd, "x", 1)) { + p_cmd++; + level = strtoul(p_cmd, NULL, 16); + } else { + if (!strncmp(p_cmd, "0x", 2)) { + p_cmd += 2; + level = strtoul(p_cmd, NULL, 16); + } else + level = strtol(p_cmd, NULL, 10); + } + if ((level >= 0) && (level < 256)) { + printf("Setting log level to 0x%x\n", level); + osm_log_set_level(&p_osm->log, level); + } else + printf("Invalid log level 0x%x\n", level); + } +} + +static void priority_parse(char **p_last, osm_opensm_t *p_osm) +{ + char *p_cmd; + int priority; + + p_cmd = next_token(p_last); + if (!p_cmd) + printf("Current sm-priority is %d\n", p_osm->subn.opt.sm_priority); + else { + priority = strtol(p_cmd, NULL, 0); + if (0 > priority || 15 < priority) + printf("Invalid sm-priority %d; must be between 0 and 15\n", priority); + else { + printf("Setting sm-priority to %d\n", priority); + p_osm->subn.opt.sm_priority = (uint8_t)priority; + /* Does the SM state machine need a kick now ? */ + } + } +} + +/* more parse routines go here */ + +static const struct command console_cmds[] = +{ + { "help", &help_command, &help_parse}, + { "loglevel", &help_loglevel, &loglevel_parse}, + { "priority", &help_priority, &priority_parse}, + { NULL, NULL, NULL} /* end of array */ +}; + +static void parse_cmd_line(char *line, osm_opensm_t *p_osm) +{ + char *p_cmd, *p_last; + int i, found = 0; + + /* find first token which is the command */ + p_cmd = strtok_r(line, " \t\n", &p_last); + if (p_cmd) { + for (i = 0; console_cmds[i].name; i++) { + if (!strcmp(p_cmd, console_cmds[i].name)) { + found = 1; + console_cmds[i].parse_function(&p_last, p_osm); + break; + } + } + if (!found) { + printf("Command %s not found\n\n", p_cmd); + help_command(); + } + } else { + printf("Error parsing command line: %s\n", line); + return; + } +} + +void osm_console(osm_opensm_t *p_osm) +{ + char *p_line; + size_t len; + ssize_t n; + + printf("\nOpenSM Console\n\n"); + while (1) { + printf("%s", OSM_COMMAND_PROMPT); + p_line = NULL; + /* Get input line */ + n = getline(&p_line, &len, stdin); + if (n > 0) { + /* Parse and act on input */ + parse_cmd_line(p_line, p_osm); + free(p_line); + } else { + printf("Input error\n"); + fflush(stdin); + } + } +} + diff --git a/trunk/ulp/opensm/user/opensm/osm_db_files.c b/trunk/ulp/opensm/user/opensm/osm_db_files.c index 05be9ce5..9d53f4b9 100644 --- a/trunk/ulp/opensm/user/opensm/osm_db_files.c +++ b/trunk/ulp/opensm/user/opensm/osm_db_files.c @@ -123,6 +123,7 @@ osm_db_domain_destroy( { osm_db_domain_imp_t *p_domain_imp; p_domain_imp = (osm_db_domain_imp_t *)p_db_domain->p_domain_imp; + osm_db_clear( p_db_domain ); cl_spinlock_destroy( &p_domain_imp->lock ); @@ -168,19 +169,19 @@ osm_db_init( if ( p_db_imp->db_dir_name == NULL ) p_db_imp->db_dir_name = OSM_DEFAULT_CACHE_DIR; - /* create the directory if it doesn't exist */ - /* There is difference between creating in windows and in linux */ + /* Create the directory if it doesn't exist */ + /* There is a difference in creating directory between windows and linux */ #ifdef __WIN__ /* Check if the directory exists. If not - create it. */ CreateDirectory(p_db_imp->db_dir_name, NULL); #else /* __WIN__ */ - /* make sure the directory exists, also if it is a link */ + /* make sure the directory exists */ if (lstat(p_db_imp->db_dir_name, &dstat)) { if (mkdir(p_db_imp->db_dir_name, 777)) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_init: ERR 6901: " + "osm_db_init: ERR 6101: " " Fail to create the db directory:%s\n", p_db_imp->db_dir_name); OSM_LOG_EXIT( p_log ); @@ -236,7 +237,7 @@ osm_db_domain_init( if (! p_file) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_domain_init: ERR 6902: " + "osm_db_domain_init: ERR 6102: " " Fail to open the db file:%s\n", p_domain_imp->file_name); cl_free(p_domain_imp); @@ -291,7 +292,7 @@ osm_db_restore( if (! p_file) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_restore: ERR 6903: " + "osm_db_restore: ERR 6103: " " Fail to open the db file:%s\n", p_domain_imp->file_name); status = 1; @@ -330,9 +331,10 @@ osm_db_restore( if (! p_first_word) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_restore: ERR 6904: " + "osm_db_restore: ERR 6104: " " Fail to get key from line:%u : %s\n", line_num, sLine); + status = 1; goto EndParsing; } @@ -355,7 +357,7 @@ osm_db_restore( else if (sLine[0] != '\n') { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_restore: ERR 6905: " + "osm_db_restore: ERR 6105: " " How did we get here? line:%u : %s\n", line_num, sLine); status = 1; @@ -377,9 +379,9 @@ osm_db_restore( (st_data_t*)&p_prev_val)) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_restore: ERR 6906: " + "osm_db_restore: ERR 6106: " " Key:%s already exists in:%s with value:%s." - " Removing it.\n", + " Removing it\n", p_key, p_domain_imp->file_name, p_prev_val); @@ -453,11 +455,10 @@ osm_db_store( /* open up the output file */ p_file = fopen(p_tmp_file_name, "w"); - if (! p_file) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_store: ERR 6907: " + "osm_db_store: ERR 6107: " " Fail to open the db file:%s for writing\n", p_domain_imp->file_name); status = 1; @@ -472,15 +473,16 @@ osm_db_store( if (status) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_store: ERR 6909: " + "osm_db_store: ERR 6109: " " Fail to remove file:%s (err:%u)\n", p_domain_imp->file_name, status); } + status = rename(p_tmp_file_name, p_domain_imp->file_name); if (status) { osm_log( p_log, OSM_LOG_ERROR, - "osm_db_store: ERR 6908: " + "osm_db_store: ERR 6108: " " Fail to rename the db file to:%s (err:%u)\n", p_domain_imp->file_name, status); } @@ -588,7 +590,7 @@ osm_db_update( { osm_log( p_log, OSM_LOG_DEBUG, "osm_db_update: " - " Key:%s previously exists in:%s with value:%s.\n", + " Key:%s previously exists in:%s with value:%s\n", p_key, p_domain_imp->file_name, p_prev_val); @@ -638,7 +640,7 @@ osm_db_delete( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_delete: " - " key:%s still exists in:%s with value:%s.\n", + " key:%s still exists in:%s with value:%s\n", p_key, p_domain_imp->file_name, p_prev_val); diff --git a/trunk/ulp/opensm/user/opensm/osm_db_pack.c b/trunk/ulp/opensm/user/opensm/osm_db_pack.c index 9d6df773..bf45d77f 100644 --- a/trunk/ulp/opensm/user/opensm/osm_db_pack.c +++ b/trunk/ulp/opensm/user/opensm/osm_db_pack.c @@ -37,6 +37,7 @@ #endif /* HAVE_CONFIG_H */ #include +#include #include static inline void __osm_pack_guid(uint64_t guid, char *p_guid_str) diff --git a/trunk/ulp/opensm/user/opensm/osm_drop_mgr.c b/trunk/ulp/opensm/user/opensm/osm_drop_mgr.c index 1e75ef5f..ed8933b4 100644 --- a/trunk/ulp/opensm/user/opensm/osm_drop_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_drop_mgr.c @@ -68,6 +68,7 @@ void osm_drop_mgr_construct( IN osm_drop_mgr_t* const p_mgr ) { + CL_ASSERT( p_mgr ); cl_memclr( p_mgr, sizeof(*p_mgr) ); } @@ -77,9 +78,10 @@ void osm_drop_mgr_destroy( IN osm_drop_mgr_t* const p_mgr ) { + CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_drop_mgr_destroy ); - CL_ASSERT( p_mgr ); OSM_LOG_EXIT( p_mgr->p_log ); } @@ -94,6 +96,7 @@ osm_drop_mgr_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_drop_mgr_init ); osm_drop_mgr_construct( p_mgr ); @@ -144,7 +147,7 @@ __osm_drop_mgr_remove_port( port_guid = osm_port_get_guid( p_port ); osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_remove_port: " - "Unreachable port 0x%016" PRIx64 ".\n", + "Unreachable port 0x%016" PRIx64 "\n", cl_ntoh64( port_guid ) ); /* @@ -175,7 +178,7 @@ __osm_drop_mgr_remove_port( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_drop_mgr_remove_port: ERR 0101: " - "Port 0x%016" PRIx64 " not in guid table.\n", + "Port 0x%016" PRIx64 " not in guid table\n", cl_ntoh64( port_guid ) ); goto Exit; } @@ -195,7 +198,7 @@ __osm_drop_mgr_remove_port( osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_remove_port: " - "Clearing abandoned LID range [0x%X,0x%X].\n", + "Clearing abandoned LID range [0x%X,0x%X]\n", min_lid_ho, max_lid_ho ); for( lid_ho = min_lid_ho; lid_ho <= max_lid_ho; lid_ho++ ) @@ -238,7 +241,7 @@ __osm_drop_mgr_remove_port( "__osm_drop_mgr_remove_port: " "Forcing delayed heavy sweep. Remote " "port 0x%016" PRIx64 " port num: 0x%X " - "was recognized in ACTIVE state \n", + "was recognized in ACTIVE state\n", cl_ntoh64( p_remote_physp->port_guid ), remote_port_num ); p_mgr->p_subn->force_delayed_heavy_sweep = TRUE; @@ -249,7 +252,7 @@ __osm_drop_mgr_remove_port( "__osm_drop_mgr_remove_port: " "Unlinking local node 0x%016" PRIx64 ", port 0x%X" "\n\t\t\t\tand remote node 0x%016" PRIx64 - ", port 0x%X.\n", + ", port 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num, cl_ntoh64( osm_node_get_node_guid( p_remote_node ) ), @@ -269,7 +272,7 @@ __osm_drop_mgr_remove_port( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_drop_mgr_remove_port: " "resetting discovery count of node: " - "0x%016" PRIx64 " port num:%u.\n", + "0x%016" PRIx64 " port num:%u\n", cl_ntoh64( osm_node_get_node_guid( p_remote_node ) ), remote_port_num ); } @@ -278,7 +281,7 @@ __osm_drop_mgr_remove_port( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_drop_mgr_remove_port: " - "Clearing physical port number %u.\n", + "Clearing physical port number %u\n", port_num ); osm_physp_destroy( p_physp ); @@ -330,13 +333,13 @@ __osm_drop_mgr_remove_port( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_drop_mgr_remove_port: ERR 0103: " - "Error sending trap reports (%s).\n", + "Error sending trap reports (%s)\n", ib_get_err_str( status ) ); goto Exit; } osm_log( p_mgr->p_log, OSM_LOG_INFO, "Removed port with GUID:0x%016" PRIx64 - " LID range [0x%X,0x%X] of node:%s \n", + " LID range [0x%X,0x%X] of node:%s\n", cl_ntoh64( port_gid.unicast.interface_id ), min_lid_ho, max_lid_ho, p_node_desc ); @@ -365,7 +368,7 @@ __osm_drop_mgr_remove_switch( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_drop_mgr_remove_switch: ERR 0102: " - "Node 0x%016" PRIx64 " not in switch table.\n", + "Node 0x%016" PRIx64 " not in switch table\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); } else @@ -390,7 +393,7 @@ __osm_drop_mgr_remove_router( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_drop_mgr_remove_router: ERR 0106: " - "Routers are not supported.\n" ); + "Routers are not supported\n" ); OSM_LOG_EXIT( p_mgr->p_log ); } @@ -416,7 +419,7 @@ __osm_drop_mgr_process_node( osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_process_node: " - "Unreachable node 0x%016" PRIx64 ".\n", + "Unreachable node 0x%016" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); /* @@ -460,7 +463,7 @@ __osm_drop_mgr_process_node( default: osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_drop_mgr_process_node: ERR 0104: " - "Node 0x%016" PRIx64 " unknown node type: %u.\n", + "Node 0x%016" PRIx64 " unknown node type: %u\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), osm_node_get_type( p_node ) ); break; @@ -472,7 +475,7 @@ __osm_drop_mgr_process_node( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_drop_mgr_process_node: ERR 0105: " - "Node 0x%016" PRIx64 " not in guid table.\n", + "Node 0x%016" PRIx64 " not in guid table\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); } @@ -520,7 +523,7 @@ __osm_drop_mgr_check_node( /* We do not have switch info for this node */ osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_check_node: " - "Node 0x%016" PRIx64 " no switch in table.\n", + "Node 0x%016" PRIx64 " no switch in table\n", cl_ntoh64( node_guid ) ); __osm_drop_mgr_process_node( p_mgr, p_node ); @@ -534,7 +537,7 @@ __osm_drop_mgr_check_node( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_check_node: " - "Node 0x%016" PRIx64 " no valid physical port 0.\n", + "Node 0x%016" PRIx64 " no valid physical port 0\n", cl_ntoh64( node_guid ) ); __osm_drop_mgr_process_node( p_mgr, p_node ); @@ -550,7 +553,7 @@ __osm_drop_mgr_check_node( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_check_node: " - "Node 0x%016" PRIx64 " no port object.\n", + "Node 0x%016" PRIx64 " no port object\n", cl_ntoh64( node_guid ) ); __osm_drop_mgr_process_node( p_mgr, p_node ); @@ -561,7 +564,7 @@ __osm_drop_mgr_check_node( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_drop_mgr_check_node: " - "Node 0x%016" PRIx64 " port has discovery count zero.\n", + "Node 0x%016" PRIx64 " port has discovery count zero\n", cl_ntoh64( node_guid ) ); __osm_drop_mgr_process_node( p_mgr, p_node ); @@ -591,10 +594,10 @@ osm_drop_mgr_process( uint8_t port_num; osm_physp_t *p_physp; - OSM_LOG_ENTER( p_mgr->p_log, osm_drop_mgr_process ); - CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_drop_mgr_process ); + p_node_guid_tbl = &p_mgr->p_subn->node_guid_tbl; p_port_guid_tbl = &p_mgr->p_subn->port_guid_tbl; p_lsweep_ports = &p_mgr->p_subn->light_sweep_physp_list; @@ -615,7 +618,7 @@ osm_drop_mgr_process( node_guid = osm_node_get_node_guid( p_node ); osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_drop_mgr_process: " - "Checking node 0x%016" PRIx64 ".\n", + "Checking node 0x%016" PRIx64 "\n", cl_ntoh64( node_guid ) ); } @@ -630,7 +633,7 @@ osm_drop_mgr_process( /* Go over all the nodes. If the node is a switch - make sure - there is also a switch record for it, and portInfo record for + there is also a switch record for it, and a portInfo record for port zero of of the node. If not - this means that there was some error in getting the data of this node. Drop the node. @@ -646,7 +649,7 @@ osm_drop_mgr_process( node_guid = osm_node_get_node_guid( p_node ); osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_drop_mgr_process: " - "Checking full discovery of node 0x%016" PRIx64 ".\n", + "Checking full discovery of node 0x%016" PRIx64 "\n", cl_ntoh64( node_guid ) ); } @@ -671,7 +674,7 @@ osm_drop_mgr_process( port_guid = osm_port_get_guid( p_port ); osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_drop_mgr_process: " - "Checking port 0x%016" PRIx64 ".\n", + "Checking port 0x%016" PRIx64 "\n", cl_ntoh64( port_guid ) ); } @@ -704,7 +707,7 @@ osm_drop_mgr_process( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_drop_mgr_process: ERR 0108: " "Unknown remote side for node 0x%016" PRIx64 - " port %u. Adding to light sweep sampling list.\n", + " port %u. Adding to light sweep sampling list\n", cl_ntoh64( osm_node_get_node_guid( p_node )), port_num); diff --git a/trunk/ulp/opensm/user/opensm/osm_fwd_tbl.c b/trunk/ulp/opensm/user/opensm/osm_fwd_tbl.c index 6edfad63..89d735be 100644 --- a/trunk/ulp/opensm/user/opensm/osm_fwd_tbl.c +++ b/trunk/ulp/opensm/user/opensm/osm_fwd_tbl.c @@ -63,6 +63,7 @@ osm_fwd_tbl_init( { uint16_t tbl_cap; ib_api_status_t status = IB_SUCCESS; + /* Determine the type and size of the forwarding table used by this switch, then initialize accordingly. diff --git a/trunk/ulp/opensm/user/opensm/osm_inform.c b/trunk/ulp/opensm/user/opensm/osm_inform.c index 655e9691..7a7c89c4 100644 --- a/trunk/ulp/opensm/user/opensm/osm_inform.c +++ b/trunk/ulp/opensm/user/opensm/osm_inform.c @@ -46,6 +46,7 @@ # include #endif /* HAVE_CONFIG_H */ +#include #include #include #include @@ -130,7 +131,6 @@ __match_rid_of_inf_rec( osm_infr_t* p_infr = (osm_infr_t*)p_list_item; int32_t count; - count = cl_memcmp( &p_infr->inform_record, p_infr_rec, @@ -146,7 +146,6 @@ __match_rid_of_inf_rec( /********************************************************************** **********************************************************************/ - osm_infr_t* osm_infr_get_by_rid( IN osm_subn_t const *p_subn, @@ -154,6 +153,7 @@ osm_infr_get_by_rid( IN ib_inform_info_record_t* const p_infr_rec ) { cl_list_item_t* p_list_item; + OSM_LOG_ENTER( p_log, osm_infr_get_by_rid ); p_list_item = cl_qlist_find_from_head( @@ -168,7 +168,6 @@ osm_infr_get_by_rid( return (osm_infr_t*)p_list_item; } - /********************************************************************** **********************************************************************/ void @@ -177,6 +176,7 @@ __dump_all_informs( IN osm_log_t *p_log) { cl_list_item_t* p_list_item; + OSM_LOG_ENTER( p_log, __dump_all_informs ); p_list_item = cl_qlist_head( &p_subn->sa_infr_list ); @@ -229,9 +229,9 @@ __match_inf_rec( return status; } + /********************************************************************** **********************************************************************/ - osm_infr_t* osm_infr_get_by_rec( IN osm_subn_t const *p_subn, @@ -272,12 +272,11 @@ osm_infr_insert_to_db( IN osm_log_t *p_log, IN osm_infr_t *p_infr) { - OSM_LOG_ENTER( p_log, osm_infr_insert_to_db ); osm_log( p_log, OSM_LOG_DEBUG, "osm_infr_insert_to_db: " - "Inserting a new InformInfo Record:\n"); + "Inserting a new InformInfo Record into Database\n"); osm_log( p_log, OSM_LOG_DEBUG, "osm_infr_insert_to_db: " "Dump before insertion (size : %d) : \n", @@ -372,7 +371,7 @@ osm_send_report( { osm_log(p_log, OSM_LOG_ERROR, "osm_send_report: ERR 0203: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); status = IB_ERROR; goto Exit; } @@ -437,6 +436,7 @@ __match_notice_to_inf_rec( osm_port_t* p_dest_port; OSM_LOG_ENTER( p_log, __match_notice_to_inf_rec ); + /* matching rules * InformInfo Notice * GID IssuerGID if non zero must match the trap @@ -715,4 +715,3 @@ osm_report_notice( return(IB_SUCCESS); } - diff --git a/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c b/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c index c42ab7d5..a4c469ed 100644 --- a/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c @@ -170,7 +170,7 @@ __osm_lid_mgr_validate_db( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_validate_db: ERR 0310: " - "could not get guid list.\n"); + "could not get guid list\n"); goto Exit; } @@ -181,7 +181,7 @@ __osm_lid_mgr_validate_db( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_validate_db: ERR 0311: " - "could not get lid for guid:0x%016" PRIx64".\n", + "could not get lid for guid:0x%016" PRIx64 "\n", p_item->guid ); } @@ -195,7 +195,7 @@ __osm_lid_mgr_validate_db( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_validate_db: ERR 0312: " "Illegal LID range [0x%x:0x%x] for guid:0x%016" PRIx64 - ".\n", + "\n", min_lid, max_lid, p_item->guid ); lids_ok = FALSE; @@ -207,7 +207,7 @@ __osm_lid_mgr_validate_db( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_validate_db: ERR 0313: " "LID range [0x%x:0x%x] for guid:0x%016" PRIx64 - " is not aligned acording to mask:0x%04x.\n", + " is not aligned acording to mask:0x%04x\n", min_lid, max_lid, p_item->guid, lmc_mask ); lids_ok = FALSE; @@ -223,7 +223,7 @@ __osm_lid_mgr_validate_db( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_validate_db: ERR 0314: " "0x%04x for guid:0x%016" PRIx64 - " was previously used.\n", + " was previously used\n", lid, p_item->guid ); lids_ok = FALSE; @@ -237,7 +237,7 @@ __osm_lid_mgr_validate_db( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_validate_db: ERR 0315: " "failed to delete entry for guid:0x%016" PRIx64 - ".\n", + "\n", p_item->guid ); } @@ -288,7 +288,7 @@ osm_lid_mgr_init( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_lid_mgr_init: ERR 0316: " - "Error initializing Guid-to-Lid persistent database.\n"); + "Error initializing Guid-to-Lid persistent database\n"); status = IB_ERROR; goto Exit; } @@ -303,7 +303,7 @@ osm_lid_mgr_init( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_lid_mgr_init: ERR 0317: " - "Error restoring Guid-to-Lid persistent database.\n"); + "Error restoring Guid-to-Lid persistent database\n"); status = IB_ERROR; goto Exit; } @@ -313,7 +313,7 @@ osm_lid_mgr_init( __osm_lid_mgr_validate_db(p_mgr); } - Exit: +Exit: OSM_LOG_EXIT( p_mgr->p_log ); return( status ); } @@ -328,7 +328,6 @@ int __osm_lid_mgr_init_sweep( IN osm_lid_mgr_t* const p_mgr ) { - cl_ptr_vector_t *p_discovered_vec = &p_mgr->p_subn->port_lid_tbl; cl_ptr_vector_t *p_persistent_vec = &p_mgr->used_lids; uint16_t max_defined_lid; @@ -385,7 +384,7 @@ __osm_lid_mgr_init_sweep( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_init_sweep: " - "Skipping all lids - as we are reassigning them.\n"); + "Skipping all lids - as we are reassigning them\n"); p_range = (osm_lid_mgr_range_t *)cl_malloc(sizeof(osm_lid_mgr_range_t)); p_range->min_lid = 1; @@ -470,7 +469,7 @@ __osm_lid_mgr_init_sweep( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_init_sweep: " - "0x%04x is not free as its mapped by the persistent db.\n", + "0x%04x is not free as its mapped by the persistent db\n", lid); is_free = FALSE; } @@ -488,16 +487,16 @@ __osm_lid_mgr_init_sweep( b. Make sure all needed lids (for the lmc) are free according to persistency table. */ - /* qualify the guid of the port is not persistently mapped to - another range */ - if (!osm_db_guid2lid_get( p_mgr->p_g2l, - cl_ntoh64(osm_port_get_guid(p_port)), - &db_min_lid, &db_max_lid)) - { + /* qualify the guid of the port is not persistently mapped to + another range */ + if (!osm_db_guid2lid_get( p_mgr->p_g2l, + cl_ntoh64(osm_port_get_guid(p_port)), + &db_min_lid, &db_max_lid)) + { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_init_sweep: " "0x%04x is free as it was discovered " - "but mapped by the persistent db to [0x%04x:0x%04x].\n", + "but mapped by the persistent db to [0x%04x:0x%04x]\n", lid, db_min_lid, db_max_lid); } else @@ -511,48 +510,48 @@ __osm_lid_mgr_init_sweep( { disc_max_lid = disc_min_lid + lmc_num_lids - 1; num_lids = lmc_num_lids; - } - else - { + } + else + { num_lids = 1; } /* Make sure the lid is aligned */ if ((num_lids != 1) && ((disc_min_lid & lmc_mask) != disc_min_lid)) { /* The lid cannot be used */ - osm_log( p_mgr->p_log, OSM_LOG_DEBUG, - "__osm_lid_mgr_init_sweep: " + osm_log( p_mgr->p_log, OSM_LOG_DEBUG, + "__osm_lid_mgr_init_sweep: " "0x%04x is free as it was discovered " - "but not aligned. \n", + "but not aligned\n", lid ); - } - else - { + } + else + { /* check that all needed lids are not persistently mapped */ is_free = FALSE; for ( req_lid = disc_min_lid + 1 ; req_lid <= disc_max_lid ; req_lid++ ) { if ((req_lid <= max_persistent_lid) && cl_ptr_vector_get(p_persistent_vec, req_lid)) { - osm_log( p_mgr->p_log, OSM_LOG_DEBUG, - "__osm_lid_mgr_init_sweep: " + osm_log( p_mgr->p_log, OSM_LOG_DEBUG, + "__osm_lid_mgr_init_sweep: " "0x%04x is free as it was discovered " - "but mapped. \n", - lid); + "but mapped\n", + lid); is_free = TRUE; break; } - } - if (is_free == FALSE) - { + } + if (is_free == FALSE) + { /* This port will use its local lid, and consume the entire required lid range. Thus we can skip that range. */ /* If the disc_max_lid is greater then lid - we can skip right to it, since we've done all neccessary checks on the lids in between. */ if (disc_max_lid > lid) lid = disc_max_lid; - } - } + } + } } } } @@ -669,10 +668,9 @@ __osm_lid_mgr_find_free_lid_range( uint8_t lmc_num_lids; uint16_t lmc_mask; - osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_find_free_lid_range: " - "LMC = %u, number LIDs = %u.\n", + "LMC = %u, number LIDs = %u\n", p_mgr->p_subn->opt.lmc, num_lids ); lmc_num_lids = (1 << p_mgr->p_subn->opt.lmc ); @@ -735,9 +733,9 @@ __osm_lid_mgr_find_free_lid_range( /********************************************************************** **********************************************************************/ void -__osm_lid_mgr_cleanup_discovered_port_lid_range( - IN osm_lid_mgr_t* p_mgr, - IN osm_port_t *p_port ) + __osm_lid_mgr_cleanup_discovered_port_lid_range( + IN osm_lid_mgr_t* p_mgr, + IN osm_port_t *p_port ) { cl_ptr_vector_t *p_discovered_vec = &p_mgr->p_subn->port_lid_tbl; uint16_t lid, min_lid, max_lid; @@ -806,7 +804,7 @@ __osm_lid_mgr_get_port_lid( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_get_port_lid: " "0x%016" PRIx64 - " with lid:0x%04x does not matches its known lid:0x%04x\n", + " with lid:0x%04x does not match its known lid:0x%04x\n", guid, cl_ntoh16(osm_port_get_base_lid(p_port)), min_lid); __osm_lid_mgr_cleanup_discovered_port_lid_range( p_mgr, p_port ); /* we still need to send the setting to the target port */ @@ -818,7 +816,7 @@ __osm_lid_mgr_get_port_lid( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_get_port_lid: " - "0x%016" PRIx64" has no persistent lid assigned.\n", + "0x%016" PRIx64" has no persistent lid assigned\n", guid); } @@ -851,7 +849,7 @@ __osm_lid_mgr_get_port_lid( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_get_port_lid: " "0x%016" PRIx64 - " existing lid range:[0x%x:0x%x] is not free.\n", + " existing lid range:[0x%x:0x%x] is not free\n", guid, min_lid, min_lid + num_lids - 1); } } @@ -860,7 +858,7 @@ __osm_lid_mgr_get_port_lid( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_get_port_lid: " "0x%016" PRIx64 - " existing lid range:[0x%x:0x%x] is not lmc aligned.\n", + " existing lid range:[0x%x:0x%x] is not lmc aligned\n", guid, min_lid, min_lid + num_lids - 1); } } @@ -896,6 +894,7 @@ __osm_lid_mgr_get_port_lid( static boolean_t __osm_lid_mgr_set_physp_pi( IN osm_lid_mgr_t * const p_mgr, + IN osm_port_t* const p_port, IN osm_physp_t* const p_physp, IN ib_net16_t const lid ) { @@ -909,6 +908,7 @@ __osm_lid_mgr_set_physp_pi( uint8_t op_vls; uint8_t port_num; boolean_t send_set = FALSE; + boolean_t new_port = FALSE; OSM_LOG_ENTER( p_mgr->p_log, __osm_lid_mgr_set_physp_pi ); @@ -936,7 +936,7 @@ __osm_lid_mgr_set_physp_pi( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_set_physp_pi: " - "Skipping switch port %u, GUID = 0x%016" PRIx64 ".\n", + "Skipping switch port %u, GUID = 0x%016" PRIx64 "\n", port_num, cl_ntoh64( osm_physp_get_port_guid( p_physp ) ) ); } @@ -1094,14 +1094,14 @@ __osm_lid_mgr_set_physp_pi( To reset the port state machine we can send PortInfo.State = DOWN. (see: 7.2.7 p161 lines:10-19.) */ - if ( (mtu != ib_port_info_get_mtu_cap( p_old_pi )) || + if ( (mtu != ib_port_info_get_neighbor_mtu( p_old_pi )) || (op_vls != ib_port_info_get_op_vls(p_old_pi))) { if( osm_log_is_active( p_mgr->p_log, OSM_LOG_DEBUG ) ) { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_set_physp_pi: " - "Sending Link Down due to op_vls or mtu change. MTU:%u,%u VL_CAP:%u,%u \n", + "Sending Link Down due to op_vls or mtu change. MTU:%u,%u VL_CAP:%u,%u\n", mtu, ib_port_info_get_mtu_cap( p_old_pi ), op_vls, ib_port_info_get_op_vls(p_old_pi) ); @@ -1139,18 +1139,28 @@ __osm_lid_mgr_set_physp_pi( /* We need to set the cli_rereg bit when we are in first_time_master_sweep for ports supporting the ClientReregistration Vol1 (v1.2) p811 14.4.11 + Also, if this port was just now discovered, then we should also set the + cli_rereg bit. We know that the port was just discovered if it is in + the p_subn->new_ports_list list. */ - if ( ( p_mgr->p_subn->first_time_master_sweep == TRUE ) && + if ( cl_is_object_in_list(&p_mgr->p_subn->new_ports_list, p_port) ) + { + /* p_port is in new_ports_list, mark new_port as TRUE */ + new_port = TRUE; + } + + if ( ( p_mgr->p_subn->first_time_master_sweep == TRUE || + new_port == TRUE ) && ( (p_old_pi->capability_mask & IB_PORT_CAP_HAS_CLIENT_REREG) != 0 ) ) ib_port_info_set_client_rereg( p_pi, 1 ); else ib_port_info_set_client_rereg( p_pi, 0 ); - /* We need to send the PortInfoSet request with the new sm_lid + /* We need to send the PortInfo Set request with the new sm_lid in the following cases: 1. There is a change in the values (send_set == TRUE) 2. first_time_master_sweep flag on the subnet is TRUE. This means the - SM just became master, and it then needs to send at PortInfoSet to + SM just became master, and it then needs to send a PortInfo Set to every port. 3. got_set_resp on the physical port is FALSE. This means we haven't seen this port before - need to send Set of PortInfo to it. @@ -1202,7 +1212,7 @@ __osm_lid_mgr_process_our_sm_node( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_lid_mgr_process_our_sm_node: ERR 0308: " - "Can't acquire SM's Port object, GUID = 0x%016" PRIx64 ".\n", + "Can't acquire SM's Port object, GUID = 0x%016" PRIx64 "\n", cl_ntoh64( p_mgr->p_subn->sm_port_guid ) ); res = FALSE; goto Exit; @@ -1219,7 +1229,7 @@ __osm_lid_mgr_process_our_sm_node( __osm_lid_mgr_get_port_lid(p_mgr, p_port, &min_lid_ho, &max_lid_ho); osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_lid_mgr_process_our_sm_node: " - "Current base LID is 0x%X.\n", min_lid_ho ); + "Current base LID is 0x%X\n", min_lid_ho ); /* Update subnet object. */ @@ -1231,7 +1241,7 @@ __osm_lid_mgr_process_our_sm_node( osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_lid_mgr_process_our_sm_node: " "Assigning SM's port 0x%016" PRIx64 - "\n\t\t\t\tto LID range [0x%X,0x%X].\n", + "\n\t\t\t\tto LID range [0x%X,0x%X]\n", cl_ntoh64( osm_port_get_guid( p_port ) ), min_lid_ho, max_lid_ho ); } @@ -1242,7 +1252,7 @@ __osm_lid_mgr_process_our_sm_node( */ p_physp = osm_port_get_default_phys_ptr( p_port ); - __osm_lid_mgr_set_physp_pi( p_mgr, p_physp, cl_hton16( min_lid_ho ) ); + __osm_lid_mgr_set_physp_pi( p_mgr, p_port, p_physp, cl_hton16( min_lid_ho ) ); Exit: OSM_LOG_EXIT( p_mgr->p_log ); @@ -1311,10 +1321,10 @@ osm_lid_mgr_process_subnet( osm_physp_t *p_physp; int lid_changed; - OSM_LOG_ENTER( p_mgr->p_log, osm_lid_mgr_process_subnet ); - CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_lid_mgr_process_subnet ); + CL_PLOCK_EXCL_ACQUIRE( p_mgr->p_lock ); CL_ASSERT( p_mgr->p_subn->sm_port_guid ); @@ -1344,7 +1354,7 @@ osm_lid_mgr_process_subnet( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_lid_mgr_process_subnet: " - "Skipping our own port 0x%016" PRIx64 ".\n", + "Skipping our own port 0x%016" PRIx64 "\n", cl_ntoh64( port_guid ) ); } else @@ -1366,7 +1376,7 @@ osm_lid_mgr_process_subnet( p_physp = osm_port_get_default_phys_ptr( p_port ); /* the proc returns the fact it sent a set port info */ - if (__osm_lid_mgr_set_physp_pi( p_mgr, p_physp, cl_hton16( min_lid_ho ))) + if (__osm_lid_mgr_set_physp_pi( p_mgr, p_port, p_physp, cl_hton16( min_lid_ho ))) p_mgr->send_set_reqs = TRUE; } } /* all ports */ diff --git a/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv.c b/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv.c index b725b2b3..b358cec7 100644 --- a/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv.c @@ -72,9 +72,10 @@ void osm_lft_rcv_destroy( IN osm_lft_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_lft_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } @@ -88,6 +89,7 @@ osm_lft_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_lft_rcv_init ); osm_lft_rcv_construct( p_rcv ); @@ -116,9 +118,10 @@ osm_lft_rcv_process( ib_net64_t node_guid; ib_api_status_t status; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_lft_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_sw_tbl = &p_rcv->p_subn->sw_guid_tbl; @@ -140,7 +143,7 @@ osm_lft_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lft_rcv_process: ERR 0401: " "LFT received for nonexistent node " - "0x%" PRIx64 ".\n", cl_ntoh64( node_guid ) ); + "0x%" PRIx64 "\n", cl_ntoh64( node_guid ) ); } else { @@ -150,7 +153,7 @@ osm_lft_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lft_rcv_process: ERR 0402: " "Setting forwarding table block failed (%s)" - "\n\t\t\t\tSwitch 0x%" PRIx64 ".\n", + "\n\t\t\t\tSwitch 0x%" PRIx64 "\n", ib_get_err_str( status ), cl_ntoh64( node_guid ) ); } diff --git a/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv_ctrl.c index ea3322bf..b6285fb7 100644 --- a/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_lin_fwd_rcv_ctrl.c @@ -84,7 +84,6 @@ osm_lft_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -113,7 +112,7 @@ osm_lft_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_lft_rcv_ctrl_init: ERR 1601: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_link_mgr.c b/trunk/ulp/opensm/user/opensm/osm_link_mgr.c index cf99298c..d0bc8c90 100644 --- a/trunk/ulp/opensm/user/opensm/osm_link_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_link_mgr.c @@ -74,11 +74,9 @@ osm_link_mgr_destroy( { OSM_LOG_ENTER( p_mgr->p_log, osm_link_mgr_destroy ); - OSM_LOG_EXIT( p_mgr->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -165,7 +163,7 @@ osm_link_mgr_set_physp_pi( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_link_mgr_set_physp_pi: " - "Skipping port 0, GUID = 0x%016" PRIx64 ".\n", + "Skipping port 0, GUID = 0x%016" PRIx64 "\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ) ); } goto Exit; @@ -383,7 +381,7 @@ __osm_link_mgr_process_port( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_link_mgr_process_port: " - "Port 0x%" PRIx64 " going to %s.\n", + "Port 0x%" PRIx64 " going to %s\n", cl_ntoh64( osm_port_get_guid( p_port ) ), ib_get_port_state_str( link_state ) ); } @@ -432,7 +430,7 @@ __osm_link_mgr_process_port( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_link_mgr_process_port: " - "Physical port 0x%X already %s. Skipping.\n", + "Physical port 0x%X already %s. Skipping\n", osm_physp_get_port_num( p_physp ), ib_get_port_state_str( current_state ) ); } diff --git a/trunk/ulp/opensm/user/opensm/osm_matrix.c b/trunk/ulp/opensm/user/opensm/osm_matrix.c index 3c3dc485..26763e82 100644 --- a/trunk/ulp/opensm/user/opensm/osm_matrix.c +++ b/trunk/ulp/opensm/user/opensm/osm_matrix.c @@ -68,6 +68,7 @@ __osm_lid_matrix_vec_init( IN void* context ) { osm_lid_matrix_t* const p_lmx = (osm_lid_matrix_t*)context; + cl_memset( p_elem, OSM_NO_PATH, p_lmx->num_ports + 1); return( CL_SUCCESS ); } @@ -82,6 +83,7 @@ __osm_lid_matrix_vec_clear( IN void* context ) { osm_lid_matrix_t* const p_lmx = (osm_lid_matrix_t*)context; + UNUSED_PARAM( index ); cl_memset( p_elem, OSM_NO_PATH, p_lmx->num_ports + 1); } diff --git a/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv.c b/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv.c index 6c0a519c..abe35ab7 100644 --- a/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv.c @@ -74,13 +74,13 @@ void osm_mft_rcv_destroy( IN osm_mft_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_mft_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -91,6 +91,7 @@ osm_mft_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_mft_rcv_init ); osm_mft_rcv_construct( p_rcv ); @@ -120,9 +121,10 @@ osm_mft_rcv_process( ib_net64_t node_guid; ib_api_status_t status; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_mft_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_sw_tbl = &p_rcv->p_subn->sw_guid_tbl; @@ -143,7 +145,7 @@ osm_mft_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mft_rcv_process: " "Setting MFT block %u, position %u" - "\n\t\t\t\tSwitch 0x%016" PRIx64 ", TID 0x%" PRIx64 ".\n", + "\n\t\t\t\tSwitch 0x%016" PRIx64 ", TID 0x%" PRIx64 "\n", block_num, position, cl_ntoh64( node_guid ), cl_ntoh64( p_smp->trans_id ) ); } @@ -156,7 +158,7 @@ osm_mft_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mft_rcv_process: ERR 0801: " "LFT received for nonexistent node " - "0x%016" PRIx64 ".\n", cl_ntoh64( node_guid ) ); + "0x%016" PRIx64 "\n", cl_ntoh64( node_guid ) ); } else { @@ -168,7 +170,7 @@ osm_mft_rcv_process( "osm_mft_rcv_process: ERR 0802: " "Setting forwarding table block failed (%s)" "\n\t\t\t\tSwitch 0x%016" PRIx64 - ", block_num = %u, position = %u.\n", + ", block_num = %u, position = %u\n", ib_get_err_str( status ), cl_ntoh64( node_guid ), block_num, position ); diff --git a/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv_ctrl.c index 078c16d2..832914a9 100644 --- a/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_mcast_fwd_rcv_ctrl.c @@ -84,7 +84,6 @@ osm_mft_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -113,7 +112,7 @@ osm_mft_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_mft_rcv_ctrl_init: ERR 0901: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c b/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c index 4401c96b..8dcf6cf2 100644 --- a/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c @@ -141,13 +141,13 @@ __osm_mcast_mgr_purge_tree( /********************************************************************** **********************************************************************/ -uint32_t +float osm_mcast_mgr_compute_avg_hops( osm_mcast_mgr_t* const p_mgr, const osm_mgrp_t* const p_mgrp, const osm_switch_t* const p_sw ) { - uint32_t avg_hops = 0; + float avg_hops = 0; uint32_t hops = 0; uint32_t num_ports = 0; uint16_t base_lid_ho; @@ -180,7 +180,7 @@ osm_mcast_mgr_compute_avg_hops( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_compute_avg_hops: ERR 0A18: " - "No port object for port 0x%016" PRIx64 ".\n", + "No port object for port 0x%016" PRIx64 "\n", cl_ntoh64( ib_gid_get_guid( &p_mcm_port->port_gid ) ) ); continue; } @@ -197,7 +197,7 @@ osm_mcast_mgr_compute_avg_hops( if( num_ports != 0 ) { - avg_hops = hops / num_ports; + avg_hops = (float)(hops / num_ports); } OSM_LOG_EXIT( p_mgr->p_log ); @@ -208,7 +208,7 @@ osm_mcast_mgr_compute_avg_hops( Calculate the maximal "min hops" from the given switch to any of the group HCAs **********************************************************************/ -uint32_t +float osm_mcast_mgr_compute_max_hops( osm_mcast_mgr_t* const p_mgr, const osm_mgrp_t* const p_mgrp, @@ -247,7 +247,7 @@ osm_mcast_mgr_compute_max_hops( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_compute_max_hops: ERR 0A18: " - "No port object for port 0x%016" PRIx64 ".\n", + "No port object for port 0x%016" PRIx64 "\n", cl_ntoh64( ib_gid_get_guid( &p_mcm_port->port_gid ) ) ); continue; } @@ -266,7 +266,7 @@ osm_mcast_mgr_compute_max_hops( } OSM_LOG_EXIT( p_mgr->p_log ); - return( max_hops ); + return(float)(max_hops); } /********************************************************************** @@ -283,8 +283,8 @@ __osm_mcast_mgr_find_optimal_switch( cl_qmap_t* p_sw_tbl; const osm_switch_t* p_sw; const osm_switch_t* p_best_sw = NULL; - uint32_t hops = 0; - uint32_t best_hops = 10000; /* any big # will do */ + float hops = 0; + float best_hops = 10000; /* any big # will do */ uint64_t sw_guid_ho; #ifdef OSM_VENDOR_INTF_ANAFA boolean_t use_avg_hops = TRUE; /* anafa2 - bug hca on switch */ /* use max hops for root */ @@ -317,7 +317,7 @@ __osm_mcast_mgr_find_optimal_switch( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_mcast_mgr_find_optimal_switch: " - "Switch 0x%016" PRIx64 ", hops = %f.\n", + "Switch 0x%016" PRIx64 ", hops = %f\n", sw_guid_ho, hops ); } @@ -337,14 +337,14 @@ __osm_mcast_mgr_find_optimal_switch( osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_mcast_mgr_find_optimal_switch: " - "Best switch is 0x%" PRIx64 ", hops = %f.\n", + "Best switch is 0x%" PRIx64 ", hops = %f\n", sw_guid_ho, best_hops ); } else { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_mcast_mgr_find_optimal_switch: " - "No multicast capable switches detected.\n" ); + "No multicast capable switches detected\n" ); } } @@ -391,9 +391,10 @@ void osm_mcast_mgr_destroy( IN osm_mcast_mgr_t* const p_mgr ) { + CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_mcast_mgr_destroy ); - CL_ASSERT( p_mgr ); OSM_LOG_EXIT( p_mgr->p_log ); } @@ -445,9 +446,10 @@ __osm_mcast_mgr_set_tbl( ib_net16_t block[IB_MCAST_BLOCK_SIZE]; osm_signal_t signal = OSM_SIGNAL_DONE; + CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, __osm_mcast_mgr_set_tbl ); - CL_ASSERT( p_mgr ); CL_ASSERT( p_sw ); p_node = osm_switch_get_node_ptr( p_sw ); @@ -477,7 +479,7 @@ __osm_mcast_mgr_set_tbl( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_mcast_mgr_set_tbl: " - "Writing MFT block 0x%X.\n", block_id_ho ); + "Writing MFT block 0x%X\n", block_id_ho ); } block_id_ho = block_num + (position << 28); @@ -495,7 +497,7 @@ __osm_mcast_mgr_set_tbl( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_set_tbl: ERR 0A02: " - "Sending linear fwd. tbl. block failed (%s).\n", + "Sending linear fwd. tbl. block failed (%s)\n", ib_get_err_str( status ) ); } @@ -567,9 +569,9 @@ __osm_mcast_mgr_subdivide( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_subdivide: ERR 0A03: " - "Error routing MLID 0x%X through switch 0x%" PRIx64 ".\n" + "Error routing MLID 0x%X through switch 0x%" PRIx64 "\n" "\t\t\t\tNo multicast paths from this switch for port " - "with LID 0x%X.\n", + "with LID 0x%X\n", mlid_ho, node_guid_ho, lid_ho ); __osm_mcast_work_obj_delete( p_wobj ); @@ -584,9 +586,9 @@ __osm_mcast_mgr_subdivide( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_subdivide: ERR 0A04: " "Error routing MLID 0x%X through switch " - "0x%" PRIx64 ".\n" + "0x%" PRIx64 "\n" "\t\t\t\tNo multicast paths from this switch " - "to port with LID 0x%X.\n", + "to port with LID 0x%X\n", mlid_ho, node_guid_ho, lid_ho ); __osm_mcast_work_obj_delete( p_wobj ); @@ -618,7 +620,7 @@ __osm_mcast_mgr_purge_list( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_purge_list: ERR 0A06: " - "Unable to route for port 0x%" PRIx64 ".\n", + "Unable to route for port 0x%" PRIx64 "\n", osm_port_get_guid( p_wobj->p_port ) ); __osm_mcast_work_obj_delete( p_wobj ); } @@ -670,8 +672,8 @@ __osm_mcast_mgr_branch( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_mcast_mgr_branch: " - "Routing MLID 0x%X through switch 0x%" PRIx64 ".\n" - "\t\t\t\t%u nodes at depth %u.\n", + "Routing MLID 0x%X through switch 0x%" PRIx64 "\n" + "\t\t\t\t%u nodes at depth %u\n", mlid_ho, node_guid_ho, cl_qlist_count( p_list ), depth ); @@ -694,7 +696,7 @@ __osm_mcast_mgr_branch( */ osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_branch: ERR 0A14: " - "Switch 0x%" PRIx64 " does not support multicast.\n", + "Switch 0x%" PRIx64 " does not support multicast\n", node_guid_ho ); /* @@ -713,7 +715,7 @@ __osm_mcast_mgr_branch( */ osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_branch: ERR 0A15: " - "Insufficient memory to build multicast tree.\n" ); + "Insufficient memory to build multicast tree\n" ); /* Deallocate all the work objects on this branch of the tree. @@ -738,7 +740,7 @@ __osm_mcast_mgr_branch( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_branch: ERR 0A16: " - "Unable to allocate list array.\n" ); + "Unable to allocate list array\n" ); __osm_mcast_mgr_purge_list( p_mgr, p_list ); goto Exit; } @@ -761,7 +763,7 @@ __osm_mcast_mgr_branch( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_mcast_mgr_branch: " - "Adding upstream port 0x%X.\n", upstream_port ); + "Adding upstream port 0x%X\n", upstream_port ); } CL_ASSERT( upstream_port ); @@ -801,7 +803,7 @@ __osm_mcast_mgr_branch( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_mcast_mgr_branch: " - "Routing %u destination(s) via switch port 0x%X.\n", + "Routing %u destination(s) via switch port 0x%X\n", count, i ); } @@ -862,7 +864,7 @@ __osm_mcast_mgr_branch( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_mcast_mgr_branch: " "Found leaf for port 0x%016" PRIx64 ",\n" - "\t\t\t\ton switch port 0x%X.\n", + "\t\t\t\ton switch port 0x%X\n", cl_ntoh64( osm_port_get_guid( p_wobj->p_port ) ), i ); } @@ -916,7 +918,7 @@ __osm_mcast_mgr_build_spanning_tree( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_mcast_mgr_build_spanning_tree: " - "MLID 0x%X has no members--nothing to do.\n", + "MLID 0x%X has no members--nothing to do\n", cl_ntoh16( osm_mgrp_get_mlid( p_mgrp ) ) ); } goto Exit; @@ -943,7 +945,7 @@ __osm_mcast_mgr_build_spanning_tree( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_build_spanning_tree: ERR 0A08: " - "Unable to locate a suitable switch for group 0x%X.\n", + "Unable to locate a suitable switch for group 0x%X\n", cl_ntoh16( osm_mgrp_get_mlid( p_mgrp ) )); status = IB_ERROR; goto Exit; @@ -967,7 +969,7 @@ __osm_mcast_mgr_build_spanning_tree( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_build_spanning_tree: ERR 0A09: " - "No port object for port 0x%016" PRIx64 ".\n", + "No port object for port 0x%016" PRIx64 "\n", cl_ntoh64( ib_gid_get_guid( &p_mcm_port->port_gid ) ) ); continue; } @@ -977,7 +979,7 @@ __osm_mcast_mgr_build_spanning_tree( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_mcast_mgr_build_spanning_tree: ERR 0A10: " - "Insufficient memory to route port 0x%016" PRIx64 ".\n", + "Insufficient memory to route port 0x%016" PRIx64 "\n", cl_ntoh64( osm_port_get_guid( p_port ) ) ); continue; } @@ -991,7 +993,7 @@ __osm_mcast_mgr_build_spanning_tree( osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_mcast_mgr_build_spanning_tree: " - "Configured MLID 0x%X for %u ports, max tree depth = %u.\n", + "Configured MLID 0x%X for %u ports, max tree depth = %u\n", cl_ntoh16( osm_mgrp_get_mlid( p_mgrp ) ), count, max_depth ); @@ -1027,7 +1029,7 @@ osm_mcast_mgr_set_table( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "osm_mcast_mgr_set_table: " - "Configuring MLID 0x%X on switch 0x%" PRIx64 ".\n", + "Configuring MLID 0x%X on switch 0x%" PRIx64 "\n", mlid_ho, osm_node_get_node_guid( osm_switch_get_node_ptr( p_sw ) ) ); } @@ -1067,7 +1069,6 @@ __osm_mcast_mgr_clear( cl_qmap_t* p_tbl; osm_mcast_tbl_t* p_mcast_tbl; - OSM_LOG_ENTER( p_mgr->p_log, __osm_mcast_mgr_clear ); /* @@ -1125,7 +1126,7 @@ osm_mcast_mgr_process_single( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_single: " "Attempting to add port 0x%" PRIx64 " to MLID 0x%X, " - "\n\t\t\t\tjoin state = 0x%X.\n", + "\n\t\t\t\tjoin state = 0x%X\n", cl_ntoh64( port_guid ), mlid_ho, join_state ); } @@ -1137,7 +1138,7 @@ osm_mcast_mgr_process_single( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A01: " - "Unable to acquire port object for 0x%" PRIx64 ".\n", + "Unable to acquire port object for 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_ERROR; goto Exit; @@ -1148,7 +1149,7 @@ osm_mcast_mgr_process_single( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A05: " - "Unable to acquire phsyical port object for 0x%" PRIx64 ".\n", + "Unable to acquire phsyical port object for 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_ERROR; goto Exit; @@ -1159,7 +1160,7 @@ osm_mcast_mgr_process_single( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A07: " "Unable to acquire valid physical port object " - "for 0x%" PRIx64 ".\n", + "for 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_ERROR; goto Exit; @@ -1171,7 +1172,7 @@ osm_mcast_mgr_process_single( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A11: " "Unable to acquire remote phsyical port object " - "for 0x%" PRIx64 ".\n", + "for 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_ERROR; goto Exit; @@ -1182,7 +1183,7 @@ osm_mcast_mgr_process_single( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A21: " "Unable to acquire valid remote physical port object " - "for 0x%" PRIx64 ".\n", + "for 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_ERROR; goto Exit; @@ -1198,7 +1199,7 @@ osm_mcast_mgr_process_single( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A22: " - "Remote node not a switch node 0x%" PRIx64 ".\n", + "Remote node not a switch node 0x%" PRIx64 "\n", cl_ntoh64( sw_guid ) ); status = IB_ERROR; goto Exit; @@ -1209,7 +1210,7 @@ osm_mcast_mgr_process_single( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A12: " - "No switch object 0x%" PRIx64 ".\n", + "No switch object 0x%" PRIx64 "\n", cl_ntoh64( sw_guid ) ); status = IB_ERROR; goto Exit; @@ -1244,14 +1245,14 @@ osm_mcast_mgr_process_single( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_single: " "Success. Nothing to do for send" - "only member.\n" ); + "only member\n" ); } } else { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_single: ERR 0A13: " - "Unknown join state 0x%X.\n", join_state ); + "Unknown join state 0x%X\n", join_state ); status = IB_ERROR; goto Exit; } @@ -1263,7 +1264,7 @@ osm_mcast_mgr_process_single( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_single: " - "Unable to add port.\n" ); + "Unable to add port\n" ); } } @@ -1297,7 +1298,7 @@ osm_mcast_mgr_process_tree( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_tree: " - "Processing multicast group 0x%X.\n", cl_ntoh16( mlid )); + "Processing multicast group 0x%X\n", cl_ntoh16( mlid )); } /* @@ -1309,7 +1310,7 @@ osm_mcast_mgr_process_tree( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_tree: " - "No switches in subnet. Nothing to do.\n" ); + "No switches in subnet. Nothing to do\n" ); } goto Exit; } @@ -1341,7 +1342,7 @@ osm_mcast_mgr_process_tree( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_tree: ERR 0A17: " - "Unable to create spanning tree (%s).\n", + "Unable to create spanning tree (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -1404,7 +1405,7 @@ osm_mcast_mgr_dump_mcast_routes( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_dump_mcast_routes: ERR 0A23: " - "Fail to open mcfdb file (%s).\n", + "Fail to open mcfdb file (%s)\n", file_name ); goto Exit; } @@ -1414,7 +1415,7 @@ osm_mcast_mgr_dump_mcast_routes( p_tbl = osm_switch_get_mcast_tbl_ptr( p_sw ); fprintf( p_mcfdbFile, "\nSwitch 0x%016" PRIx64 "\n" - "LID : Out Port(s) \n", + "LID : Out Port(s)\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); while ( block_num <= p_tbl->max_block_in_use ) { @@ -1484,7 +1485,7 @@ osm_mcast_mgr_process_mgrp( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process_mgrp: ERR 0A19: " - "Unable to create spanning tree (%s).\n", + "Unable to create spanning tree (%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -1557,7 +1558,7 @@ osm_mcast_mgr_process( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_process: ERR 0A20: " - "Unable to create spanning tree (%s).\n", + "Unable to create spanning tree (%s)\n", ib_get_err_str( status ) ); } @@ -1595,7 +1596,6 @@ osm_mcast_mgr_process( /********************************************************************** **********************************************************************/ - static osm_mgrp_t * __get_mgrp_by_mlid( @@ -1656,14 +1656,14 @@ osm_mcast_mgr_process_mgrp_cb( signal = OSM_SIGNAL_DONE; osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_mgrp_cb: " - "Skip processing mgrp with lid:0x%X change id:%u \n", + "Skip processing mgrp with lid:0x%X change id:%u\n", cl_ntoh16(mlid), p_mgrp->last_change_id ); } else { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_mgrp_cb: " - "Processing mgrp with lid:0x%X change id:%u \n", + "Processing mgrp with lid:0x%X change id:%u\n", cl_ntoh16(mlid), p_mgrp->last_change_id ); signal = @@ -1680,7 +1680,7 @@ osm_mcast_mgr_process_mgrp_cb( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_mcast_mgr_process_mgrp_cb: " - "Destroying mgrp with lid:0x%X \n", + "Destroying mgrp with lid:0x%X\n", cl_ntoh16(mlid) ); /* Send a Report to any InformInfo registerd for diff --git a/trunk/ulp/opensm/user/opensm/osm_mtree.c b/trunk/ulp/opensm/user/opensm/osm_mtree.c index cdfa46dd..89e30e9b 100644 --- a/trunk/ulp/opensm/user/opensm/osm_mtree.c +++ b/trunk/ulp/opensm/user/opensm/osm_mtree.c @@ -47,6 +47,7 @@ # include #endif /* HAVE_CONFIG_H */ +#include #include /********************************************************************** diff --git a/trunk/ulp/opensm/user/opensm/osm_multicast.c b/trunk/ulp/opensm/user/opensm/osm_multicast.c index d07046f4..beffd471 100644 --- a/trunk/ulp/opensm/user/opensm/osm_multicast.c +++ b/trunk/ulp/opensm/user/opensm/osm_multicast.c @@ -32,7 +32,6 @@ */ - /* * Abstract: * Implementation of multicast functions. @@ -261,7 +260,6 @@ osm_mgrp_is_port_present( return FALSE; } - /********************************************************************** **********************************************************************/ static void @@ -345,7 +343,7 @@ osm_mgrp_send_delete_notice( { osm_log( p_log, OSM_LOG_ERROR, "osm_mgrp_send_delete_notice: ERR 7601: " - "Error sending trap reports (%s).\n", + "Error sending trap reports (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -392,7 +390,7 @@ osm_mgrp_send_create_notice( { osm_log( p_log, OSM_LOG_ERROR, "osm_mgrp_send_create_notice: ERR 7602: " - "Error sending trap reports (%s).\n", + "Error sending trap reports (%s)\n", ib_get_err_str( status ) ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv.c b/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv.c index e502222b..68d0bc9f 100644 --- a/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv.c @@ -82,7 +82,7 @@ __osm_nd_rcv_process_nd( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_nd_rcv_process_nd: " - "Node 0x%" PRIx64 "\n\t\t\t\tDescription = %s.\n", + "Node 0x%" PRIx64 "\n\t\t\t\tDescription = %s\n", cl_ntoh64( osm_node_get_node_guid( p_node )), desc ); } @@ -91,7 +91,6 @@ __osm_nd_rcv_process_nd( OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ void @@ -107,13 +106,13 @@ void osm_nd_rcv_destroy( IN osm_nd_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_nd_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -124,6 +123,7 @@ osm_nd_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_nd_rcv_init ); osm_nd_rcv_construct( p_rcv ); @@ -149,9 +149,10 @@ osm_nd_rcv_process( osm_node_t *p_node; ib_net64_t node_guid; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_nd_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_guid_tbl = &p_rcv->p_subn->node_guid_tbl; @@ -171,7 +172,7 @@ osm_nd_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_nd_rcv_process: ERR 0B01: " "NodeDescription received for nonexistent node " - "0x%" PRIx64 ".\n", cl_ntoh64(node_guid) ); + "0x%" PRIx64 "\n", cl_ntoh64(node_guid) ); } else { diff --git a/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv_ctrl.c index e52b0d87..03c807b6 100644 --- a/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_node_desc_rcv_ctrl.c @@ -88,7 +88,6 @@ osm_nd_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,6 @@ osm_nd_rcv_ctrl_init( osm_nd_rcv_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_rcv = p_rcv; p_ctrl->p_disp = p_disp; @@ -119,7 +117,7 @@ osm_nd_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_nd_rcv_ctrl_init: ERR 0C01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -129,8 +127,3 @@ osm_nd_rcv_ctrl_init( return( status ); } - - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_node_info_rcv.c b/trunk/ulp/opensm/user/opensm/osm_node_info_rcv.c index afe72a4e..ec17dcbb 100755 --- a/trunk/ulp/opensm/user/opensm/osm_node_info_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_node_info_rcv.c @@ -101,7 +101,7 @@ __osm_ni_rcv_set_links( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_set_links: ERR 0D10: " "Unexpected removal of neighbor node " - "0x%" PRIx64 ".\n", + "0x%" PRIx64 "\n", cl_ntoh64( p_ni_context->node_guid ) ); } else @@ -122,7 +122,7 @@ __osm_ni_rcv_set_links( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_ni_rcv_set_links: " - "Link already exists.\n" ); + "Link already exists\n" ); } else { @@ -130,43 +130,79 @@ __osm_ni_rcv_set_links( { /* Uh oh... + This means that we found 2 nodes with the same guid, + or a 12x link with lane reversal that is not configured correctly. */ + char line[BUF_SIZE]; + char dr_new_path[BUF_SIZE]; + char dr_old_path[BUF_SIZE]; + uint32_t i; + osm_dr_path_t *p_path = NULL, *p_old_path = NULL; + + p_physp = osm_node_get_physp_ptr( p_node, port_num ); + sprintf( dr_new_path, "no_path_available" ); + if (p_physp) + { + p_path = osm_physp_get_dr_path_ptr( p_physp ); + if ( p_path ) + { + sprintf( dr_new_path, "new path:" ); + for (i = 0; i <= p_path->hop_count; i++ ) + { + sprintf( line, "[%X]", p_path->path[i] ); + strcat( dr_new_path, line ); + } + } + } + p_old_neighbor_node = osm_node_get_remote_node( p_node, port_num, &old_neighbor_port_num ); + p_old_physp = osm_node_get_physp_ptr( + p_old_neighbor_node, + old_neighbor_port_num); + sprintf( dr_old_path, "no_path_available" ); + if (p_old_physp) + { + p_old_path = osm_physp_get_dr_path_ptr( p_old_physp ); + if ( p_old_path ) + { + sprintf( dr_old_path, "old_path:" ); + for (i = 0; i <= p_old_path->hop_count; i++ ) + { + sprintf( line, "[%X]", p_old_path->path[i] ); + strcat( dr_old_path, line ); + } + } + } osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_set_links: ERR 0D01: " + "Found duplicated guids or 12x link " + "with lane reversal badly configured.\n" "Overriding existing link to:" "node 0x%" PRIx64 ", port number 0x%X connected to:\n" "\t\t\t\told node 0x%" PRIx64 ", " - "port number 0x%X.\n" + "port number 0x%X %s\n" "\t\t\t\tnew node 0x%" PRIx64 ", " - "port number 0x%X.\n", + "port number 0x%X %s\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num, cl_ntoh64( osm_node_get_node_guid( p_old_neighbor_node ) ), old_neighbor_port_num , + dr_old_path, cl_ntoh64( p_ni_context->node_guid ), - p_ni_context->port_num + p_ni_context->port_num, + dr_new_path ); - if (osm_log_is_active(p_rcv->p_log, OSM_LOG_ERROR)) - { - p_physp = osm_node_get_physp_ptr( p_node, port_num ); - if (p_physp) - osm_dump_dr_path(p_rcv->p_log, - osm_physp_get_dr_path_ptr( p_physp ), - OSM_LOG_ERROR); - - p_old_physp = osm_node_get_physp_ptr( - p_old_neighbor_node, - old_neighbor_port_num); - if (p_old_physp) - osm_dump_dr_path(p_rcv->p_log, - osm_physp_get_dr_path_ptr( p_old_physp ), - OSM_LOG_ERROR); - } + osm_log( p_rcv->p_log, OSM_LOG_SYS, + "Errors on subnet. SM found duplicated guids or 12x " + "link with lane reversal badly configured. " + "See osm log for more details\n"); + + if ( p_rcv->p_subn->opt.exit_on_fatal == TRUE ) + exit( 1 ); } /* @@ -182,7 +218,7 @@ __osm_ni_rcv_set_links( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_set_links: ERR 0D18: " "Duplicate GUID found by link from a port to itself:" - "node 0x%" PRIx64 ", port number 0x%X \n", + "node 0x%" PRIx64 ", port number 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num ); p_physp = osm_node_get_physp_ptr( p_node, port_num ); @@ -190,6 +226,14 @@ __osm_ni_rcv_set_links( osm_dump_dr_path(p_rcv->p_log, osm_physp_get_dr_path_ptr(p_physp), OSM_LOG_ERROR); + + osm_log( p_rcv->p_log, OSM_LOG_SYS, + "Errors on subnet. Duplicate GUID found " + "by link from a port to itself. " + "See osm log for more details\n"); + + if ( p_rcv->p_subn->opt.exit_on_fatal == TRUE ) + exit( 1 ); } else { @@ -202,7 +246,7 @@ __osm_ni_rcv_set_links( "\n\t\t\t\tnode 0x%" PRIx64 ", " "port number 0x%X and" "\n\t\t\t\tnode 0x%" PRIx64 ", " - "port number 0x%X.\n", + "port number 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num, cl_ntoh64( p_ni_context->node_guid ), @@ -223,7 +267,7 @@ __osm_ni_rcv_set_links( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_ni_rcv_set_links: " - "Nothing to link for our own node 0x%" PRIx64 ".\n", + "Nothing to link for our own node 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); } @@ -256,8 +300,6 @@ __osm_ni_rcv_process_new_node( p_ni = (ib_node_info_t*)ib_smp_get_payload_ptr( p_smp ); port_num = ib_node_info_get_local_port_num( p_ni ); - CL_ASSERT( p_node ); - /* Request PortInfo & NodeDescription attributes for the port that responded to the NodeInfo attribute. @@ -291,7 +333,7 @@ __osm_ni_rcv_process_new_node( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_new_node: ERR 0D02: " - "Failure initiating PortInfo request (%s).\n", + "Failure initiating PortInfo request (%s)\n", ib_get_err_str(status)); } @@ -323,7 +365,6 @@ __osm_ni_rcv_get_node_desc( p_ni = (ib_node_info_t*)ib_smp_get_payload_ptr( p_smp ); port_num = ib_node_info_get_local_port_num( p_ni ); - /* Request PortInfo & NodeDescription attributes for the port that responded to the NodeInfo attribute. @@ -352,7 +393,7 @@ __osm_ni_rcv_get_node_desc( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_get_node_desc: ERR 0D03: " - "Failure initiating NodeDescription request (%s).\n", + "Failure initiating NodeDescription request (%s)\n", ib_get_err_str(status)); } @@ -426,7 +467,7 @@ __osm_ni_rcv_process_ca_port( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_ni_rcv_process_ca_port: " - "Creating new Port object with GUID = 0x%" PRIx64 ".\n", + "Creating new Port object with GUID = 0x%" PRIx64 "\n", cl_ntoh64( p_ni->port_guid ) ); osm_node_init_physp( p_node, p_madw ); @@ -436,7 +477,7 @@ __osm_ni_rcv_process_ca_port( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_ca_port: ERR 0D04: " - "Unable to create new port object.\n" ); + "Unable to create new port object\n" ); goto Exit; } @@ -453,7 +494,7 @@ __osm_ni_rcv_process_ca_port( */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_ca_port: ERR 0D12: " - "Port 0x%" PRIx64 " already in the database!.\n", + "Port 0x%" PRIx64 " already in the database!\n", cl_ntoh64( p_ni->port_guid ) ); osm_port_delete( &p_port ); @@ -474,7 +515,7 @@ __osm_ni_rcv_process_ca_port( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_ca_port: ERR 0D08: " - "Error %s adding to list.\n", + "Error %s adding to list\n", CL_STATUS_MSG( cl_status ) ); osm_port_delete( &p_port ); goto Exit; @@ -525,7 +566,7 @@ __osm_ni_rcv_process_ca_port( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_ca_port: ERR 0D13: " - "Failure initiating PortInfo request (%s).\n", + "Failure initiating PortInfo request (%s)\n", ib_get_err_str(status)); } @@ -606,7 +647,7 @@ __osm_ni_rcv_process_switch( /* continue despite error */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_switch: ERR 0D06: " - "Failure initiating SwitchInfo request (%s).\n", + "Failure initiating SwitchInfo request (%s)\n", ib_get_err_str( status ) ); } @@ -652,7 +693,7 @@ __osm_ni_rcv_process_existing_switch( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_ni_rcv_process_existing_switch: " "Retry to get SwitchInfo on node GUID:0x%" - PRIx64 ".\n", cl_ntoh64(node_guid) ); + PRIx64 "\n", cl_ntoh64(node_guid) ); __osm_ni_rcv_process_switch( p_rcv, p_node, p_madw ); } } @@ -718,7 +759,7 @@ __osm_ni_rcv_process_new( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_ni_rcv_process_new: " "Discovered new %s node," - "\n\t\t\t\tGUID = 0x%" PRIx64 ", TID = 0x%" PRIx64 ".\n", + "\n\t\t\t\tGUID = 0x%" PRIx64 ", TID = 0x%" PRIx64 "\n", ib_get_node_type_str( p_ni->node_type ), cl_ntoh64( p_ni->node_guid ), cl_ntoh64( p_smp->trans_id ) ); @@ -728,7 +769,7 @@ __osm_ni_rcv_process_new( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_new: ERR 0D07: " - "Unable to create new node object.\n" ); + "Unable to create new node object\n" ); goto Exit; } @@ -741,7 +782,7 @@ __osm_ni_rcv_process_new( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_new: ERR 0D14: " - "Unable to create new port object.\n" ); + "Unable to create new port object\n" ); osm_node_delete( &p_node ); goto Exit; } @@ -791,7 +832,7 @@ __osm_ni_rcv_process_new( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_new: ERR 0D05: " - "Error %s adding to list.\n", + "Error %s adding to list\n", CL_STATUS_MSG(status ) ); osm_port_delete( &p_port ); osm_node_delete( &p_node ); @@ -818,7 +859,7 @@ __osm_ni_rcv_process_new( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_ni_rcv_process_new: " - "Discovery race detected at node 0x%" PRIx64 ".\n", + "Discovery race detected at node 0x%" PRIx64 "\n", cl_ntoh64( p_ni->node_guid ) ); osm_node_delete( &p_node ); @@ -846,7 +887,7 @@ __osm_ni_rcv_process_new( default: osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_new: ERR 0D16: " - "Unknown node type = %u with GUID = 0x%" PRIx64 ".\n", + "Unknown node type = %u with GUID = 0x%" PRIx64 "\n", p_ni->node_type, cl_ntoh64( p_ni->node_guid ) ); break; } @@ -882,7 +923,7 @@ __osm_ni_rcv_process_existing( "__osm_ni_rcv_process_existing: " "Rediscovered %s node 0x%" PRIx64 "\n\t\t\t\tTID = 0x%" PRIx64 - ", discovered %u times already.\n", + ", discovered %u times already\n", ib_get_node_type_str(p_ni->node_type), cl_ntoh64( p_ni->node_guid ), cl_ntoh64( p_smp->trans_id ), @@ -912,7 +953,7 @@ __osm_ni_rcv_process_existing( default: osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_ni_rcv_process_existing: ERR 0D09: " - "Unknown node type = %u with GUID = 0x%" PRIx64 ".\n", + "Unknown node type = %u with GUID = 0x%" PRIx64 "\n", p_ni->node_type, cl_ntoh64( p_ni->node_guid ) ); break; } @@ -937,9 +978,10 @@ void osm_ni_rcv_destroy( IN osm_ni_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_ni_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } @@ -955,6 +997,7 @@ osm_ni_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_ni_rcv_init ); osm_ni_rcv_construct( p_rcv ); @@ -982,12 +1025,12 @@ osm_ni_rcv_process( osm_node_t *p_node; boolean_t process_new_flag = FALSE; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_ni_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); - p_guid_tbl = &p_rcv->p_subn->node_guid_tbl; p_smp = osm_madw_get_smp_ptr( p_madw ); p_ni = (ib_node_info_t*)ib_smp_get_payload_ptr( p_smp ); @@ -1010,6 +1053,9 @@ osm_ni_rcv_process( osm_dump_smp_dr_path(p_rcv->p_log, p_smp, OSM_LOG_ERROR); goto Exit; } + + p_guid_tbl = &p_rcv->p_subn->node_guid_tbl; + /* Determine if this node has already been discovered, and process accordingly. diff --git a/trunk/ulp/opensm/user/opensm/osm_node_info_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_node_info_rcv_ctrl.c index eeecc475..a86a5522 100644 --- a/trunk/ulp/opensm/user/opensm/osm_node_info_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_node_info_rcv_ctrl.c @@ -88,7 +88,6 @@ osm_ni_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,6 @@ osm_ni_rcv_ctrl_init( osm_ni_rcv_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_rcv = p_rcv; p_ctrl->p_disp = p_disp; @@ -119,7 +117,7 @@ osm_ni_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_ni_rcv_ctrl_init: ERR 0E01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -129,8 +127,3 @@ osm_ni_rcv_ctrl_init( return( status ); } - - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_opensm.c b/trunk/ulp/opensm/user/opensm/osm_opensm.c index 7ccfc813..87135a3c 100644 --- a/trunk/ulp/opensm/user/opensm/osm_opensm.c +++ b/trunk/ulp/opensm/user/opensm/osm_opensm.c @@ -55,6 +55,10 @@ #include #include #include +#include +#ifdef OSM_VENDOR_INTF_OPENIB +#include +#endif #include #include #include @@ -95,26 +99,23 @@ osm_opensm_destroy( osm_vendor_set_sm( p_osm->sm.mad_ctrl.h_bind, FALSE ); /* shut down the SA - * - unbind from Q1 Messages and + * - unbind from QP1 messages */ osm_sa_shutdown( &p_osm->sa ); /* shut down the SM * - make sure the SM sweeper thread exited - * - unbind from Q0 Messages and + * - unbind from QP0 messages */ osm_sm_shutdown( &p_osm->sm ); - /* shut down the dispatcher - so no new messages cross */ - cl_disp_shutdown( &p_osm->disp ); - /* cleanup all messages on VL15 fifo that were not sent yet */ osm_vl15_shutdown( &p_osm->vl15, &p_osm->mad_pool ); - /* lock the whole thing so we do not get any requests etc */ - cl_plock_excl_acquire( &p_osm->lock ); + /* shut down the dispatcher - so no new messages cross */ + cl_disp_shutdown( &p_osm->disp ); - /* do the destruction in reverse init order */ + /* do the destruction in reverse order as init */ updn_destroy( p_osm->p_updn_ucast_routing ); osm_sa_destroy( &p_osm->sa ); osm_sm_destroy( &p_osm->sm ); @@ -125,7 +126,6 @@ osm_opensm_destroy( osm_subn_destroy( &p_osm->subn ); cl_disp_destroy( &p_osm->disp ); - cl_plock_release( &p_osm->lock ); cl_plock_destroy( &p_osm->lock ); cl_mem_display( ); @@ -180,14 +180,16 @@ osm_reg_sig_handler( IN osm_opensm_t * const p_osm ) { __p_osm_to_signal = p_osm; +#ifndef OSM_VENDOR_INTF_OPENIB cl_reg_sig_hdl( SIGINT, __sig_handler ); +#endif cl_reg_sig_hdl( SIGTERM, __sig_handler ); cl_reg_sig_hdl( SIGHUP, __sig_handler ); osm_exit_flag = 0; return; } -#endif +#endif /* __WIN__ */ /********************************************************************** **********************************************************************/ @@ -206,12 +208,33 @@ osm_opensm_init( if( status != IB_SUCCESS ) return ( status ); +#ifndef OSM_VENDOR_INTF_OPENIB /* If there is a log level defined - add the OSM_VERSION to it. */ osm_log( &p_osm->log, osm_log_get_level( &p_osm->log ) & ( OSM_LOG_SYS ^ 0xFF ), "%s\n", OSM_VERSION ); /* Write the OSM_VERSION to the SYS_LOG */ osm_log( &p_osm->log, OSM_LOG_SYS, "%s\n", OSM_VERSION ); /* Format Waived */ +#else + if (strlen(OSM_SVN_REVISION)) + { + /* If there is a log level defined - add OSM_VERSION and OSM_SVN_REVISION to it. */ + osm_log( &p_osm->log, + osm_log_get_level( &p_osm->log ) & ( OSM_LOG_SYS ^ 0xFF ), "%s OpenIB svn %s\n", + OSM_VERSION, OSM_SVN_REVISION ); + /* Write the OSM_VERSION and OSM_SVN_REVISION to the SYS_LOG */ + osm_log( &p_osm->log, OSM_LOG_SYS, "%s OpenIB svn %s\n", OSM_VERSION, OSM_SVN_REVISION ); /* Format Waived */ + } + else + { + /* If there is a log level defined - add the OSM_VERSION to it. */ + osm_log( &p_osm->log, + osm_log_get_level( &p_osm->log ) & ( OSM_LOG_SYS ^ 0xFF ), "%s\n", + OSM_VERSION ); + /* Write the OSM_VERSION to the SYS_LOG */ + osm_log( &p_osm->log, OSM_LOG_SYS, "%s\n", OSM_VERSION ); /* Format Waived */ + } +#endif osm_log( &p_osm->log, OSM_LOG_FUNCS, "osm_opensm_init: [\n" ); /* Format Waived */ @@ -233,9 +256,9 @@ osm_opensm_init( */ status = cl_disp_init( &p_osm->disp, 0, "opensm" ); } - if( status != IB_SUCCESS ) goto Exit; + status = osm_subn_init( &p_osm->subn, p_opt ); if( status != IB_SUCCESS ) goto Exit; @@ -255,7 +278,7 @@ osm_opensm_init( status = osm_vl15_init( &p_osm->vl15, p_osm->p_vendor, &p_osm->log, &p_osm->stats, p_opt->max_wire_smps, - &p_osm->subn, &p_osm->disp, &p_osm->lock ); + &p_osm->subn, &p_osm->disp, &p_osm->lock ); if( status != IB_SUCCESS ) goto Exit; diff --git a/trunk/ulp/opensm/user/opensm/osm_pkey.c b/trunk/ulp/opensm/user/opensm/osm_pkey.c index c1dc8aa9..d9bc2b75 100644 --- a/trunk/ulp/opensm/user/opensm/osm_pkey.c +++ b/trunk/ulp/opensm/user/opensm/osm_pkey.c @@ -73,6 +73,7 @@ void osm_pkey_tbl_destroy( IN osm_pkey_tbl_t *p_pkey_tbl) { uint16_t num_blocks, i; + num_blocks = (uint16_t)(cl_ptr_vector_get_size( &p_pkey_tbl->blocks )); for (i = 0; i < num_blocks; i++) cl_free(cl_ptr_vector_get( &p_pkey_tbl->blocks, i )); @@ -359,7 +360,7 @@ osm_physp_has_pkey( osm_log( p_log, OSM_LOG_DEBUG, "osm_physp_has_pkey: " - "Search for pkey: 0x%X\n", + "Search for PKey: 0x%4x\n", cl_ntoh16(pkey) ); /* if the pkey given is an invalid pkey - return TRUE. */ @@ -367,7 +368,7 @@ osm_physp_has_pkey( { osm_log( p_log, OSM_LOG_DEBUG, "osm_physp_has_pkey: " - "Given invalid PKey - we treat it loosely and allow it.\n"); + "Given invalid PKey - we treat it loosely and allow it\n"); res = TRUE; goto Exit; } @@ -382,13 +383,13 @@ osm_physp_has_pkey( res = TRUE; osm_log( p_log, OSM_LOG_DEBUG, "osm_physp_has_pkey: " - "PKey 0x%04x was found.\n", cl_ntoh16(pkey)); + "PKey 0x%04x was found\n", cl_ntoh16(pkey)); } else { osm_log( p_log, OSM_LOG_DEBUG, "osm_physp_has_pkey: " - "PKey 0x%04x was not found.\n", cl_ntoh16(pkey)); + "PKey 0x%04x was not found\n", cl_ntoh16(pkey)); } Exit: diff --git a/trunk/ulp/opensm/user/opensm/osm_pkey_mgr.c b/trunk/ulp/opensm/user/opensm/osm_pkey_mgr.c new file mode 100644 index 00000000..c3a1ccf3 --- /dev/null +++ b/trunk/ulp/opensm/user/opensm/osm_pkey_mgr.c @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +/* + * Abstract: + * Implementation of osm_pkey_mgr_t. + * This object represents the P_Key Manager object. + * This object is part of the opensm family of objects. + * + * Environment: + * Linux User Mode + * + * $Revision: 1.7 $ + */ + +#if HAVE_CONFIG_H +# include +#endif /* HAVE_CONFIG_H */ + +#include +#include +#include +#include +#include + +/********************************************************************** + **********************************************************************/ +void +osm_pkey_mgr_construct( + IN osm_pkey_mgr_t * const p_mgr ) +{ + CL_ASSERT( p_mgr ); + cl_memclr( p_mgr, sizeof( *p_mgr ) ); +} + +/********************************************************************** + **********************************************************************/ +void +osm_pkey_mgr_destroy( + IN osm_pkey_mgr_t * const p_mgr ) +{ + CL_ASSERT( p_mgr ); + + OSM_LOG_ENTER( p_mgr->p_log, osm_pkey_mgr_destroy ); + + OSM_LOG_EXIT( p_mgr->p_log ); +} + +/********************************************************************** + **********************************************************************/ +ib_api_status_t +osm_pkey_mgr_init( + IN osm_pkey_mgr_t * const p_mgr, + IN osm_subn_t * const p_subn, + IN osm_log_t * const p_log, + IN osm_req_t * const p_req, + IN cl_plock_t * const p_lock ) +{ + ib_api_status_t status = IB_SUCCESS; + + OSM_LOG_ENTER( p_log, osm_pkey_mgr_init ); + + osm_pkey_mgr_construct( p_mgr ); + + p_mgr->p_log = p_log; + p_mgr->p_subn = p_subn; + p_mgr->p_lock = p_lock; + p_mgr->p_req = p_req; + + OSM_LOG_EXIT( p_mgr->p_log ); + return ( status ); +} + +/********************************************************************** + **********************************************************************/ +boolean_t +__osm_pkey_mgr_process_physical_port( + IN const osm_pkey_mgr_t * const p_mgr, + IN osm_node_t * p_node, + IN uint8_t port_num, + IN osm_physp_t * p_physp ) +{ + boolean_t return_val = FALSE; /* TRUE if IB_DEFAULT_PKEY was inserted */ + osm_madw_context_t context; + ib_pkey_table_t *block = NULL; + uint16_t block_index; + uint16_t num_of_blocks; + const osm_pkey_tbl_t *p_pkey_tbl; + uint32_t attr_mod; + uint32_t i; + ib_net16_t pkey; + ib_api_status_t status; + boolean_t block_with_empty_entry_found; + + OSM_LOG_ENTER( p_mgr->p_log, __osm_pkey_mgr_process_physical_port ); + + /* + * Send a new entry for the pkey table for this node that includes + * IB_DEFAULT_PKEY when IB_DEFAULT_PARTIAL_PKEY or IB_DEFAULT_PKEY + * don't exist + */ + if ( ( osm_physp_has_pkey( p_mgr->p_log, + IB_DEFAULT_PKEY, + p_physp ) == FALSE ) && + ( osm_physp_has_pkey( p_mgr->p_log, + IB_DEFAULT_PARTIAL_PKEY, p_physp ) == FALSE ) ) + { + context.pkey_context.node_guid = osm_node_get_node_guid( p_node ); + context.pkey_context.port_guid = osm_physp_get_port_guid( p_physp ); + context.pkey_context.set_method = TRUE; + + p_pkey_tbl = osm_physp_get_pkey_tbl( p_physp ); + num_of_blocks = osm_pkey_tbl_get_num_blocks( p_pkey_tbl ); + block_with_empty_entry_found = FALSE; + + for ( block_index = 0; block_index < num_of_blocks; block_index++ ) + { + block = osm_pkey_tbl_block_get( p_pkey_tbl, block_index ); + for ( i = 0; i < IB_NUM_PKEY_ELEMENTS_IN_BLOCK; i++ ) + { + pkey = block->pkey_entry[i]; + if ( ib_pkey_is_invalid( pkey ) ) + { + block->pkey_entry[i] = IB_DEFAULT_PKEY; + block_with_empty_entry_found = TRUE; + break; + } + } + if ( block_with_empty_entry_found ) + { + break; + } + } + + if ( block_with_empty_entry_found == FALSE ) + { + osm_log( p_mgr->p_log, OSM_LOG_ERROR, + "__osm_pkey_mgr_process_physical_port: ERR 0501: " + "No empty entry was found to insert IB_DEFAULT_PKEY for node " + "0x%016" PRIx64 " and port %u\n", + cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num ); + } + else + { + /* Building the attribute modifier */ + if ( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH ) + { + /* Port num | Block Index */ + attr_mod = port_num << 16 | block_index; + } + else + { + attr_mod = block_index; + } + + status = osm_req_set( p_mgr->p_req, + osm_physp_get_dr_path_ptr( p_physp ), + ( uint8_t * ) block, + sizeof( *block ), + IB_MAD_ATTR_P_KEY_TABLE, + cl_hton32( attr_mod ), + CL_DISP_MSGID_NONE, &context ); + return_val = TRUE; /*IB_DEFAULT_PKEY was inserted */ + + if ( osm_log_is_active( p_mgr->p_log, OSM_LOG_VERBOSE ) ) + { + osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, + "__osm_pkey_mgr_process_physical_port: " + "IB_DEFAULT_PKEY was inserted for node 0x%016" PRIx64 + " and port %u\n", + cl_ntoh64( osm_node_get_node_guid( p_node ) ), + port_num ); + } + } + } + else + { + /* default key or partial default key already exist */ + if ( osm_log_is_active( p_mgr->p_log, OSM_LOG_VERBOSE ) ) + { + osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, + "__osm_pkey_mgr_process_physical_port: " + "No need to insert IB_DEFAULT_PKEY for node 0x%016" PRIx64 + " port %u\n", + cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num ); + } + } + + OSM_LOG_EXIT( p_mgr->p_log ); + return ( return_val ); +} + +/********************************************************************** + **********************************************************************/ +osm_signal_t +osm_pkey_mgr_process( + IN const osm_pkey_mgr_t * const p_mgr ) +{ + cl_qmap_t *p_node_guid_tbl; + osm_node_t *p_node; + osm_node_t *p_next_node; + uint8_t port_num; + osm_physp_t *p_physp; + osm_signal_t result = OSM_SIGNAL_DONE; + + CL_ASSERT( p_mgr ); + + OSM_LOG_ENTER( p_mgr->p_log, osm_pkey_mgr_process ); + + p_node_guid_tbl = &p_mgr->p_subn->node_guid_tbl; + + CL_PLOCK_EXCL_ACQUIRE( p_mgr->p_lock ); + + p_next_node = ( osm_node_t * ) cl_qmap_head( p_node_guid_tbl ); + while ( p_next_node != ( osm_node_t * ) cl_qmap_end( p_node_guid_tbl ) ) + { + p_node = p_next_node; + p_next_node = ( osm_node_t * ) cl_qmap_next( &p_next_node->map_item ); + + for ( port_num = 0; port_num < osm_node_get_num_physp( p_node ); + port_num++ ) + { + p_physp = osm_node_get_physp_ptr( p_node, port_num ); + if ( osm_physp_is_valid( p_physp ) ) + { + if ( __osm_pkey_mgr_process_physical_port + ( p_mgr, p_node, port_num, p_physp ) ) + { + if ( osm_log_is_active( p_mgr->p_log, OSM_LOG_VERBOSE ) ) + { + osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, + "osm_pkey_mgr_process: " + "Adding IB_DEFAULT_PKEY for pkey table of node " + "0x%016" PRIx64 " port %u\n", + cl_ntoh64( osm_node_get_node_guid( p_node ) ), + port_num ); + } + result = OSM_SIGNAL_DONE_PENDING; + } + } + } + } + + CL_PLOCK_RELEASE( p_mgr->p_lock ); + OSM_LOG_EXIT( p_mgr->p_log ); + return ( result ); +} diff --git a/trunk/ulp/opensm/user/opensm/osm_pkey_rcv.c b/trunk/ulp/opensm/user/opensm/osm_pkey_rcv.c index 2cea8189..6e3f9b49 100644 --- a/trunk/ulp/opensm/user/opensm/osm_pkey_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_pkey_rcv.c @@ -68,13 +68,13 @@ void osm_pkey_rcv_destroy( IN osm_pkey_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_pkey_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -86,6 +86,7 @@ osm_pkey_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_pkey_rcv_init ); osm_pkey_rcv_construct( p_rcv ); @@ -102,9 +103,8 @@ osm_pkey_rcv_init( /********************************************************************** **********************************************************************/ /* - * WE MIGHT ONLY RECEIVE A GET or SET responses + * WE MIGHT ONLY RECEIVE GET or SET responses */ - void osm_pkey_rcv_process( IN const osm_pkey_rcv_t* const p_rcv, @@ -122,9 +122,10 @@ osm_pkey_rcv_process( uint8_t port_num; uint16_t block_num; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_pkey_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_smp = osm_madw_get_smp_ptr( p_madw ); @@ -148,7 +149,7 @@ osm_pkey_rcv_process( "osm_pkey_rcv_process: ERR 4806: " "No Port object for port with GUID = 0x%" PRIx64 "\n\t\t\t\tfor parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), cl_ntoh64( p_smp->trans_id ) ); @@ -183,7 +184,7 @@ osm_pkey_rcv_process( "osm_pkey_rcv_process: " "Got GetResp(PKey) block:%u port_num %u with GUID = 0x%" PRIx64 " for parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", block_num, port_num, cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), @@ -200,7 +201,7 @@ osm_pkey_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pkey_rcv_process: " - "Got invalid port number 0x%X.\n", + "Got invalid port number 0x%X\n", port_num ); } goto Exit; diff --git a/trunk/ulp/opensm/user/opensm/osm_pkey_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_pkey_rcv_ctrl.c index 233d527d..e37f1e22 100644 --- a/trunk/ulp/opensm/user/opensm/osm_pkey_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_pkey_rcv_ctrl.c @@ -46,7 +46,7 @@ /********************************************************************** **********************************************************************/ -void +static void __osm_pkey_rcv_ctrl_disp_callback( IN void *context, IN void *p_data ) diff --git a/trunk/ulp/opensm/user/opensm/osm_port.c b/trunk/ulp/opensm/user/opensm/osm_port.c index 98154c2e..1cabf922 100644 --- a/trunk/ulp/opensm/user/opensm/osm_port.c +++ b/trunk/ulp/opensm/user/opensm/osm_port.c @@ -755,7 +755,7 @@ osm_physp_replace_dr_path_with_alternate_dr_path( p_remote_physp = p_physp->p_remote_physp; /* - make sure that all three of the following occure: + make sure that all of the following occurred: 1. The port isn't NULL 2. The port is a valid port 3. This is not the port we came from diff --git a/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c b/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c index 8ca5b321..a5a56396 100644 --- a/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c @@ -83,7 +83,7 @@ __osm_pi_rcv_set_sm( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pi_rcv_set_sm: " - "Setting 'IS_SM' bit in port attributes.\n" ); + "Setting 'IS_SM' bit in port attributes\n" ); } p_dr_path = osm_physp_get_dr_path_ptr( p_physp ); @@ -125,7 +125,7 @@ __osm_pi_rcv_process_endport( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pi_rcv_process_endport: " "Setting endport minimal MTU to:%u defined by port:0x%" - PRIx64 ".\n", + PRIx64 "\n", mtu, cl_ntoh64( port_guid ) ); p_rcv->p_subn->min_ca_mtu = mtu; @@ -137,7 +137,7 @@ __osm_pi_rcv_process_endport( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pi_rcv_process_endport: " "Setting endport minimal rate to:%u defined by port:0x%" - PRIx64 ".\n", + PRIx64 "\n", rate, cl_ntoh64( port_guid ) ); p_rcv->p_subn->min_ca_rate = rate; @@ -177,7 +177,7 @@ __osm_pi_rcv_process_endport( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pi_rcv_process_endport: " - "Ignoring SM on port 0x%" PRIx64 ".\n", + "Ignoring SM on port 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); } else @@ -187,12 +187,12 @@ __osm_pi_rcv_process_endport( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pi_rcv_process_endport: " "Detected another SM. Requesting SMInfo." - "\n\t\t\t\tPort 0x%" PRIx64 ".\n", + "\n\t\t\t\tPort 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); } /* - This port indicates it's an SM, and it's not our own port. + This port indicates it's an SM and it's not our own port. Acquire the SMInfo Attribute. */ cl_memclr( &context, sizeof(context) ); @@ -208,7 +208,7 @@ __osm_pi_rcv_process_endport( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pi_rcv_process_endport: ERR 0F05: " - "Failure requesting SMInfo (%s).\n", + "Failure requesting SMInfo (%s)\n", ib_get_err_str( status ) ); } } @@ -232,6 +232,7 @@ __osm_pi_rcv_process_switch_port( osm_madw_context_t context; osm_physp_t *p_remote_physp; osm_node_t *p_remote_node; + ib_net16_t orig_lid; uint8_t port_num; uint8_t remote_port_num; osm_dr_path_t path; @@ -262,7 +263,7 @@ __osm_pi_rcv_process_switch_port( "__osm_pi_rcv_process_switch_port: " "Unlinking local node 0x%" PRIx64 ", port 0x%X" "\n\t\t\t\tand remote node 0x%" PRIx64 - ", port 0x%X.\n", + ", port 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), port_num, cl_ntoh64( osm_node_get_node_guid( p_remote_node ) ), @@ -310,8 +311,8 @@ __osm_pi_rcv_process_switch_port( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pi_rcv_process_switch_port: ERR 0F02: " - "Failure initiating NodeInfo request (%s).\n", - ib_get_err_str(status)); + "Failure initiating NodeInfo request (%s)\n", + ib_get_err_str(status) ); } } else @@ -320,7 +321,7 @@ __osm_pi_rcv_process_switch_port( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pi_rcv_process_switch_port: " - "Skipping SMP responder port 0x%X.\n", + "Skipping SMP responder port 0x%X\n", p_pi->local_port_num ); } } @@ -329,8 +330,8 @@ __osm_pi_rcv_process_switch_port( default: osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pi_rcv_process_switch_port: ERR 0F03: " - "Unknown link state = %u, port = 0x%X.\n", - osm_physp_get_port_state( p_physp ), + "Unknown link state = %u, port = 0x%X\n", + ib_port_info_get_port_state( p_pi ), p_pi->local_port_num ); break; } @@ -343,8 +344,13 @@ __osm_pi_rcv_process_switch_port( if (port_num == 0) { - /* This is a management port 0 */ - __osm_pi_rcv_process_endport(p_rcv, p_physp, p_pi); + /* This is switch management port 0 */ + if ( ( orig_lid = osm_physp_trim_base_lid_to_valid_range( p_physp ) ) ) + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_pi_rcv_process_switch_port: ERR 0F04: " + "Invalid base LID 0x%x corrected\n", + cl_ntoh16( orig_lid ) ); + __osm_pi_rcv_process_endport(p_rcv, p_physp, p_pi); } OSM_LOG_EXIT( p_rcv->p_log ); @@ -359,11 +365,18 @@ __osm_pi_rcv_process_ca_port( IN osm_physp_t* const p_physp, IN const ib_port_info_t* const p_pi ) { + ib_net16_t orig_lid; + OSM_LOG_ENTER( p_rcv->p_log, __osm_pi_rcv_process_ca_port ); UNUSED_PARAM( p_node ); osm_physp_set_port_info( p_physp, p_pi ); + if ( (orig_lid = osm_physp_trim_base_lid_to_valid_range( p_physp ) ) ) + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_pi_rcv_process_ca_port: ERR 0F08: " + "Invalid base LID 0x%x corrected\n", + cl_ntoh16 ( orig_lid ) ); __osm_pi_rcv_process_endport(p_rcv, p_physp, p_pi); @@ -379,6 +392,8 @@ __osm_pi_rcv_process_router_port( IN osm_physp_t* const p_physp, IN const ib_port_info_t* const p_pi ) { + ib_net16_t orig_lid; + OSM_LOG_ENTER( p_rcv->p_log, __osm_pi_rcv_process_router_port ); UNUSED_PARAM( p_node ); @@ -387,10 +402,18 @@ __osm_pi_rcv_process_router_port( Update the PortInfo attribute. */ osm_physp_set_port_info( p_physp, p_pi ); + if ( (orig_lid = osm_physp_trim_base_lid_to_valid_range( p_physp ) ) ) + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_pi_rcv_process_router_port: ERR 0F09: " + "Invalid base LID 0x%x corrected\n", + cl_ntoh16 ( orig_lid) ); + + __osm_pi_rcv_process_endport(p_rcv, p_physp, p_pi); OSM_LOG_EXIT( p_rcv->p_log ); } +#define IBM_VENDOR_ID (0x5076) /********************************************************************** **********************************************************************/ void osm_pkey_get_tables( @@ -423,7 +446,7 @@ void osm_pkey_get_tables( if (osm_node_get_type( p_node ) != IB_NODE_TYPE_SWITCH || port_num == 0 ) { - /* The maximum blocks is defined on the node info partition cap for CA, routers and + /* The maximum blocks is defined by the node info partition cap for CA, routers and switch management ports. */ max_blocks = (cl_ntoh16(p_node->node_info.partition_cap)+IB_NUM_PKEY_ELEMENTS_IN_BLOCK -1) / IB_NUM_PKEY_ELEMENTS_IN_BLOCK ; @@ -437,13 +460,17 @@ void osm_pkey_get_tables( if (! p_switch) { osm_log( p_log, OSM_LOG_ERROR, - "osm_physp_has_pkey: ERR 4A02: " + "osm_physp_has_pkey: ERR 0F11: " "Cannot find switch by guid: %" PRIx64 "\n", cl_ntoh64(p_node->node_info.node_guid) ); goto Exit; } - /* bail out if this is a switch with no partition enforcement capability */ + /* Check for IBM eHCA firmware defect in reporting partition enforcement cap */ + if (cl_ntoh32(ib_node_info_get_vendor_id(&p_node->node_info)) == IBM_VENDOR_ID) + p_switch->switch_info.enforce_cap = 0; + + /* Bail out if this is a switch with no partition enforcement capability */ if (cl_ntoh16(p_switch->switch_info.enforce_cap) == 0) goto Exit; @@ -467,8 +494,8 @@ void osm_pkey_get_tables( if( status != IB_SUCCESS ) { osm_log( p_log, OSM_LOG_ERROR, - "osm_physp_has_pkey: ERR 4A03: " - "Failure initiating PkeyTable request (%s).\n", + "osm_physp_has_pkey: ERR 0F12: " + "Failure initiating PkeyTable request (%s)\n", ib_get_err_str(status)); goto Exit; } @@ -577,7 +604,7 @@ osm_pi_rcv_process_set( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pi_rcv_process_set: ERR 0F10: " - "Received Error Status for SetResp()\n"); + "Received error status for SetResp()\n"); osm_dump_port_info( p_rcv->p_log, osm_node_get_node_guid( p_node ), @@ -594,7 +621,7 @@ osm_pi_rcv_process_set( "Received logical SetResp() for GUID = 0x%" PRIx64 ", port num = %u" "\n\t\t\t\tfor parent node GUID = 0x%" PRIx64 - " TID = 0x%" PRIx64 ".\n", + " TID = 0x%" PRIx64 "\n", cl_ntoh64( port_guid ), port_num, cl_ntoh64( osm_node_get_node_guid( p_node ) ), @@ -657,7 +684,7 @@ osm_pi_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_pi_rcv_process: " "Got light sweep response from remote port of parent node GUID = 0x%" PRIx64 - " port = %u, Commencing heavy sweep.\n", + " port = %u, Commencing heavy sweep\n", cl_ntoh64( node_guid ), cl_ntoh64( port_guid ) ); osm_state_mgr_process( p_rcv->p_state_mgr, @@ -676,7 +703,7 @@ osm_pi_rcv_process( "osm_pi_rcv_process: ERR 0F06: " "No Port object for port with GUID = 0x%" PRIx64 "\n\t\t\t\tfor parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), cl_ntoh64( p_smp->trans_id ) ); @@ -685,7 +712,7 @@ osm_pi_rcv_process( /* If we were setting the PortInfo, then receiving - this attribute was not part of sweeping the subent. + this attribute was not part of sweeping the subnet. In this case, just update the PortInfo attribute. In an unfortunate blunder, the IB spec defines the @@ -712,7 +739,7 @@ osm_pi_rcv_process( "osm_pi_rcv_process: " "Discovered port num %u with GUID = 0x%" PRIx64 " for parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", port_num, cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), @@ -727,7 +754,7 @@ osm_pi_rcv_process( /* Determine if we encountered a new Physical Port. - If so, initialize the new Physical Port then + If so, initialize the new Physical Port then continue processing as normal. */ if( !osm_physp_is_valid( p_physp ) ) @@ -736,7 +763,7 @@ osm_pi_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_pi_rcv_process: " - "Initializing port number 0x%X.\n", + "Initializing port number 0x%X\n", port_num ); } @@ -767,7 +794,7 @@ osm_pi_rcv_process( OSM_LOG_DEBUG ); /* - Check if the update_sm_base_lid in the context is on TRUE. + Check if the update_sm_base_lid in the context is TRUE. If it is - then update the master_sm_base_lid of the variable in the subnet. */ @@ -799,7 +826,7 @@ osm_pi_rcv_process( default: osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pi_rcv_process: ERR 0F07: " - "Unknown node type %u with GUID = 0x%" PRIx64 ".\n", + "Unknown node type %u with GUID = 0x%" PRIx64 "\n", osm_node_get_type( p_node ), cl_ntoh64( node_guid ) ); break; diff --git a/trunk/ulp/opensm/user/opensm/osm_port_info_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_port_info_rcv_ctrl.c index 5aaba07a..b9862203 100644 --- a/trunk/ulp/opensm/user/opensm/osm_port_info_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_port_info_rcv_ctrl.c @@ -105,7 +105,6 @@ osm_pi_rcv_ctrl_init( osm_pi_rcv_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_rcv = p_rcv; p_ctrl->p_disp = p_disp; @@ -119,7 +118,7 @@ osm_pi_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_pi_rcv_ctrl_init: ERR 1001: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -129,8 +128,3 @@ osm_pi_rcv_ctrl_init( return( status ); } - - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_req.c b/trunk/ulp/opensm/user/opensm/osm_req.c index 7306a9df..0a43f98e 100644 --- a/trunk/ulp/opensm/user/opensm/osm_req.c +++ b/trunk/ulp/opensm/user/opensm/osm_req.c @@ -71,6 +71,8 @@ void osm_req_construct( IN osm_req_t* const p_req ) { + CL_ASSERT( p_req ); + cl_memclr( p_req, sizeof(*p_req) ); } @@ -83,7 +85,6 @@ osm_req_destroy( CL_ASSERT( p_req ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -96,12 +97,12 @@ osm_req_init( IN atomic32_t* const p_sm_trans_id ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_req_init ); osm_req_construct( p_req ); p_req->p_log = p_log; - p_req->p_pool = p_pool; p_req->p_vl15 = p_vl15; p_req->p_subn = p_subn; @@ -127,9 +128,10 @@ osm_req_get( ib_api_status_t status = IB_SUCCESS; ib_net64_t tid; + CL_ASSERT( p_req ); + OSM_LOG_ENTER( p_req->p_log, osm_req_get ); - CL_ASSERT( p_req ); CL_ASSERT( p_path ); CL_ASSERT( attr_id ); @@ -148,7 +150,7 @@ osm_req_get( { osm_log( p_req->p_log, OSM_LOG_ERROR, "osm_req_get: ERR 1101: " - "Unable to acquire MAD.\n" ); + "Unable to acquire MAD\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -159,7 +161,7 @@ osm_req_get( { osm_log( p_req->p_log, OSM_LOG_DEBUG, "osm_req_get: " - "Getting %s (0x%X), modifier = 0x%X, TID = 0x%" PRIx64 ".\n", + "Getting %s (0x%X), modifier = 0x%X, TID = 0x%" PRIx64 "\n", ib_get_sm_attr_str( attr_id ), cl_ntoh16( attr_id ), cl_ntoh32( attr_mod ), @@ -217,9 +219,10 @@ osm_req_set( ib_api_status_t status = IB_SUCCESS; ib_net64_t tid; + CL_ASSERT( p_req ); + OSM_LOG_ENTER( p_req->p_log, osm_req_set ); - CL_ASSERT( p_req ); CL_ASSERT( p_path ); CL_ASSERT( attr_id ); CL_ASSERT( p_payload ); @@ -239,7 +242,7 @@ osm_req_set( { osm_log( p_req->p_log, OSM_LOG_ERROR, "osm_req_set: ERR 1102: " - "Unable to acquire MAD.\n" ); + "Unable to acquire MAD\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -250,7 +253,7 @@ osm_req_set( { osm_log( p_req->p_log, OSM_LOG_DEBUG, "osm_req_set: " - "Setting %s (0x%X), modifier = 0x%X, TID = 0x%" PRIx64 ".\n", + "Setting %s (0x%X), modifier = 0x%X, TID = 0x%" PRIx64 "\n", ib_get_sm_attr_str( attr_id ), cl_ntoh16( attr_id ), cl_ntoh32( attr_mod ), @@ -293,7 +296,3 @@ osm_req_set( return( status ); } - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_req_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_req_ctrl.c index c5708822..42b9aee2 100644 --- a/trunk/ulp/opensm/user/opensm/osm_req_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_req_ctrl.c @@ -97,7 +97,6 @@ osm_req_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -108,12 +107,12 @@ osm_req_ctrl_init( IN cl_dispatcher_t* const p_disp ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_req_ctrl_init ); osm_req_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_disp = p_disp; p_ctrl->p_req = p_req; @@ -127,7 +126,7 @@ osm_req_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_req_ctrl_init: ERR 1202: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_resp.c b/trunk/ulp/opensm/user/opensm/osm_resp.c index 2f50055c..ddf3a9cb 100644 --- a/trunk/ulp/opensm/user/opensm/osm_resp.c +++ b/trunk/ulp/opensm/user/opensm/osm_resp.c @@ -90,6 +90,7 @@ osm_resp_init( IN osm_log_t* const p_log ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_resp_init ); osm_resp_construct( p_resp ); @@ -124,7 +125,9 @@ osm_resp_make_resp_smp( p_src_smp->method == IB_MAD_METHOD_SET ) { p_dest_smp->method = IB_MAD_METHOD_GET_RESP; p_dest_smp->status = (ib_net16_t)(status | IB_SMP_DIRECTION); - } else if (p_src_smp->method == IB_MAD_METHOD_TRAP) { + } + else if (p_src_smp->method == IB_MAD_METHOD_TRAP) + { p_dest_smp->method = IB_MAD_METHOD_TRAP_REPRESS; p_dest_smp->status = 0; } @@ -132,7 +135,7 @@ osm_resp_make_resp_smp( { osm_log( p_resp->p_log, OSM_LOG_ERROR, "osm_resp_make_resp_smp: ERR 1302: " - "src smp method unsupported 0x%X.\n", + "src smp method unsupported 0x%X\n", p_src_smp->method ); goto Exit; } @@ -177,13 +180,13 @@ osm_resp_send( { osm_log( p_resp->p_log, OSM_LOG_ERROR, "osm_resp_send: ERR 1301: " - "Unable to acquire MAD.\n" ); + "Unable to acquire MAD\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } /* - Copy the requester smp to the response smp, then just + Copy the request smp to the response smp, then just update the necessary fields. */ p_smp = osm_madw_get_smp_ptr( p_madw ); @@ -203,7 +206,7 @@ osm_resp_send( osm_log( p_resp->p_log, OSM_LOG_DEBUG, "osm_resp_send: " "Responding to %s (0x%X)" - "\n\t\t\t\tattribute modifier = 0x%X, TID = 0x%" PRIx64 ".\n", + "\n\t\t\t\tattribute modifier = 0x%X, TID = 0x%" PRIx64 "\n", ib_get_sm_attr_str( p_smp->attr_id ), cl_ntoh16( p_smp->attr_id ), cl_ntoh32( p_smp->attr_mod ), diff --git a/trunk/ulp/opensm/user/opensm/osm_sa.c b/trunk/ulp/opensm/user/opensm/osm_sa.c index 3c62aa37..f7b14057 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa.c @@ -86,6 +86,9 @@ osm_sa_construct( osm_pir_rcv_construct( &p_sa->pir_rcv ); osm_pir_rcv_ctrl_construct( &p_sa->pir_rcv_ctrl ); + osm_gir_rcv_construct( &p_sa->gir_rcv ); + osm_gir_rcv_ctrl_construct( &p_sa->gir_rcv_ctrl ); + osm_lr_rcv_construct( &p_sa->lr_rcv ); osm_lr_rcv_ctrl_construct( &p_sa->lr_rcv_ctrl ); @@ -132,6 +135,7 @@ osm_sa_shutdown( /* remove any registered dispatcher message */ osm_nr_rcv_ctrl_destroy( &p_sa->nr_rcv_ctrl ); osm_pir_rcv_ctrl_destroy( &p_sa->pir_rcv_ctrl ); + osm_gir_rcv_ctrl_destroy( &p_sa->gir_rcv_ctrl ); osm_lr_rcv_ctrl_destroy( &p_sa->lr_rcv_ctrl ); osm_pr_rcv_ctrl_destroy( &p_sa->pr_rcv_ctrl ); osm_smir_ctrl_destroy( &p_sa->smir_ctrl ); @@ -159,6 +163,7 @@ osm_sa_destroy( osm_nr_rcv_destroy( &p_sa->nr_rcv ); osm_pir_rcv_destroy( &p_sa->pir_rcv ); + osm_gir_rcv_destroy( &p_sa->gir_rcv ); osm_lr_rcv_destroy( &p_sa->lr_rcv ); osm_pr_rcv_destroy( &p_sa->pr_rcv ); osm_smir_rcv_destroy( &p_sa->smir_rcv ); @@ -207,8 +212,6 @@ osm_sa_init( if( status != IB_SUCCESS ) goto Exit; - - status = osm_sa_mad_ctrl_init( &p_sa->mad_ctrl, &p_sa->resp, @@ -275,6 +278,24 @@ osm_sa_init( if( status != IB_SUCCESS ) goto Exit; + status = osm_gir_rcv_init( + &p_sa->gir_rcv, + &p_sa->resp, + p_sa->p_mad_pool, + p_subn, + p_log, + p_lock ); + if( status != IB_SUCCESS ) + goto Exit; + + status = osm_gir_rcv_ctrl_init( + &p_sa->gir_rcv_ctrl, + &p_sa->gir_rcv, + p_log, + p_disp ); + if( status != IB_SUCCESS ) + goto Exit; + status = osm_lr_rcv_init( &p_sa->lr_rcv, &p_sa->resp, @@ -495,7 +516,7 @@ ib_gid_t osm_ipoib_mgid = { }; /* - * HACK: Until TS resolves their un-compliant join compmask + * HACK: Until TS resolves their noncompliant join compmask * we have to pre-define the MGID */ ib_gid_t osm_ts_ipoib_mgid = { @@ -542,7 +563,6 @@ osm_sa_create_template_record_ipoib( * HACK: Until TS resolves their noncompliant join compmask * we have to pre-define the MGID */ - mc_rec.mgid = osm_ts_ipoib_mgid; osm_sa_add_well_known_mc_record(&p_sa->mcmr_rcv, &mc_rec); @@ -553,7 +573,6 @@ osm_sa_create_template_record_ipoib( /********************************************************************** **********************************************************************/ - void osm_sa_add_well_known_mc_record( osm_mcmr_recv_t* const p_mcmr, @@ -569,6 +588,7 @@ osm_sa_add_well_known_mc_record( p_mcmr, comp_mask, p_well_know_mc_rec, + NULL, &p_mgrp); if(p_mgrp) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c b/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c index 4454afa8..85bfca89 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c @@ -82,7 +82,6 @@ osm_cpi_rcv_destroy( OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -139,7 +138,7 @@ __osm_cpi_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_cpi_rcv_respond: ERR 1408: " - "Unable to allocate MAD.\n" ); + "Unable to allocate MAD\n" ); goto Exit; } @@ -181,7 +180,6 @@ __osm_cpi_rcv_respond( SMInfoRecord, (we do support it - under the table) InformInfoRecord, LinkRecord, (we do support it - under the table) - GuidInfoRecord ServiceAssociationRecord OSM_CAP_IS_SUBN_OPT_MULTI_PATH_SUP: @@ -207,7 +205,7 @@ __osm_cpi_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_cpi_rcv_respond: ERR 1409: " - "Unable to send MAD (%s).\n", ib_get_err_str( status ) ); + "Unable to send MAD (%s)\n", ib_get_err_str( status ) ); /* osm_mad_pool_put( p_rcv->p_mad_pool, p_resp_madw ); */ goto Exit; } @@ -216,7 +214,6 @@ __osm_cpi_rcv_respond( OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** * This code actually handles the call **********************************************************************/ @@ -239,7 +236,7 @@ osm_cpi_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_cpi_rcv_process: ERR 1403: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info_ctrl.c index 126cd3c2..d67a78f0 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info_ctrl.c @@ -88,7 +88,6 @@ osm_cpi_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_cpi_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_cpi_rcv_ctrl_init: ERR 1501: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -127,4 +126,3 @@ osm_cpi_rcv_ctrl_init( return( status ); } - diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_guidinfo_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_guidinfo_record.c new file mode 100644 index 00000000..6b916195 --- /dev/null +++ b/trunk/ulp/opensm/user/opensm/osm_sa_guidinfo_record.c @@ -0,0 +1,621 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +/* + * Abstract: + * Implementation of osm_gir_rcv_t. + * This object represents the GUIDInfoRecord Receiver object. + * This object is part of the opensm family of objects. + * + * Environment: + * Linux User Mode + * + */ + +/* + Next available error code: 0x403 +*/ + +#if HAVE_CONFIG_H +# include +#endif /* HAVE_CONFIG_H */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OSM_GIR_RCV_POOL_MIN_SIZE 32 +#define OSM_GIR_RCV_POOL_GROW_SIZE 32 + +typedef struct _osm_gir_item +{ + cl_pool_item_t pool_item; + ib_guidinfo_record_t rec; + +} osm_gir_item_t; + +typedef struct _osm_gir_search_ctxt +{ + const ib_guidinfo_record_t* p_rcvd_rec; + ib_net64_t comp_mask; + cl_qlist_t* p_list; + osm_gir_rcv_t* p_rcv; + const osm_physp_t* p_req_physp; + +} osm_gir_search_ctxt_t; + +/********************************************************************** + **********************************************************************/ +void +osm_gir_rcv_construct( + IN osm_gir_rcv_t* const p_rcv ) +{ + cl_memclr( p_rcv, sizeof(*p_rcv) ); + cl_qlock_pool_construct( &p_rcv->pool ); +} + +/********************************************************************** + **********************************************************************/ +void +osm_gir_rcv_destroy( + IN osm_gir_rcv_t* const p_rcv ) +{ + OSM_LOG_ENTER( p_rcv->p_log, osm_gir_rcv_destroy ); + cl_qlock_pool_destroy( &p_rcv->pool ); + OSM_LOG_EXIT( p_rcv->p_log ); +} + +/********************************************************************** + **********************************************************************/ +ib_api_status_t +osm_gir_rcv_init( + IN osm_gir_rcv_t* const p_rcv, + IN osm_sa_resp_t* const p_resp, + IN osm_mad_pool_t* const p_mad_pool, + IN const osm_subn_t* const p_subn, + IN osm_log_t* const p_log, + IN cl_plock_t* const p_lock ) +{ + ib_api_status_t status; + + OSM_LOG_ENTER( p_log, osm_gir_rcv_init ); + + osm_gir_rcv_construct( p_rcv ); + + p_rcv->p_log = p_log; + p_rcv->p_subn = p_subn; + p_rcv->p_lock = p_lock; + p_rcv->p_resp = p_resp; + p_rcv->p_mad_pool = p_mad_pool; + + status = cl_qlock_pool_init( &p_rcv->pool, + OSM_GIR_RCV_POOL_MIN_SIZE, + 0, + OSM_GIR_RCV_POOL_GROW_SIZE, + sizeof(osm_gir_item_t), + NULL, NULL, NULL ); + + OSM_LOG_EXIT( p_log ); + return( status ); +} + +/********************************************************************** + **********************************************************************/ +static ib_api_status_t +__osm_gir_rcv_new_gir( + IN osm_gir_rcv_t* const p_rcv, + IN const osm_node_t* const p_node, + IN cl_qlist_t* const p_list, + IN ib_net64_t const match_port_guid, + IN ib_net16_t const match_lid, + IN const osm_physp_t* const p_req_physp, + IN uint8_t const block_num ) +{ + osm_gir_item_t* p_rec_item; + ib_api_status_t status = IB_SUCCESS; + + OSM_LOG_ENTER( p_rcv->p_log, __osm_gir_rcv_new_gir ); + + p_rec_item = (osm_gir_item_t*)cl_qlock_pool_get( &p_rcv->pool ); + if( p_rec_item == NULL ) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_gir_rcv_new_gir: ERR 5102: " + "cl_qlock_pool_get failed\n" ); + status = IB_INSUFFICIENT_RESOURCES; + goto Exit; + } + + if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_gir_rcv_new_gir: " + "New GUIDInfoRecord: lid 0x%X, block num %d\n", + cl_ntoh16( match_lid ), block_num ); + } + + cl_memclr( &p_rec_item->rec, sizeof( p_rec_item->rec ) ); + + p_rec_item->rec.lid = match_lid; + p_rec_item->rec.block_num = block_num; + if (!block_num) + p_rec_item->rec.guid_info.guid[0] = osm_physp_get_port_guid( p_req_physp ); + + cl_qlist_insert_tail( p_list, (cl_list_item_t*)&p_rec_item->pool_item ); + + Exit: + OSM_LOG_EXIT( p_rcv->p_log ); + return( status ); +} + +/********************************************************************** + **********************************************************************/ +void +__osm_sa_gir_create_gir( + IN osm_gir_rcv_t* const p_rcv, + IN const osm_node_t* const p_node, + IN cl_qlist_t* const p_list, + IN ib_net64_t const match_port_guid, + IN ib_net16_t const match_lid, + IN const osm_physp_t* const p_req_physp, + IN uint8_t const match_block_num ) +{ + const osm_physp_t* p_physp; + uint8_t port_num; + uint8_t num_ports; + uint16_t match_lid_ho; + uint16_t lid_ho; + ib_net16_t base_lid_ho; + ib_net16_t max_lid_ho; + uint8_t lmc; + ib_net64_t port_guid; + ib_api_status_t status; + const ib_port_info_t* p_pi; + uint8_t block_num, start_block_num, end_block_num, num_blocks; + + OSM_LOG_ENTER( p_rcv->p_log, __osm_sa_gir_create_gir ); + + if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_sa_gir_create_gir: " + "Looking for GUIDRecord with LID: 0x%X GUID:0x%016" PRIx64 "\n", + cl_ntoh16( match_lid ), + cl_ntoh64( match_port_guid ) + ); + } + + /* + For switches, do not return the GUIDInfo record(s) + for each port on the switch, just for port 0. + */ + if( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH ) + num_ports = 1; + else + num_ports = osm_node_get_num_physp( p_node ); + + for( port_num = 0; port_num < num_ports; port_num++ ) + { + p_physp = osm_node_get_physp_ptr( p_node, port_num ); + + if( !osm_physp_is_valid( p_physp ) ) + continue; + + /* Check to see if the found p_physp and the requestor physp + share a pkey. If not - continue */ + if (!osm_physp_share_pkey( p_rcv->p_log, p_physp, p_req_physp ) ) + continue; + + port_guid = osm_physp_get_port_guid( p_physp ); + + if( match_port_guid && ( port_guid != match_port_guid ) ) + continue; + + p_pi = osm_physp_get_port_info_ptr( p_physp ); + num_blocks = p_pi->guid_cap / 8; + if ( p_pi->guid_cap % 8 ) + num_blocks++; + if (match_block_num == 255) + { + start_block_num = 0; + end_block_num = num_blocks - 1; + } + else + { + if (match_block_num >= num_blocks) + continue; + end_block_num = start_block_num = match_block_num; + } + + base_lid_ho = cl_ntoh16( osm_physp_get_base_lid( p_physp ) ); + lmc = osm_physp_get_lmc( p_physp ); + max_lid_ho = (uint16_t)( base_lid_ho + (1 << lmc) - 1 ); + match_lid_ho = cl_ntoh16( match_lid ); + + if( match_lid_ho ) + { + /* + We validate that the lid belongs to this node. + */ + if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "__osm_sa_gir_create_gir: " + "Comparing LID: 0x%X <= 0x%X <= 0x%X\n", + cl_ntoh16( base_lid_ho ), + cl_ntoh16( match_lid_ho ), + cl_ntoh16( max_lid_ho ) + ); + } + + if( (match_lid_ho <= max_lid_ho) && (match_lid_ho >= base_lid_ho) ) + { + /* + Ignore return code for now. + */ + for (block_num = start_block_num; block_num <= end_block_num; block_num++) + __osm_gir_rcv_new_gir( p_rcv, p_node, p_list, + port_guid, match_lid, + p_physp, block_num ); + } + } + else + { + /* + For every lid value create the GUIDInfo record(s). + */ + for( lid_ho = base_lid_ho; lid_ho <= max_lid_ho; lid_ho++ ) + { + for (block_num = start_block_num; block_num <= end_block_num; block_num++) + { + status = __osm_gir_rcv_new_gir( p_rcv, p_node, p_list, + port_guid, cl_hton16( lid_ho ), + p_physp, block_num ); + if( status != IB_SUCCESS ) + break; + } + } + } + } + + OSM_LOG_EXIT( p_rcv->p_log ); +} + +/********************************************************************** + **********************************************************************/ +void +__osm_sa_gir_by_comp_mask_cb( + IN cl_map_item_t* const p_map_item, + IN void* context ) +{ + const osm_gir_search_ctxt_t* const p_ctxt = (osm_gir_search_ctxt_t *)context; + const osm_node_t* const p_node = (osm_node_t*)p_map_item; + const ib_guidinfo_record_t* const p_rcvd_rec = p_ctxt->p_rcvd_rec; + const osm_physp_t* const p_req_physp = p_ctxt->p_req_physp; + osm_gir_rcv_t* const p_rcv = p_ctxt->p_rcv; + const ib_guid_info_t* p_comp_gi; + ib_net64_t const comp_mask = p_ctxt->comp_mask; + ib_net64_t match_port_guid = 0; + ib_net16_t match_lid = 0; + uint8_t match_block_num = 255; + + OSM_LOG_ENTER( p_ctxt->p_rcv->p_log, __osm_sa_gir_by_comp_mask_cb); + + if( comp_mask & IB_GIR_COMPMASK_LID ) + match_lid = p_rcvd_rec->lid; + + if( comp_mask & IB_GIR_COMPMASK_BLOCKNUM ) + match_block_num = p_rcvd_rec->block_num; + + p_comp_gi = &p_rcvd_rec->guid_info; + /* Different rule for block 0 v. other blocks */ + if( comp_mask & IB_GIR_COMPMASK_GID0 ) + { + if ( !p_rcvd_rec->block_num ) + match_port_guid = osm_physp_get_port_guid( p_req_physp ); + if ( p_comp_gi->guid[0] != match_port_guid ) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID1 ) + { + if ( p_comp_gi->guid[1] != 0) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID2 ) + { + if ( p_comp_gi->guid[2] != 0) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID3 ) + { + if ( p_comp_gi->guid[3] != 0) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID4 ) + { + if ( p_comp_gi->guid[4] != 0) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID5 ) + { + if ( p_comp_gi->guid[5] != 0) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID6 ) + { + if ( p_comp_gi->guid[6] != 0) + goto Exit; + } + + if( comp_mask & IB_GIR_COMPMASK_GID7 ) + { + if ( p_comp_gi->guid[7] != 0) + goto Exit; + } + + __osm_sa_gir_create_gir( p_rcv, p_node, p_ctxt->p_list, + match_port_guid, match_lid, p_req_physp, + match_block_num ); + + Exit: + OSM_LOG_EXIT( p_ctxt->p_rcv->p_log ); +} + +/********************************************************************** + **********************************************************************/ +void +osm_gir_rcv_process( + IN osm_gir_rcv_t* const p_rcv, + IN const osm_madw_t* const p_madw ) +{ + const ib_sa_mad_t* p_rcvd_mad; + const ib_guidinfo_record_t* p_rcvd_rec; + cl_qlist_t rec_list; + osm_madw_t* p_resp_madw; + ib_sa_mad_t* p_resp_sa_mad; + ib_guidinfo_record_t* p_resp_rec; + uint32_t num_rec, pre_trim_num_rec; +#ifndef VENDOR_RMPP_SUPPORT + uint32_t trim_num_rec; +#endif + uint32_t i; + osm_gir_search_ctxt_t context; + osm_gir_item_t* p_rec_item; + ib_api_status_t status; + osm_physp_t* p_req_physp; + + CL_ASSERT( p_rcv ); + + OSM_LOG_ENTER( p_rcv->p_log, osm_gir_rcv_process ); + + CL_ASSERT( p_madw ); + + p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); + p_rcvd_rec = (ib_guidinfo_record_t*)ib_sa_mad_get_payload_ptr( p_rcvd_mad ); + + CL_ASSERT( p_rcvd_mad->attr_id == IB_MAD_ATTR_GUIDINFO_RECORD ); + + /* update the requestor physical port. */ + p_req_physp = osm_get_physp_by_mad_addr(p_rcv->p_log, + p_rcv->p_subn, + osm_madw_get_mad_addr_ptr(p_madw) ); + if (p_req_physp == NULL) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "osm_gir_rcv_process: ERR 5104: " + "Cannot find requestor physical port\n" ); + goto Exit; + } + + if ( (p_rcvd_mad->method != IB_MAD_METHOD_GET) && + (p_rcvd_mad->method != IB_MAD_METHOD_GETTABLE) ) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "osm_gir_rcv_process: ERR 5105: " + "Unsupported Method (%s)\n", + ib_get_sa_method_str( p_rcvd_mad->method ) ); + osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); + goto Exit; + } + + if ( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + osm_dump_guidinfo_record( p_rcv->p_log, p_rcvd_rec, OSM_LOG_DEBUG ); + + cl_qlist_init( &rec_list ); + + context.p_rcvd_rec = p_rcvd_rec; + context.p_list = &rec_list; + context.comp_mask = p_rcvd_mad->comp_mask; + context.p_rcv = p_rcv; + context.p_req_physp = p_req_physp; + + cl_plock_acquire( p_rcv->p_lock ); + + cl_qmap_apply_func( &p_rcv->p_subn->node_guid_tbl, + __osm_sa_gir_by_comp_mask_cb, + &context ); + + cl_plock_release( p_rcv->p_lock ); + + num_rec = cl_qlist_count( &rec_list ); + + /* + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! + */ + if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && + (num_rec > 1)) { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "osm_gir_rcv_process: " + "Got more than one record for SubnAdmGet (%u)\n", + num_rec ); + osm_sa_send_error( p_rcv->p_resp, p_madw, + IB_SA_MAD_STATUS_TOO_MANY_RECORDS); + + /* need to set the mem free ... */ + p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list ); + while( p_rec_item != (osm_gir_item_t*)cl_qlist_end( &rec_list ) ) + { + cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item ); + p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list ); + } + + goto Exit; + } + + pre_trim_num_rec = num_rec; +#ifndef VENDOR_RMPP_SUPPORT + trim_num_rec = (MAD_BLOCK_SIZE - IB_SA_MAD_HDR_SIZE) / sizeof(ib_guidinfo_record_t); + if (trim_num_rec < num_rec) + { + osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, + "osm_gir_rcv_process: " + "Number of records:%u trimmed to:%u to fit in one MAD\n", + num_rec, trim_num_rec ); + num_rec = trim_num_rec; + } +#endif + + osm_log( p_rcv->p_log, OSM_LOG_DEBUG, + "osm_gir_rcv_process: " + "Returning %u records\n", num_rec ); + + if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) + { + osm_sa_send_error( p_rcv->p_resp, p_madw, + IB_SA_MAD_STATUS_NO_RECORDS ); + goto Exit; + } + + /* + * Get a MAD to reply. Address of Mad is in the received mad_wrapper + */ + p_resp_madw = osm_mad_pool_get( p_rcv->p_mad_pool, + p_madw->h_bind, + num_rec * sizeof(ib_guidinfo_record_t) + IB_SA_MAD_HDR_SIZE, + &p_madw->mad_addr ); + + if( !p_resp_madw ) + { + osm_log(p_rcv->p_log, OSM_LOG_ERROR, + "osm_gir_rcv_process: ERR 5106: " + "osm_mad_pool_get failed\n" ); + + for( i = 0; i < num_rec; i++ ) + { + p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list ); + cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item ); + } + + osm_sa_send_error( p_rcv->p_resp, p_madw, + IB_SA_MAD_STATUS_NO_RESOURCES ); + + goto Exit; + } + + p_resp_sa_mad = osm_madw_get_sa_mad_ptr( p_resp_madw ); + + /* + Copy the MAD header back into the response mad. + Set the 'R' bit and the payload length, + Then copy all records from the list into the response payload. + */ + + cl_memcpy( p_resp_sa_mad, p_rcvd_mad, IB_SA_MAD_HDR_SIZE ); + p_resp_sa_mad->method = (uint8_t)(p_resp_sa_mad->method | 0x80); + /* C15-0.1.5 - always return SM_Key = 0 (table 151 p 782) */ + p_resp_sa_mad->sm_key = 0; + /* Fill in the offset (paylen will be done by the rmpp SAR) */ + p_resp_sa_mad->attr_offset = + ib_get_attr_offset( sizeof(ib_guidinfo_record_t) ); + + p_resp_rec = (ib_guidinfo_record_t*) + ib_sa_mad_get_payload_ptr( p_resp_sa_mad ); + +#ifndef VENDOR_RMPP_SUPPORT + /* we support only one packet RMPP - so we will set the first and + last flags for gettable */ + if (p_resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP) + { + p_resp_sa_mad->rmpp_type = IB_RMPP_TYPE_DATA; + p_resp_sa_mad->rmpp_flags = IB_RMPP_FLAG_FIRST | IB_RMPP_FLAG_LAST | IB_RMPP_FLAG_ACTIVE; + } +#else + /* forcefully define the packet as RMPP one */ + if (p_resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP) + p_resp_sa_mad->rmpp_flags = IB_RMPP_FLAG_ACTIVE; +#endif + + for( i = 0; i < pre_trim_num_rec; i++ ) + { + p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list ); + /* copy only if not trimmed */ + if (i < num_rec) + { + *p_resp_rec = p_rec_item->rec; + } + cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item ); + p_resp_rec++; + } + + CL_ASSERT( cl_is_qlist_empty( &rec_list ) ); + + status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE); + if(status != IB_SUCCESS) + { + osm_log(p_rcv->p_log, OSM_LOG_ERROR, + "osm_gir_rcv_process: ERR 5107: " + "osm_vendor_send. status = %s\n", + ib_get_err_str(status)); + goto Exit; + } + + Exit: + OSM_LOG_EXIT( p_rcv->p_log ); +} diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_guidinfo_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_guidinfo_record_ctrl.c new file mode 100644 index 00000000..511bdd90 --- /dev/null +++ b/trunk/ulp/opensm/user/opensm/osm_sa_guidinfo_record_ctrl.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +/* + * Abstract: + * Implementation of osm_gir_rcv_ctrl_t. + * This object represents the GUIDInfoRecord request controller object. + * This object is part of the opensm family of objects. + * + * Environment: + * Linux User Mode + * + */ + +/* + Next available error code: 0x203 +*/ + +#if HAVE_CONFIG_H +# include +#endif /* HAVE_CONFIG_H */ + +#include +#include +#include + +/********************************************************************** + **********************************************************************/ +void +__osm_gir_rcv_ctrl_disp_callback( + IN void *context, + IN void *p_data ) +{ + /* ignore return status when invoked via the dispatcher */ + osm_gir_rcv_process( ((osm_gir_rcv_ctrl_t*)context)->p_rcv, + (osm_madw_t*)p_data ); +} + +/********************************************************************** + **********************************************************************/ +void +osm_gir_rcv_ctrl_construct( + IN osm_gir_rcv_ctrl_t* const p_ctrl ) +{ + cl_memclr( p_ctrl, sizeof(*p_ctrl) ); + p_ctrl->h_disp = CL_DISP_INVALID_HANDLE; +} + +/********************************************************************** + **********************************************************************/ +void +osm_gir_rcv_ctrl_destroy( + IN osm_gir_rcv_ctrl_t* const p_ctrl ) +{ + CL_ASSERT( p_ctrl ); + cl_disp_unregister( p_ctrl->h_disp ); +} + +/********************************************************************** + **********************************************************************/ +ib_api_status_t +osm_gir_rcv_ctrl_init( + IN osm_gir_rcv_ctrl_t* const p_ctrl, + IN osm_gir_rcv_t* const p_rcv, + IN osm_log_t* const p_log, + IN cl_dispatcher_t* const p_disp ) +{ + ib_api_status_t status = IB_SUCCESS; + + OSM_LOG_ENTER( p_log, osm_gir_rcv_ctrl_init ); + + osm_gir_rcv_ctrl_construct( p_ctrl ); + p_ctrl->p_log = p_log; + p_ctrl->p_rcv = p_rcv; + p_ctrl->p_disp = p_disp; + + p_ctrl->h_disp = cl_disp_register( + p_disp, + OSM_MSG_MAD_GUIDINFO_RECORD, + __osm_gir_rcv_ctrl_disp_callback, + p_ctrl ); + + if( p_ctrl->h_disp == CL_DISP_INVALID_HANDLE ) + { + osm_log( p_log, OSM_LOG_ERROR, + "osm_gir_rcv_ctrl_init: ERR 5201: " + "Dispatcher registration failed\n" ); + status = IB_INSUFFICIENT_RESOURCES; + goto Exit; + } + + Exit: + OSM_LOG_EXIT( p_log ); + return( status ); +} diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c b/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c index 246c21a2..4cf2ff9b 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c @@ -84,7 +84,6 @@ osm_infr_rcv_destroy( OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -136,8 +135,8 @@ __validate_ports_access_rights( ib_net16_t lid_range_end; ib_net16_t lid; const cl_ptr_vector_t* p_tbl; - ib_gid_t zero_gid; + OSM_LOG_ENTER( p_rcv->p_log, __validate_ports_access_rights ); /* get the requestor physp from the request address */ @@ -158,7 +157,7 @@ __validate_ports_access_rights( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__validate_ports_access_rights: ERR 4301: " - "Invalid port guid: 0x%016 \n", + "Invalid port guid: 0x%016\n", portguid ); valid = FALSE; goto Exit; @@ -173,7 +172,7 @@ __validate_ports_access_rights( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_ports_access_rights: " - "port and requestor don't share pkey. \n" ); + "port and requestor don't share pkey\n" ); valid = FALSE; goto Exit; } @@ -205,7 +204,7 @@ __validate_ports_access_rights( /* lid requested is out of range */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__validate_ports_access_rights: ERR 4302: " - "Given LID (%u) is out of range:%u. \n", + "Given LID (%u) is out of range:%u\n", lid, cl_ptr_vector_get_size(p_tbl) ); valid = FALSE; goto Exit; @@ -220,7 +219,7 @@ __validate_ports_access_rights( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_ports_access_rights: " - "port and requestor don't share pkey. \n" ); + "port and requestor don't share pkey\n" ); valid = FALSE; goto Exit; } @@ -234,7 +233,6 @@ __validate_ports_access_rights( /********************************************************************** **********************************************************************/ - static boolean_t __validate_infr( @@ -245,13 +243,12 @@ __validate_infr( OSM_LOG_ENTER( p_rcv->p_log, __validate_infr ); - valid = __validate_ports_access_rights( p_rcv, p_infr_rec); if(!valid) { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_infr: " - "Invalid Access for InformInfo.\n"); + "Invalid Access for InformInfo\n"); valid = FALSE; goto Exit; } @@ -259,7 +256,6 @@ __validate_infr( Exit: OSM_LOG_EXIT( p_rcv->p_log ); return valid; - } /********************************************************************** @@ -284,7 +280,7 @@ __osm_infr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_infr_rcv_respond: " - "Generating successful InformInfo response.\n"); + "Generating successful InformInfo response\n"); } /* @@ -298,7 +294,7 @@ __osm_infr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_infr_rcv_respond: ERR 4303: " - "Unable to allocate MAD.\n" ); + "Unable to allocate MAD\n" ); goto Exit; } @@ -324,7 +320,7 @@ __osm_infr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_infr_rcv_respond: ERR 4304: " - "Unable to send MAD (%s).\n", ib_get_err_str( status ) ); + "Unable to send MAD (%s)\n", ib_get_err_str( status ) ); /* osm_mad_pool_put( p_rcv->p_mad_pool, p_resp_madw ); */ goto Exit; } @@ -334,7 +330,7 @@ __osm_infr_rcv_respond( } /********************************************************************** -Recived an Set(InformInfo) MAD +Received an Set(InformInfo) MAD **********************************************************************/ static void @@ -410,7 +406,7 @@ osm_infr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_infr_rcv_process_set_method: " - "Got Subscribe Request with QPN: 0x%06X.\n", + "Got Subscribe Request with QPN: 0x%06X\n", cl_ntoh32(inform_info_rec.report_addr.addr_type.gsi.remote_qp) ); } @@ -422,7 +418,7 @@ osm_infr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_infr_rcv_process_set_method: " - "Got UnSubscribe Request with QPN: 0x%06X.\n", + "Got UnSubscribe Request with QPN: 0x%06X\n", cl_ntoh32(qpn) ); } @@ -444,7 +440,7 @@ osm_infr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_infr_rcv_process_set_method: ERR 4305: " - "Fail to validate a new inform object.\n"); + "Fail to validate a new inform object\n"); /* o13-13.1.1: we need to set the subscribe bit to 0 */ p_recvd_inform_info->subscribe = 0; @@ -467,7 +463,7 @@ osm_infr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_infr_rcv_process_set_method: ERR 4306: " - "Fail to create a new inform object.\n"); + "Fail to create a new inform object\n"); /* o13-13.1.1: we need to set the subscribe bit to 0 */ p_recvd_inform_info->subscribe = 0; @@ -476,7 +472,6 @@ osm_infr_rcv_process_set_method( p_madw, IB_SA_MAD_STATUS_NO_RESOURCES); - goto Exit; } @@ -503,7 +498,7 @@ osm_infr_rcv_process_set_method( /* No Such Item - So Error */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_infr_rcv_process_set_method: ERR 4307: " - "Fail to Un-Subscribe to non exiting inform object.\n"); + "Fail to Un-Subscribe to non exiting inform object\n"); /* o13-13.1.1: we need to set the subscribe bit to 0 */ p_recvd_inform_info->subscribe = 0; @@ -564,4 +559,3 @@ osm_infr_rcv_process( return; } - diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_informinfo_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_informinfo_ctrl.c index b2cc8185..0178559a 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_informinfo_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_informinfo_ctrl.c @@ -88,7 +88,6 @@ osm_infr_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_infr_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_infr_rcv_ctrl_init: ERR 1701: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c index ed3894ee..7c54edb4 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c @@ -155,7 +155,7 @@ __osm_lftr_rcv_new_lftr( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lftr_rcv_new_lftr: ERR 4402: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -205,7 +205,7 @@ __osm_lftr_get_port_by_guid( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_lftr_get_port_by_guid ERR 4404: " - "Invalid port_guid 0x%016" PRIx64 ".\n", + "Invalid port_guid 0x%016" PRIx64 "\n", port_guid); CL_PLOCK_RELEASE(p_rcv->p_lock); return NULL; @@ -235,7 +235,7 @@ __osm_lftr_rcv_by_comp_mask( uint16_t sw_max_lid_ho, lids_per_block; const osm_physp_t* p_physp; - /* In switches the port guid is the node guid. */ + /* In switches, the port guid is the node guid. */ p_port = __osm_lftr_get_port_by_guid( p_rcv, p_sw->p_node->node_info.port_guid); if (! p_port) @@ -243,7 +243,7 @@ __osm_lftr_rcv_by_comp_mask( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lftr_rcv_by_comp_mask: ERR 4405: " "Fail to find Port by Node Guid:0x%016" PRIx64 - ".\n", + "\n", cl_ntoh64( p_sw->p_node->node_info.node_guid ) ); return; @@ -260,7 +260,7 @@ __osm_lftr_rcv_by_comp_mask( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lftr_rcv_by_comp_mask: ERR 4406: " "Fail to find default physical Port by Node Guid:0x%016" PRIx64 - ".\n", + "\n", cl_ntoh64( p_sw->p_node->node_info.node_guid ) ); return; @@ -326,9 +326,10 @@ osm_lftr_rcv_process( ib_api_status_t status; osm_physp_t* p_req_physp; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_lftr_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -344,7 +345,7 @@ osm_lftr_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lftr_rcv_process: ERR 4407: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -352,7 +353,7 @@ osm_lftr_rcv_process( (p_rcvd_mad->method != IB_MAD_METHOD_GETTABLE) ) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lftr_rcv_process: ERR 4408: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_rcvd_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -378,14 +379,14 @@ osm_lftr_rcv_process( num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lftr_rcv_process: ERR 4409: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -409,7 +410,7 @@ osm_lftr_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_lftr_rcv_process: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -417,7 +418,7 @@ osm_lftr_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_lftr_rcv_process: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if ((p_rcvd_mad->method != IB_MAD_METHOD_GETTABLE) && (num_rec == 0)) @@ -439,7 +440,7 @@ osm_lftr_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_lftr_rcv_process: ERR 4410: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_lft_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_lft_record_ctrl.c index e60dd05a..dbeee1d4 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_lft_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_lft_record_ctrl.c @@ -88,7 +88,6 @@ osm_lftr_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_lftr_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_lftr_rcv_ctrl_init: ERR 4501: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_link_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_link_record.c index 8c6827bd..2db42f86 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_link_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_link_record.c @@ -64,7 +64,7 @@ #include #define OSM_LR_RCV_POOL_MIN_SIZE 64 -#define OSM_LR_RCV_POOL_GROW_SIZE 64 +#define OSM_LR_RCV_POOL_GROW_SIZE 64 typedef struct _osm_lr_item { @@ -106,6 +106,7 @@ osm_lr_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_lr_rcv_init ); osm_lr_rcv_construct( p_rcv ); @@ -146,7 +147,7 @@ __osm_lr_rcv_build_physp_link( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lr_rcv_build_physp_link: ERR 1801: " - "Unable to acquire link record.\n" + "Unable to acquire link record\n" "\t\t\t\tFrom port 0x%\n" "\t\t\t\tTo port 0x%\n" "\t\t\t\tFrom lid 0x%\n" @@ -232,7 +233,7 @@ __osm_lr_rcv_get_physp_link( Ensure the two physp's are actually connected. If not, bail out. */ - if( osm_physp_get_remote( p_src_physp ) != p_src_physp ) + if( osm_physp_get_remote( p_src_physp ) != p_dest_physp ) goto Exit; } else @@ -310,7 +311,7 @@ __osm_lr_rcv_get_physp_link( "__osm_lr_rcv_get_physp_link: " "Acquiring link record.\n" "\t\t\t\tsrc port 0x%" PRIx64 " (port 0x%X)" - ", dest port 0x%" PRIx64 " (port 0x%X).\n", + ", dest port 0x%" PRIx64 " (port 0x%X)\n", cl_ntoh64( osm_physp_get_port_guid( p_src_physp ) ), src_port_num, cl_ntoh64( osm_physp_get_port_guid( p_dest_physp ) ), @@ -390,9 +391,11 @@ __osm_lr_rcv_get_port_links( { p_dest_physp = osm_port_get_phys_ptr( p_dest_port, dest_port_num ); - __osm_lr_rcv_get_physp_link( p_rcv, p_lr, p_src_physp, - p_dest_physp, comp_mask, - p_list, p_req_physp ); + /* both physical ports should be with data */ + if (p_src_physp && p_dest_physp) + __osm_lr_rcv_get_physp_link( p_rcv, p_lr, p_src_physp, + p_dest_physp, comp_mask, + p_list, p_req_physp ); } } } @@ -409,9 +412,10 @@ __osm_lr_rcv_get_port_links( if (port_num < p_src_port->physp_tbl_size) { p_src_physp = osm_port_get_phys_ptr( p_src_port, port_num ); - __osm_lr_rcv_get_physp_link( p_rcv, p_lr, p_src_physp, - NULL, comp_mask, p_list, - p_req_physp ); + if (p_src_physp) + __osm_lr_rcv_get_physp_link( p_rcv, p_lr, p_src_physp, + NULL, comp_mask, p_list, + p_req_physp ); } } else @@ -420,9 +424,10 @@ __osm_lr_rcv_get_port_links( for( port_num = 1; port_num < num_ports; port_num++ ) { p_src_physp = osm_port_get_phys_ptr( p_src_port, port_num ); - __osm_lr_rcv_get_physp_link( p_rcv, p_lr, p_src_physp, - NULL, comp_mask, p_list, - p_req_physp ); + if (p_src_physp) + __osm_lr_rcv_get_physp_link( p_rcv, p_lr, p_src_physp, + NULL, comp_mask, p_list, + p_req_physp ); } } } @@ -443,9 +448,10 @@ __osm_lr_rcv_get_port_links( { p_dest_physp = osm_port_get_phys_ptr( p_dest_port, port_num ); - __osm_lr_rcv_get_physp_link( p_rcv, p_lr, NULL, - p_dest_physp, comp_mask, - p_list, p_req_physp ); + if (p_dest_physp) + __osm_lr_rcv_get_physp_link( p_rcv, p_lr, NULL, + p_dest_physp, comp_mask, + p_list, p_req_physp ); } } else @@ -455,9 +461,10 @@ __osm_lr_rcv_get_port_links( { p_dest_physp = osm_port_get_phys_ptr( p_dest_port, port_num ); - __osm_lr_rcv_get_physp_link( p_rcv, p_lr, NULL, - p_dest_physp, comp_mask, - p_list, p_req_physp ); + if (p_dest_physp) + __osm_lr_rcv_get_physp_link( p_rcv, p_lr, NULL, + p_dest_physp, comp_mask, + p_list, p_req_physp ); } } } @@ -529,7 +536,7 @@ __osm_lr_rcv_get_end_points( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_lr_rcv_get_end_points: " - "No source port with LID = 0x%X.\n", + "No source port with LID = 0x%X\n", cl_ntoh16( p_lr->from_lid ) ); sa_status = IB_SA_MAD_STATUS_NO_RECORDS; @@ -553,7 +560,7 @@ __osm_lr_rcv_get_end_points( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_lr_rcv_get_end_points: " - "No dest port with LID = 0x%X.\n", + "No dest port with LID = 0x%X\n", cl_ntoh16( p_lr->to_lid ) ); sa_status = IB_SA_MAD_STATUS_NO_RECORDS; @@ -590,14 +597,14 @@ __osm_lr_rcv_respond( num_rec = cl_qlist_count( p_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lr_rcv_respond: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -619,7 +626,7 @@ __osm_lr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_lr_rcv_respond: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -629,7 +636,7 @@ __osm_lr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_lr_rcv_respond: " - "Generating response with %u records.", num_rec ); + "Generating response with %u records", num_rec ); } /* @@ -643,7 +650,7 @@ __osm_lr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lr_rcv_respond: ERR 1802: " - "Unable to allocate MAD.\n" ); + "Unable to allocate MAD\n" ); /* Release the quick pool items */ p_lr_item = (osm_lr_item_t*)cl_qlist_remove_head( p_list ); while( p_lr_item != (osm_lr_item_t*)cl_qlist_end( p_list ) ) @@ -715,7 +722,7 @@ __osm_lr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lr_rcv_respond: ERR 1803: " - "Unable to send MAD (%s).\n", ib_get_err_str( status ) ); + "Unable to send MAD (%s)\n", ib_get_err_str( status ) ); /* osm_mad_pool_put( p_rcv->p_mad_pool, p_resp_madw ); */ goto Exit; } @@ -751,7 +758,7 @@ osm_lr_rcv_process( (p_sa_mad->method != IB_MAD_METHOD_GETTABLE)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lr_rcv_process: ERR 1804: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -767,7 +774,7 @@ osm_lr_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_lr_rcv_process: ERR 1805: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_mad_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_mad_ctrl.c index 278e5cea..94eecfb9 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_mad_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_mad_ctrl.c @@ -83,6 +83,7 @@ __osm_sa_mad_ctrl_disp_done_callback( osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); OSM_LOG_EXIT( p_ctrl->p_log ); } + /************/ /****f* opensm: SA/__osm_sa_mad_ctrl_process_get * NAME @@ -113,7 +114,7 @@ __osm_sa_mad_ctrl_process( But how do we know? The dispatcher reports back the number of outstanding messages and the time the last message stayed in the queue. - HACK: Actually, we cannot send a mad within the receive callback, + HACK: Actually, we cannot send a mad from within the receive callback; thus - we will just drop it. */ cl_disp_get_queue_status(p_ctrl->h_disp, @@ -127,7 +128,7 @@ __osm_sa_mad_ctrl_process( osm_log( p_ctrl->p_log, OSM_LOG_INFO, "__osm_sa_mad_ctrl_process: " /* "Responding BUSY status since the dispatcher is already"*/ - "Dropping mad since the dispatcher is already" + "Dropping MAD since the dispatcher is already" " overloaded with %u messages and queue time of:%u[msec]\n", num_messages, last_dispatched_msg_queue_time_msec); @@ -201,10 +202,14 @@ __osm_sa_mad_ctrl_process( msg_id = OSM_MSG_MAD_LFT_RECORD; break; + case IB_MAD_ATTR_GUIDINFO_RECORD: + msg_id = OSM_MSG_MAD_GUIDINFO_RECORD; + break; + default: osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sa_mad_ctrl_process: ERR 1A01: " - "Unsupported attribute = 0x%X.\n", + "Unsupported attribute = 0x%X\n", cl_ntoh16( p_sa_mad->attr_id ) ); osm_dump_sa_mad( p_ctrl->p_log, p_sa_mad, OSM_LOG_ERROR ); } @@ -218,7 +223,7 @@ __osm_sa_mad_ctrl_process( osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sa_mad_ctrl_process: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( msg_id ) ); status = cl_disp_post( p_ctrl->h_disp, @@ -231,8 +236,9 @@ __osm_sa_mad_ctrl_process( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sa_mad_ctrl_process: ERR 1A02: " - "Dispatcher post message failed (%s).\n", - CL_STATUS_MSG( status ) ); + "Dispatcher post message failed (%s) for attribute = 0x%X\n", + CL_STATUS_MSG( status ), + cl_ntoh16( p_sa_mad->attr_id ) ); osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); goto Exit; @@ -292,7 +298,7 @@ __osm_sa_mad_ctrl_rcv_callback( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sa_mad_ctrl_rcv_callback: " - "%u QP1 MADs received.\n", + "%u QP1 MADs received\n", p_ctrl->p_stats->qp1_mads_rcvd ); } @@ -308,7 +314,7 @@ __osm_sa_mad_ctrl_rcv_callback( { osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE, "__osm_sa_mad_ctrl_rcv_callback: " - "Received SA MAD while SM is not MASTER. MAD ignored.\n"); + "Received SA MAD while SM not MASTER. MAD ignored\n"); osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); goto Exit; } @@ -316,7 +322,7 @@ __osm_sa_mad_ctrl_rcv_callback( { osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE, "__osm_sa_mad_ctrl_rcv_callback: " - "Received SA MAD while SM in first sweep. MAD ignored.\n"); + "Received SA MAD while SM in first sweep. MAD ignored\n"); osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); goto Exit; } @@ -335,8 +341,8 @@ __osm_sa_mad_ctrl_rcv_callback( (p_sa_mad->sm_key != p_ctrl->p_subn->opt.sm_key)) { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sa_mad_ctrl_rcv_callback: ERR 1A04: " - "Non Zero SA MAD SM_Key: 0x%" PRIx64 " != SM_Key : 0x%" PRIx64 - " Mad Ignored.\n", + "Non-Zero SA MAD SM_Key: 0x%" PRIx64 " != SM_Key: 0x%" PRIx64 + "; MAD ignored\n", cl_ntoh64(p_sa_mad->sm_key), cl_ntoh64(p_ctrl->p_subn->opt.sm_key) ); @@ -351,7 +357,7 @@ __osm_sa_mad_ctrl_rcv_callback( just retire the transaction */ osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sa_mad_ctrl_rcv_callback: " - "Received Report Repress. Retiring the transaction.\n"); + "Received Report Repress. Retiring the transaction\n"); if (p_req_madw) osm_mad_pool_put( p_ctrl->p_mad_pool, p_req_madw ); @@ -369,7 +375,7 @@ __osm_sa_mad_ctrl_rcv_callback( default: osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sa_mad_ctrl_rcv_callback: ERR 1A05: " - "Not yet implemented Method=<0x%X> Attribute=<0x%X>", + "Not yet implemented Method=<0x%X> Attribute=<0x%X>\n", p_sa_mad->method,p_sa_mad->attr_id); osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); goto Exit; @@ -411,14 +417,14 @@ __osm_sa_mad_ctrl_send_err_callback( osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sa_mad_ctrl_send_err_callback: ERR 1A06: " - "MAD transaction completed in error.\n" ); + "MAD transaction completed in error\n" ); /* We should never be here since the SA never originates a request. Unless we generated a Report(Notice) */ + CL_ASSERT( p_madw ); - CL_ASSERT( p_madw->resp_expected == TRUE); /* An error occurred. No response was received to a request MAD. @@ -436,7 +442,7 @@ __osm_sa_mad_ctrl_send_err_callback( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sa_mad_ctrl_send_err_callback: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( osm_madw_get_err_msg( p_madw ) ) ); } @@ -449,7 +455,7 @@ __osm_sa_mad_ctrl_send_err_callback( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sa_mad_ctrl_send_err_callback: ERR 1A07: " - "Dispatcher post message failed (%s).\n", + "Dispatcher post message failed (%s)\n", CL_STATUS_MSG( status ) ); } } @@ -495,7 +501,6 @@ osm_sa_mad_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -533,7 +538,7 @@ osm_sa_mad_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_sa_mad_ctrl_init: ERR 1A08: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -559,7 +564,7 @@ osm_sa_mad_ctrl_bind( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "osm_sa_mad_ctrl_bind: ERR 1A09: " - "Multiple binds not allowed. Call unbind first. " ); + "Multiple binds not allowed\n" ); status = IB_ERROR; goto Exit; } @@ -575,7 +580,7 @@ osm_sa_mad_ctrl_bind( osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE, "osm_sa_mad_ctrl_bind: " - "Binding to port GUID 0x%" PRIx64 ".\n", + "Binding to port GUID 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); p_ctrl->h_bind = osm_vendor_bind( p_ctrl->p_vendor, @@ -590,7 +595,7 @@ osm_sa_mad_ctrl_bind( status = IB_ERROR; osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "osm_sa_mad_ctrl_bind: ERR 1A10: " - "Vendor specific bind() failed (%s).\n", + "Vendor specific bind failed (%s)\n", ib_get_err_str(status) ); goto Exit; } @@ -614,7 +619,7 @@ osm_sa_mad_ctrl_unbind( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "osm_sa_mad_ctrl_unbind: ERR 1A11: " - "No previous bind. Call bind first.\n" ); + "No previous bind\n" ); status = IB_ERROR; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c index 5d729410..b4da07ce 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c @@ -106,10 +106,12 @@ void osm_mcmr_rcv_destroy( IN osm_mcmr_recv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_mcmr_rcv_destroy ); - CL_ASSERT( p_rcv ); cl_qlock_pool_destroy( &p_rcv->pool ); + OSM_LOG_EXIT( p_rcv->p_log ); } @@ -148,7 +150,7 @@ osm_mcmr_rcv_init( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_init: ERR 1B02: " - "Error Init of qlock pool (%d).\n", + "Error Init of qlock pool (%d)\n", status ); } OSM_LOG_EXIT( p_rcv->p_log ); @@ -162,7 +164,7 @@ osm_mcmr_rcv_init( Inputs: p_map_item - which is part of a mgrp object - context - points to the osm_sa_mcmr_search_ctxt_t including the mgid + context - points to the osm_sa_mcmr_search_ctxt_t including the mgid looked for and the result p_mgrp **********************************************************************/ static @@ -194,7 +196,7 @@ __search_mgrp_by_mgid( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__search_mgrp_by_mgid: ERR 1B03: " - "Multiple MCGROUP for same MGID.\n" ); + "Multiple MC groups for same MGID\n" ); return; } p_ctxt->p_mgrp = p_mgrp; @@ -672,6 +674,57 @@ __validate_more_comp_fields( return TRUE; } +/********************************************************************* +In joining an existing group, we make sure the following components +are physically realizable: MTU and RATE +**********************************************************************/ +static boolean_t +__validate_port_caps( + osm_log_t * const p_log, + const osm_mgrp_t *p_mgrp, + const osm_physp_t *p_physp) +{ + ib_port_info_t *p_pi; + uint8_t mtu_required; + uint8_t mtu_mgrp; + uint8_t rate_required; + uint8_t rate_mgrp; + + p_pi = osm_physp_get_port_info_ptr(p_physp); + if (!p_pi) + { + osm_log( p_log, OSM_LOG_DEBUG, + "__validate_port_caps: " + "Cannot get Port's 0x%016" PRIx64 " PortInfo\n", + osm_physp_get_port_guid(p_physp)); + return FALSE; + } + + mtu_required = ib_port_info_get_mtu_cap(p_pi); + mtu_mgrp = (uint8_t)(p_mgrp->mcmember_rec.mtu & 0x3F); + if (mtu_required < mtu_mgrp) + { + osm_log( p_log, OSM_LOG_DEBUG, + "__validate_port_caps: " + "Port's MTU %x is less than %x\n", + mtu_required, mtu_mgrp); + return FALSE; + } + + rate_required = ib_port_info_compute_rate(p_pi); + rate_mgrp = (uint8_t)(p_mgrp->mcmember_rec.rate & 0x3F); + if (rate_required < rate_mgrp) + { + osm_log( p_log, OSM_LOG_DEBUG, + "__validate_port_caps: " + "Port's RATE %x is less than %x\n", + rate_required, rate_mgrp); + return FALSE; + } + + return TRUE; +} + /********************************************************************** * o15-0.2.1: If SA supports UD multicast, then if SA receives a SubnAdmSet() * or SubnAdmDelete() method that would modify an existing @@ -697,12 +750,12 @@ __validate_modify(IN osm_mcmr_recv_t* const p_rcv, *pp_mcm_port = NULL; - /* o15-0.2.1 : If this is a new port adding - nothing to check */ + /* o15-0.2.1: If this is a new port being added - nothing to check */ if (! osm_mgrp_is_port_present(p_mgrp, portguid, pp_mcm_port)) { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_modify: " - "This is a new port in the mgroup\n"); + "This is a new port in the MC group\n"); return TRUE; } @@ -794,7 +847,7 @@ __validate_delete(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_delete: " - "Failed to find the port in the mgroup\n"); + "Failed to find the port in the MC group\n"); return FALSE; } @@ -815,7 +868,7 @@ __validate_delete(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_delete: " - "Some bits in the request JoinState (0x%X) are not set in the stored port (0x%X).\n", + "Some bits in the request JoinState (0x%X) are not set in the stored port (0x%X)\n", (p_recvd_mcmember_rec->scope_state & 0x0F), (0x0F & (*pp_mcm_port)->scope_state) ); @@ -829,7 +882,7 @@ __validate_delete(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_delete: " - "proxy_join validation failure.\n" ); + "proxy_join validation failure\n" ); return FALSE; } return TRUE; @@ -886,12 +939,12 @@ __validate_requested_mgid(IN osm_mcmr_recv_t* const p_rcv, OSM_LOG_ENTER( p_rcv->p_log, __validate_requested_mgid ); - /* 14-a : mcast GID must start with 0xFF */ + /* 14-a: mcast GID must start with 0xFF */ if (p_mcm_rec->mgid.multicast.header[0] != 0xFF) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__validate_requested_mgid: ERR 1B01: " - "Wrong MGID Prefix 0x%02X Must be 0xFF.\n", + "Wrong MGID Prefix 0x%02X must be 0xFF\n", cl_ntoh16(p_mcm_rec->mgid.multicast.header[0]) ); valid = FALSE; @@ -903,7 +956,7 @@ __validate_requested_mgid(IN osm_mcmr_recv_t* const p_rcv, signature = cl_ntoh16(signature); osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_requested_mgid: " - "MGID Signed as 0x%04X.\n", + "MGID Signed as 0x%04X\n", signature ); @@ -930,7 +983,7 @@ __validate_requested_mgid(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__validate_requested_mgid: " - "Skipping MGID Validation for IPoIB Signed (0x%04X) MGIDs.\n", + "Skipping MGID Validation for IPoIB Signed (0x%04X) MGIDs\n", signature ); goto Exit; @@ -941,7 +994,7 @@ __validate_requested_mgid(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__validate_requested_mgid: ERR 1B28: " - "MGID Uses Reserved Flags: flags=0x%X.\n", + "MGID uses Reserved Flags: flags=0x%X\n", (p_mcm_rec->mgid.multicast.header[1] & 0xE0) >> 4 ); valid = FALSE; @@ -954,7 +1007,7 @@ __validate_requested_mgid(IN osm_mcmr_recv_t* const p_rcv, ((p_mcm_rec->mgid.multicast.header[1] & 0x0F) == 0x02) ) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__validate_requested_mgid: ERR 1B24: " - "MGID Uses 0xA01B signature but with link-local scope.\n"); + "MGID Uses 0xA01B signature but with link-local scope\n"); valid = FALSE; goto Exit; } @@ -971,22 +1024,27 @@ __validate_requested_mgid(IN osm_mcmr_recv_t* const p_rcv, } /********************************************************************** - Check if the requested new mgroup parameters are realizable. + Check if the requested new MC group parameters are realizable. Also set the default MTU and Rate if not provided by the user. **********************************************************************/ boolean_t __mgrp_request_is_realizable( IN osm_mcmr_recv_t* const p_rcv, IN ib_net64_t comp_mask, - IN ib_member_rec_t * p_mcm_rec) + IN ib_member_rec_t * p_mcm_rec, + IN const osm_physp_t* const p_physp) { uint8_t mtu_sel; uint8_t mtu_required; uint8_t rate_sel; uint8_t rate_required; osm_log_t *p_log = p_rcv->p_log; + ib_port_info_t *p_pi = NULL; + + OSM_LOG_ENTER( p_rcv->p_log, __mgrp_request_is_realizable;) - OSM_LOG_ENTER( p_rcv->p_log, __mgrp_request_is_realizable); + if (p_physp != NULL) + p_pi = osm_physp_get_port_info_ptr(p_physp); /* * End of o15-0.1.6 specifies: @@ -1030,17 +1088,24 @@ __mgrp_request_is_realizable( { osm_log( p_log, OSM_LOG_DEBUG, "__mgrp_request_is_realizable: " - "Requested MTU %x >= the maximal possible:%x \n", + "Requested MTU %x >= the maximal possible:%x\n", mtu_required, p_rcv->p_subn->min_ca_mtu); return FALSE; } break; case 1: /* Less than MTU specified */ - /* if the requested MTU is not already the minimal we just - use one lower */ + /* if the requested MTU is not already the minimal, then we will + use the smaller of the two: + a. one lower then the required + b. the mtu of the requesting port + If the p_pi is NULL, this means there is no requestor port and + just use mtu one lower than the required. */ if ( mtu_required > 1 ) { - p_mcm_rec->mtu--; + if (p_pi && ib_port_info_get_mtu_cap(p_pi) < (mtu_required - 1)) + p_mcm_rec->mtu = (mtu_sel<<6) | ib_port_info_get_mtu_cap(p_pi); + else + p_mcm_rec->mtu--; } else { @@ -1057,7 +1122,7 @@ __mgrp_request_is_realizable( { osm_log( p_log, OSM_LOG_DEBUG, "__mgrp_request_is_realizable: " - "Requested MTU %x out of range: 1 .. %x \n", + "Requested MTU %x out of range: 1 .. %x\n", mtu_required, p_rcv->p_subn->min_ca_mtu); return FALSE; } @@ -1099,17 +1164,25 @@ __mgrp_request_is_realizable( { osm_log( p_log, OSM_LOG_DEBUG, "__mgrp_request_is_realizable: " - "Requested RATE %x >= the maximal possible:%x \n", + "Requested RATE %x >= the maximal possible:%x\n", rate_required, p_rcv->p_subn->min_ca_rate); return FALSE; } break; case 1: /* Less than RATE specified */ - /* if the requested RATE is not already the minimal we just - use one lower */ + /* if the requested RATE is not already the minimal, then we will + use the smaller of the two: + a. one lower then the required + b. the rate of the requesting port + If the p_pi is NULL, this means there is no requestor port and + just use rate one lower than the required. */ + if ( rate_required > 2 ) { - p_mcm_rec->rate--; + if (p_pi && ib_port_info_compute_rate(p_pi) < (rate_required - 1)) + p_mcm_rec->rate = (rate_sel<<6) | ib_port_info_compute_rate(p_pi); + else + p_mcm_rec->rate--; } else { @@ -1126,7 +1199,7 @@ __mgrp_request_is_realizable( { osm_log( p_log, OSM_LOG_DEBUG, "__mgrp_request_is_realizable: " - "Requested RATE %x out of range: 2 .. %x \n", + "Requested RATE %x out of range: 2 .. %x\n", rate_required, p_rcv->p_subn->min_ca_rate); return FALSE; } @@ -1148,6 +1221,7 @@ osm_mcmr_rcv_create_new_mgrp( IN osm_mcmr_recv_t* const p_rcv, IN ib_net64_t comp_mask, IN const ib_member_rec_t* const p_recvd_mcmember_rec, + IN const osm_physp_t* const p_physp, OUT osm_mgrp_t **pp_mgrp) { ib_net16_t mlid; @@ -1164,7 +1238,8 @@ osm_mcmr_rcv_create_new_mgrp( /* but what if the given MGID was not 0 ? */ zero_mgid = 1; - for ( i = 0 ; i < sizeof(p_recvd_mcmember_rec->mgid); i++) { + for ( i = 0 ; i < sizeof(p_recvd_mcmember_rec->mgid); i++ ) + { if (p_recvd_mcmember_rec->mgid.raw[i] != 0) { zero_mgid = 0; @@ -1181,14 +1256,14 @@ osm_mcmr_rcv_create_new_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_create_new_mgrp: ERR 1B19: " - "__get_new_mlid failed.\n"); + "__get_new_mlid failed\n"); status = IB_SA_MAD_STATUS_NO_RESOURCES; goto Exit; } osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_create_new_mgrp: " - "Getting new mlid 0x%x.\n", cl_ntoh16(mlid)); + "Getting new mlid 0x%x\n", cl_ntoh16(mlid)); /* we need to create the new MGID if it was not defined */ if (zero_mgid) @@ -1236,7 +1311,7 @@ osm_mcmr_rcv_create_new_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_create_new_mgrp: ERR 1B22: " - "Invalid requested MGID.\n"); + "Invalid requested MGID\n"); __free_mlid(p_rcv, mlid); status = IB_SA_MAD_STATUS_REQ_INVALID; goto Exit; @@ -1244,11 +1319,11 @@ osm_mcmr_rcv_create_new_mgrp( } /* check the requested parameters are realizable */ - if (__mgrp_request_is_realizable(p_rcv, comp_mask, &mcm_rec) == FALSE) + if (__mgrp_request_is_realizable(p_rcv, comp_mask, &mcm_rec, p_physp) == FALSE) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_create_new_mgrp: ERR 1B26: " - "Requested MGRP parameters are not realizable.\n"); + "Requested MGRP parameters are not realizable\n"); __free_mlid(p_rcv, mlid); status = IB_SA_MAD_STATUS_REQ_INVALID; goto Exit; @@ -1261,7 +1336,7 @@ osm_mcmr_rcv_create_new_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_create_new_mgrp: ERR 1B08: " - "osm_mgrp_new failed.\n"); + "osm_mgrp_new failed\n"); __free_mlid(p_rcv, mlid); status = IB_SA_MAD_STATUS_NO_RESOURCES; goto Exit; @@ -1286,7 +1361,7 @@ osm_mcmr_rcv_create_new_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_create_new_mgrp: " - "Found previous group for mlid:0x%04x - Need to destroy it.\n", + "Found previous group for mlid:0x%04x - Need to destroy it\n", cl_ntoh16(mlid)); cl_qmap_remove_item(&p_rcv->p_subn->mgrp_mlid_tbl, (cl_map_item_t *)p_prev_mgrp ); @@ -1298,7 +1373,7 @@ osm_mcmr_rcv_create_new_mgrp( &(*pp_mgrp)->map_item); /* Send a Report to any InformInfo registerd for - Trap 66 : MCGroup create */ + Trap 66: MCGroup create */ osm_mgrp_send_create_notice(p_rcv->p_subn, p_rcv->p_log, *pp_mgrp); Exit: @@ -1369,7 +1444,7 @@ osm_mcmr_rcv_leave_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_leave_mgrp: " - "After update JoinState != 0. Updating from 0x%X to 0x%X.\n", + "After update JoinState != 0. Updating from 0x%X to 0x%X\n", port_join_state, new_join_state ); @@ -1394,8 +1469,7 @@ osm_mcmr_rcv_leave_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_leave_mgrp: ERR 1B09: " - "osm_sm_mcgrp_leave failed.\n"); - + "osm_sm_mcgrp_leave failed\n"); } CL_PLOCK_EXCL_ACQUIRE(p_rcv->p_lock); @@ -1408,7 +1482,7 @@ osm_mcmr_rcv_leave_mgrp( CL_PLOCK_RELEASE( p_rcv->p_lock ); osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_leave_mgrp: ERR 1B25: " - "Received an Invalid Delete Request on " + "Received an invalid delete request on " "MGID: 0x%016" PRIx64 " : " "0x%016" PRIx64 " for " "PortGID: 0x%016" PRIx64 " : " @@ -1428,7 +1502,7 @@ osm_mcmr_rcv_leave_mgrp( CL_PLOCK_RELEASE( p_rcv->p_lock ); osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_leave_mgrp: " - "Multicast group not present failed.\n"); + "Multicast group not present failed\n"); sa_status = IB_SA_MAD_STATUS_REQ_INVALID; osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status); goto Exit; @@ -1444,7 +1518,6 @@ osm_mcmr_rcv_leave_mgrp( Exit: OSM_LOG_EXIT( p_rcv->p_log ); return; - } /********************************************************************** @@ -1485,11 +1558,11 @@ osm_mcmr_rcv_join_mgrp( mcmember_rec = *p_recvd_mcmember_rec; - if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + if ( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_join_mgrp: " - "Dump of incoming record.\n"); + "Dump of incoming record\n"); osm_dump_mc_record( p_rcv->p_log, &mcmember_rec, OSM_LOG_DEBUG ); } @@ -1499,13 +1572,13 @@ osm_mcmr_rcv_join_mgrp( p_port = (osm_port_t *)cl_qmap_get(&p_rcv->p_subn->port_guid_tbl, portguid); - if(p_port == (osm_port_t *)cl_qmap_end(&p_rcv->p_subn->port_guid_tbl)) + if (p_port == (osm_port_t *)cl_qmap_end(&p_rcv->p_subn->port_guid_tbl)) { CL_PLOCK_RELEASE( p_rcv->p_lock ); osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_join_mgrp: " - "Invalid portguid =< 0x%016" PRIx64 ".\n", + "Invalid portguid =< 0x%016" PRIx64 "\n", portguid); sa_status = IB_SA_MAD_STATUS_REQ_INVALID; osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status); @@ -1531,7 +1604,7 @@ osm_mcmr_rcv_join_mgrp( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_rcv_join_mgrp: " - "port and requestor don't share pkey.\n" ); + "port and requestor don't share pkey\n" ); sa_status = IB_SA_MAD_STATUS_REQ_INVALID; osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status); goto Exit; @@ -1542,7 +1615,7 @@ osm_mcmr_rcv_join_mgrp( /* do we need to create a new group? */ status = __get_mgrp_by_mgid(p_rcv, p_recvd_mcmember_rec, &p_mgrp); - if((status == IB_NOT_FOUND) || p_mgrp->to_be_deleted) + if ((status == IB_NOT_FOUND) || p_mgrp->to_be_deleted) { /* check for JoinState.FullMember = 1 o15.0.1.9 */ if ((join_state & 0x01) != 0x01) @@ -1563,13 +1636,14 @@ osm_mcmr_rcv_join_mgrp( /* check for the comp_mask */ valid = __check_create_comp_mask(p_sa_mad->comp_mask, p_recvd_mcmember_rec); - if(valid) + if (valid) { status = osm_mcmr_rcv_create_new_mgrp(p_rcv, p_sa_mad->comp_mask, p_recvd_mcmember_rec, + p_physp, &p_mgrp); - if(status != IB_SUCCESS) + if (status != IB_SUCCESS) { CL_PLOCK_RELEASE( p_rcv->p_lock ); sa_status = status; @@ -1583,7 +1657,7 @@ osm_mcmr_rcv_join_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_join_mgrp: ERR 1B11: " - "method = %s," + "method = %s, " "scope_state = 0x%x, " "component mask = 0x%016" PRIx64 ", " "expected comp mask = 0x%016" PRIx64 ", " @@ -1637,14 +1711,18 @@ osm_mcmr_rcv_join_mgrp( p_rcv->p_log, p_mgrp, p_recvd_mcmember_rec, - p_sa_mad->comp_mask) && (join_state != 0); + p_sa_mad->comp_mask) && __validate_port_caps( + p_rcv->p_log, + p_mgrp, + p_physp) && (join_state != 0); - if(!valid) + if (! valid) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_join_mgrp: ERR 1B12: " - "__validate_more_comp_fields or JoinState = 0 failed, " - "sending IB_SA_MAD_STATUS_REQ_INVALID.\n"); + "__validate_more_comp_fields, __validate_port_caps, " + "or JoinState = 0 failed, " + "sending IB_SA_MAD_STATUS_REQ_INVALID\n"); /* since we might have created the new group we need to cleanup */ __cleanup_mgrp(p_rcv, mlid); @@ -1675,7 +1753,7 @@ osm_mcmr_rcv_join_mgrp( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_join_mgrp: ERR 1B13: " "__validate_modify failed, " - "sending IB_SA_MAD_STATUS_REQ_INVALID.\n"); + "sending IB_SA_MAD_STATUS_REQ_INVALID\n"); CL_PLOCK_RELEASE( p_rcv->p_lock ); @@ -1693,7 +1771,7 @@ osm_mcmr_rcv_join_mgrp( osm_madw_get_mad_addr_ptr(p_madw), &p_mcmr_port); - if(status != IB_SUCCESS) + if (status != IB_SUCCESS) { /* we fail to add the port so we might need to delete the group */ @@ -1721,18 +1799,18 @@ osm_mcmr_rcv_join_mgrp( p_recvd_mcmember_rec->port_gid.unicast.interface_id, req_type ); - if(status != IB_SUCCESS) + if (status != IB_SUCCESS) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_join_mgrp: ERR 1B14: " "osm_sm_mcgrp_join failed, " - "sending IB_SA_MAD_STATUS_NO_RESOURCES.\n"); + "sending IB_SA_MAD_STATUS_NO_RESOURCES\n"); CL_PLOCK_EXCL_ACQUIRE(p_rcv->p_lock); /* the request for routing failed so we need to remove the port */ p_mgrp = __get_mgrp_by_mlid(p_rcv, mlid); - if(p_mgrp != NULL) + if (p_mgrp != NULL) { osm_mgrp_remove_port( p_rcv->p_subn, @@ -1748,7 +1826,7 @@ osm_mcmr_rcv_join_mgrp( } /* failed to route */ - if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + if ( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) osm_dump_mc_record( p_rcv->p_log, &mcmember_rec, OSM_LOG_DEBUG ); __osm_mcmr_rcv_respond( p_rcv, @@ -1780,7 +1858,7 @@ __osm_mcmr_rcv_new_mcmr( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_mcmr_rcv_new_mcmr: ERR 1B15: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -1833,7 +1911,7 @@ __osm_sa_mcm_by_comp_mask_cb( { osm_log(p_rcv->p_log, OSM_LOG_DEBUG, "__osm_sa_mcm_by_comp_mask_cb: " - "Group mlid:0x%X is marked to be deleted.\n", + "Group mlid:0x%X is marked to be deleted\n", cl_ntoh16(p_mgrp->mlid )); goto Exit; } @@ -1865,7 +1943,7 @@ __osm_sa_mcm_by_comp_mask_cb( if (IB_MCR_COMPMASK_PORT_GID & comp_mask) { /* try to find this port */ - if (! osm_mgrp_is_port_present(p_mgrp, portguid, &p_mcm_port)) + if (osm_mgrp_is_port_present(p_mgrp, portguid, &p_mcm_port)) { scope_state = p_mcm_port->scope_state; } @@ -1964,9 +2042,10 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, osm_physp_t* p_req_physp; boolean_t trusted_req = TRUE; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_mcmr_query_mgrp ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -1983,7 +2062,7 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_query_mgrp: ERR 1B04: " - "Cannot find requestor physical port.\n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -2007,14 +2086,14 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_query_mgrp: ERR 1B05: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -2037,7 +2116,7 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_mcmr_query_mgrp: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -2045,7 +2124,7 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_mcmr_query_mgrp: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { @@ -2066,7 +2145,7 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_query_mgrp: ERR 1B16: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { @@ -2123,7 +2202,7 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, if (p_resp_sa_mad->sm_key == 0) trusted_req = FALSE; - for( i = 0; i < pre_trim_num_rec; i++ ) + for ( i = 0; i < pre_trim_num_rec; i++ ) { p_rec_item = (osm_mcmr_item_t*)cl_qlist_remove_head( &rec_list ); /* copy only if not trimmed */ @@ -2169,9 +2248,10 @@ osm_mcmr_rcv_process( ib_member_rec_t *p_recvd_mcmember_rec; boolean_t valid; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_mcmr_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -2215,7 +2295,7 @@ osm_mcmr_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_process: ERR 1B20: " "component mask = 0x%016" PRIx64 ", " - "expected comp mask = 0x%016" PRIx64 ".\n", + "expected comp mask = 0x%016" PRIx64 "\n", cl_ntoh64(p_sa_mad->comp_mask), CL_NTOH64(JOIN_MC_COMP_MASK)); @@ -2238,7 +2318,7 @@ osm_mcmr_rcv_process( default: osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_process: ERR 1B21: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status); break; diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record_ctrl.c index 7102a8bb..fd97c4c2 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record_ctrl.c @@ -90,7 +90,6 @@ osm_mcmr_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -119,7 +118,7 @@ osm_mcmr_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_mcmr_rcv_ctrl_init: ERR 1C01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -129,4 +128,3 @@ osm_mcmr_rcv_ctrl_init( return( status ); } - diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_node_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_node_record.c index e8a21edc..d86134ad 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_node_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_node_record.c @@ -58,7 +58,7 @@ #include #define OSM_NR_RCV_POOL_MIN_SIZE 32 -#define OSM_NR_RCV_POOL_GROW_SIZE 32 +#define OSM_NR_RCV_POOL_GROW_SIZE 32 typedef struct _osm_nr_item { @@ -152,7 +152,7 @@ __osm_nr_rcv_new_nr( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_nr_rcv_new_nr: ERR 1D02: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -162,7 +162,7 @@ __osm_nr_rcv_new_nr( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_nr_rcv_new_nr: " "New NodeRecord: node 0x%016" PRIx64 - "\n\t\t\t\tport 0x%016" PRIx64 ", lid 0x%X.\n", + "\n\t\t\t\tport 0x%016" PRIx64 ", lid 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), cl_ntoh64( port_guid ), cl_ntoh16( lid ) ); @@ -219,7 +219,7 @@ __osm_nr_rcv_create_nr( /* For switches, do not return the NodeInfo record - for each port on the switch, just port 0. + for each port on the switch, just for port 0. */ if( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH ) num_ports = 1; @@ -328,7 +328,7 @@ __osm_nr_rcv_by_comp_mask( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_nr_rcv_by_comp_mask: " "Looking for node 0x%016" PRIx64 - ", found 0x%016" PRIx64 ".\n", + ", found 0x%016" PRIx64 "\n", cl_ntoh64( p_rcvd_rec->node_info.node_guid ), cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); @@ -408,6 +408,7 @@ __osm_nr_rcv_by_comp_mask( Exit: OSM_LOG_EXIT( p_ctxt->p_rcv->p_log ); } + /********************************************************************** **********************************************************************/ void @@ -431,9 +432,10 @@ osm_nr_rcv_process( ib_api_status_t status; osm_physp_t* p_req_physp; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_nr_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -449,7 +451,7 @@ osm_nr_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_nr_rcv_process: ERR 1D04: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -457,12 +459,15 @@ osm_nr_rcv_process( (p_rcvd_mad->method != IB_MAD_METHOD_GETTABLE) ) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_nr_rcv_process: ERR 1D05: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_rcvd_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; } + if ( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + osm_dump_node_record( p_rcv->p_log, p_rcvd_rec, OSM_LOG_DEBUG ); + cl_qlist_init( &rec_list ); context.p_rcvd_rec = p_rcvd_rec; @@ -482,14 +487,14 @@ osm_nr_rcv_process( num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_nr_rcv_process: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -513,7 +518,7 @@ osm_nr_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_nr_rcv_process: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -521,7 +526,7 @@ osm_nr_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_nr_rcv_process: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { @@ -542,7 +547,7 @@ osm_nr_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_nr_rcv_process: ERR 1D06: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_node_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_node_record_ctrl.c index a70e6b53..8c37d064 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_node_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_node_record_ctrl.c @@ -84,7 +84,6 @@ osm_nr_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -113,7 +112,7 @@ osm_nr_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_nr_rcv_ctrl_init: ERR 1E01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_path_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_path_record.c index d75c1f9d..2d11b844 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_path_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_path_record.c @@ -69,7 +69,7 @@ #include #define OSM_PR_RCV_POOL_MIN_SIZE 64 -#define OSM_PR_RCV_POOL_GROW_SIZE 64 +#define OSM_PR_RCV_POOL_GROW_SIZE 64 typedef struct _osm_pr_item { @@ -154,26 +154,28 @@ osm_pr_rcv_init( static ib_api_status_t __osm_pr_rcv_get_path_parms( IN osm_pr_rcv_t* const p_rcv, - IN const ib_path_rec_t* const p_pr, + IN const ib_path_rec_t* const p_pr, IN const osm_port_t* const p_src_port, IN const osm_port_t* const p_dest_port, IN const uint16_t dest_lid_ho, - IN const ib_net64_t comp_mask, + IN const ib_net64_t comp_mask, OUT osm_path_parms_t* const p_parms ) { ib_net64_t node_guid; const osm_node_t* p_node; const osm_physp_t* p_physp; const osm_physp_t* p_dest_physp; - const osm_switch_t* p_sw; + const osm_switch_t* p_sw; const ib_port_info_t* p_pi; const cl_qmap_t* p_sw_tbl; ib_api_status_t status = IB_SUCCESS; uint8_t mtu; uint8_t rate; + uint8_t pkt_life; uint8_t required_mtu; uint8_t required_rate; + uint8_t required_pkt_life; ib_net16_t dest_lid; OSM_LOG_ENTER( p_rcv->p_log, __osm_pr_rcv_get_path_parms ); @@ -219,15 +221,16 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_path_parms: ERR 1F02: " - "Cannot find routing to lid:0x%X from switch for guid 0x%016" PRIx64 ".\n", + "Cannot find routing to lid:0x%X from switch for guid 0x%016" PRIx64 "\n", dest_lid_ho, cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); status = IB_ERROR; goto Exit; } } + /* - * Same as above.. + * Same as above */ p_node = osm_physp_get_node_ptr(p_dest_physp); @@ -250,7 +253,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_path_parms: ERR 1F03: " - "Cannot find routing to lid:0x%X from switch for guid 0x%016" PRIx64 ".\n", + "Cannot find routing to lid:0x%X from switch for guid 0x%016" PRIx64 "\n", dest_lid_ho, cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); status = IB_ERROR; @@ -267,7 +270,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_path_parms: ERR 1F05: " - "Cannot find remote phys port when routing to lid:0x%X from node guid 0x%016" PRIx64 ".\n", + "Cannot find remote phys port when routing to lid:0x%X from node guid 0x%016" PRIx64 "\n", dest_lid_ho, cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); status = IB_ERROR; @@ -277,7 +280,6 @@ __osm_pr_rcv_get_path_parms( /* This is point to point case (no switch in between) */ - if( p_physp == p_dest_physp ) break; @@ -292,7 +294,7 @@ __osm_pr_rcv_get_path_parms( */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_path_parms: ERR 1F06: " - "Internal error, bad path.\n" ); + "Internal error, bad path\n" ); status = IB_ERROR; goto Exit; } @@ -307,7 +309,7 @@ __osm_pr_rcv_get_path_parms( */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_path_parms: ERR 1F04: " - "Internal error, no switch for guid 0x%016" PRIx64 ".\n", + "Internal error, no switch for guid 0x%016" PRIx64 "\n", cl_ntoh64( node_guid ) ); status = IB_ERROR; goto Exit; @@ -325,7 +327,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "New smallest MTU = %u at intervening port 0x%016" PRIx64 ".\n", + "New smallest MTU = %u at intervening port 0x%016" PRIx64 "\n", mtu, osm_physp_get_port_guid( p_physp ) ); } @@ -339,7 +341,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "New smallest rate = %u at intervening port 0x%016" PRIx64 ".\n", + "New smallest rate = %u at intervening port 0x%016" PRIx64 "\n", rate, osm_physp_get_port_guid( p_physp ) ); } @@ -354,7 +356,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_path_parms: ERR 1F07: " - "Dead end on path to lid:0x%X from switch for guid 0x%016" PRIx64 ".\n", + "Dead end on path to lid:0x%X from switch for guid 0x%016" PRIx64 "\n", dest_lid_ho, cl_ntoh64( node_guid ) ); status = IB_ERROR; @@ -373,7 +375,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "New smallest MTU = %u at intervening port 0x%016" PRIx64 ".\n", + "New smallest MTU = %u at intervening port 0x%016" PRIx64 "\n", mtu, osm_physp_get_port_guid( p_physp ) ); } @@ -387,7 +389,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "New smallest rate = %u at intervening port 0x%016" PRIx64 ".\n", + "New smallest rate = %u at intervening port 0x%016" PRIx64 "\n", rate, osm_physp_get_port_guid( p_physp ) ); } @@ -407,7 +409,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "New smallest MTU = %u at destination port 0x%016" PRIx64 ".\n", + "New smallest MTU = %u at destination port 0x%016" PRIx64 "\n", mtu, osm_physp_get_port_guid( p_physp ) ); } @@ -421,7 +423,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "New smallest rate = %u at destination port 0x%016" PRIx64 ".\n", + "New smallest rate = %u at destination port 0x%016" PRIx64 "\n", rate, osm_physp_get_port_guid( p_physp ) ); } @@ -431,7 +433,7 @@ __osm_pr_rcv_get_path_parms( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_path_parms: " - "Path min MTU = %u, min rate = %u.\n", mtu, rate ); + "Path min MTU = %u, min rate = %u\n", mtu, rate ); } /* @@ -506,10 +508,54 @@ __osm_pr_rcv_get_path_parms( } } + /* Verify the pkt_life_time */ + /* According to spec definition IBA 1.1 Table 171 PacketLifeTime description, + for loopback paths, packetLifeTime shall be zero. */ + if ( p_src_port == p_dest_port ) + /* This is loopback */ + pkt_life = 0; + else + pkt_life = OSM_DEFAULT_SUBNET_TIMEOUT; + + /* we silently ignore cases where only the PktLife selector is defined */ + if ((comp_mask & IB_PR_COMPMASK_PKTLIFETIMESELEC) && + (comp_mask & IB_PR_COMPMASK_PKTLIFETIME)) + { + required_pkt_life = ib_path_rec_pkt_life( p_pr ); + switch( ib_path_rec_pkt_life_sel( p_pr ) ) + { + case 0: /* must be greater than */ + if( pkt_life <= required_pkt_life ) + status = IB_NOT_FOUND; + break; + + case 1: /* must be less than */ + if( pkt_life >= required_pkt_life ) + status = IB_NOT_FOUND; + break; + + case 2: /* exact match */ + if( pkt_life != required_pkt_life ) + status = IB_NOT_FOUND; + break; + + case 3: /* smallest available */ + /* can't be disqualified by this one */ + break; + + default: + /* if we're here, there's a bug in ib_path_rec_pkt_life_sel() */ + CL_ASSERT( FALSE ); + status = IB_ERROR; + break; + } + } + p_parms->mtu = mtu; p_parms->rate = rate; p_parms->pkey = IB_DEFAULT_PKEY; - p_parms->pkt_life = OSM_DEFAULT_SUBNET_TIMEOUT; + /* the pkt_life */ + p_parms->pkt_life = pkt_life; p_parms->sl = OSM_DEFAULT_SL; Exit: @@ -566,14 +612,13 @@ __osm_pr_rcv_build_pr( p_pr->preference = preference; - /* always return num_path = 0: so this is only the reversible */ - if (p_parms->reversible) p_pr->num_path = 0x80; + /* always return num_path = 0; so this is only the reversible */ + if (p_parms->reversible) + p_pr->num_path = 0x80; OSM_LOG_EXIT( p_rcv->p_log ); } - - /********************************************************************** **********************************************************************/ static osm_pr_item_t* @@ -598,7 +643,7 @@ __osm_pr_rcv_get_lid_pair_path( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_lid_pair_path: " - "Src LID 0x%X, Dest LID 0x%X.\n", + "Src LID 0x%X, Dest LID 0x%X\n", src_lid_ho, dest_lid_ho ); } @@ -607,7 +652,7 @@ __osm_pr_rcv_get_lid_pair_path( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_get_lid_pair_path: ERR 1F01: " - "Unable to allocate path record.\n" ); + "Unable to allocate path record\n" ); goto Exit; } @@ -639,7 +684,7 @@ __osm_pr_rcv_get_lid_pair_path( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_lid_pair_path: " - "Requested reversible path but failed to get one.\n"); + "Requested reversible path but failed to get one\n"); cl_qlock_pool_put( &p_rcv->pr_pool, &p_pr_item->pool_item ); p_pr_item = NULL; @@ -660,13 +705,15 @@ __osm_pr_rcv_get_lid_pair_path( static void __osm_pr_rcv_get_port_pair_paths( IN osm_pr_rcv_t* const p_rcv, - IN const ib_path_rec_t* const p_pr, + IN const osm_madw_t* const p_madw, IN const osm_port_t* const p_req_port, IN const osm_port_t* const p_src_port, IN const osm_port_t* const p_dest_port, IN const ib_net64_t comp_mask, IN cl_qlist_t* const p_list ) { + const ib_path_rec_t* p_pr; + const ib_sa_mad_t* p_sa_mad; osm_pr_item_t* p_pr_item; uint16_t src_lid_min_ho; uint16_t src_lid_max_ho; @@ -687,7 +734,7 @@ __osm_pr_rcv_get_port_pair_paths( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_port_pair_paths: " "Src port 0x%016" PRIx64 ", " - "Dst port 0x%016" PRIx64 ".\n", + "Dst port 0x%016" PRIx64 "\n", cl_ntoh64( osm_port_get_guid( p_src_port ) ), cl_ntoh64( osm_port_get_guid( p_dest_port ) ) ); } @@ -703,6 +750,9 @@ __osm_pr_rcv_get_port_pair_paths( goto Exit; } + p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); + p_pr = (ib_path_rec_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); + /* We shouldn't be here if the paths are disqualified in some way... Thus, we assume every possible connection is valid. @@ -779,7 +829,7 @@ __osm_pr_rcv_get_port_pair_paths( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_pr_rcv_get_port_pair_paths: " "Src LIDs [0x%X,0x%X], " - "Dest LIDs [0x%X,0x%X].\n", + "Dest LIDs [0x%X,0x%X]\n", src_lid_min_ho, src_lid_max_ho, dest_lid_min_ho, dest_lid_max_ho ); } @@ -793,10 +843,14 @@ __osm_pr_rcv_get_port_pair_paths( preference = 0; path_num = 0; - if( comp_mask & IB_PR_COMPMASK_NUMBPATH ) - iterations = p_pr->num_path & 0x7F; + /* If SubnAdmGet, assume NumbPaths 1 (1.2 erratum) */ + if (p_sa_mad->method != IB_MAD_METHOD_GET) + if( comp_mask & IB_PR_COMPMASK_NUMBPATH ) + iterations = p_pr->num_path & 0x7F; + else + iterations = (uintn_t)(-1); else - iterations = (uintn_t)(-1); + iterations = 1; while( path_num < iterations ) { @@ -958,7 +1012,7 @@ __osm_pr_rcv_get_end_points( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pr_rcv_get_end_points: " - "No source port with GUID = 0x%016" PRIx64 ".\n", + "No source port with GUID = 0x%016" PRIx64 "\n", cl_ntoh64( p_pr->sgid.unicast.interface_id) ); sa_status = IB_SA_MAD_STATUS_INVALID_GID; @@ -983,7 +1037,7 @@ __osm_pr_rcv_get_end_points( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pr_rcv_get_end_points: " - "No source port with LID = 0x%X.\n", + "No source port with LID = 0x%X\n", cl_ntoh16( p_pr->slid) ); sa_status = IB_SA_MAD_STATUS_NO_RECORDS; @@ -1008,7 +1062,7 @@ __osm_pr_rcv_get_end_points( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pr_rcv_get_end_points: " - "No dest port with GUID = 0x%016" PRIx64 ".\n", + "No dest port with GUID = 0x%016" PRIx64 "\n", cl_ntoh64( p_pr->dgid.unicast.interface_id) ); sa_status = IB_SA_MAD_STATUS_INVALID_GID; @@ -1033,7 +1087,7 @@ __osm_pr_rcv_get_end_points( */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pr_rcv_get_end_points: " - "No dest port with LID = 0x%X.\n", + "No dest port with LID = 0x%X\n", cl_ntoh16( p_pr->dlid) ); sa_status = IB_SA_MAD_STATUS_NO_RECORDS; @@ -1052,7 +1106,7 @@ __osm_pr_rcv_get_end_points( static void __osm_pr_rcv_process_world( IN osm_pr_rcv_t* const p_rcv, - IN const ib_path_rec_t* const p_pr, + IN const osm_madw_t* const p_madw, IN const osm_port_t* const requestor_port, IN const ib_net64_t comp_mask, IN cl_qlist_t* const p_list ) @@ -1079,7 +1133,7 @@ __osm_pr_rcv_process_world( p_src_port = (osm_port_t*)cl_qmap_head( p_tbl ); while( p_src_port != (osm_port_t*)cl_qmap_end( p_tbl ) ) { - __osm_pr_rcv_get_port_pair_paths( p_rcv, p_pr, requestor_port, p_src_port, + __osm_pr_rcv_get_port_pair_paths( p_rcv, p_madw, requestor_port, p_src_port, p_dest_port, comp_mask, p_list ); p_src_port = (osm_port_t*)cl_qmap_next( &p_src_port->map_item ); @@ -1096,7 +1150,7 @@ __osm_pr_rcv_process_world( static void __osm_pr_rcv_process_half( IN osm_pr_rcv_t* const p_rcv, - IN const ib_path_rec_t* const p_pr, + IN const osm_madw_t* const p_madw, IN const osm_port_t* const requestor_port, IN const osm_port_t* const p_src_port, IN const osm_port_t* const p_dest_port, @@ -1123,7 +1177,7 @@ __osm_pr_rcv_process_half( p_port = (osm_port_t*)cl_qmap_head( p_tbl ); while( p_port != (osm_port_t*)cl_qmap_end( p_tbl ) ) { - __osm_pr_rcv_get_port_pair_paths( p_rcv, p_pr, requestor_port, p_src_port, + __osm_pr_rcv_get_port_pair_paths( p_rcv, p_madw , requestor_port, p_src_port, p_port, comp_mask, p_list ); p_port = (osm_port_t*)cl_qmap_next( &p_port->map_item ); } @@ -1136,7 +1190,7 @@ __osm_pr_rcv_process_half( p_port = (osm_port_t*)cl_qmap_head( p_tbl ); while( p_port != (osm_port_t*)cl_qmap_end( p_tbl ) ) { - __osm_pr_rcv_get_port_pair_paths( p_rcv, p_pr, requestor_port, p_port, + __osm_pr_rcv_get_port_pair_paths( p_rcv, p_madw, requestor_port, p_port, p_dest_port, comp_mask, p_list ); p_port = (osm_port_t*)cl_qmap_next( &p_port->map_item ); } @@ -1150,7 +1204,7 @@ __osm_pr_rcv_process_half( static void __osm_pr_rcv_process_pair( IN osm_pr_rcv_t* const p_rcv, - IN const ib_path_rec_t* const p_pr, + IN const osm_madw_t* const p_madw, IN const osm_port_t* const requestor_port, IN const osm_port_t* const p_src_port, IN const osm_port_t* const p_dest_port, @@ -1159,7 +1213,7 @@ __osm_pr_rcv_process_pair( { OSM_LOG_ENTER( p_rcv->p_log, __osm_pr_rcv_process_pair ); - __osm_pr_rcv_get_port_pair_paths( p_rcv, p_pr, requestor_port, p_src_port, + __osm_pr_rcv_get_port_pair_paths( p_rcv, p_madw, requestor_port, p_src_port, p_dest_port, comp_mask, p_list ); OSM_LOG_EXIT( p_rcv->p_log ); @@ -1182,9 +1236,12 @@ __search_mgrp_by_mgid( p_recvd_mgid = p_ctxt->p_mgid; p_rcv = p_ctxt->p_rcv; - /* Why not compare the entire MGID ???? */ - /* different scope can sneak in for the same MGID ? */ - /* EZ: I changed it to full compare ! */ + /* ignore groups marked for deletion */ + if (p_mgrp->to_be_deleted) + return; + + /* compare entire MGID so different scope will not sneak in for + the same MGID */ if (cl_memcmp(&p_mgrp->mcmember_rec.mgid, p_recvd_mgid, sizeof(ib_gid_t))) @@ -1203,7 +1260,7 @@ __search_mgrp_by_mgid( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__search_mgrp_by_mgid: ERR 1F08: " - "Multiple MCGROUP for same MGID.\n" ); + "Multiple MC groups for same MGID\n" ); return; } p_ctxt->p_mgrp = p_mgrp; @@ -1284,7 +1341,7 @@ __osm_pr_get_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_get_mgrp: ERR 1F09: " - "No MC group found for PathRecord destination GID.\n" ); + "No MC group found for PathRecord destination GID\n" ); goto Exit; } } @@ -1300,7 +1357,7 @@ __osm_pr_get_mgrp( /* Note: perhaps this might be better indicated as an invalid request */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_get_mgrp: ERR 1F10: " - "MC group MLID does not match PathRecord destination LID.\n" ); + "MC group MLID does not match PathRecord destination LID\n" ); *pp_mgrp = NULL; goto Exit; } @@ -1312,7 +1369,7 @@ __osm_pr_get_mgrp( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_get_mgrp: ERR 1F11: " - "No MC group found for PathRecord destination LID.\n" ); + "No MC group found for PathRecord destination LID\n" ); } } } @@ -1344,8 +1401,8 @@ __osm_pr_match_mgrp_attributes( comp_mask = p_sa_mad->comp_mask; - /* If SGID and/or SLID specified, should validate as part of MC group */ - /* Also, not checking MTU, rate, packet lifetime, and raw traffic currently */ + /* If SGID and/or SLID specified, should validate as member of MC group */ + /* Also, MTU, rate, packet lifetime, and raw traffic requested are not currently checked */ if( comp_mask & IB_PR_COMPMASK_PKEY ) { if( p_pr->pkey != p_mgrp->mcmember_rec.pkey ) @@ -1361,7 +1418,8 @@ __osm_pr_match_mgrp_attributes( goto Exit; } - if( comp_mask & IB_PR_COMPMASK_NUMBPATH ) + /* If SubnAdmGet, assume NumbPaths of 1 (1.2 erratum) */ + if( ( comp_mask & IB_PR_COMPMASK_NUMBPATH ) && ( p_sa_mad->method != IB_MAD_METHOD_GET ) ) { if( ( p_pr->num_path & 0x7f ) == 0 ) goto Exit; @@ -1414,7 +1472,7 @@ __osm_pr_rcv_check_mcast_dest( if( comp_mask & IB_PR_COMPMASK_DGID ) { is_multicast = ib_gid_is_multicast( &p_pr->dgid ); - if( is_multicast ) + if( !is_multicast ) goto Exit; } @@ -1426,7 +1484,7 @@ __osm_pr_rcv_check_mcast_dest( else if( is_multicast ) osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_check_mcast_dest: ERR 1F12: " - "PathRecord request indicates MGID but not MLID.\n" ); + "PathRecord request indicates MGID but not MLID\n" ); } Exit: @@ -1445,7 +1503,7 @@ __osm_pr_rcv_respond( osm_madw_t* p_resp_madw; const ib_sa_mad_t* p_sa_mad; ib_sa_mad_t* p_resp_sa_mad; - size_t num_rec, num_copied; + size_t num_rec, pre_trim_num_rec; #ifndef VENDOR_RMPP_SUPPORT size_t trim_num_rec; #endif @@ -1453,20 +1511,21 @@ __osm_pr_rcv_respond( ib_api_status_t status; const ib_sa_mad_t* p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); osm_pr_item_t* p_pr_item; + uint32_t i; OSM_LOG_ENTER( p_rcv->p_log, __osm_pr_rcv_respond ); num_rec = cl_qlist_count( p_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_respond: ERR 1F13: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -1480,23 +1539,28 @@ __osm_pr_rcv_respond( goto Exit; } + pre_trim_num_rec = num_rec; #ifndef VENDOR_RMPP_SUPPORT trim_num_rec = (MAD_BLOCK_SIZE - IB_SA_MAD_HDR_SIZE) / sizeof(ib_path_rec_t); if (trim_num_rec < num_rec) { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_pr_rcv_respond: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec,trim_num_rec ); num_rec = trim_num_rec; } #endif - if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + osm_log( p_rcv->p_log, OSM_LOG_DEBUG, + "__osm_pr_rcv_respond: " + "Generating response with %u records\n", num_rec ); + + if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { - osm_log( p_rcv->p_log, OSM_LOG_DEBUG, - "__osm_pr_rcv_respond: " - "Generating response with %u records.\n", num_rec ); + osm_sa_send_error( p_rcv->p_resp, p_madw, + IB_SA_MAD_STATUS_NO_RECORDS ); + goto Exit; } /* @@ -1510,7 +1574,17 @@ __osm_pr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_respond: ERR 1F14: " - "Unable to allocate MAD.\n" ); + "Unable to allocate MAD\n" ); + + for( i = 0; i < num_rec; i++ ) + { + p_pr_item = (osm_pr_item_t*)cl_qlist_remove_head( p_list ); + cl_qlock_pool_put( &p_rcv->pr_pool, &p_pr_item->pool_item ); + } + + osm_sa_send_error( p_rcv->p_resp, p_madw, + IB_SA_MAD_STATUS_NO_RESOURCES ); + goto Exit; } @@ -1525,6 +1599,8 @@ __osm_pr_rcv_respond( p_resp_sa_mad->attr_offset = ib_get_attr_offset( sizeof(ib_path_rec_t) ); + p_resp_pr = (ib_path_rec_t*)ib_sa_mad_get_payload_ptr( p_resp_sa_mad ); + #ifndef VENDOR_RMPP_SUPPORT /* we support only one packet RMPP - so we will set the first and last flags for gettable */ @@ -1539,44 +1615,26 @@ __osm_pr_rcv_respond( p_resp_sa_mad->rmpp_flags = IB_RMPP_FLAG_ACTIVE; #endif - p_resp_pr = (ib_path_rec_t*)ib_sa_mad_get_payload_ptr( p_resp_sa_mad ); - - if ( num_rec == 0 ) - { - if (p_resp_sa_mad->method == IB_MAD_METHOD_GET_RESP) - p_resp_sa_mad->status = IB_SA_MAD_STATUS_NO_RECORDS; - cl_memclr( p_resp_pr, sizeof(*p_resp_pr) ); - } - else + for ( i = 0; i < pre_trim_num_rec; i++ ) { p_pr_item = (osm_pr_item_t*)cl_qlist_remove_head( p_list ); - - /* we need to track the number of copied items so we can - * stop the copy - but clear them all - */ - num_copied = 0; - - while( p_pr_item != (osm_pr_item_t*)cl_qlist_end( p_list ) ) - { - /* Copy the Path Records from the list into the MAD */ - if (num_copied < num_rec) - { + /* copy only if not trimmed */ + if (i < num_rec) *p_resp_pr = p_pr_item->path_rec; - num_copied++; - } - cl_qlock_pool_put( &p_rcv->pr_pool, &p_pr_item->pool_item ); - p_resp_pr++; - p_pr_item = (osm_pr_item_t*)cl_qlist_remove_head( p_list ); - } + + cl_qlock_pool_put( &p_rcv->pr_pool, &p_pr_item->pool_item ); + p_resp_pr++; } + CL_ASSERT( cl_is_qlist_empty( p_list ) ); + status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE ); if( status != IB_SUCCESS ) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pr_rcv_respond: ERR 1F15: " - "Unable to send MAD (%s).\n", ib_get_err_str( status ) ); + "Unable to send MAD (%s)\n", ib_get_err_str( status ) ); /* osm_mad_pool_put( p_rcv->p_mad_pool, p_resp_madw ); */ goto Exit; } @@ -1599,12 +1657,6 @@ osm_pr_rcv_process( cl_qlist_t pr_list; ib_net16_t sa_status; osm_port_t* requestor_port; - osm_mgrp_t* p_mgrp = NULL; - ib_api_status_t status; - osm_pr_item_t* p_pr_item; - uint32_t flow_label; - uint8_t sl; - uint8_t hop_limit; OSM_LOG_ENTER( p_rcv->p_log, osm_pr_rcv_process ); @@ -1619,7 +1671,7 @@ osm_pr_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pr_rcv_process: ERR 1F16: " - "Cannot find requestor physical port.\n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -1632,7 +1684,7 @@ osm_pr_rcv_process( (p_sa_mad->method != IB_MAD_METHOD_GETTABLE)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pr_rcv_process: ERR 1F17: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -1655,7 +1707,7 @@ osm_pr_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_pr_rcv_process: " - "Unicast destination requested.\n" ); + "Unicast destination requested\n" ); sa_status = __osm_pr_rcv_get_end_points( p_rcv, p_madw, &p_src_port, &p_dest_port ); @@ -1674,22 +1726,22 @@ osm_pr_rcv_process( if( p_src_port ) { if( p_dest_port ) - __osm_pr_rcv_process_pair( p_rcv, p_pr, requestor_port, p_src_port, p_dest_port, + __osm_pr_rcv_process_pair( p_rcv, p_madw, requestor_port, p_src_port, p_dest_port, p_sa_mad->comp_mask, &pr_list ); else - __osm_pr_rcv_process_half( p_rcv, p_pr, requestor_port, p_src_port, NULL, + __osm_pr_rcv_process_half( p_rcv, p_madw, requestor_port, p_src_port, NULL, p_sa_mad->comp_mask, &pr_list ); } else { if( p_dest_port ) - __osm_pr_rcv_process_half( p_rcv, p_pr, requestor_port, NULL, p_dest_port, + __osm_pr_rcv_process_half( p_rcv, p_madw, requestor_port, NULL, p_dest_port, p_sa_mad->comp_mask, &pr_list ); else /* Katie, bar the door! */ - __osm_pr_rcv_process_world( p_rcv, p_pr, requestor_port, + __osm_pr_rcv_process_world( p_rcv, p_madw, requestor_port, p_sa_mad->comp_mask, &pr_list ); } goto Unlock; @@ -1697,61 +1749,69 @@ osm_pr_rcv_process( McastDest: osm_log(p_rcv->p_log, OSM_LOG_DEBUG, "osm_pr_rcv_process: " - "Multicast destination requested.\n" ); + "Multicast destination requested\n" ); + { + osm_mgrp_t *p_mgrp = NULL; + ib_api_status_t status; + osm_pr_item_t* p_pr_item; + uint32_t flow_label; + uint8_t sl; + uint8_t hop_limit; - /* First, get the MC info */ - __osm_pr_get_mgrp( p_rcv, p_madw, &p_mgrp ); + /* First, get the MC info */ + __osm_pr_get_mgrp( p_rcv, p_madw, &p_mgrp ); - if ( p_mgrp ) - { - /* Make sure the rest of the PathRecord matches the MC group attributes */ - status = __osm_pr_match_mgrp_attributes( p_rcv, p_madw, p_mgrp); - if ( status == IB_SUCCESS ) + if ( p_mgrp ) { - p_pr_item = (osm_pr_item_t*)cl_qlock_pool_get( &p_rcv->pr_pool ); - if( p_pr_item == NULL ) + /* Make sure the rest of the PathRecord matches the MC group attributes */ + status = __osm_pr_match_mgrp_attributes( p_rcv, p_madw, p_mgrp); + if ( status == IB_SUCCESS ) { - osm_log( p_rcv->p_log, OSM_LOG_ERROR, - "osm_pr_rcv_process: ERR 1F18: " - "Unable to allocate path record for MC group.\n" ); + p_pr_item = (osm_pr_item_t*)cl_qlock_pool_get( &p_rcv->pr_pool ); + if( p_pr_item == NULL ) + { + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "osm_pr_rcv_process: ERR 1F18: " + "Unable to allocate path record for MC group\n" ); + } + else + { + /* Copy PathRecord request into response */ + p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); + p_pr = (ib_path_rec_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); + p_pr_item->path_rec = *p_pr; + + /* Now, use the MC info to cruft up the PathRecord response */ + p_pr_item->path_rec.dgid = p_mgrp->mcmember_rec.mgid; + p_pr_item->path_rec.dlid = p_mgrp->mcmember_rec.mlid; + p_pr_item->path_rec.tclass = p_mgrp->mcmember_rec.tclass; + p_pr_item->path_rec.num_path = 1; + p_pr_item->path_rec.pkey = p_mgrp->mcmember_rec.pkey; + + /* MTU, rate, and packet lifetime should be exactly */ + p_pr_item->path_rec.mtu = (2<<6) | p_mgrp->mcmember_rec.mtu; + p_pr_item->path_rec.rate = (2<<6) | p_mgrp->mcmember_rec.rate; + p_pr_item->path_rec.pkt_life = (2<<6) | p_mgrp->mcmember_rec.pkt_life; + + /* SL, Hop Limit, and Flow Label */ + ib_member_get_sl_flow_hop( p_mgrp->mcmember_rec.sl_flow_hop, + &sl, &flow_label, &hop_limit ); + p_pr_item->path_rec.sl = sl; + p_pr_item->path_rec.hop_flow_raw = (uint32_t)(hop_limit) | + (flow_label << 8); + + cl_qlist_insert_tail( &pr_list, + (cl_list_item_t*)&p_pr_item->pool_item ); + + } } else { - /* Copy PathRecord request into response */ - p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); - p_pr = (ib_path_rec_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); - p_pr_item->path_rec = *p_pr; - - /* Now, use the MC info to cruft up the PathRecord response */ - p_pr_item->path_rec.dgid = p_mgrp->mcmember_rec.mgid; - p_pr_item->path_rec.dlid = p_mgrp->mcmember_rec.mlid; - p_pr_item->path_rec.tclass = p_mgrp->mcmember_rec.tclass; - p_pr_item->path_rec.num_path = 1; - p_pr_item->path_rec.pkey = p_mgrp->mcmember_rec.pkey; - - /* MTU, rate, and packet lifetime should be exactly */ - p_pr_item->path_rec.mtu = (2<<6) | p_mgrp->mcmember_rec.mtu; - p_pr_item->path_rec.rate = (2<<6) | p_mgrp->mcmember_rec.rate; - p_pr_item->path_rec.pkt_life = (2<<6) | p_mgrp->mcmember_rec.pkt_life; - - /* SL, Hop Limit, and Flow Label */ - ib_member_get_sl_flow_hop( p_mgrp->mcmember_rec.sl_flow_hop, - &sl, &flow_label, &hop_limit ); - p_pr_item->path_rec.sl = sl; - p_pr_item->path_rec.hop_flow_raw = (uint32_t)(hop_limit) | - (flow_label << 8); - - cl_qlist_insert_tail( &pr_list, - (cl_list_item_t*)&p_pr_item->pool_item ); - + osm_log( p_rcv->p_log, OSM_LOG_ERROR, + "osm_pr_rcv_process: ERR 1F19: " + "MC group attributes don't match PathRecord request\n" ); } } - else - { - osm_log( p_rcv->p_log, OSM_LOG_ERROR, - "osm_pr_rcv_process: ERR 1F19: " - "MC group attributes don't match PathRecord request.\n" ); - } } /* Now, (finally) respond to the PathRecord request */ diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_path_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_path_record_ctrl.c index e5f9d8ee..50057384 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_path_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_path_record_ctrl.c @@ -88,7 +88,6 @@ osm_pr_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_pr_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_pr_rcv_ctrl_init: ERR 2001: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -127,4 +126,3 @@ osm_pr_rcv_ctrl_init( return( status ); } - diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record.c index bbd7bb3e..27b3da15 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record.c @@ -159,7 +159,7 @@ __osm_sa_pkey_create( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_pkey_create: ERR 4602: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -169,7 +169,7 @@ __osm_sa_pkey_create( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_pkey_create: " "New P_Key table for: port 0x%016" PRIx64 - ", lid 0x%X, port# 0x%X Block:%u.\n", + ", lid 0x%X, port# 0x%X Block:%u\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ), cl_ntoh16( lid ), osm_physp_get_port_num( p_physp ), block @@ -252,7 +252,7 @@ __osm_sa_pkey_by_comp_mask( port_num = p_port->default_port_num; osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_sa_pkey_by_comp_mask: " - "Using Physical Default Port Number: 0x%X (for End Node).\n", + "Using Physical Default Port Number: 0x%X (for End Node)\n", port_num); comp_mask |= IB_PKEY_COMPMASK_PORT; } @@ -272,7 +272,7 @@ __osm_sa_pkey_by_comp_mask( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_pkey_by_comp_mask: ERR 4603: " - "Given Physical Port Number: 0x%X is out of range should be < 0x%X.\n", + "Given Physical Port Number: 0x%X is out of range should be < 0x%X\n", port_num, osm_port_get_num_physp( p_port )); goto Exit; } @@ -341,9 +341,10 @@ osm_pkey_rec_rcv_process( ib_net64_t comp_mask; osm_physp_t* p_req_physp; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_pkey_rec_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -360,7 +361,7 @@ osm_pkey_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pkey_rec_rcv_process: ERR 4604: " - "Cannot find requestor physical port.\n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -369,7 +370,7 @@ osm_pkey_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pkey_rec_rcv_process: ERR 4605: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_rcvd_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -406,7 +407,7 @@ osm_pkey_rec_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_pkey_rec_rcv_process: " - "Got Query Lid:0x%04X(%02X), Block:0x%02X(%02X), Port:0x%02X(%02X).\n", + "Got Query Lid:0x%04X(%02X), Block:0x%02X(%02X), Port:0x%02X(%02X)\n", cl_ntoh16(p_rcvd_rec->lid), (comp_mask &IB_PKEY_COMPMASK_LID) != 0, p_rcvd_rec->port_num, (comp_mask &IB_PKEY_COMPMASK_PORT) != 0, p_rcvd_rec->block_num, (comp_mask &IB_PKEY_COMPMASK_BLOCK) != 0) ; @@ -429,7 +430,7 @@ osm_pkey_rec_rcv_process( { /* port out of range */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pkey_rec_rcv_process: " - "Given LID (%u) is out of range:%u.\n", + "Given LID (%u) is out of range:%u\n", cl_ntoh16(p_rcvd_rec->lid), cl_ptr_vector_get_size(p_tbl)); } } @@ -450,14 +451,14 @@ osm_pkey_rec_rcv_process( num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pkey_rec_rcv_process: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -480,7 +481,7 @@ osm_pkey_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_pkey_rec_rcv_process: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -488,7 +489,7 @@ osm_pkey_rec_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_pkey_rec_rcv_process: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { @@ -509,7 +510,7 @@ osm_pkey_rec_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_pkey_rec_rcv_process: ERR 4606: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record_ctrl.c index 9b0313d3..a20aed9a 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_pkey_record_ctrl.c @@ -76,7 +76,6 @@ osm_pkey_rec_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,7 @@ osm_pkey_rec_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_pkey_rec_rcv_ctrl_init: ERR 4701: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record.c index d113eac4..933970a3 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record.c @@ -159,7 +159,7 @@ __osm_pir_rcv_new_pir( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pir_rcv_new_pir: ERR 2102: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -169,7 +169,7 @@ __osm_pir_rcv_new_pir( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_pir_rcv_new_pir: " "New PortInfoRecord: port 0x%016" PRIx64 - ", lid 0x%X, port# 0x%X.\n", + ", lid 0x%X, port# 0x%X\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ), cl_ntoh16( lid ), osm_physp_get_port_num( p_physp ) ); } @@ -263,6 +263,13 @@ __osm_sa_pir_check_physp( &p_physp->port_info, OSM_LOG_DEBUG ); + /* We have to re-check the base_lid, since if the given + base_lid in p_pi is zero - we are comparing on all ports. */ + if( comp_mask & IB_PIR_COMPMASK_BASELID ) + { + if( p_comp_pi->base_lid != p_pi->base_lid ) + goto Exit; + } if( comp_mask & IB_PIR_COMPMASK_MKEY ) { if( p_comp_pi->m_key != p_pi->m_key ) @@ -337,6 +344,12 @@ __osm_sa_pir_check_physp( ib_port_info_get_link_down_def_state( p_pi ) ) goto Exit; } + if ( comp_mask & IB_PIR_COMPMASK_MKEYPROTBITS ) + { + if( ib_port_info_get_mpb( p_comp_pi ) != + ib_port_info_get_mpb( p_pi ) ) + goto Exit; + } if( comp_mask & IB_PIR_COMPMASK_LMC ) { if( ib_port_info_get_lmc( p_comp_pi ) != @@ -361,6 +374,24 @@ __osm_sa_pir_check_physp( ib_port_info_get_neighbor_mtu( p_pi ) ) goto Exit; } + if( comp_mask & IB_PIR_COMPMASK_MASTERSMSL ) + { + if( ib_port_info_get_master_smsl( p_comp_pi ) != + ib_port_info_get_master_smsl( p_pi ) ) + goto Exit; + } + if( comp_mask & IB_PIR_COMPMASK_VLCAP ) + { + if( ib_port_info_get_vl_cap( p_comp_pi ) != + ib_port_info_get_vl_cap( p_pi ) ) + goto Exit; + } + if( comp_mask & IB_PIR_COMPMASK_INITTYPE ) + { + if( ib_port_info_get_init_type( p_comp_pi ) != + ib_port_info_get_init_type( p_pi ) ) + goto Exit; + } if( comp_mask & IB_PIR_COMPMASK_VLHIGHLIMIT ) { if( p_comp_pi->vl_high_limit != p_pi->vl_high_limit ) @@ -382,6 +413,12 @@ __osm_sa_pir_check_physp( ib_port_info_get_mtu_cap( p_pi ) ) goto Exit; } + if( comp_mask & IB_PIR_COMPMASK_VLSTALLCNT ) + { + if( ib_port_info_get_vl_stall_count( p_comp_pi ) != + ib_port_info_get_vl_stall_count( p_pi ) ) + goto Exit; + } if (comp_mask & IB_PIR_COMPMASK_HOQLIFE ) { if ((p_comp_pi->vl_stall_life & 0x1F) != (p_pi->vl_stall_life & 0x1F) ) @@ -442,6 +479,18 @@ __osm_sa_pir_check_physp( if ((p_comp_pi->resp_time_value & 0x1F) != (p_pi->resp_time_value &0x1F) ) goto Exit; } + if (comp_mask & IB_PIR_COMPMASK_LOCALPHYERR ) + { + if( ib_port_info_get_local_phy_err_thd( p_comp_pi ) != + ib_port_info_get_local_phy_err_thd( p_pi ) ) + goto Exit; + } + if (comp_mask & IB_PIR_COMPMASK_OVERRUNERR) + { + if( ib_port_info_get_overrun_err_thd( p_comp_pi ) != + ib_port_info_get_overrun_err_thd( p_pi ) ) + goto Exit; + } __osm_sa_pir_create( p_rcv, p_physp, p_ctxt ); @@ -548,9 +597,10 @@ osm_pir_rcv_process( osm_physp_t* p_req_physp; boolean_t trusted_req = TRUE; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_pir_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -567,7 +617,7 @@ osm_pir_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pir_rcv_process: ERR 2104: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -576,12 +626,15 @@ osm_pir_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pir_rcv_process: ERR 2105: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_rcvd_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; } + if ( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + osm_dump_portinfo_record( p_rcv->p_log, p_rcvd_rec, OSM_LOG_DEBUG ); + p_tbl = &p_rcv->p_subn->port_lid_tbl; p_pi = &p_rcvd_rec->port_info; @@ -611,7 +664,7 @@ osm_pir_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pir_rcv_process: " - "Given LID (%u) is out of range:%u.\n", + "Given LID (%u) is out of range:%u\n", cl_ntoh16(p_rcvd_rec->lid), cl_ptr_vector_get_size(p_tbl)); } } @@ -627,7 +680,7 @@ osm_pir_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pir_rcv_process: " - "Given LID (%u) is out of range:%u.\n", + "Given LID (%u) is out of range:%u\n", cl_ntoh16(p_pi->base_lid), cl_ptr_vector_get_size(p_tbl)); } } @@ -647,14 +700,14 @@ osm_pir_rcv_process( num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_pir_rcv_process: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -677,7 +730,7 @@ osm_pir_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_pir_rcv_process: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -685,7 +738,7 @@ osm_pir_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_pir_rcv_process: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { @@ -706,7 +759,7 @@ osm_pir_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_pir_rcv_process: ERR 2106: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record_ctrl.c index 2d0657a5..bed575c5 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_portinfo_record_ctrl.c @@ -88,7 +88,6 @@ osm_pir_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_pir_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_pir_rcv_ctrl_init: ERR 2201: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_response.c b/trunk/ulp/opensm/user/opensm/osm_sa_response.c index eacf399a..7f149065 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_response.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_response.c @@ -78,7 +78,6 @@ osm_sa_resp_destroy( CL_ASSERT( p_resp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -120,7 +119,7 @@ osm_sa_send_error( { osm_log( p_resp->p_log, OSM_LOG_DEBUG, "osm_sa_send_error: ", - "Ignoring requested send after exit.\n" ); + "Ignoring requested send after exit\n" ); goto Exit; } @@ -131,7 +130,7 @@ osm_sa_send_error( { osm_log( p_resp->p_log, OSM_LOG_ERROR, "osm_sa_send_error: ERR 2301: " - "Unable to acquire response MAD.\n" ); + "Unable to acquire response MAD\n" ); goto Exit; } @@ -162,7 +161,7 @@ osm_sa_send_error( { osm_log( p_resp->p_log, OSM_LOG_ERROR, "osm_sa_send_error: ERR 2302: " - "Error sending MAD (%s).\n", ib_get_err_str( status ) ); + "Error sending MAD (%s)\n", ib_get_err_str( status ) ); /* osm_mad_pool_put( p_resp->p_pool, p_resp_madw ); */ goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c index fb95d255..5269d25c 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c @@ -66,7 +66,7 @@ #include #define OSM_SR_RCV_POOL_MIN_SIZE 64 -#define OSM_SR_RCV_POOL_GROW_SIZE 64 +#define OSM_SR_RCV_POOL_GROW_SIZE 64 typedef struct _osm_sr_item { @@ -75,20 +75,20 @@ typedef struct _osm_sr_item } osm_sr_item_t; - typedef struct osm_sr_match_item { cl_qlist_t sr_list; ib_service_record_t* p_service_rec; ib_net64_t comp_mask; osm_sr_rcv_t* p_rcv; -}osm_sr_match_item_t; +} osm_sr_match_item_t; typedef struct _osm_sr_search_ctxt { osm_sr_match_item_t * p_sr_item; const osm_physp_t* p_req_physp; } osm_sr_search_ctxt_t; + /********************************************************************** **********************************************************************/ void @@ -113,7 +113,6 @@ osm_sr_rcv_destroy( OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -182,7 +181,7 @@ __match_service_pkey_with_ports_pkey( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__match_service_pkey_with_ports_pkey: ERR 2404: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); valid = FALSE; goto Exit; } @@ -197,6 +196,7 @@ __match_service_pkey_with_ports_pkey( valid = FALSE; goto Exit; } + /* Make sure it matches the port of the ServiceGid */ if((comp_mask & IB_SR_COMPMASK_SGID) == IB_SR_COMPMASK_SGID) { @@ -206,7 +206,7 @@ __match_service_pkey_with_ports_pkey( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__match_service_pkey_with_ports_pkey: ERR 2405: " - "No port object for port 0x%016" PRIx64 ".\n", + "No port object for port 0x%016" PRIx64 "\n", cl_ntoh64( service_guid ) ); valid = FALSE; goto Exit; @@ -215,19 +215,19 @@ __match_service_pkey_with_ports_pkey( if ( !osm_physp_has_pkey( p_rcv->p_log, p_service_rec->service_pkey, osm_port_get_default_phys_ptr(service_port) )) - { - valid = FALSE; - goto Exit; + { + valid = FALSE; + goto Exit; + } } } - } Exit: return valid; } + /********************************************************************** **********************************************************************/ - boolean_t __match_name_to_key_association( IN osm_sr_rcv_t* const p_rcv, @@ -252,7 +252,6 @@ __match_name_to_key_association( /********************************************************************** **********************************************************************/ - static boolean_t __validate_sr( @@ -265,7 +264,6 @@ __validate_sr( OSM_LOG_ENTER( p_rcv->p_log, __validate_sr ); - p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); p_recvd_service_rec = (ib_service_record_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); @@ -299,11 +297,9 @@ __validate_sr( goto Exit; } - Exit: OSM_LOG_EXIT( p_rcv->p_log ); return valid; - } /********************************************************************** @@ -332,8 +328,8 @@ __osm_sr_rcv_respond( num_rec = cl_qlist_count( p_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { @@ -342,7 +338,7 @@ __osm_sr_rcv_respond( "Got more than one record for SubnAdmGet (%u).\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, - IB_SA_MAD_STATUS_TOO_MANY_RECORDS); + IB_SA_MAD_STATUS_TOO_MANY_RECORDS ); /* need to set the mem free ... */ p_sr_item = (osm_sr_item_t*)cl_qlist_remove_head( p_list ); @@ -361,7 +357,7 @@ __osm_sr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_sr_rcv_respond: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -371,7 +367,7 @@ __osm_sr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_sr_rcv_respond: " - "Generating response with %u records.\n", num_rec ); + "Generating response with %u records\n", num_rec ); } /* @@ -385,7 +381,7 @@ __osm_sr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sr_rcv_respond: ERR 2402: " - "Unable to allocate MAD.\n" ); + "Unable to allocate MAD\n" ); /* Release the quick pool items */ p_sr_item = (osm_sr_item_t*)cl_qlist_remove_head( p_list ); while( p_sr_item != (osm_sr_item_t*)cl_qlist_end( p_list ) ) @@ -478,7 +474,7 @@ __osm_sr_rcv_respond( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sr_rcv_respond: ERR 2407: " - "Unable to send MAD (%s).\n", ib_get_err_str( status ) ); + "Unable to send MAD (%s)\n", ib_get_err_str( status ) ); /* osm_mad_pool_put( p_rcv->p_mad_pool, p_resp_madw ); */ goto Exit; } @@ -486,9 +482,9 @@ __osm_sr_rcv_respond( Exit: OSM_LOG_EXIT( p_rcv->p_log ); } + /********************************************************************** **********************************************************************/ - static void __get_matching_sr( @@ -730,7 +726,7 @@ __get_matching_sr( } /* Check that the requestor port has the pkey which is the service_pkey. - If not - then it cannot receive this serviceRecord. */ + If not - then it cannot receive this ServiceRecord. */ /* The check is relevant only if the service_pkey is valid */ if (!ib_pkey_is_invalid(p_svcr->service_record.service_pkey)) { @@ -752,7 +748,7 @@ __get_matching_sr( { osm_log( p_sr_item->p_rcv->p_log, OSM_LOG_ERROR, "__get_matching_sr: ERR 2408: " - "Unable to acquire Service Record form Pool.\n"); + "Unable to acquire Service Record from pool\n"); goto Exit; } @@ -764,9 +760,9 @@ __get_matching_sr( Exit: return; } + /********************************************************************** **********************************************************************/ - static void osm_sr_rcv_process_get_method( @@ -791,7 +787,7 @@ osm_sr_rcv_process_get_method( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_sr_rcv_process_get_method: ERR 2409: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -799,6 +795,13 @@ osm_sr_rcv_process_get_method( p_recvd_service_rec = (ib_service_record_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); + if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) ) + { + osm_dump_service_record( p_rcv->p_log, + p_recvd_service_rec, + OSM_LOG_DEBUG ); + } + cl_qlist_init(&sr_match_item.sr_list); sr_match_item.p_service_rec = p_recvd_service_rec; sr_match_item.comp_mask = p_sa_mad->comp_mask; @@ -821,7 +824,7 @@ osm_sr_rcv_process_get_method( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_sr_rcv_process_get_method: " - "No Records Matched the query Service Record\n"); + "No records matched the Service Record query\n"); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_NO_RECORDS ); @@ -834,8 +837,8 @@ osm_sr_rcv_process_get_method( Exit: OSM_LOG_EXIT( p_rcv->p_log ); return; - } + /********************************************************************** **********************************************************************/ static @@ -855,6 +858,7 @@ osm_sr_rcv_process_set_method( OSM_LOG_ENTER( p_rcv->p_log, osm_sr_rcv_process_set_method ); CL_ASSERT( p_madw ); + p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); p_recvd_service_rec = (ib_service_record_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); @@ -874,7 +878,7 @@ osm_sr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_sr_rcv_process_set_method: " "Component Mask RID check failed for METHOD_SET\n"); - osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status); + osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status ); goto Exit; } @@ -907,12 +911,12 @@ osm_sr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_sr_rcv_process_set_method: ERR 2411: " - "osm_svcr_get_by_rid failed\n"); + "osm_svcr_get_by_rid failed\n" ); osm_sa_send_error( p_rcv->p_resp, p_madw, - IB_SA_MAD_STATUS_NO_RESOURCES); + IB_SA_MAD_STATUS_NO_RESOURCES ); goto Exit; @@ -937,7 +941,7 @@ osm_sr_rcv_process_set_method( /* cl_timer_trim(&p_rcv->sr_timer, */ /* p_recvd_service_rec->service_lease * 1000 ); */ /* This was a bug since no check was made to see if too long */ - /* just make sure the timer works - geta call back within a second */ + /* just make sure the timer works - get a call back within a second */ cl_timer_trim(&p_rcv->sr_timer, 1000); p_svcr->modified_time = cl_get_time_stamp_sec(); } @@ -947,7 +951,7 @@ osm_sr_rcv_process_set_method( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_sr_rcv_process_set_method: ERR 2412: " - "Unable to acquire Service record.\n"); + "Unable to acquire Service record\n" ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_NO_RESOURCES ); goto Exit; @@ -969,9 +973,9 @@ osm_sr_rcv_process_set_method( OSM_LOG_EXIT( p_rcv->p_log ); return; } + /********************************************************************** **********************************************************************/ - static void osm_sr_rcv_process_delete_method( @@ -988,6 +992,7 @@ osm_sr_rcv_process_delete_method( OSM_LOG_ENTER( p_rcv->p_log, osm_sr_rcv_process_delete_method ); CL_ASSERT( p_madw ); + p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); p_recvd_service_rec = (ib_service_record_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); @@ -1015,7 +1020,7 @@ osm_sr_rcv_process_delete_method( cl_plock_release(p_rcv->p_lock); osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_sr_rcv_process_delete_method: " - "No Records Matched the RID\n"); + "No records matched the RID\n"); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_NO_RECORDS ); goto Exit; @@ -1034,7 +1039,7 @@ osm_sr_rcv_process_delete_method( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_sr_rcv_process_delete_method: ERR 2413: " - "Unable to acquire Service record.\n"); + "Unable to acquire Service record\n"); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_NO_RESOURCES ); goto Exit; @@ -1056,7 +1061,6 @@ osm_sr_rcv_process_delete_method( /********************************************************************** **********************************************************************/ - void osm_sr_rcv_process( IN osm_sr_rcv_t* const p_rcv, @@ -1071,6 +1075,7 @@ osm_sr_rcv_process( OSM_LOG_ENTER( p_rcv->p_log, osm_sr_rcv_process ); CL_ASSERT( p_madw ); + p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); p_recvd_service_rec = (ib_service_record_t*)ib_sa_mad_get_payload_ptr( p_sa_mad ); @@ -1109,7 +1114,7 @@ osm_sr_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_sr_rcv_process: " "Bad Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method )); - osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status); + osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status ); break; } @@ -1120,7 +1125,6 @@ osm_sr_rcv_process( /********************************************************************** **********************************************************************/ - void osm_sr_rcv_lease_cb( IN void* context ) @@ -1167,9 +1171,9 @@ osm_sr_rcv_lease_cb( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_sr_rcv_lease_cb: " - "Remaining time for Service Name:%s is:0x%X \n", + "Remaining time for Service Name:%s is:0x%X\n", p_svcr->service_record.service_name, - p_svcr->lease_period); + p_svcr->lease_period ); p_svcr->modified_time = curr_time; @@ -1210,9 +1214,7 @@ osm_sr_rcv_lease_cb( } OSM_LOG_EXIT( p_rcv->p_log ); - } /********************************************************************** **********************************************************************/ - diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_service_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_service_record_ctrl.c index 110fdf31..f7ca42be 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_service_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_service_record_ctrl.c @@ -84,7 +84,6 @@ osm_sr_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -113,7 +112,7 @@ osm_sr_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_sr_rcv_ctrl_init: ERR 2501: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -123,4 +122,3 @@ osm_sr_rcv_ctrl_init( return( status ); } - diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record.c index 8b6d0613..35d6f2fb 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record.c @@ -171,7 +171,7 @@ __osm_sa_slvl_create( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_slvl_create: ERR 2602: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -181,7 +181,7 @@ __osm_sa_slvl_create( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_slvl_create: " "New SLtoVL Map for: OUT port 0x%016" PRIx64 - ", lid 0x%X, port# 0x%X to In Port:%u.\n", + ", lid 0x%X, port# 0x%X to In Port:%u\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ), cl_ntoh16( lid ), osm_physp_get_port_num( p_physp ), in_port_idx @@ -231,7 +231,7 @@ __osm_sa_slvl_by_comp_mask( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_sa_slvl_by_comp_mask: " - "Using Physical Default Port Number: 0x%X (for End Node).\n", + "Using Physical Default Port Number: 0x%X (for End Node)\n", p_port->default_port_num); p_out_physp = osm_port_get_phys_ptr( p_port, p_port->default_port_num); /* check that the p_out_physp and the p_req_physp share a pkey */ @@ -321,9 +321,10 @@ osm_slvl_rec_rcv_process( ib_net64_t comp_mask; osm_physp_t* p_req_physp; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_slvl_rec_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -340,7 +341,7 @@ osm_slvl_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_slvl_rec_rcv_process: ERR 2603: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } @@ -349,7 +350,7 @@ osm_slvl_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_slvl_rec_rcv_process: ERR 2604: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_rcvd_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -371,7 +372,7 @@ osm_slvl_rec_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_slvl_rec_rcv_process: " - "Got Query Lid:0x%04X(%02X), In-Port:0x%02X(%02X), Out-Port:0x%02X(%02X).\n", + "Got Query Lid:0x%04X(%02X), In-Port:0x%02X(%02X), Out-Port:0x%02X(%02X)\n", cl_ntoh16(p_rcvd_rec->lid), (comp_mask &IB_SLVL_COMPMASK_LID) != 0, p_rcvd_rec->in_port_num, (comp_mask &IB_SLVL_COMPMASK_IN_PORT) != 0, p_rcvd_rec->out_port_num, (comp_mask &IB_SLVL_COMPMASK_OUT_PORT) != 0) ; @@ -393,12 +394,12 @@ osm_slvl_rec_rcv_process( { /* port out of range */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_slvl_rec_rcv_process: " - "Given LID (%u) is out of range:%u.\n", + "Given LID (%u) is out of range:%u\n", cl_ntoh16(p_rcvd_rec->lid), cl_ptr_vector_get_size(p_tbl)); } } - /* if we got a unique port - no need for a port search */ + /* if we have a unique port - no need for a port search */ if( p_port ) /* this does the loop on all the port phys ports */ __osm_sa_slvl_by_comp_mask( p_rcv, p_port, &context ); @@ -414,14 +415,14 @@ osm_slvl_rec_rcv_process( num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_slvl_rec_rcv_process: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -444,7 +445,7 @@ osm_slvl_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_slvl_rec_rcv_process: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -452,7 +453,7 @@ osm_slvl_rec_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_slvl_rec_rcv_process: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { @@ -473,7 +474,7 @@ osm_slvl_rec_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_slvl_rec_rcv_process: ERR 2605: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record_ctrl.c index 7cc78c9a..a08be54b 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_slvl_record_ctrl.c @@ -88,7 +88,6 @@ osm_slvl_rec_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_slvl_rec_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_slvl_rec_rcv_ctrl_init: ERR 2701: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record.c index 89924a1e..b300b19b 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record.c @@ -86,9 +86,10 @@ void osm_smir_rcv_destroy( IN osm_smir_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_smir_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } @@ -105,6 +106,7 @@ osm_smir_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_smir_rcv_init ); osm_smir_rcv_construct( p_rcv ); @@ -137,9 +139,10 @@ osm_smir_rcv_process( ib_net64_t local_guid; osm_port_t* local_port; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_smir_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -153,17 +156,18 @@ osm_smir_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_smir_rcv_process: ERR 2803: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } CL_ASSERT( p_sa_mad->attr_id == IB_MAD_ATTR_SMINFO_RECORD ); - if (p_sa_mad->method != IB_MAD_METHOD_GET) + if ( (p_sa_mad->method != IB_MAD_METHOD_GET) && + (p_sa_mad->method != IB_MAD_METHOD_GETTABLE) ) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_smir_rcv_process: ERR 2804: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -180,7 +184,7 @@ osm_smir_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_smir_rcv_process: ERR 2801: " - "Unable to acquire response MAD.\n" ); + "Unable to acquire response MAD\n" ); goto Exit; } @@ -193,7 +197,7 @@ osm_smir_rcv_process( /* HACK: This handling is incorrect. The record to return is records of known SMs by our SM, and not just the details of our SM. */ - /* check a matching of pkeys with the local physp the sm is on. */ + /* check the matching of pkeys with the local physp the SM is on. */ local_guid = p_rcv->p_subn->sm_port_guid; local_port = (osm_port_t*)cl_qmap_get( &p_rcv->p_subn->port_guid_tbl, local_guid ); if (FALSE == @@ -202,7 +206,7 @@ osm_smir_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_smir_rcv_process: ERR 2802: " - "Cannot get sminfo record - pkey violation.\n" ); + "Cannot get sminfo record - pkey violation\n" ); goto Exit; } @@ -235,7 +239,7 @@ osm_smir_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_smir_rcv_process: ERR 2802: " - "Error sending MAD (%s).\n", + "Error sending MAD (%s)\n", ib_get_err_str( status ) ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record_ctrl.c index 43115524..bfb09eb0 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_sminfo_record_ctrl.c @@ -88,7 +88,6 @@ osm_smir_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_smir_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_smir_ctrl_init: ERR 2901: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record.c index 4dc4e45c..1015924e 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record.c @@ -171,7 +171,7 @@ __osm_sa_vl_arb_create( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_vl_arb_create: ERR 2A02: " - "cl_qlock_pool_get failed.\n" ); + "cl_qlock_pool_get failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -181,7 +181,7 @@ __osm_sa_vl_arb_create( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_vl_arb_create: " "New VLArbitration for: port 0x%016" PRIx64 - ", lid 0x%X, port# 0x%X Block:%u.\n", + ", lid 0x%X, port# 0x%X Block:%u\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ), cl_ntoh16( lid ), osm_physp_get_port_num( p_physp ), block @@ -256,7 +256,7 @@ __osm_sa_vl_arb_by_comp_mask( port_num = p_port->default_port_num; osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_sa_vl_arb_by_comp_mask: " - "Using Physical Default Port Number: 0x%X (for End Node).\n", + "Using Physical Default Port Number: 0x%X (for End Node)\n", port_num); comp_mask |= IB_VLA_COMPMASK_OUT_PORT; } @@ -276,7 +276,7 @@ __osm_sa_vl_arb_by_comp_mask( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sa_vl_arb_by_comp_mask: ERR 2A03: " - "Given Physical Port Number: 0x%X is out of range should be < 0x%X.\n", + "Given Physical Port Number: 0x%X is out of range should be < 0x%X\n", port_num, osm_port_get_num_physp( p_port )); goto Exit; } @@ -345,6 +345,8 @@ osm_vlarb_rec_rcv_process( ib_net64_t comp_mask; osm_physp_t* p_req_physp; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_vlarb_rec_rcv_process ); /* update the requestor physical port. */ @@ -355,11 +357,10 @@ osm_vlarb_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_vlarb_rec_rcv_process: ERR 2A04: " - "Cannot find requestor physical port. \n" ); + "Cannot find requestor physical port\n" ); goto Exit; } - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw ); @@ -373,7 +374,7 @@ osm_vlarb_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_vlarb_rec_rcv_process: ERR 2A05: " - "Unsupported Method (%s).\n", + "Unsupported Method (%s)\n", ib_get_sa_method_str( p_rcvd_mad->method ) ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -384,7 +385,6 @@ osm_vlarb_rec_rcv_process( cl_qlist_init( &rec_list ); - context.p_rcvd_rec = p_rcvd_rec; context.p_list = &rec_list; context.comp_mask = p_rcvd_mad->comp_mask; @@ -394,7 +394,7 @@ osm_vlarb_rec_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_vlarb_rec_rcv_process: " - "Got Query Lid:0x%04X(%02X), Port:0x%02X(%02X), Block:0x%02X(%02X).\n", + "Got Query Lid:0x%04X(%02X), Port:0x%02X(%02X), Block:0x%02X(%02X)\n", cl_ntoh16(p_rcvd_rec->lid), (comp_mask &IB_VLA_COMPMASK_LID) != 0, p_rcvd_rec->port_num, (comp_mask &IB_VLA_COMPMASK_OUT_PORT) != 0, p_rcvd_rec->block_num, (comp_mask &IB_VLA_COMPMASK_BLOCK) != 0) ; @@ -416,7 +416,7 @@ osm_vlarb_rec_rcv_process( { /* port out of range */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_vlarb_rec_rcv_process: " - "Given LID (%u) is out of range:%u.\n", + "Given LID (%u) is out of range:%u\n", cl_ntoh16(p_rcvd_rec->lid), cl_ptr_vector_get_size(p_tbl)); } } @@ -437,14 +437,14 @@ osm_vlarb_rec_rcv_process( num_rec = cl_qlist_count( &rec_list ); /* - * C15-0.1.30 : - * If we do a SubAdmGet and got more than one record it is an error ! + * C15-0.1.30: + * If we do a SubnAdmGet and got more than one record it is an error ! */ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec > 1)) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_vlarb_rec_rcv_process: " - "Got more than one record for SubnAdmGet (%u).\n", + "Got more than one record for SubnAdmGet (%u)\n", num_rec ); osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS); @@ -467,7 +467,7 @@ osm_vlarb_rec_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "osm_vlarb_rec_rcv_process: " - "Number of records:%u trimmed to:%u to fit in one MAD.\n", + "Number of records:%u trimmed to:%u to fit in one MAD\n", num_rec, trim_num_rec ); num_rec = trim_num_rec; } @@ -475,7 +475,7 @@ osm_vlarb_rec_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_vlarb_rec_rcv_process: " - "Returning %u records.\n", num_rec ); + "Returning %u records\n", num_rec ); if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0)) { @@ -496,7 +496,7 @@ osm_vlarb_rec_rcv_process( { osm_log(p_rcv->p_log, OSM_LOG_ERROR, "osm_vlarb_rec_rcv_process: ERR 2A06: " - "osm_mad_pool_get failed.\n" ); + "osm_mad_pool_get failed\n" ); for( i = 0; i < num_rec; i++ ) { diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record_ctrl.c index c8a9800e..0b219168 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_vlarb_record_ctrl.c @@ -88,7 +88,6 @@ osm_vlarb_rec_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -117,7 +116,7 @@ osm_vlarb_rec_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_vlarb_rec_rcv_ctrl_init: ERR 2B01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_service.c b/trunk/ulp/opensm/user/opensm/osm_service.c index 4daaecc9..e819dae0 100644 --- a/trunk/ulp/opensm/user/opensm/osm_service.c +++ b/trunk/ulp/opensm/user/opensm/osm_service.c @@ -32,7 +32,6 @@ */ - /* * Abstract: * Implementation of service record functions. @@ -47,22 +46,22 @@ # include #endif /* HAVE_CONFIG_H */ +#include #include #include #include /********************************************************************** **********************************************************************/ - void osm_svcr_construct( IN osm_svcr_t* const p_svcr ) { cl_memclr( p_svcr, sizeof(*p_svcr) ); } + /********************************************************************** **********************************************************************/ - void osm_svcr_destroy( IN osm_svcr_t* const p_svcr ) @@ -89,7 +88,6 @@ osm_svcr_init( p_svcr->service_record = *p_svc_rec; } - /********************************************************************** **********************************************************************/ osm_svcr_t* @@ -123,7 +121,6 @@ __match_rid_of_svc_rec( osm_svcr_t* p_svcr = (osm_svcr_t*)p_list_item; int32_t count; - count = cl_memcmp( &p_svcr->service_record, p_svc_rec, @@ -140,7 +137,6 @@ __match_rid_of_svc_rec( /********************************************************************** **********************************************************************/ - osm_svcr_t* osm_svcr_get_by_rid( IN osm_subn_t const *p_subn, @@ -148,6 +144,7 @@ osm_svcr_get_by_rid( IN ib_service_record_t* const p_svc_rec ) { cl_list_item_t* p_list_item; + OSM_LOG_ENTER( p_log, osm_svcr_get_by_rid ); p_list_item = cl_qlist_find_from_head( @@ -170,18 +167,16 @@ osm_svcr_insert_to_db( IN osm_log_t *p_log, IN osm_svcr_t *p_svcr) { - OSM_LOG_ENTER( p_log, osm_svcr_insert_to_db ); osm_log( p_log, OSM_LOG_DEBUG, "osm_svcr_insert_to_db: " - "Inserting a new Service Record\n"); + "Inserting a new Service Record into Database\n"); cl_qlist_insert_head(&p_subn->sa_sr_list, &p_svcr->list_item); OSM_LOG_EXIT( p_log ); - } void diff --git a/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv.c b/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv.c index dde027d8..08fa1d80 100644 --- a/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv.c @@ -80,13 +80,13 @@ void osm_slvl_rcv_destroy( IN osm_slvl_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_slvl_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -98,6 +98,7 @@ osm_slvl_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_slvl_rcv_init ); osm_slvl_rcv_construct( p_rcv ); @@ -132,9 +133,10 @@ osm_slvl_rcv_process( ib_net64_t node_guid; uint8_t out_port_num, in_port_num; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_slvl_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_smp = osm_madw_get_smp_ptr( p_madw ); @@ -157,7 +159,7 @@ osm_slvl_rcv_process( "osm_slvl_rcv_process: ERR 2C06: " "No Port object for port with GUID = 0x%" PRIx64 "\n\t\t\t\tfor parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), cl_ntoh64( p_smp->trans_id ) ); @@ -193,7 +195,7 @@ osm_slvl_rcv_process( "osm_slvl_rcv_process: " "Got SLtoVL get response in_port_num %u out_port_num %u with GUID = 0x%" PRIx64 " for parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", in_port_num, out_port_num, cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), @@ -210,7 +212,7 @@ osm_slvl_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_slvl_rcv_process: " - "Got invalid port number 0x%X.\n", + "Got invalid port number 0x%X\n", out_port_num ); } goto Exit; diff --git a/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv_ctrl.c index c495834f..ad6e3f6d 100644 --- a/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_slvl_map_rcv_ctrl.c @@ -88,7 +88,6 @@ osm_slvl_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,6 @@ osm_slvl_rcv_ctrl_init( osm_slvl_rcv_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_rcv = p_rcv; p_ctrl->p_disp = p_disp; @@ -119,7 +117,7 @@ osm_slvl_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_slvl_rcv_ctrl_init: ERR 2D01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sm.c b/trunk/ulp/opensm/user/opensm/osm_sm.c index 48eb00b7..e3956be8 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sm.c +++ b/trunk/ulp/opensm/user/opensm/osm_sm.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -84,7 +85,7 @@ __osm_sm_sweeper( if( p_sm->thread_state == OSM_THREAD_STATE_INIT ) { osm_log( p_sm->p_log, OSM_LOG_DEBUG, - "__osm_sm_sweeper: " "Masking ^C Signals.\n" ); + "__osm_sm_sweeper: " "Masking ^C Signals\n" ); cl_sig_mask_sigint( ); p_sm->thread_state = OSM_THREAD_STATE_RUN; @@ -114,7 +115,7 @@ __osm_sm_sweeper( if( osm_log_is_active( p_sm->p_log, OSM_LOG_DEBUG ) ) { osm_log( p_sm->p_log, OSM_LOG_DEBUG, - "__osm_sm_sweeper: " "Off schedule sweep signalled.\n" ); + "__osm_sm_sweeper: " "Off schedule sweep signalled\n" ); } } else @@ -123,7 +124,7 @@ __osm_sm_sweeper( { osm_log( p_sm->p_log, OSM_LOG_ERROR, "__osm_sm_sweeper: ERR 2E01: " - "Event wait failed (%s).\n", CL_STATUS_MSG( status ) ); + "Event wait failed (%s)\n", CL_STATUS_MSG( status ) ); } } } @@ -161,6 +162,7 @@ osm_sm_construct( osm_state_mgr_construct( &p_sm->state_mgr ); osm_state_mgr_ctrl_construct( &p_sm->state_mgr_ctrl ); osm_drop_mgr_construct( &p_sm->drop_mgr ); + osm_pkey_mgr_construct( &p_sm->pkey_mgr ); osm_lft_rcv_construct( &p_sm->lft_rcv ); osm_lft_rcv_ctrl_construct( &p_sm->lft_rcv_ctrl ); osm_mft_rcv_construct( &p_sm->mft_rcv ); @@ -229,7 +231,6 @@ osm_sm_shutdown( osm_state_mgr_ctrl_destroy( &p_sm->state_mgr_ctrl ); OSM_LOG_EXIT( p_sm->p_log ); - } /********************************************************************** @@ -251,6 +252,7 @@ osm_sm_destroy( osm_ucast_mgr_destroy( &p_sm->ucast_mgr ); osm_link_mgr_destroy( &p_sm->link_mgr ); osm_drop_mgr_destroy( &p_sm->drop_mgr ); + osm_pkey_mgr_destroy( &p_sm->pkey_mgr ); osm_lft_rcv_destroy( &p_sm->lft_rcv ); osm_mft_rcv_destroy( &p_sm->mft_rcv ); osm_slvl_rcv_destroy( &p_sm->slvl_rcv ); @@ -301,7 +303,7 @@ osm_sm_init( if( p_sm->p_report_buf == NULL ) { osm_log( p_sm->p_log, OSM_LOG_ERROR, - "osm_sm_init: ERR 2E09: " "Can't allocate report buffer.\n" ); + "osm_sm_init: ERR 2E09: " "Can't allocate report buffer\n" ); status = IB_INSUFFICIENT_MEMORY; goto Exit; } @@ -408,6 +410,7 @@ osm_sm_init( &p_sm->mcast_mgr, &p_sm->link_mgr, &p_sm->drop_mgr, + &p_sm->pkey_mgr, &p_sm->req, p_stats, &p_sm->sm_state_mgr, @@ -430,6 +433,12 @@ osm_sm_init( if( status != IB_SUCCESS ) goto Exit; + status = osm_pkey_mgr_init( &p_sm->pkey_mgr, + p_sm->p_subn, + p_sm->p_log, &p_sm->req, p_sm->p_lock ); + if( status != IB_SUCCESS ) + goto Exit; + status = osm_lft_rcv_init( &p_sm->lft_rcv, p_subn, p_log, p_lock ); if( status != IB_SUCCESS ) goto Exit; @@ -569,7 +578,7 @@ osm_sm_bind( { osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_bind: ERR 2E10: " - "SM MAD Controller bind() failed (%s).\n", + "SM MAD Controller bind failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -643,7 +652,7 @@ __osm_sm_mgrp_disconnect( { osm_log( p_sm->p_log, OSM_LOG_ERROR, "__osm_sm_mgrp_disconnect: ERR 2E11: " - "Failure processing multicast group (%s).\n", + "Failure processing multicast group (%s)\n", ib_get_err_str( status ) ); } @@ -669,7 +678,7 @@ osm_sm_mcgrp_join( osm_log( p_sm->p_log, OSM_LOG_VERBOSE, "osm_sm_mcgrp_join: " - "Port 0x%016" PRIx64 " joining MLID 0x%X.\n", + "Port 0x%016" PRIx64 " joining MLID 0x%X\n", cl_ntoh64( port_guid ), cl_ntoh16( mlid ) ); /* @@ -684,7 +693,7 @@ osm_sm_mcgrp_join( CL_PLOCK_RELEASE( p_sm->p_lock ); osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_mcgrp_join: ERR 2E05: " - "No port object for port 0x%016" PRIx64 ".\n", + "No port object for port 0x%016" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_INVALID_PARAMETER; goto Exit; @@ -699,7 +708,7 @@ osm_sm_mcgrp_join( { osm_log( p_sm->p_log, OSM_LOG_VERBOSE, "osm_sm_mcgrp_join: " - "Creating group, MLID 0x%X.\n", cl_ntoh16( mlid ) ); + "Creating group, MLID 0x%X\n", cl_ntoh16( mlid ) ); p_mgrp = osm_mgrp_new( mlid ); if( p_mgrp == NULL ) @@ -707,7 +716,7 @@ osm_sm_mcgrp_join( CL_PLOCK_RELEASE( p_sm->p_lock ); osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_mcgrp_join: ERR 2E06: " - "Unable to allocate multicast group object.\n" ); + "Unable to allocate multicast group object\n" ); status = IB_INSUFFICIENT_MEMORY; goto Exit; } @@ -727,7 +736,7 @@ osm_sm_mcgrp_join( CL_PLOCK_RELEASE( p_sm->p_lock ); osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_mcgrp_join: ERR 2E12: " - "Port 0x%016" PRIx64 " not in mcast group 0x%X.\n", + "Port 0x%016" PRIx64 " not in mcast group 0x%X\n", cl_ntoh64( port_guid ), cl_ntoh16( mlid ) ); goto Exit; } @@ -760,7 +769,7 @@ osm_sm_mcgrp_join( cl_plock_release( p_sm->p_lock ); osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_mcgrp_join: ERR 2E03: " - "Unable to associate port 0x%" PRIx64 " to mlid 0x%X.\n", + "Unable to associate port 0x%" PRIx64 " to mlid 0x%X\n", cl_ntoh64( osm_port_get_guid( p_port ) ), cl_ntoh16( osm_mgrp_get_mlid( p_mgrp ) ) ); goto Exit; @@ -791,7 +800,7 @@ osm_sm_mcgrp_leave( osm_log( p_sm->p_log, OSM_LOG_VERBOSE, "osm_sm_mcgrp_leave: " - "Port 0x%" PRIx64 " leaving MLID 0x%X.\n", + "Port 0x%" PRIx64 " leaving MLID 0x%X\n", cl_ntoh64( port_guid ), cl_ntoh16( mlid ) ); /* @@ -806,7 +815,7 @@ osm_sm_mcgrp_leave( CL_PLOCK_RELEASE( p_sm->p_lock ); osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_mcgrp_leave: ERR 2E04: " - "No port object for port 0x%" PRIx64 ".\n", + "No port object for port 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); status = IB_INVALID_PARAMETER; goto Exit; @@ -822,7 +831,7 @@ osm_sm_mcgrp_leave( CL_PLOCK_RELEASE( p_sm->p_lock ); osm_log( p_sm->p_log, OSM_LOG_ERROR, "osm_sm_mcgrp_leave: ERR 2E08: " - "No multicast group for MLID 0x%X.\n", cl_ntoh16( mlid ) ); + "No multicast group for MLID 0x%X\n", cl_ntoh16( mlid ) ); status = IB_INVALID_PARAMETER; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c index 9ae897cf..dfceb40d 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c @@ -90,30 +90,19 @@ __osm_sm_mad_ctrl_retire_trans_mad( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_retire_trans_mad: " - "Retiring MAD with TID = 0x%" PRIx64 ".\n", + "Retiring MAD with TID = 0x%" PRIx64 "\n", cl_ntoh64( osm_madw_get_smp_ptr( p_madw )->trans_id ) ); } osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); - if ( !&p_ctrl->p_stats->qp0_mads_outstanding ) - { - osm_log( p_ctrl->p_log, OSM_LOG_ERROR, - "__osm_sm_mad_ctrl_retire_trans_mad: ERR 3120: " - "Trying to dec qp0_mads_outstanding=0. " - "Problem with transaction mgr!\n"); - outstanding = 0; - } - else - { - outstanding = cl_atomic_dec( &p_ctrl->p_stats->qp0_mads_outstanding ); - } + outstanding = cl_atomic_dec( &p_ctrl->p_stats->qp0_mads_outstanding ); if( osm_log_is_active( p_ctrl->p_log, OSM_LOG_DEBUG ) ) { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_retire_trans_mad: " - "%u QP0 MADs outstanding.\n", + "%u QP0 MADs outstanding\n", p_ctrl->p_stats->qp0_mads_outstanding ); } @@ -127,7 +116,7 @@ __osm_sm_mad_ctrl_retire_trans_mad( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_retire_trans_mad: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( OSM_MSG_NO_SMPS_OUTSTANDING ) ); } @@ -141,7 +130,7 @@ __osm_sm_mad_ctrl_retire_trans_mad( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_retire_trans_mad: ERR 3101: " - "Dispatcher post message failed (%s).\n", + "Dispatcher post message failed (%s)\n", CL_STATUS_MSG( status ) ); goto Exit; } @@ -218,25 +207,14 @@ __osm_sm_mad_ctrl_update_wire_stats( OSM_LOG_ENTER( p_ctrl->p_log, __osm_sm_mad_ctrl_update_wire_stats ); - /* Make sure we are not decrementing below zero */ - if ( !&p_ctrl->p_stats->qp0_mads_outstanding_on_wire ) - { - osm_log( p_ctrl->p_log, OSM_LOG_ERROR, - "__osm_sm_mad_ctrl_update_wire_stats: ERR 3105: " - "Trying to dec qp0_mads_outstanding_on_wire=0. " - "Problem with transaction mgr!\n"); - } - else - { - mads_on_wire = cl_atomic_dec( - &p_ctrl->p_stats->qp0_mads_outstanding_on_wire ); - } + mads_on_wire = cl_atomic_dec( + &p_ctrl->p_stats->qp0_mads_outstanding_on_wire ); if( osm_log_is_active( p_ctrl->p_log, OSM_LOG_DEBUG ) ) { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_update_wire_stats: " - "%u SMPs on the wire, %u outstanding.\n", mads_on_wire, + "%u SMPs on the wire, %u outstanding\n", mads_on_wire, p_ctrl->p_stats->qp0_mads_outstanding ); } @@ -280,7 +258,7 @@ __osm_sm_mad_ctrl_process_get_resp( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_get_resp: ERR 3102: " - "'D' bit not set in returned SMP.\n" ); + "'D' bit not set in returned SMP\n" ); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR ); } @@ -342,7 +320,7 @@ __osm_sm_mad_ctrl_process_get_resp( default: osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_get_resp: ERR 3103: " - "Unsupported attribute = 0x%X.\n", + "Unsupported attribute = 0x%X\n", cl_ntoh16( p_smp->attr_id ) ); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR ); goto Exit; @@ -359,7 +337,7 @@ __osm_sm_mad_ctrl_process_get_resp( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_process_get_resp: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( msg_id ) ); } @@ -373,8 +351,9 @@ __osm_sm_mad_ctrl_process_get_resp( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_get_resp: ERR 3104: " - "Dispatcher post message failed (%s).\n", - CL_STATUS_MSG( status ) ); + "Dispatcher post message failed (%s) for attribute = 0x%X\n", + CL_STATUS_MSG( status ), + cl_ntoh16( p_smp->attr_id ) ); goto Exit; } } @@ -425,7 +404,7 @@ __osm_sm_mad_ctrl_process_get( default: osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE, "__osm_sm_mad_ctrl_process_get: " - "Ignoring SubnGet MAD - unsupported attribute = 0x%X.\n", + "Ignoring SubnGet MAD - unsupported attribute = 0x%X\n", cl_ntoh16( p_smp->attr_id ) ); } @@ -440,7 +419,7 @@ __osm_sm_mad_ctrl_process_get( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_process_get: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( msg_id ) ); } @@ -454,7 +433,7 @@ __osm_sm_mad_ctrl_process_get( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_get: ERR 3106: " - "Dispatcher post message failed (%s).\n", + "Dispatcher post message failed (%s)\n", CL_STATUS_MSG( status ) ); goto Exit; } @@ -517,7 +496,7 @@ __osm_sm_mad_ctrl_process_set( default: osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_set: ERR 3107: " - "Unsupported attribute = 0x%X.\n", + "Unsupported attribute = 0x%X\n", cl_ntoh16( p_smp->attr_id ) ); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR ); @@ -534,7 +513,7 @@ __osm_sm_mad_ctrl_process_set( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_process_set: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( msg_id ) ); } @@ -548,7 +527,7 @@ __osm_sm_mad_ctrl_process_set( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_set: ERR 3108: " - "Dispatcher post message failed (%s).\n", + "Dispatcher post message failed (%s)\n", CL_STATUS_MSG( status ) ); goto Exit; } @@ -604,7 +583,7 @@ __osm_sm_mad_ctrl_process_trap( osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_process_trap: " "Received trap but OpenSM is not in MASTER state. " - "Dropping mad. \n"); + "Dropping mad\n"); osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); goto Exit; } @@ -622,7 +601,7 @@ __osm_sm_mad_ctrl_process_trap( default: osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_trap: ERR 3109: " - "Unsupported attribute = 0x%X.\n", + "Unsupported attribute = 0x%X\n", cl_ntoh16( p_smp->attr_id ) ); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR ); @@ -639,7 +618,7 @@ __osm_sm_mad_ctrl_process_trap( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_process_trap: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( msg_id ) ); } @@ -653,7 +632,7 @@ __osm_sm_mad_ctrl_process_trap( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_process_trap: ERR 3110: " - "Dispatcher post message failed (%s).\n", + "Dispatcher post message failed (%s)\n", CL_STATUS_MSG( status ) ); goto Exit; } @@ -712,7 +691,7 @@ __osm_sm_mad_ctrl_rcv_callback( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_rcv_callback: " - "%u QP0 MADs received.\n", + "%u QP0 MADs received\n", p_ctrl->p_stats->qp0_mads_rcvd ); } @@ -723,7 +702,7 @@ __osm_sm_mad_ctrl_rcv_callback( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_rcv_callback: " - "Ignoring received mad - since we are exiting.\n"); + "Ignoring received mad - since we are exiting\n"); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_DEBUG ); @@ -752,7 +731,7 @@ __osm_sm_mad_ctrl_rcv_callback( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_rcv_callback: ERR 3111: " - "Error status = 0x%X.\n", ib_smp_get_status( p_smp ) ); + "Error status = 0x%X\n", ib_smp_get_status( p_smp ) ); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR ); } @@ -778,6 +757,7 @@ __osm_sm_mad_ctrl_rcv_callback( CL_ASSERT( p_req_madw == NULL ); __osm_sm_mad_ctrl_process_set( p_ctrl, p_madw ); break; + case IB_MAD_METHOD_SEND: case IB_MAD_METHOD_REPORT: case IB_MAD_METHOD_REPORT_RESP: @@ -785,7 +765,7 @@ __osm_sm_mad_ctrl_rcv_callback( default: osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_rcv_callback: ERR 3112: " - "Unsupported method = 0x%X.\n", p_smp->method ); + "Unsupported method = 0x%X\n", p_smp->method ); osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR ); osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw ); goto Exit; @@ -826,16 +806,15 @@ __osm_sm_mad_ctrl_send_err_cb( OSM_LOG_ENTER( p_ctrl->p_log, __osm_sm_mad_ctrl_send_err_cb ); + CL_ASSERT( p_madw ); + osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_send_err_cb: ERR 3113: " - "MAD completed in error (%s).\n", + "MAD completed in error (%s)\n", ib_get_err_str( p_madw->status ) ); - CL_ASSERT( p_madw ); - CL_ASSERT( p_madw->resp_expected == TRUE ); - /* - If this was a SubnSet mad, then this error might indicate a problem + If this was a SubnSet MAD, then this error might indicate a problem in configuring the subnet. In this case - need to mark that there was such a problem. The subnet will not be up, and the next sweep should be a heavy sweep as well. @@ -849,7 +828,7 @@ __osm_sm_mad_ctrl_send_err_cb( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_send_err_cb: ERR 3119: " - "Set method failed.\n" ); + "Set method failed\n" ); p_ctrl->p_subn->subnet_initialization_error = TRUE; } @@ -873,7 +852,7 @@ __osm_sm_mad_ctrl_send_err_cb( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_send_err_cb: ERR 3114: " - "Fail to find the corresponding phys port.\n"); + "Fail to find the corresponding phys port\n"); } else { @@ -898,7 +877,7 @@ __osm_sm_mad_ctrl_send_err_cb( { osm_log( p_ctrl->p_log, OSM_LOG_DEBUG, "__osm_sm_mad_ctrl_send_err_cb: " - "Posting Dispatcher message %s.\n", + "Posting Dispatcher message %s\n", osm_get_disp_msg_str( osm_madw_get_err_msg( p_madw ) ) ); } @@ -911,7 +890,7 @@ __osm_sm_mad_ctrl_send_err_cb( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_send_err_cb: ERR 3115: " - "Dispatcher post message failed (%s).\n", + "Dispatcher post message failed (%s)\n", CL_STATUS_MSG( status ) ); } } @@ -1000,7 +979,7 @@ osm_sm_mad_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_sm_mad_ctrl_init: ERR 3116: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -1026,7 +1005,7 @@ osm_sm_mad_ctrl_bind( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "osm_sm_mad_ctrl_bind: ERR 3117: " - "Multiple binds not allowed. Call unbind first. " ); + "Multiple binds not allowed\n" ); status = IB_ERROR; goto Exit; } @@ -1042,7 +1021,7 @@ osm_sm_mad_ctrl_bind( osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE, "osm_sm_mad_ctrl_bind: " - "Binding to port 0x%" PRIx64 ".\n", + "Binding to port 0x%" PRIx64 "\n", cl_ntoh64( port_guid ) ); p_ctrl->h_bind = osm_vendor_bind( p_ctrl->p_vendor, @@ -1057,7 +1036,7 @@ osm_sm_mad_ctrl_bind( status = IB_ERROR; osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "osm_sm_mad_ctrl_bind: ERR 3118: " - "Vendor specific bind() failed.\n" ); + "Vendor specific bind failed\n" ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c b/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c index 7537ea4d..2b420565 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c @@ -72,7 +72,7 @@ static void __osm_sm_state_mgr_standby_msg( IN const osm_sm_state_mgr_t * p_sm_mgr ) { - osm_log( p_sm_mgr->p_log, OSM_LOG_SYS, "Entering STANDBY state" ); /* Format Waived */ + osm_log( p_sm_mgr->p_log, OSM_LOG_SYS, "Entering STANDBY state\n" ); /* Format Waived */ if( osm_log_is_active( p_sm_mgr->p_log, OSM_LOG_VERBOSE ) ) { @@ -81,7 +81,7 @@ __osm_sm_state_mgr_standby_msg( "\n\n\n********************************" "**********************************\n" "******************** ENTERING SM STANDBY" - " STATE **********************\n" + " STATE *******************\n" "**************************************" "****************************\n\n\n" ); } @@ -93,6 +93,8 @@ static void __osm_sm_state_mgr_master_msg( IN const osm_sm_state_mgr_t * p_sm_mgr ) { + osm_log( p_sm_mgr->p_log, OSM_LOG_SYS, "Entering MASTER state\n" ); /* Format Waived */ + if( osm_log_is_active( p_sm_mgr->p_log, OSM_LOG_VERBOSE ) ) { osm_log( p_sm_mgr->p_log, OSM_LOG_VERBOSE, @@ -100,7 +102,7 @@ __osm_sm_state_mgr_master_msg( "\n\n\n********************************" "**********************************\n" "******************** ENTERING SM MASTER" - " STATE **********************\n" + " STATE ********************\n" "**************************************" "****************************\n\n\n" ); } @@ -144,7 +146,6 @@ __osm_sm_state_mgr_notactive_msg( } } - /********************************************************************** **********************************************************************/ void @@ -170,7 +171,7 @@ __osm_sm_state_mgr_send_local_port_info_req( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "__osm_sm_state_mgr_send_local_port_info_req: ERR 3205: " - "No port object for port 0x%016" PRIx64 ".\n", + "No port object for port 0x%016" PRIx64 "\n", cl_ntoh64( port_guid ) ); goto Exit; } @@ -195,7 +196,7 @@ __osm_sm_state_mgr_send_local_port_info_req( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "__osm_sm_state_mgr_send_local_port_info_req: ERR 3202: " - "Failure requesting PortInfo (%s).\n", + "Failure requesting PortInfo (%s)\n", ib_get_err_str( status ) ); } @@ -240,7 +241,7 @@ __osm_sm_state_mgr_send_master_sm_info_req( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "__osm_sm_state_mgr_send_master_sm_info_req: ERR 3203: " - "No port object for guid 0x%X \n", p_sm_mgr->master_guid ); + "No port object for guid 0x%X\n", p_sm_mgr->master_guid ); goto Exit; } @@ -257,7 +258,7 @@ __osm_sm_state_mgr_send_master_sm_info_req( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "__osm_sm_state_mgr_send_master_sm_info_req: ERR 3204: " - "Failure rquesting SMInfo (%s).\n", ib_get_err_str( status ) ); + "Failure rquesting SMInfo (%s)\n", ib_get_err_str( status ) ); } Exit: @@ -296,7 +297,7 @@ __osm_sm_state_mgr_start_polling( if( cl_status != CL_SUCCESS ) { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, - "__osm_sm_state_mgr_start_polling : ERROR 1000: " + "__osm_sm_state_mgr_start_polling : ERR 3210: " "Failed to start timer\n" ); } @@ -360,7 +361,7 @@ __osm_sm_state_mgr_polling_callback( { osm_log( p_sm_mgr->p_log, OSM_LOG_DEBUG, "__osm_sm_state_mgr_polling_callback : " - "Reached polling_retry_number value in retrys" + "Reached polling_retry_number value in retry_number. " "Go to DISCOVERY state\n" ); osm_sm_state_mgr_process( p_sm_mgr, OSM_SM_SIGNAL_POLLING_TIMEOUT ); goto Exit; @@ -375,7 +376,7 @@ __osm_sm_state_mgr_polling_callback( if( cl_status != CL_SUCCESS ) { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, - "__osm_sm_state_mgr_polling_callback : ERROR 1000: " + "__osm_sm_state_mgr_polling_callback : ERR 3211: " "Failed to re-start timer\n" ); } @@ -394,7 +395,6 @@ osm_sm_state_mgr_construct( cl_memclr( p_sm_mgr, sizeof( *p_sm_mgr ) ); cl_spinlock_construct( &p_sm_mgr->state_lock ); cl_timer_construct( &p_sm_mgr->polling_timer ); - } /********************************************************************** @@ -403,17 +403,16 @@ void osm_sm_state_mgr_destroy( IN osm_sm_state_mgr_t * const p_sm_mgr ) { - OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_destroy ); - CL_ASSERT( p_sm_mgr ); + OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_destroy ); + cl_spinlock_destroy( &p_sm_mgr->state_lock ); cl_timer_destroy( &p_sm_mgr->polling_timer ); OSM_LOG_EXIT( p_sm_mgr->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -447,7 +446,7 @@ osm_sm_state_mgr_init( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "osm_sm_state_mgr_init: ERR 3201: " - "Spinlock init failed (%s).\n", CL_STATUS_MSG( status ) ); + "Spinlock init failed (%s)\n", CL_STATUS_MSG( status ) ); } status = cl_timer_init( &p_sm_mgr->polling_timer, @@ -457,7 +456,7 @@ osm_sm_state_mgr_init( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "osm_sm_state_mgr_init: ERR 3206: " - "Timer init failed (%s).\n", CL_STATUS_MSG( status ) ); + "Timer init failed (%s)\n", CL_STATUS_MSG( status ) ); } OSM_LOG_EXIT( p_sm_mgr->p_log ); @@ -473,7 +472,7 @@ __osm_sm_state_mgr_signal_error( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "__osm_sm_state_mgr_signal_error: ERR 3207: " - "Invalid signal %s in state %s.\n", + "Invalid signal %s in state %s\n", osm_get_sm_mgr_signal_str( signal ), osm_get_sm_mgr_state_str( p_sm_mgr->p_subn->sm_state ) ); } @@ -487,12 +486,10 @@ osm_sm_state_mgr_signal_master_is_alive( OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_signal_master_is_alive ); p_sm_mgr->retry_number = 0; OSM_LOG_EXIT( p_sm_mgr->p_log ); - } /********************************************************************** **********************************************************************/ - ib_api_status_t osm_sm_state_mgr_process( IN osm_sm_state_mgr_t * const p_sm_mgr, @@ -500,10 +497,10 @@ osm_sm_state_mgr_process( { ib_api_status_t status = IB_SUCCESS; - OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_process ); - CL_ASSERT( p_sm_mgr ); + OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_process ); + /* * The state lock prevents many race conditions from screwing * up the state transition process. @@ -514,7 +511,7 @@ osm_sm_state_mgr_process( { osm_log( p_sm_mgr->p_log, OSM_LOG_DEBUG, "osm_sm_state_mgr_process: " - "Received signal %s in state %s.\n", + "Received signal %s in state %s\n", osm_get_sm_mgr_signal_str( signal ), osm_get_sm_mgr_state_str( p_sm_mgr->p_subn->sm_state ) ); } @@ -582,6 +579,14 @@ osm_sm_state_mgr_process( __osm_sm_state_mgr_start_polling( p_sm_mgr ); break; + case OSM_SM_SIGNAL_HANDOVER: + /* + * Do nothing. We will discover it later on. If we already discovered + * this SM, and got the HANDOVER - this means the remote SM is of + * lower priority. In this case we will stop polling it (since it is + * a lower priority SM in STANDBY state). + */ + break; default: __osm_sm_state_mgr_signal_error( p_sm_mgr, signal ); status = IB_INVALID_PARAMETER; @@ -694,7 +699,7 @@ osm_sm_state_mgr_process( osm_log( p_sm_mgr->p_log, OSM_LOG_VERBOSE, "osm_sm_state_mgr_process: " "Forcing immediate heavy sweep. " - "Received OSM_SM_SIGNAL_HANDOVER \n" ); + "Received OSM_SM_SIGNAL_HANDOVER\n" ); p_sm_mgr->p_polling_sm = NULL; p_sm_mgr->p_subn->force_immediate_heavy_sweep = TRUE; osm_state_mgr_process( p_sm_mgr->p_state_mgr, OSM_SIGNAL_SWEEP ); @@ -732,7 +737,7 @@ osm_sm_state_mgr_process( default: osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "osm_sm_state_mgr_process: ERR 3208: " - "Invalid state %s.\n", + "Invalid state %s\n", osm_get_sm_mgr_state_str( p_sm_mgr->p_subn->sm_state ) ); } @@ -745,7 +750,6 @@ osm_sm_state_mgr_process( /********************************************************************** **********************************************************************/ - ib_api_status_t osm_sm_state_mgr_check_legality( IN osm_sm_state_mgr_t * const p_sm_mgr, @@ -753,10 +757,10 @@ osm_sm_state_mgr_check_legality( { ib_api_status_t status = IB_SUCCESS; - OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_check_legality ); - CL_ASSERT( p_sm_mgr ); + OSM_LOG_ENTER( p_sm_mgr->p_log, osm_sm_state_mgr_check_legality ); + /* * The state lock prevents many race conditions from screwing * up the state transition process. @@ -767,7 +771,7 @@ osm_sm_state_mgr_check_legality( { osm_log( p_sm_mgr->p_log, OSM_LOG_DEBUG, "osm_sm_state_mgr_check_legality: " - "Received signal %s in state %s.\n", + "Received signal %s in state %s\n", osm_get_sm_mgr_signal_str( signal ), osm_get_sm_mgr_state_str( p_sm_mgr->p_subn->sm_state ) ); } @@ -793,6 +797,7 @@ osm_sm_state_mgr_check_legality( case OSM_SM_SIGNAL_DISCOVERY_COMPLETED: case OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED: case OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED_DONE: + case OSM_SM_SIGNAL_HANDOVER: status = IB_SUCCESS; break; default: @@ -849,7 +854,7 @@ osm_sm_state_mgr_check_legality( default: osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "osm_sm_state_mgr_check_legality: ERR 3209: " - "Invalid state %s.\n", + "Invalid state %s\n", osm_get_sm_mgr_state_str( p_sm_mgr->p_subn->sm_state ) ); status = IB_INVALID_PARAMETER; diff --git a/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv.c b/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv.c index eba36bda..75c51eb8 100755 --- a/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv.c @@ -77,13 +77,13 @@ void osm_sminfo_rcv_destroy( IN osm_sminfo_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_sminfo_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -98,6 +98,7 @@ osm_sminfo_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_sminfo_rcv_init ); osm_sminfo_rcv_construct( p_rcv ); @@ -189,7 +190,7 @@ __osm_sminfo_rcv_process_get_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_request: ERR 2F02: " - "Error sending response (%s).\n", + "Error sending response (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -237,7 +238,6 @@ __osm_sminfo_rcv_check_set_req_legality( return( IB_INVALID_PARAMETER ); } - /********************************************************************** **********************************************************************/ void @@ -272,7 +272,7 @@ __osm_sminfo_rcv_process_set_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_request: ERR 2F03: " - "Unsupported method 0x%X.\n", + "Unsupported method 0x%X\n", p_smp->method ); CL_PLOCK_RELEASE( p_rcv->p_lock ); goto Exit; @@ -318,7 +318,7 @@ __osm_sminfo_rcv_process_set_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_request: ERR 2F05: " - "Error sending response (%s).\n", + "Error sending response (%s)\n", ib_get_err_str( status ) ); } CL_PLOCK_RELEASE( p_rcv->p_lock ); @@ -350,7 +350,7 @@ __osm_sminfo_rcv_process_set_request( */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_request: ERR 2F06: " - "THIS CODE SHOULD NOT BE REACHED!! \n"); + "THIS CODE SHOULD NOT BE REACHED!!\n"); CL_PLOCK_RELEASE( p_rcv->p_lock ); goto Exit; } @@ -371,7 +371,7 @@ __osm_sminfo_rcv_process_set_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_request: ERR 2F08: " - "Error sending response (%s).\n", + "Error sending response (%s)\n", ib_get_err_str( status ) ); } CL_PLOCK_RELEASE( p_rcv->p_lock ); @@ -384,21 +384,21 @@ __osm_sminfo_rcv_process_set_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_request: ERR 2F09: " - "Error sending response (%s).\n", + "Error sending response (%s)\n", ib_get_err_str( status ) ); } /* it is a legal packet - act according to it */ /* if the AttributeModifier is STANDBY - need to save on the */ - /* p_sm_state_mgr in the maseter_guid variable - the guid of the */ + /* p_sm_state_mgr in the master_guid variable - the guid of the */ /* current master. */ if ( p_smp->attr_mod == IB_SMINFO_ATTR_MOD_STANDBY) { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_sminfo_rcv_process_set_request: " - "Received a STANDBY signalUpdating " - "sm_state_mgr master_guid: 0x%X.\n", + "Received a STANDBY signal. Updating " + "sm_state_mgr master_guid: 0x%X\n", p_rcv_smi->guid ); p_rcv->p_sm_state_mgr->master_guid = p_rcv_smi->guid; } @@ -412,7 +412,7 @@ __osm_sminfo_rcv_process_set_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_request: ERR 2F10: " - "Error in SM state transition (%s).\n", + "Error in SM state transition (%s)\n", ib_get_err_str( status ) ); } @@ -420,7 +420,6 @@ __osm_sminfo_rcv_process_set_request( OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** * Return a signal with which to call the osm_state_mgr_process. * This is done since we are locked by p_rcv->p_lock in this function, @@ -443,7 +442,7 @@ __osm_sminfo_rcv_process_get_sm( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_sminfo_rcv_process_get_sm: " - "Detected SM 0x%016" PRIx64 " in state %u.\n", + "Detected SM 0x%016" PRIx64 " in state %u\n", cl_ntoh64( p_smi->guid ), ib_sminfo_get_state( p_smi ) ); } @@ -465,7 +464,7 @@ __osm_sminfo_rcv_process_get_sm( /* save on the p_sm_state_mgr the guid of the current master. */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_sminfo_rcv_process_get_sm: " - "Found master SM. Updating sm_state_mgr master_guid: 0x%016" PRIx64 ".\n", + "Found master SM. Updating sm_state_mgr master_guid: 0x%016" PRIx64 "\n", cl_ntoh64( p_sm->p_port->guid ) ); p_rcv->p_sm_state_mgr->master_guid = p_sm->p_port->guid; break; @@ -479,7 +478,7 @@ __osm_sminfo_rcv_process_get_sm( /* we will poll it - as long as it lives - we should be in Standby. */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_sminfo_rcv_process_get_sm: " - "Found higher SM. Updating sm_state_mgr master_guid: 0x%X.\n", + "Found higher SM. Updating sm_state_mgr master_guid: 0x%X\n", p_sm->p_port->guid ); p_rcv->p_sm_state_mgr->master_guid = p_sm->p_port->guid; } @@ -551,7 +550,6 @@ __osm_sminfo_rcv_process_get_sm( return ret_val; } - /********************************************************************** **********************************************************************/ void @@ -579,7 +577,7 @@ __osm_sminfo_rcv_process_get_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_response: ERR 2F11: " - "Unsupported method 0x%X.\n", + "Unsupported method 0x%X\n", p_smp->method ); goto Exit; } @@ -600,7 +598,7 @@ __osm_sminfo_rcv_process_get_response( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_response: ERR 2F18: " "Got SM with sm_key that doesn't match our " - "local key. Exiting.\n" ); + "local key. Exiting\n" ); osm_log( p_rcv->p_log, OSM_LOG_SYS, "Found remote SM with non-matching sm_key. Exiting\n" ); osm_exit_flag = TRUE; @@ -608,7 +606,7 @@ __osm_sminfo_rcv_process_get_response( } /* - Determine if we already have an Other SM object for this SM. + Determine if we already have another SM object for this SM. */ CL_PLOCK_EXCL_ACQUIRE( p_rcv->p_lock ); @@ -617,7 +615,7 @@ __osm_sminfo_rcv_process_get_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_response: ERR 2F12: " - "No Port object for this SM.\n" ); + "No Port object for this SM\n" ); goto Exit; } @@ -625,9 +623,9 @@ __osm_sminfo_rcv_process_get_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_response: ERR 2F13: " - "Bogus SM port GUID." + "Bogus SM port GUID" "\n\t\t\t\tExpected 0x%016" PRIx64 - ", Received 0x%016" PRIx64 ".\n", + ", Received 0x%016" PRIx64 "\n", cl_ntoh64( osm_port_get_guid( p_port ) ), cl_ntoh64( p_smi->guid ) ); goto Exit; @@ -641,7 +639,7 @@ __osm_sminfo_rcv_process_get_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_response: ERR 2F14: " - "Unable to allocate SM object.\n" ); + "Unable to allocate SM object\n" ); goto Exit; } @@ -650,7 +648,7 @@ __osm_sminfo_rcv_process_get_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_get_response: ERR 2F15: " - "Other SM object initialization failed (%s).\n", + "Other SM object initialization failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -698,7 +696,7 @@ __osm_sminfo_rcv_process_set_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_response: ERR 2F16: " - "Unsupported method 0x%X.\n", + "Unsupported method 0x%X\n", p_smp->method ); goto Exit; } @@ -708,7 +706,7 @@ __osm_sminfo_rcv_process_set_response( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_sminfo_rcv_process_set_response: ERR 2F17: " - "Unsupported attribute modifier 0x%X.\n", + "Unsupported attribute modifier 0x%X\n", p_smp->attr_mod ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv_ctrl.c index cd6db17e..f8fe47b4 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sminfo_rcv_ctrl.c @@ -84,7 +84,6 @@ osm_sminfo_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -114,7 +113,7 @@ osm_sminfo_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_sminfo_rcv_ctrl_init: ERR 3001: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -124,8 +123,3 @@ osm_sminfo_rcv_ctrl_init( return( status ); } - - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_state_mgr.c b/trunk/ulp/opensm/user/opensm/osm_state_mgr.c index 3d94c45d..e27247b7 100644 --- a/trunk/ulp/opensm/user/opensm/osm_state_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_state_mgr.c @@ -75,7 +75,6 @@ osm_state_mgr_construct( cl_spinlock_construct( &p_mgr->state_lock ); cl_spinlock_construct( &p_mgr->idle_lock ); p_mgr->state = OSM_SM_STATE_INIT; - } /********************************************************************** @@ -84,10 +83,10 @@ void osm_state_mgr_destroy( IN osm_state_mgr_t * const p_mgr ) { - OSM_LOG_ENTER( p_mgr->p_log, osm_state_mgr_destroy ); - CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_state_mgr_destroy ); + /* destroy the locks */ cl_spinlock_destroy( &p_mgr->state_lock ); cl_spinlock_destroy( &p_mgr->idle_lock ); @@ -95,7 +94,6 @@ osm_state_mgr_destroy( OSM_LOG_EXIT( p_mgr->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -107,6 +105,7 @@ osm_state_mgr_init( IN osm_mcast_mgr_t * const p_mcast_mgr, IN osm_link_mgr_t * const p_link_mgr, IN osm_drop_mgr_t * const p_drop_mgr, + IN osm_pkey_mgr_t * const p_pkey_mgr, IN osm_req_t * const p_req, IN osm_stats_t * const p_stats, IN osm_sm_state_mgr_t * const p_sm_state_mgr, @@ -126,6 +125,7 @@ osm_state_mgr_init( CL_ASSERT( p_mcast_mgr ); CL_ASSERT( p_link_mgr ); CL_ASSERT( p_drop_mgr ); + CL_ASSERT( p_pkey_mgr ); CL_ASSERT( p_req ); CL_ASSERT( p_stats ); CL_ASSERT( p_sm_state_mgr ); @@ -142,6 +142,7 @@ osm_state_mgr_init( p_mgr->p_mcast_mgr = p_mcast_mgr; p_mgr->p_link_mgr = p_link_mgr; p_mgr->p_drop_mgr = p_drop_mgr; + p_mgr->p_pkey_mgr = p_pkey_mgr; p_mgr->p_mad_ctrl = p_mad_ctrl; p_mgr->p_req = p_req; p_mgr->p_stats = p_stats; @@ -158,7 +159,7 @@ osm_state_mgr_init( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_state_mgr_init: ERR 3301: " - "Spinlock init failed (%s).\n", CL_STATUS_MSG( status ) ); + "Spinlock init failed (%s)\n", CL_STATUS_MSG( status ) ); } cl_qlist_init( &p_mgr->idle_time_list ); @@ -168,7 +169,7 @@ osm_state_mgr_init( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_state_mgr_init: ERR 3302: " - "Spinlock init failed (%s).\n", CL_STATUS_MSG( status ) ); + "Spinlock init failed (%s)\n", CL_STATUS_MSG( status ) ); } OSM_LOG_EXIT( p_mgr->p_log ); @@ -224,7 +225,7 @@ static void __osm_state_mgr_init_errors_msg( IN const osm_state_mgr_t * p_mgr ) { - osm_log( p_mgr->p_log, OSM_LOG_SYS, "Errors during initialization.\n" ); /* Format Waived */ + osm_log( p_mgr->p_log, OSM_LOG_SYS, "Errors during initialization\n" ); /* Format Waived */ osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_init_errors_msg: " @@ -280,7 +281,7 @@ static void __osm_state_mgr_sm_port_down_msg( IN const osm_state_mgr_t * p_mgr ) { - osm_log( p_mgr->p_log, OSM_LOG_SYS, "SM port is down.\n" ); /* Format Waived */ + osm_log( p_mgr->p_log, OSM_LOG_SYS, "SM port is down\n" ); /* Format Waived */ if( osm_log_is_active( p_mgr->p_log, OSM_LOG_VERBOSE ) ) { @@ -475,7 +476,7 @@ __osm_state_mgr_signal_warning( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_state_mgr_signal_warning: " - "Invalid signal %s(%d) in state %s.\n", + "Invalid signal %s(%d) in state %s\n", osm_get_sm_signal_str( signal ), signal, osm_get_sm_state_str( p_mgr->state ) ); } @@ -494,7 +495,7 @@ __osm_state_mgr_signal_error( else osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_signal_error: ERR 3303: " - "Invalid signal %s(%d) in state %s.\n", + "Invalid signal %s(%d) in state %s\n", osm_get_sm_signal_str( signal ), signal, osm_get_sm_state_str( p_mgr->state ) ); } @@ -513,7 +514,7 @@ __osm_state_mgr_reset_node_count( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_reset_node_count: " - "Resetting discovery count for node 0x%" PRIx64 ".\n", + "Resetting discovery count for node 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); } @@ -534,7 +535,7 @@ __osm_state_mgr_reset_port_count( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_reset_port_count: " - "Resetting discovery count for port 0x%" PRIx64 ".\n", + "Resetting discovery count for port 0x%" PRIx64 "\n", cl_ntoh64( osm_port_get_guid( p_port ) ) ); } @@ -555,7 +556,7 @@ __osm_state_mgr_reset_switch_count( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_reset_switch_count: " - "Resetting discovery count for switch 0x%" PRIx64 ".\n", + "Resetting discovery count for switch 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_sw->p_node ) ) ); } @@ -596,7 +597,7 @@ __osm_state_mgr_get_sw_info( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_get_sw_info: ERR 3304: " - "Request SwitchInfo failed.\n" ); + "Request SwitchInfo failed\n" ); } OSM_LOG_EXIT( p_mgr->p_log ); @@ -644,7 +645,7 @@ __osm_state_mgr_get_remote_port_info( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_get_remote_port_info: ERR 332E: " - "Request PortInfo failed.\n" ); + "Request for PortInfo failed\n" ); } OSM_LOG_EXIT( p_mgr->p_log ); @@ -712,14 +713,14 @@ __osm_state_mgr_sweep_hop_0( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_sweep_hop_0: ERR 3305: " - "Request NodeInfo failed.\n" ); + "Request NodeInfo failed\n" ); } } else { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_sweep_hop_0: " - "No bound ports. Deferring sweep...\n" ); + "No bound ports. Deferring sweep...\n" ); status = IB_INVALID_STATE; } @@ -775,7 +776,7 @@ __osm_state_mgr_notify_lid_change( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_notify_lid_change: ERR 3306: " - "No bound ports.\n" ); + "No bound ports\n" ); status = IB_ERROR; goto Exit; } @@ -788,7 +789,7 @@ __osm_state_mgr_notify_lid_change( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_notify_lid_change: ERR 3307: " - "Vendor LID update failed (%s).\n", ib_get_err_str( status ) ); + "Vendor LID update failed (%s)\n", ib_get_err_str( status ) ); } Exit: @@ -821,7 +822,7 @@ __osm_state_mgr_is_sm_port_down( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_is_sm_port_down: ERR 3308: " - "SM port GUID unknown.\n" ); + "SM port GUID unknown\n" ); state = IB_LINK_DOWN; goto Exit; } @@ -836,7 +837,7 @@ __osm_state_mgr_is_sm_port_down( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_is_sm_port_down: ERR 3309: " - "SM port with GUID:%016" PRIx64 " is unknown.\n", + "SM port with GUID:%016" PRIx64 " is unknown\n", cl_ntoh64( port_guid ) ); state = IB_LINK_DOWN; CL_PLOCK_RELEASE( p_mgr->p_lock ); @@ -903,7 +904,7 @@ __osm_state_mgr_sweep_hop_1( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_sweep_hop_1: ERR 3310: " - "No SM port object.\n" ); + "No SM port object\n" ); status = IB_ERROR; goto Exit; } @@ -915,7 +916,7 @@ __osm_state_mgr_sweep_hop_1( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_sweep_hop_1: " - "Probing hop 1 on local port %u.\n", port_num ); + "Probing hop 1 on local port %u\n", port_num ); p_physp = osm_node_get_physp_ptr( p_node, port_num ); @@ -948,7 +949,7 @@ __osm_state_mgr_sweep_hop_1( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_sweep_hop_1: ERR 3311: " - "Request NodeInfo failed.\n" ); + "Request NodeInfo failed\n" ); } break; @@ -986,7 +987,7 @@ __osm_state_mgr_sweep_hop_1( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_sweep_hop_1: ERR 3312: " - "Request NodeInfo failed.\n" ); + "Request NodeInfo failed\n" ); } } } @@ -995,7 +996,7 @@ __osm_state_mgr_sweep_hop_1( default: osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_sweep_hop_1: ERR 3313: " - " Supported node type that hosts SM is CA or SW only" ); + " Supported node type that hosts SM is CA or SW only\n" ); } Exit: @@ -1053,7 +1054,7 @@ __osm_state_mgr_light_sweep_start( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_light_sweep_start: " - "No bound ports. Deferring sweep...\n" ); + "No bound ports. Deferring sweep...\n" ); status = IB_INVALID_STATE; } @@ -1229,7 +1230,6 @@ osm_topology_file_create( /********************************************************************** **********************************************************************/ - static void __osm_state_mgr_report( IN osm_state_mgr_t * const p_mgr ) @@ -1268,7 +1268,7 @@ __osm_state_mgr_report( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_state_mgr_report: " - "Processing port 0x%016" PRIx64 ".\n", + "Processing port 0x%016" PRIx64 "\n", cl_ntoh64( osm_port_get_guid( p_port ) ) ); } @@ -1427,7 +1427,7 @@ __process_idle_time_queue_done( cl_spinlock_release( &p_mgr->idle_lock ); osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__process_idle_time_queue_done: ERR 3314: " - "Idle time queue is empty.\n" ); + "Idle time queue is empty\n" ); return; } cl_spinlock_release( &p_mgr->idle_lock ); @@ -1514,7 +1514,7 @@ __osm_state_mgr_exists_other_master( { osm_log( p_mgr->p_log, OSM_LOG_VERBOSE, "__osm_state_mgr_exists_other_master: " - "Found remote master sm with guid:0x%X \n", + "Found remote master sm with guid:0x%X\n", p_sm->smi.guid ); p_sm_res = p_sm; goto Exit; @@ -1673,12 +1673,11 @@ __osm_state_mgr_send_handover( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_send_handover: ERR 3317: " - "Failure requesting SMInfo (%s).\n", ib_get_err_str( status ) ); + "Failure requesting SMInfo (%s)\n", ib_get_err_str( status ) ); } Exit: OSM_LOG_EXIT( p_mgr->p_log ); - } @@ -1732,13 +1731,13 @@ __osm_state_mgr_report_new_ports( osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_state_mgr_report_new_ports: ERR 3318: " "Error sending trap reports on GUID:0x%016" PRIx64 - " (%s).\n", port_gid.unicast.interface_id, + " (%s)\n", port_gid.unicast.interface_id, ib_get_err_str( status ) ); } osm_port_get_lid_range_ho( p_port, &min_lid_ho, &max_lid_ho ); osm_log( p_mgr->p_log, OSM_LOG_INFO, "Discovered new port with GUID:0x%016" PRIx64 - " LID range [0x%X,0x%X] of node:%s \n", + " LID range [0x%X,0x%X] of node:%s\n", cl_ntoh64( port_gid.unicast.interface_id ), min_lid_ho, max_lid_ho, ( p_port->p_node ? @@ -1882,9 +1881,10 @@ osm_state_mgr_process( ib_api_status_t status; osm_remote_sm_t *p_remote_sm; - OSM_LOG_ENTER( p_mgr->p_log, osm_state_mgr_process ); CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_state_mgr_process ); + /* if we are exiting do nothing */ if( osm_exit_flag ) signal = OSM_SIGNAL_NONE; @@ -1905,7 +1905,7 @@ osm_state_mgr_process( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "osm_state_mgr_process: " - "Received signal %s in state %s.\n", + "Received signal %s in state %s\n", osm_get_sm_signal_str( signal ), osm_get_sm_state_str( p_mgr->state ) ); } @@ -2216,9 +2216,11 @@ osm_state_mgr_process( } } } + /* Need to continue with lid assigning */ osm_drop_mgr_process( p_mgr->p_drop_mgr ); - p_mgr->state = OSM_SM_STATE_SET_SM_UCAST_LID; + + p_mgr->state = OSM_SM_STATE_SET_PKEY; /* * If we are not MASTER already - this means that we are @@ -2229,6 +2231,61 @@ osm_state_mgr_process( osm_sm_state_mgr_process( p_mgr->p_sm_state_mgr, OSM_SM_SIGNAL_DISCOVERY_COMPLETED ); + /* the returned signal might be DONE or DONE_PENDING */ + signal = osm_pkey_mgr_process( p_mgr->p_pkey_mgr ); + break; + + default: + __osm_state_mgr_signal_error( p_mgr, signal ); + signal = OSM_SIGNAL_NONE; + break; + } + break; + + case OSM_SM_STATE_SET_PKEY: + switch ( signal ) + { + case OSM_SIGNAL_DONE: + p_mgr->state = OSM_SM_STATE_SET_PKEY_DONE; + break; + + case OSM_SIGNAL_DONE_PENDING: + /* + * There are outstanding transactions, so we + * must wait for the wire to clear. + */ + p_mgr->state = OSM_SM_STATE_SET_PKEY_WAIT; + signal = OSM_SIGNAL_NONE; + break; + + default: + __osm_state_mgr_signal_error( p_mgr, signal ); + signal = OSM_SIGNAL_NONE; + break; + } + break; + + case OSM_SM_STATE_SET_PKEY_WAIT: + switch ( signal ) + { + case OSM_SIGNAL_NO_PENDING_TRANSACTIONS: + p_mgr->state = OSM_SM_STATE_SET_PKEY_DONE; + break; + + default: + __osm_state_mgr_signal_error( p_mgr, signal ); + signal = OSM_SIGNAL_NONE; + break; + } + break; + + case OSM_SM_STATE_SET_PKEY_DONE: + switch ( signal ) + { + case OSM_SIGNAL_NO_PENDING_TRANSACTIONS: + case OSM_SIGNAL_DONE: + + p_mgr->state = OSM_SM_STATE_SET_SM_UCAST_LID; signal = osm_lid_mgr_process_sm( p_mgr->p_lid_mgr ); break; @@ -2237,6 +2294,7 @@ osm_state_mgr_process( signal = OSM_SIGNAL_NONE; break; } + break; case OSM_SM_STATE_SET_SM_UCAST_LID: @@ -2471,7 +2529,6 @@ osm_state_mgr_process( break; } - if( !p_mgr->p_subn->opt.disable_multicast ) { p_mgr->state = OSM_SM_STATE_SET_MCAST_TABLES; @@ -2776,7 +2833,7 @@ osm_state_mgr_process( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_state_mgr_process: ERR 3319: " - "Invalid SM state %u.\n", p_mgr->state ); + "Invalid SM state %u\n", p_mgr->state ); } break; @@ -2854,7 +2911,7 @@ osm_state_mgr_process( CL_ASSERT( FALSE ); osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_state_mgr_process: ERR 3320: " - "Invalid SM state %u.\n", p_mgr->state ); + "Invalid SM state %u\n", p_mgr->state ); p_mgr->state = OSM_SM_STATE_IDLE; signal = OSM_SIGNAL_NONE; break; @@ -2875,7 +2932,6 @@ osm_state_mgr_process( signal = OSM_SIGNAL_SWEEP; } - /* * for single step mode - some stages need to break only * after evaluating a single step. @@ -2914,7 +2970,6 @@ osm_state_mgr_process_idle( return IB_ERROR; } - p_idle_item->pfn_start = pfn_start; p_idle_item->pfn_done = pfn_done; p_idle_item->context1 = context1; diff --git a/trunk/ulp/opensm/user/opensm/osm_state_mgr_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_state_mgr_ctrl.c index d20ee8b8..6eba8969 100644 --- a/trunk/ulp/opensm/user/opensm/osm_state_mgr_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_state_mgr_ctrl.c @@ -88,7 +88,6 @@ osm_state_mgr_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,6 @@ osm_state_mgr_ctrl_init( osm_state_mgr_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_mgr = p_mgr; p_ctrl->p_disp = p_disp; @@ -119,7 +117,7 @@ osm_state_mgr_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_state_mgr_ctrl_init: ERR 3401: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -129,8 +127,3 @@ osm_state_mgr_ctrl_init( return( status ); } - - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_subnet.c b/trunk/ulp/opensm/user/opensm/osm_subnet.c index d0de277d..ff1ad691 100644 --- a/trunk/ulp/opensm/user/opensm/osm_subnet.c +++ b/trunk/ulp/opensm/user/opensm/osm_subnet.c @@ -48,6 +48,7 @@ # include #endif /* HAVE_CONFIG_H */ +#include #include #include #include @@ -154,8 +155,8 @@ osm_subn_destroy( cl_list_destroy( &p_subn->light_sweep_physp_list ); cl_ptr_vector_destroy( &p_subn->port_lid_tbl ); - cl_map_remove_all(&(p_subn->opt.port_pro_ignore_guids)); - cl_map_destroy(&(p_subn->opt.port_pro_ignore_guids)); + cl_map_remove_all(&(p_subn->opt.port_prof_ignore_guids)); + cl_map_destroy(&(p_subn->opt.port_prof_ignore_guids)); } /********************************************************************** @@ -203,7 +204,7 @@ osm_subn_init( p_subn->min_ca_rate = IB_MAX_RATE; /* note that insert and remove are part of the port_profile thing. */ - cl_map_init(&(p_subn->opt.port_pro_ignore_guids), 10); + cl_map_init(&(p_subn->opt.port_prof_ignore_guids), 10); /* ignore_existing_lfts follows the reassign_lfts on first sweep */ p_subn->ignore_existing_lfts = p_subn->opt.reassign_lfts; @@ -245,7 +246,7 @@ osm_get_gid_by_mad_addr( /* The dest_lid is not in the subnet table - this is an error */ osm_log( p_log, OSM_LOG_ERROR, "osm_get_gid_by_mad_addr: ERR 7501 " - "Lid is out of range: 0x%X \n", + "Lid is out of range: 0x%X\n", cl_ntoh16(p_mad_addr->dest_lid) ); } @@ -279,7 +280,7 @@ osm_get_physp_by_mad_addr( /* The port is not in the port_lid table - this is an error */ osm_log( p_log, OSM_LOG_ERROR, "osm_get_physp_by_mad_addr: ERR 7502 " - "Cannot locate port object by lid: 0x%X \n", + "Cannot locate port object by lid: 0x%X\n", cl_ntoh16(p_mad_addr->dest_lid) ); @@ -292,7 +293,7 @@ osm_get_physp_by_mad_addr( /* The dest_lid is not in the subnet table - this is an error */ osm_log( p_log, OSM_LOG_ERROR, "osm_get_physp_by_mad_addr: ERR 7503 " - "Lid is out of range: 0x%X \n", + "Lid is out of range: 0x%X\n", cl_ntoh16(p_mad_addr->dest_lid) ); @@ -330,7 +331,7 @@ osm_get_port_by_mad_addr( /* The dest_lid is not in the subnet table - this is an error */ osm_log( p_log, OSM_LOG_ERROR, "osm_get_port_by_mad_addr: ERR 7504 " - "Lid is out of range: 0x%X \n", + "Lid is out of range: 0x%X\n", cl_ntoh16(p_mad_addr->dest_lid) ); goto Exit; @@ -380,7 +381,6 @@ osm_get_port_by_guid( if( p_port == (osm_port_t*)cl_qmap_end( &(p_subn->port_guid_tbl)) ) p_port = NULL; return p_port; - } /********************************************************************** @@ -396,6 +396,7 @@ osm_subn_set_default_opt( p_opt->m_key_lease_period = 0; p_opt->sweep_interval = OSM_DEFAULT_SWEEP_INTERVAL_SECS; p_opt->max_wire_smps = OSM_DEFAULT_SMP_MAX_ON_WIRE; + p_opt->console = FALSE; p_opt->transaction_timeout = OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC; /* by default we will consider waiting for 50x transaction timeout normal */ p_opt->max_msg_fifo_timeout = 50*OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC; @@ -437,6 +438,7 @@ osm_subn_set_default_opt( p_opt->testability_mode = OSM_TEST_MODE_NONE; p_opt->updn_activate = FALSE; p_opt->updn_guid_file = NULL; + p_opt->exit_on_fatal = TRUE; } /********************************************************************** @@ -528,7 +530,6 @@ __osm_subn_opts_unpack_uint8( IN char *p_val_str, IN uint8_t *p_val) { - if (!strcmp(p_req_key, p_key)) { uint32_t val; @@ -763,6 +764,10 @@ osm_subn_parse_conf_file( __osm_subn_opts_unpack_charp( "updn_guid_file" , p_key, p_val, &p_opts->updn_guid_file); + + __osm_subn_opts_unpack_boolean( + "exit_on_fatal", + p_key, p_val, &p_opts->exit_on_fatal); } } fclose(opts_file); @@ -805,7 +810,7 @@ osm_subn_write_conf_file( "# The value 0x14 disables this mechanism\n" "packet_life_time 0x%02x\n\n" "# The code of maximal time a packet can wait at the head of\n" - "# transmision queue. \n" + "# transmission queue. \n" "# The actual time is 4.096usec * 2^\n" "# The value 0x14 disables this mechanism\n" "head_of_queue_lifetime 0x%02x\n\n" @@ -903,7 +908,7 @@ osm_subn_write_conf_file( "# Maximal time in [msec] a message can stay in the incoming message queue.\n" "# If there is more then one message in the queue and the last message\n" "# stayed in the queue more then this value any SA request will be \n" - "# immediatly returned with a BUSY status.\n" + "# immediately returned with a BUSY status.\n" "max_msg_fifo_timeout %u\n\n" "# Use a single thread for handling SA queries\n" "single_thread %s\n\n", @@ -928,14 +933,17 @@ osm_subn_write_conf_file( "# If TRUE if OpenSM should disable multicast support\n" "no_multicast_option %s\n\n" "# No multicast routing is performed if TRUE\n" - "disable_multicast %s\n\n", + "disable_multicast %s\n\n" + "# If TRUE opensm will exit on fatal initialization issues\n" + "exit_on_fatal %s\n\n", p_opts->log_flags, p_opts->force_log_flush ? "TRUE" : "FALSE", p_opts->log_file, p_opts->accum_log_file ? "TRUE" : "FALSE", p_opts->dump_files_dir, p_opts->no_multicast_option ? "TRUE" : "FALSE", - p_opts->disable_multicast ? "TRUE" : "FALSE" + p_opts->disable_multicast ? "TRUE" : "FALSE", + p_opts->exit_on_fatal ? "TRUE" : "FALSE" ); /* optional string attributes ... */ diff --git a/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv.c b/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv.c index 51762ae3..5c8d2d20 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv.c @@ -92,7 +92,7 @@ __osm_si_rcv_clear_sc_bit( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_clear_sc_bit: ERR 3601: " "Unable to clear state change bit for switch " - "with GUID = 0x%" PRIx64 ".\n", + "with GUID = 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); } @@ -164,7 +164,7 @@ __osm_si_rcv_get_port_info( /* continue the loop despite the error */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_get_port_info: ERR 3602: " - "Failure initiating PortInfo request (%s).\n", + "Failure initiating PortInfo request (%s)\n", ib_get_err_str(status)); } } @@ -213,7 +213,7 @@ __osm_si_rcv_get_fwd_tbl( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_get_fwd_tbl: " - "Retrieving FT block %u.\n", block_id_ho ); + "Retrieving FT block %u\n", block_id_ho ); } status = osm_req_get( @@ -228,7 +228,7 @@ __osm_si_rcv_get_fwd_tbl( /* continue the loop despite the error */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_get_fwd_tbl: ERR 3603: " - "Failure initiating PortInfo request (%s).\n", + "Failure initiating PortInfo request (%s)\n", ib_get_err_str(status)); } } @@ -268,7 +268,7 @@ __osm_si_rcv_get_mcast_fwd_tbl( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_get_mcast_fwd_tbl: " - "Multicast not supported by switch 0x%016" PRIx64 ".\n", + "Multicast not supported by switch 0x%016" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); goto Exit; } @@ -288,7 +288,7 @@ __osm_si_rcv_get_mcast_fwd_tbl( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_get_mcast_fwd_tbl: ERR 3609: " "Out-of-range mcast block size = %u on switch 0x%016" PRIx64 - ".\n", max_block_id_ho, + "\n", max_block_id_ho, cl_ntoh64( osm_node_get_node_guid( p_node ) ) ); goto Exit; } @@ -299,7 +299,7 @@ __osm_si_rcv_get_mcast_fwd_tbl( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_get_mcast_fwd_tbl: " - "Max MFT block = %u, Max position = %u.\n", max_block_id_ho, + "Max MFT block = %u, Max position = %u\n", max_block_id_ho, max_position ); p_dr_path = osm_physp_get_dr_path_ptr( p_physp ); @@ -310,7 +310,7 @@ __osm_si_rcv_get_mcast_fwd_tbl( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_get_mcast_fwd_tbl: " - "Retrieving MFT block %u.\n", block_id_ho ); + "Retrieving MFT block %u\n", block_id_ho ); } for( position = 0; position <= max_position; position++ ) @@ -319,7 +319,7 @@ __osm_si_rcv_get_mcast_fwd_tbl( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_get_mcast_fwd_tbl: " - "Retrieving MFT position %u.\n", position ); + "Retrieving MFT position %u\n", position ); } attr_mod_ho = block_id_ho | position << IB_MCAST_POSITION_SHIFT; @@ -335,7 +335,7 @@ __osm_si_rcv_get_mcast_fwd_tbl( /* continue the loop despite the error */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_get_mcast_fwd_tbl: ERR 3607: " - "Failure initiating PortInfo request (%s).\n", + "Failure initiating PortInfo request (%s)\n", ib_get_err_str(status)); } } @@ -360,9 +360,10 @@ __osm_si_rcv_process_new( ib_smp_t *p_smp; cl_qmap_t *p_sw_guid_tbl; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, __osm_si_rcv_process_new ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_sw_guid_tbl = &p_rcv->p_subn->sw_guid_tbl; @@ -381,7 +382,7 @@ __osm_si_rcv_process_new( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_process_new: ERR 3608: " - "Unable to allocate new switch object.\n" ); + "Unable to allocate new switch object\n" ); goto Exit; } @@ -415,7 +416,7 @@ __osm_si_rcv_process_new( */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_si_rcv_process_new: ERR 3605: " - "Unable to add new switch object to database.\n" ); + "Unable to add new switch object to database\n" ); osm_switch_delete( &p_sw ); goto Exit; } @@ -486,7 +487,7 @@ __osm_si_rcv_process_existing( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_process_existing: " - "Received logical SetResp().\n" ); + "Received logical SetResp()\n" ); } osm_switch_set_switch_info( p_sw, p_si ); @@ -497,7 +498,7 @@ __osm_si_rcv_process_existing( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_process_existing: " - "Received logical GetResp().\n" ); + "Received logical GetResp()\n" ); } osm_switch_set_switch_info( p_sw, p_si ); @@ -516,7 +517,7 @@ __osm_si_rcv_process_existing( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_si_rcv_process_existing: " "GetResp() received with error in light sweep. " - "Commencing heavy sweep.\n" ); + "Commencing heavy sweep\n" ); is_change_detected = TRUE; } else @@ -542,7 +543,7 @@ __osm_si_rcv_process_existing( osm_switch_discovery_count_inc( p_sw ); osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_si_rcv_process_existing: " - "discovery_count is:%u \n", + "discovery_count is:%u\n", osm_switch_discovery_count_get( p_sw ) ); /* If this is the first discovery - then get the port_info */ @@ -553,7 +554,7 @@ __osm_si_rcv_process_existing( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_si_rcv_process_existing: " "Not discovering again through switch:0x%" - PRIx64 ".\n", + PRIx64 "\n", osm_node_get_node_guid( p_sw->p_node) ); } } @@ -578,13 +579,13 @@ void osm_si_rcv_destroy( IN osm_si_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_si_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -611,7 +612,6 @@ osm_si_rcv_init( return( status ); } - /********************************************************************** **********************************************************************/ void @@ -628,9 +628,10 @@ osm_si_rcv_process( ib_net64_t node_guid; osm_si_context_t *p_context; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_si_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_node_guid_tbl = &p_rcv->p_subn->node_guid_tbl; @@ -651,7 +652,7 @@ osm_si_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "osm_si_rcv_process: " "Switch GUID = 0x%016" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", cl_ntoh64( node_guid ), cl_ntoh64( p_smp->trans_id ) ); } @@ -664,7 +665,7 @@ osm_si_rcv_process( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_si_rcv_process: ERR 3606: " "SwitchInfo received for nonexistent node " - "with GUID = 0x%" PRIx64 ".\n", + "with GUID = 0x%" PRIx64 "\n", cl_ntoh64( node_guid ) ); } else @@ -679,7 +680,7 @@ osm_si_rcv_process( "osm_si_rcv_process: ERR 3610: " "\n\t\t\t\tBad LinearFDBTop value = 0x%X " "on switch 0x%" PRIx64 "." - "\n\t\t\t\tForcing correction to 0x%X.\n", + "\n\t\t\t\tForcing correction to 0x%X\n", cl_ntoh16( p_si->lin_top ), cl_ntoh64( osm_node_get_node_guid( p_node ) ), 0 ); diff --git a/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv_ctrl.c index 04132ff6..37870283 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sw_info_rcv_ctrl.c @@ -88,7 +88,6 @@ osm_si_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,6 @@ osm_si_rcv_ctrl_init( osm_si_rcv_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_rcv = p_rcv; p_ctrl->p_disp = p_disp; @@ -119,7 +117,7 @@ osm_si_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_si_rcv_ctrl_init: ERR 3701: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -129,8 +127,3 @@ osm_si_rcv_ctrl_init( return( status ); } - - - - - diff --git a/trunk/ulp/opensm/user/opensm/osm_sweep_fail_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sweep_fail_ctrl.c index fa2d09ca..f9c3aea7 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sweep_fail_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sweep_fail_ctrl.c @@ -119,7 +119,7 @@ osm_sweep_fail_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_sweep_fail_ctrl_init: ERR 3501: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_switch.c b/trunk/ulp/opensm/user/opensm/osm_switch.c index 489a4e6f..55fc58db 100644 --- a/trunk/ulp/opensm/user/opensm/osm_switch.c +++ b/trunk/ulp/opensm/user/opensm/osm_switch.c @@ -100,8 +100,8 @@ osm_switch_init( status = osm_fwd_tbl_init( &p_sw->fwd_tbl, p_si ); - p_sw->p_pro = cl_zalloc( sizeof(*p_sw->p_pro) * num_ports ); - if( p_sw->p_pro == NULL ) + p_sw->p_prof = cl_zalloc( sizeof(*p_sw->p_prof) * num_ports ); + if( p_sw->p_prof == NULL ) { status = IB_INSUFFICIENT_MEMORY; goto Exit; @@ -113,7 +113,7 @@ osm_switch_init( goto Exit; for( port_num = 0; port_num < num_ports; port_num++ ) - osm_port_pro_construct( &p_sw->p_pro[port_num] ); + osm_port_prof_construct( &p_sw->p_prof[port_num] ); Exit: return( status ); @@ -127,7 +127,7 @@ osm_switch_destroy( { /* free memory to avoid leaks */ osm_mcast_tbl_destroy( &p_sw->mcast_tbl ); - cl_free( p_sw->p_pro ); + cl_free( p_sw->p_prof ); osm_fwd_tbl_destroy( &p_sw->fwd_tbl ); osm_lid_matrix_destroy( &p_sw->lmx ); } @@ -276,7 +276,7 @@ osm_switch_recommend_path( return (OSM_NO_PATH); /* - First, enquire with the forwarding table for an existing + First, inquire with the forwarding table for an existing route. If one is found, honor it unless: 1. the ignore existing flag is set. 2. the physical port is not a valid one or not healthy @@ -354,8 +354,8 @@ osm_switch_recommend_path( the number of paths through this port. Select the port routing the least number of paths. */ - check_count = osm_port_pro_path_count_get( - &p_sw->p_pro[port_num] ); + check_count = osm_port_prof_path_count_get( + &p_sw->p_prof[port_num] ); /* Advanced LMC routing requires tracking of the @@ -470,7 +470,7 @@ osm_switch_prepare_path_rebuild( num_ports = osm_switch_get_num_ports( p_sw ); osm_lid_matrix_clear( &p_sw->lmx ); for( port_num = 0; port_num < num_ports; port_num++ ) - osm_port_pro_construct( &p_sw->p_pro[port_num] ); + osm_port_prof_construct( &p_sw->p_prof[port_num] ); } /********************************************************************** diff --git a/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c b/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c index 7dd44d1d..29d7228f 100644 --- a/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c @@ -186,15 +186,15 @@ void osm_trap_rcv_destroy( IN osm_trap_rcv_t* const p_rcv ) { - OSM_LOG_ENTER( p_rcv->p_log, osm_trap_rcv_destroy ); - CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_trap_rcv_destroy ); + cl_event_wheel_destroy( &p_rcv->trap_aging_tracker ); + OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -208,6 +208,7 @@ osm_trap_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_trap_rcv_init ); osm_trap_rcv_construct( p_rcv ); @@ -271,7 +272,6 @@ __osm_trap_calc_crc32(void *buffer, uint32_t count) return crc; } - /******************************************************************** ********************************************************************/ @@ -329,7 +329,7 @@ __osm_trap_rcv_process_request( /* We got an exit flag - do nothing Otherwise we start a sweep on the trap 144 caused by cleaning up - SM Cap bit ... + SM Cap bit... */ goto Exit; } @@ -351,7 +351,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: ERR 3801: " - "Unsupported method 0x%X.\n", + "Unsupported method 0x%X\n", p_smp->method ); goto Exit; } @@ -382,12 +382,12 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_trap_rcv_process_request: " - "Received a SLID=0 Trap. local LID=0. Ignoring mad. \n"); + "Received SLID=0 Trap with local LID=0. Ignoring MAD\n"); goto Exit; } osm_log( p_rcv->p_log, OSM_LOG_DEBUG, "__osm_trap_rcv_process_request: " - "Received a SLID=0 Trap. Using local LID:0x%04X instead:.\n", + "Received SLID=0 Trap. Using local LID:0x%04X instead\n", cl_ntoh16(p_rcv->p_subn->sm_base_lid) ); tmp_madw.mad_addr.addr_type.smi.source_lid = p_rcv->p_subn->sm_base_lid; @@ -413,7 +413,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: " - "Received Vend Notice type:0x%02X vend:0x%06X dev:%u " + "Received Vendor Notice type:0x%02X vend:0x%06X dev:%u " "from LID:0x%04X TID:0x%016" PRIx64 "\n", ib_notice_get_type(p_ntci), cl_ntoh32(ib_notice_get_vend_id(p_ntci)), @@ -431,7 +431,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: ERR 3802: " - "Error sending response (%s).\n", + "Error sending response (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -482,7 +482,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: ERR 3804: " - "Received the trap %u times continuously.\n", + "Received the trap %u times continuously\n", num_received); /* * If the trap provides info about a bad port @@ -543,14 +543,14 @@ __osm_trap_rcv_process_request( trap_key, cl_get_time_stamp() + event_wheel_timeout, osm_trap_rcv_aging_tracker_callback, /* no callback */ - p_rcv /* no conetxt */ + p_rcv /* no context */ ); else cl_event_wheel_reg(&p_rcv->trap_aging_tracker, trap_key, cl_get_time_stamp() + event_wheel_timeout, NULL, /* no callback */ - NULL /* no conetxt */ + NULL /* no context */ ); /* If was already registered do nothing more */ @@ -558,7 +558,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_trap_rcv_process_request: " - "Continuously received this trap %u times. Ignoring it.\n", + "Continuously received this trap %u times. Ignoring it\n", num_received); goto Exit; } @@ -582,7 +582,7 @@ __osm_trap_rcv_process_request( osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_trap_rcv_process_request: " "Forcing immediate heavy sweep. " - "Received trap:%u \n", + "Received trap:%u\n", cl_ntoh16(p_ntci->g_or_v.generic.trap_num) ); p_rcv->p_subn->force_immediate_heavy_sweep = TRUE; @@ -619,17 +619,17 @@ __osm_trap_rcv_process_request( } else { - /* Need to use the IssuerLID. */ + /* Need to use the IssuerLID */ p_tbl = &p_rcv->p_subn->port_lid_tbl; CL_ASSERT( cl_ptr_vector_get_size(p_tbl) < 0x10000 ); if ((uint16_t)cl_ptr_vector_get_size(p_tbl) <= cl_ntoh16(source_lid) ) { - /* the source lid is out of range. */ + /* the source lid is out of range */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_trap_rcv_process_request: " - "source lid is out of range:0x%X \n", + "source lid is out of range:0x%X\n", cl_ntoh16(source_lid) ); goto Exit; @@ -640,7 +640,7 @@ __osm_trap_rcv_process_request( /* We have the lid - but no corresponding port */ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, "__osm_trap_rcv_process_request: " - "Cannot find port according to lid:0x%X \n", + "Cannot find port according to lid:0x%X\n", cl_ntoh16(source_lid) ); goto Exit; @@ -655,7 +655,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: ERR 3803: " - "Error sending trap reports (%s).\n", + "Error sending trap reports (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -677,13 +677,11 @@ __osm_trap_rcv_process_sm( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_sm: " - "This function is not supported yet.\n"); - + "This function is not supported yet\n"); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** CURRENTLY WE ARE NOT CREATING TRAPS - SO THIS CALL IN AN ERROR **********************************************************************/ @@ -697,7 +695,7 @@ __osm_trap_rcv_process_response( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_response: " - "This function is not supported yet.\n"); + "This function is not supported yet\n"); OSM_LOG_EXIT( p_rcv->p_log ); } diff --git a/trunk/ulp/opensm/user/opensm/osm_trap_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_trap_rcv_ctrl.c index 2cd19e96..138fe027 100644 --- a/trunk/ulp/opensm/user/opensm/osm_trap_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_trap_rcv_ctrl.c @@ -84,7 +84,6 @@ osm_trap_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -114,7 +113,7 @@ osm_trap_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_trap_rcv_ctrl_init: ERR 3901: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c b/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c index 2a93e9ca..017d95c0 100644 --- a/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c @@ -87,13 +87,13 @@ void osm_ucast_mgr_destroy( IN osm_ucast_mgr_t* const p_mgr ) { + CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, osm_ucast_mgr_destroy ); - CL_ASSERT( p_mgr ); OSM_LOG_EXIT( p_mgr->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -239,7 +239,7 @@ osm_ucast_mgr_dump_ucast_routes( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_ucast_mgr_dump_ucast_routes: ERR 3A12: " - "Fail to open fdb file (%s).\n", + "Fail to open fdb file (%s)\n", file_name ); goto Exit; } @@ -364,7 +364,7 @@ __osm_ucast_mgr_process_hop_0( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_hop_0: " - "Processing switch GUID 0x%" PRIx64 ", LID 0x%X.\n", + "Processing switch GUID 0x%" PRIx64 ", LID 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), lid_ho ); } @@ -374,7 +374,7 @@ __osm_ucast_mgr_process_hop_0( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_hop_0: ERR 3A02: " - "Setting hop count failed (%s).\n", + "Setting hop count failed (%s)\n", CL_STATUS_MSG( status ) ); } @@ -419,7 +419,7 @@ __osm_ucast_mgr_process_neighbor( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_neighbor: " "Node 0x%" PRIx64 ", remote node 0x%" PRIx64 "\n" - "\t\t\t\tport 0x%X, remote port 0x%X.\n", + "\t\t\t\tport 0x%X, remote port 0x%X\n", cl_ntoh64( osm_node_get_node_guid( p_node ) ), cl_ntoh64( osm_node_get_node_guid( p_remote_node ) ), port_num, remote_port_num ); @@ -461,7 +461,7 @@ __osm_ucast_mgr_process_neighbor( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_neighbor: " - "New best path is %u hops for LID 0x%X.\n", + "New best path is %u hops for LID 0x%X\n", hops, lid_ho ); } @@ -474,7 +474,7 @@ __osm_ucast_mgr_process_neighbor( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_neighbor: ERR 3A03: " - "Setting hop count failed (%s).\n", + "Setting hop count failed (%s)\n", CL_STATUS_MSG( status ) ); } } @@ -482,7 +482,6 @@ __osm_ucast_mgr_process_neighbor( } OSM_LOG_EXIT( p_mgr->p_log ); - } /********************************************************************** @@ -525,7 +524,7 @@ __osm_ucast_mgr_process_leaf( default: osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_leaf: ERR 3A01: " - "Bad node type %u, GUID = 0x%" PRIx64 ".\n", + "Bad node type %u, GUID = 0x%" PRIx64 "\n", osm_node_get_type( p_remote_node ), cl_ntoh64( osm_node_get_node_guid( p_node ) )); goto Exit; @@ -538,7 +537,7 @@ __osm_ucast_mgr_process_leaf( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_leaf: " "Discovered LIDs [0x%X,0x%X]\n" - "\t\t\t\tport number 0x%X, node 0x%" PRIx64 ".\n", + "\t\t\t\tport number 0x%X, node 0x%" PRIx64 "\n", base_lid_ho, max_lid_ho, port_num, cl_ntoh64( osm_node_get_node_guid( p_node ) )); } @@ -548,7 +547,6 @@ __osm_ucast_mgr_process_leaf( Exit: OSM_LOG_EXIT( p_mgr->p_log ); - } /********************************************************************** @@ -577,7 +575,7 @@ __osm_ucast_mgr_process_leaves( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_leaves: " - "Processing switch 0x%" PRIx64 ".\n", + "Processing switch 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) )); } @@ -609,7 +607,6 @@ __osm_ucast_mgr_process_leaves( } } - OSM_LOG_EXIT( p_mgr->p_log ); } @@ -625,7 +622,7 @@ __osm_ucast_mgr_process_port( uint16_t max_lid_ho; uint16_t lid_ho; uint8_t port; - boolean_t ignore_existing, is_ignored_by_port_pro; + boolean_t ignore_existing, is_ignored_by_port_prof; ib_net64_t node_guid; boolean_t ui_ucast_fdb_assign_func_defined; /* @@ -633,8 +630,8 @@ __osm_ucast_mgr_process_port( in providing better routing in LMC > 0 situations */ uint16_t lids_per_port = 1 << p_mgr->p_subn->opt.lmc; - uint64_t* remote_sys_guids = NULL; - uint64_t* remote_node_guids = NULL; + uint64_t *remote_sys_guids = NULL; + uint64_t *remote_node_guids = NULL; uint16_t num_used_sys = 0; uint16_t num_used_nodes = 0; @@ -645,7 +642,7 @@ __osm_ucast_mgr_process_port( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_port: ERR 3A09: " - "Cannot allocate array. Memory insufficient.\n"); + "Cannot allocate array. Insufficient memory\n"); goto Exit; } @@ -654,7 +651,7 @@ __osm_ucast_mgr_process_port( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_port: ERR 3A0A: " - "Cannot allocate array. Memory insufficient.\n"); + "Cannot allocate array. Insufficient memory\n"); goto Exit; } @@ -677,7 +674,7 @@ __osm_ucast_mgr_process_port( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_port: " "Processing port 0x%" PRIx64 - ", LIDs [0x%X,0x%X].\n", + ", LIDs [0x%X,0x%X]\n", cl_ntoh64( osm_port_get_guid( p_port ) ), min_lid_ho, max_lid_ho ); } @@ -732,7 +729,7 @@ __osm_ucast_mgr_process_port( if (port == OSM_NO_PATH) { /* do not try to overwrite the ppro of non existing port ... */ - is_ignored_by_port_pro = TRUE; + is_ignored_by_port_prof = TRUE; /* Up/Down routing can cause unreachable routes between some switches so we do not report that as an error in that case */ @@ -740,7 +737,7 @@ __osm_ucast_mgr_process_port( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_port: ERR 3A08: " - "No path to get to LID 0x%X from switch 0x%" PRIx64 ".\n", + "No path to get to LID 0x%X from switch 0x%" PRIx64 "\n", lid_ho, cl_ntoh64( node_guid ) ); /* trigger a new sweep - try again ... */ p_mgr->p_subn->subnet_initialization_error = TRUE; @@ -748,7 +745,7 @@ __osm_ucast_mgr_process_port( else osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_port: " - "No path to get to LID 0x%X from switch 0x%" PRIx64 ".\n", + "No path to get to LID 0x%X from switch 0x%" PRIx64 "\n", lid_ho, cl_ntoh64( node_guid ) ); } else @@ -756,15 +753,15 @@ __osm_ucast_mgr_process_port( osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_port: " "Routing LID 0x%X to port 0x%X" - "\n\t\t\t\tFor switch 0x%" PRIx64 ".\n", + "\n\t\t\t\tFor switch 0x%" PRIx64 "\n", lid_ho, port, cl_ntoh64( node_guid ) ); /* we would like to optionally ignore this port in equalization like in the case of the Mellanox Anafa Internal PCI TCA port */ - is_ignored_by_port_pro = - osm_port_pro_is_ignored_port(p_mgr->p_subn, cl_ntoh64(node_guid), port); + is_ignored_by_port_prof = + osm_port_prof_is_ignored_port(p_mgr->p_subn, cl_ntoh64(node_guid), port); /* We also would ignore this route if the target lid if of a switch @@ -772,7 +769,7 @@ __osm_ucast_mgr_process_port( */ if (! p_mgr->p_subn->opt.port_profile_switch_nodes) { - is_ignored_by_port_pro |= + is_ignored_by_port_prof |= (osm_node_get_type(osm_port_get_parent_node(p_port)) == IB_NODE_TYPE_SWITCH); } @@ -782,11 +779,14 @@ __osm_ucast_mgr_process_port( We have selected the port for this LID. Write it to the forwarding tables. */ - osm_switch_set_path( p_sw, lid_ho, port, is_ignored_by_port_pro); + osm_switch_set_path( p_sw, lid_ho, port, is_ignored_by_port_prof); } + Exit: - if (remote_sys_guids) cl_free(remote_sys_guids); - if (remote_node_guids) cl_free(remote_node_guids); + if (remote_sys_guids) + cl_free(remote_sys_guids); + if (remote_node_guids) + cl_free(remote_node_guids); OSM_LOG_EXIT( p_mgr->p_log ); } @@ -805,9 +805,10 @@ __osm_ucast_mgr_set_table( uint32_t block_id_ho = 0; uint8_t block[IB_SMP_DATA_SIZE]; + CL_ASSERT( p_mgr ); + OSM_LOG_ENTER( p_mgr->p_log, __osm_ucast_mgr_set_table ); - CL_ASSERT( p_mgr ); CL_ASSERT( p_sw ); p_node = osm_switch_get_node_ptr( p_sw ); @@ -836,7 +837,7 @@ __osm_ucast_mgr_set_table( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_set_table: " - "Setting switch FT top to LID 0x%X.\n", + "Setting switch FT top to LID 0x%X\n", osm_switch_get_max_lid_ho( p_sw ) ); } @@ -857,7 +858,7 @@ __osm_ucast_mgr_set_table( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_set_table: ERR 3A06: " - "Sending SwitchInfo attribute failed (%s).\n", + "Sending SwitchInfo attribute failed (%s)\n", ib_get_err_str( status ) ); } @@ -876,7 +877,7 @@ __osm_ucast_mgr_set_table( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_set_table: " - "Writing FT block %u.\n", block_id_ho ); + "Writing FT block %u\n", block_id_ho ); } status = osm_req_set( p_mgr->p_req, @@ -892,7 +893,7 @@ __osm_ucast_mgr_set_table( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_set_table: ERR 3A05: " - "Sending linear fwd. tbl. block failed (%s).\n", + "Sending linear fwd. tbl. block failed (%s)\n", ib_get_err_str( status ) ); } @@ -900,7 +901,6 @@ __osm_ucast_mgr_set_table( } OSM_LOG_EXIT( p_mgr->p_log ); - } /********************************************************************** @@ -927,7 +927,7 @@ __osm_ucast_mgr_process_tbl( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_tbl: " - "Processing switch 0x%" PRIx64 ".\n", + "Processing switch 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) )); } @@ -981,7 +981,7 @@ __osm_ucast_mgr_process_neighbors( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_ucast_mgr_process_neighbors: " - "Processing switch with GUID = 0x%" PRIx64 ".\n", + "Processing switch with GUID = 0x%" PRIx64 "\n", cl_ntoh64( osm_node_get_node_guid( p_node ) )); } @@ -1014,7 +1014,7 @@ __osm_ucast_mgr_process_neighbors( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "__osm_ucast_mgr_process_neighbors: ERR 3A07: " - "No switch object for Node GUID = 0x%" PRIx64 ".\n", + "No switch object for Node GUID = 0x%" PRIx64 "\n", cl_ntoh64( remote_node_guid ) ); } else @@ -1029,7 +1029,6 @@ __osm_ucast_mgr_process_neighbors( } } - OSM_LOG_EXIT( p_mgr->p_log ); } @@ -1052,7 +1051,7 @@ osm_ucast_mgr_process( osm_log(p_mgr->p_log, OSM_LOG_VERBOSE, "osm_ucast_mgr_process: " - "Starting switches Min Hop Table Assignment.\n"); + "Starting switches Min Hop Table Assignment\n"); /* Set the switch matrixes for each switch's own port 0 LID, @@ -1136,7 +1135,7 @@ osm_ucast_mgr_process( osm_log(p_mgr->p_log, OSM_LOG_INFO, "osm_ucast_mgr_process: " - "Min Hop Tables configured on all switches.\n"); + "Min Hop Tables configured on all switches\n"); /* Now that the lid matrixes have been built, we can @@ -1164,7 +1163,7 @@ osm_ucast_mgr_process( osm_log(p_mgr->p_log, OSM_LOG_VERBOSE, "osm_ucast_mgr_process: " - "LFT Tables configured on all switches.\n"); + "LFT Tables configured on all switches\n"); CL_PLOCK_RELEASE( p_mgr->p_lock ); OSM_LOG_EXIT( p_mgr->p_log ); diff --git a/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c b/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c index 3d604f3c..2aaea04a 100644 --- a/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c +++ b/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c @@ -47,6 +47,7 @@ # include #endif /* HAVE_CONFIG_H */ +#include #include #include #include @@ -75,12 +76,11 @@ __updn_get_dir(IN uint8_t cur_rank, uint64_t *p_guid = osm.p_updn_ucast_routing->updn_ucast_reg_inputs.guid_list; boolean_t cur_is_root = FALSE , rem_is_root = FALSE; - /* HACK : comes to solve root nodes connection, in a classic subnet root nodes does not connect - directly , but in case they are we assign to root node an UP direction to allow UPDN discover + /* HACK: comes to solve root nodes connection, in a classic subnet root nodes does not connect + directly, but in case they are we assign to root node an UP direction to allow UPDN discover correctly (and not from the point of view of the last root node) the subnet . */ - - for ( i = 0 ; i < max_num_guids ; i++ ) + for ( i = 0; i < max_num_guids; i++ ) { if (cur_guid == p_guid[i]) cur_is_root = TRUE; @@ -97,7 +97,7 @@ __updn_get_dir(IN uint8_t cur_rank, return UP; else { - /* Equal rank , decide by guid number , bigger == UP direction */ + /* Equal rank, decide by guid number, bigger == UP direction */ if (cur_guid > rem_guid) return UP; else @@ -122,11 +122,11 @@ __updn_create_updn_next_step_t(IN updn_switch_dir_t state, IN osm_switch_t* cons return p_next_step; } + /********************************************************************** **********************************************************************/ /* This function updates an element in the qmap list by guid index and rank value */ /* Return 0 if no need to futher update 1 if brought a new value */ - int __updn_update_rank( IN cl_qmap_t *p_guid_rank_tbl, @@ -167,14 +167,14 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t /* Init local vars */ osm_port_t *p_port; osm_switch_t *p_self_node = NULL; - uint8_t pn,pn_rem; + uint8_t pn, pn_rem; osm_physp_t *p_physp, *p_remote_physp; - cl_list_t *p_currList,*p_nextList; + cl_list_t *p_currList, *p_nextList; uint16_t root_lid, max_sw_lid; - updn_next_step_t *p_updn_switch,*p_tmp; - updn_switch_dir_t next_dir,current_dir; + updn_next_step_t *p_updn_switch, *p_tmp; + updn_switch_dir_t next_dir, current_dir; - OSM_LOG_ENTER( &(osm.log) , __updn_bfs_by_node); + OSM_LOG_ENTER( &(osm.log), __updn_bfs_by_node); /* Init the list pointers */ p_nextList = (cl_list_t*)cl_malloc(sizeof(cl_list_t)); @@ -224,8 +224,8 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t if (osm_node_get_type(p_remote_physp->p_node) != IB_NODE_TYPE_SWITCH) { osm_log(&(osm.log), OSM_LOG_ERROR, - "__updn_bfs_by_node: ERR AA07: " - "This is a non switched subnet OR non valid connection, cannot perform Algorithm\n"); + "__updn_bfs_by_node: ERR AA07: " + "This is a non switched subnet OR non valid connection, cannot perform UPDN algorithm\n"); OSM_LOG_EXIT( &(osm.log)); return 1; } else @@ -262,7 +262,7 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t osm_log(&(osm.log), OSM_LOG_DEBUG, "__updn_bfs_by_node:" - "Starting from switch- port guid 0x%" PRIx64 ".\n" + "Starting from switch- port guid 0x%" PRIx64 "\n" , cl_ntoh64(p_self_node->p_node->node_info.port_guid)); /* Update list with the updn_next_step_t new element */ @@ -309,10 +309,10 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t /* printf("-V- Inner for in port num %d\n", pn); */ osm_node_t *p_remote_node; cl_list_iterator_t updn_switch_iterator; - boolean_t HasVisited=FALSE; + boolean_t HasVisited = FALSE; ib_net64_t remote_guid,current_guid; - updn_rank_t *p_rem_rank,*p_cur_rank; - uint8_t current_min_hop,remote_min_hop,set_hop_return_value; + updn_rank_t *p_rem_rank, *p_cur_rank; + uint8_t current_min_hop, remote_min_hop, set_hop_return_value; osm_switch_t *p_remote_sw; current_guid = osm_node_get_node_guid(p_updn_switch->p_sw->p_node); @@ -336,8 +336,8 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t osm_log(&(osm.log), OSM_LOG_DEBUG, "__updn_bfs_by_node:" - "move from 0x%016" PRIx64 " rank:%u " - "to 0x%016" PRIx64" rank:%u\n", + "move from 0x%016" PRIx64 " rank: %u " + "to 0x%016" PRIx64" rank: %u\n", cl_ntoh64(current_guid), p_cur_rank->rank, cl_ntoh64(remote_guid), p_rem_rank->rank); /* Check if this is a legal step : the only illegal step is going @@ -360,18 +360,18 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t { osm_log(&(osm.log), OSM_LOG_DEBUG, "__updn_bfs_by_node (less):" - "Setting Min Hop Table of switch : 0x%" PRIx64 - "\n\t\tCurrent hop count is : %d , next hop count : %d" - "\n\tlid to set : 0x%x" - "\n\tport number : %d" + "Setting Min Hop Table of switch: 0x%" PRIx64 + "\n\t\tCurrent hop count is: %d, next hop count: %d" + "\n\tlid to set: 0x%x" + "\n\tport number: %d" " \n\thops number: %d\n" - , cl_ntoh64(remote_guid), remote_min_hop,current_min_hop+1, root_lid, pn_rem,current_min_hop+1); - set_hop_return_value=osm_switch_set_hops(p_remote_sw, root_lid, pn_rem, current_min_hop+1); + , cl_ntoh64(remote_guid), remote_min_hop,current_min_hop + 1, root_lid, pn_rem, current_min_hop + 1); + set_hop_return_value=osm_switch_set_hops(p_remote_sw, root_lid, pn_rem, current_min_hop + 1); if (set_hop_return_value) { osm_log(&(osm.log), OSM_LOG_ERROR, - "__updn_bfs_by_node (less) ERR AA1: " - "Invalid value returned from set min hop is : %d\n", set_hop_return_value); + "__updn_bfs_by_node (less) ERR AA01: " + "Invalid value returned from set min hop is: %d\n", set_hop_return_value); } /* Check if remote port is allready has been visited */ updn_switch_iterator = cl_list_head(p_nextList); @@ -393,13 +393,13 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t if(!(p_tmp=__updn_create_updn_next_step_t(next_dir, p_remote_sw))) { osm_log(&(osm.log), OSM_LOG_ERROR, - "__updn_bfs_by_node: ERR AA2: " + "__updn_bfs_by_node: ERR AA11: " "Could not create updn_next_step_t\n"); return 1; } osm_log(&(osm.log), OSM_LOG_DEBUG, "__updn_bfs_by_node: " - "Inserting a new element to the next list : guid=0x%" PRIx64 " %s\n" + "Inserting a new element to the next list: guid=0x%" PRIx64 " %s\n" , cl_ntoh64(p_tmp->p_sw->p_node->node_info.port_guid), (p_tmp->state == UP ? "UP" : "DOWN") ); @@ -412,20 +412,20 @@ __updn_bfs_by_node(IN osm_subn_t *p_subn, IN ib_net64_t guid_index, IN cl_qmap_t { osm_log(&(osm.log), OSM_LOG_DEBUG, "__updn_bfs_by_node (equal):" - "Setting Min Hop Table of switch : 0x%" PRIx64 - "\n\t\tCurrent hop count is : %d , next hop count : %d" - "\n\tlid to set : 0x%x" - "\n\tport number : %d" + "Setting Min Hop Table of switch: 0x%" PRIx64 + "\n\t\tCurrent hop count is: %d, next hop count: %d" + "\n\tlid to set: 0x%x" + "\n\tport number: %d" "\n\thops number: %d\n" , cl_ntoh64(remote_guid), osm_switch_get_hop_count(p_remote_sw, root_lid, pn_rem) - , current_min_hop+1, root_lid, pn_rem, current_min_hop+1); - set_hop_return_value=osm_switch_set_hops(p_remote_sw, root_lid, pn_rem, current_min_hop+1); + , current_min_hop + 1, root_lid, pn_rem, current_min_hop + 1); + set_hop_return_value = osm_switch_set_hops(p_remote_sw, root_lid, pn_rem, current_min_hop + 1); if (set_hop_return_value) { osm_log(&(osm.log), OSM_LOG_ERROR, - "__updn_bfs_by_node (less) ERR AA3: " - "Invalid value returned from set min hop is : %d\n", set_hop_return_value); + "__updn_bfs_by_node (less) ERR AA12: " + "Invalid value returned from set min hop is: %d\n", set_hop_return_value); } } } @@ -463,7 +463,7 @@ updn_destroy( while( p_map_item != cl_qmap_end( &p_updn->guid_rank_tbl)) { osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_subn_calc_up_down_min_hop_table : " + "osm_subn_calc_up_down_min_hop_table: " "guid = 0x%" PRIx64 " rank = %u\n", cl_ntoh64(cl_qmap_key(p_map_item)), ((updn_rank_t *)p_map_item)->rank); cl_qmap_remove_item( &p_updn->guid_rank_tbl, p_map_item); @@ -490,15 +490,9 @@ updn_construct(void) { updn_t* p_updn; - OSM_LOG_ENTER( &(osm.log) , updn_construct); - + OSM_LOG_ENTER( &(osm.log), updn_construct); p_updn = cl_zalloc(sizeof(updn_t)); - if (p_updn == NULL) - { - goto Exit; - } - Exit : - OSM_LOG_EXIT( &(osm.log) ); + OSM_LOG_EXIT( &(osm.log) ); return(p_updn); } @@ -515,8 +509,13 @@ updn_init( cl_list_iterator_t guid_iterator; ib_api_status_t status = IB_SUCCESS; - - OSM_LOG_ENTER( &(osm.log) , updn_init ); + OSM_LOG_ENTER( &(osm.log), updn_init ); + /* Make sure the p_updn isn't NULL */ + if (!p_updn) + { + status = IB_ERROR; + goto Exit_Bad; + } p_updn->state = UPDN_INIT; cl_qmap_init( &p_updn->guid_rank_tbl); p_list = (cl_list_t*)cl_malloc(sizeof(cl_list_t)); @@ -525,6 +524,7 @@ updn_init( status = IB_ERROR; goto Exit_Bad; } + cl_list_construct( p_list ); cl_list_init( p_list, 10 ); p_updn->p_root_nodes = p_list; @@ -546,13 +546,13 @@ updn_init( { osm_log( &osm.log, OSM_LOG_ERROR, "osm_opensm_init : ERR AA02: " - "Fail to open guid list file (%s).\n", + "Fail to open guid list file (%s)\n", osm.subn.opt.updn_guid_file); status = IB_NOT_FOUND; goto Exit; } - while ( fgets(line,MAX_UPDN_GUID_FILE_LINE_LENGTH, p_updn_guid_file) ) + while ( fgets(line, MAX_UPDN_GUID_FILE_LINE_LENGTH, p_updn_guid_file) ) { if (strcspn(line, " ,;.") == strlen(line)) { @@ -560,15 +560,15 @@ updn_init( if (strlen(line) > 1) { p_tmp = cl_malloc(sizeof(uint64_t)); - *p_tmp = strtoull(line,NULL,16); + *p_tmp = strtoull(line, NULL, 16); cl_list_insert_tail(osm.p_updn_ucast_routing->p_root_nodes, p_tmp); } } else { osm_log( &osm.log, OSM_LOG_ERROR, - "osm_opensm_init : ERR AA03: " - "Bad formatted guid in file (%s) : %s.\n" + "osm_opensm_init: ERR AA03: " + "Bad formatted guid in file (%s) : %s\n" , osm.subn.opt.updn_guid_file,line); status = IB_NOT_FOUND; break; @@ -577,15 +577,15 @@ updn_init( /* For Debug Purposes ... */ osm_log( &osm.log, OSM_LOG_DEBUG, - "osm_opensm_init : " - "UPDN - Root nodes fetching by file %s.\n", + "osm_opensm_init: " + "UPDN - Root nodes fetching by file %s\n", osm.subn.opt.updn_guid_file); guid_iterator = cl_list_head(osm.p_updn_ucast_routing->p_root_nodes); while( guid_iterator != cl_list_end(osm.p_updn_ucast_routing->p_root_nodes) ) { osm_log( &osm.log, OSM_LOG_DEBUG, - "osm_opensm_init : " - "Inserting guid 0x%" PRIx64 " as root node.\n", + "osm_opensm_init: " + "Inserting guid 0x%" PRIx64 " as root node\n", *((uint64_t*)cl_list_obj(guid_iterator)) ); guid_iterator = cl_list_next(guid_iterator); } @@ -617,15 +617,15 @@ updn_subn_rank( IN updn_t* p_updn) { /* Init local vars */ - osm_port_t *p_root_port=NULL; + osm_port_t *p_root_port = NULL; uint16_t tbl_size; - uint8_t rank=base_rank; - osm_physp_t *p_physp, *p_remote_physp,*p_physp_temp; + uint8_t rank = base_rank; + osm_physp_t *p_physp, *p_remote_physp, *p_physp_temp; cl_list_t *p_currList,*p_nextList; cl_status_t did_cause_update; - uint8_t num_ports,port_num; + uint8_t num_ports, port_num; - OSM_LOG_ENTER( &(osm.log) , updn_subn_rank); + OSM_LOG_ENTER( &(osm.log), updn_subn_rank); osm_log(&(osm.log), OSM_LOG_VERBOSE, "updn_subn_rank: " @@ -643,7 +643,7 @@ updn_subn_rank( { osm_log(&(osm.log), OSM_LOG_ERROR, "updn_subn_rank: ERR AA04: " - "Port guid table is empty, cannot perform ranking.\n"); + "Port guid table is empty, cannot perform ranking\n"); OSM_LOG_EXIT( &(osm.log)); return 1; } @@ -655,7 +655,7 @@ updn_subn_rank( osm_log(&(osm.log), OSM_LOG_ERROR, "updn_subn_rank: ERR AA05: " - "Wrong guid value : 0x%" PRIx64 ".\n", root_guid); + "Wrong guid value: 0x%" PRIx64 "\n", root_guid); OSM_LOG_EXIT( &(osm.log)); return 1; } @@ -663,7 +663,7 @@ updn_subn_rank( /* Rank the first chosen guid anyway since its the base rank */ osm_log(&(osm.log), OSM_LOG_DEBUG, "updn_subn_rank: " - "Ranking port guid 0x%" PRIx64 ".\n",root_guid); + "Ranking port guid 0x%" PRIx64 "\n",root_guid); __updn_update_rank(&p_updn->guid_rank_tbl, cl_ntoh64(root_guid), rank); /* @@ -679,7 +679,6 @@ updn_subn_rank( /* Assign pointer to the list for BFS */ p_currList = p_nextList; - /* BFS the list till its empty */ osm_log(&(osm.log), OSM_LOG_VERBOSE, "updn_subn_rank: " @@ -700,7 +699,7 @@ updn_subn_rank( osm_log(&(osm.log), OSM_LOG_DEBUG, "updn_subn_rank: " "Handling port guid 0x%" PRIx64 "\n", cl_ntoh64(p_physp->port_guid)); - for (port_num = 1 ; port_num < num_ports ; port_num++) + for (port_num = 1; port_num < num_ports; port_num++) { ib_net64_t port_guid; @@ -770,7 +769,6 @@ updn_subn_rank( /********************************************************************** **********************************************************************/ - int osm_subn_set_up_down_min_hop_table( IN updn_t* p_updn) @@ -781,13 +779,13 @@ osm_subn_set_up_down_min_hop_table( osm_port_t *p_next_port,*p_port; ib_net64_t port_guid; - OSM_LOG_ENTER( &(osm.log) , osm_subn_set_up_down_min_hop_table ); + OSM_LOG_ENTER( &(osm.log), osm_subn_set_up_down_min_hop_table ); if (p_updn->state == UPDN_INIT) { osm_log(&(osm.log), OSM_LOG_ERROR, "osm_subn_set_up_down_min_hop_table: ERR AA06: " - "Calculating Min Hop only allowed after Ranking\n"); - OSM_LOG_EXIT( &(osm.log)); + "Calculating Min Hop only allowed after ranking\n"); + OSM_LOG_EXIT( &(osm.log) ); return 1; } @@ -796,20 +794,20 @@ osm_subn_set_up_down_min_hop_table( { osm_log(&(osm.log), OSM_LOG_ERROR, "osm_subn_set_up_down_min_hop_table: ERR AA10: " - "This is a non switched subnet , cannot perform Algorithm\n"); + "This is a non switched subnet, cannot perform UPDN algorithm\n"); OSM_LOG_EXIT( &(osm.log)); return 1; } /* Go over all the switches in the subnet - for each init their Min Hop Table */ osm_log(&(osm.log), OSM_LOG_VERBOSE, - "osm_subn_set_up_down_min_hop_table:" + "osm_subn_set_up_down_min_hop_table: " "Init Min Hop Table of all switches [\n"); p_next_sw = (osm_switch_t*)cl_qmap_head( &p_subn->sw_guid_tbl ); while( p_next_sw != (osm_switch_t*)cl_qmap_end( &p_subn->sw_guid_tbl ) ) { - uint16_t max_lid_ho,lid_ho; + uint16_t max_lid_ho, lid_ho; p_sw = p_next_sw; p_next_sw = (osm_switch_t*)cl_qmap_next( &p_sw->map_item ); @@ -817,17 +815,17 @@ osm_subn_set_up_down_min_hop_table( rebuild its FWD tables , post setting Min Hop Tables */ osm_lid_matrix_clear(&(p_sw->lmx)); max_lid_ho = osm_switch_get_max_lid_ho(p_sw); - for (lid_ho=1 ; lid_ho <= max_lid_ho ; lid_ho++) - osm_switch_set_path(p_sw,lid_ho,OSM_NO_PATH,TRUE); + for (lid_ho = 1; lid_ho <= max_lid_ho; lid_ho++) + osm_switch_set_path(p_sw, lid_ho, OSM_NO_PATH,TRUE); } osm_log(&(osm.log), OSM_LOG_VERBOSE, - "osm_subn_set_up_down_min_hop_table:" + "osm_subn_set_up_down_min_hop_table: " "Init Min Hop Table of all switches ]\n"); /* Now do the BFS for each port in the subnet */ osm_log(&(osm.log), OSM_LOG_VERBOSE, - "osm_subn_set_up_down_min_hop_table:" + "osm_subn_set_up_down_min_hop_table: " "BFS through all port guids in the subnet [\n"); p_next_port = (osm_port_t*)cl_qmap_head( &p_subn->port_guid_tbl ); while( p_next_port != (osm_port_t*)cl_qmap_end( &p_subn->port_guid_tbl ) ) @@ -836,57 +834,56 @@ osm_subn_set_up_down_min_hop_table( p_next_port = (osm_port_t*)cl_qmap_next( &p_port->map_item ); port_guid = cl_qmap_key(&(p_port->map_item)); osm_log(&(osm.log), OSM_LOG_DEBUG, - "BFS through port guid 0x%" PRIx64 ".\n" + "BFS through port guid 0x%" PRIx64 "\n" , cl_ntoh64(port_guid)); if(__updn_bfs_by_node(p_subn,port_guid, &p_updn->guid_rank_tbl)) { - OSM_LOG_EXIT( &(osm.log)); + OSM_LOG_EXIT( &(osm.log) ); return 1; } } osm_log(&(osm.log), OSM_LOG_INFO, - "osm_subn_set_up_down_min_hop_table:" + "osm_subn_set_up_down_min_hop_table: " "BFS through all port guids in the subnet ]\n"); /* Cleanup */ - OSM_LOG_EXIT( &(osm.log)); + OSM_LOG_EXIT( &(osm.log) ); return 0; } /********************************************************************** **********************************************************************/ - int osm_subn_calc_up_down_min_hop_table( IN uint32_t num_guids, IN uint64_t * guid_list, IN updn_t* p_updn) { - uint8_t idx=0; + uint8_t idx = 0; cl_map_item_t *p_map_item; int status; - OSM_LOG_ENTER( &(osm.log) , osm_subn_calc_up_down_min_hop_table ); + OSM_LOG_ENTER( &(osm.log), osm_subn_calc_up_down_min_hop_table ); osm_log(&(osm.log), OSM_LOG_VERBOSE, - "osm_subn_calc_up_down_min_hop_table :" + "osm_subn_calc_up_down_min_hop_table: " "Ranking all port guids in the list\n"); if (num_guids == 0) { osm_log(&(osm.log), OSM_LOG_ERROR, - "osm_subn_calc_up_down_min_hop_table :" + "osm_subn_calc_up_down_min_hop_table: " "No guids were given or number of guids is 0\n"); return 1; } - for (idx=0;idx < num_guids;idx++) + for (idx = 0; idx < num_guids; idx++) { /* Apply the ranking for each guid given by user - bypass illegal ones */ updn_subn_rank(guid_list[idx], 0, p_updn); } /* After multiple ranking need to set Min Hop Table by UpDn algorithm */ osm_log(&(osm.log), OSM_LOG_VERBOSE, - "osm_subn_calc_up_down_min_hop_table :" + "osm_subn_calc_up_down_min_hop_table: " "Setting all switches' Min Hop Table\n"); status = osm_subn_set_up_down_min_hop_table (p_updn); @@ -896,7 +893,7 @@ osm_subn_calc_up_down_min_hop_table( while( p_map_item != cl_qmap_end( &p_updn->guid_rank_tbl)) { osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_subn_calc_up_down_min_hop_table : " + "osm_subn_calc_up_down_min_hop_table: " "guid = 0x%" PRIx64 " rank = %u\n", cl_ntoh64(cl_qmap_key(p_map_item)), ((updn_rank_t *)p_map_item)->rank); cl_qmap_remove_item( &p_updn->guid_rank_tbl, p_map_item); @@ -909,12 +906,11 @@ osm_subn_calc_up_down_min_hop_table( } - /********************************************************************** **********************************************************************/ /* UPDN callback function */ - -int __osm_updn_call( void *ctx) { +int __osm_updn_call(void *ctx) +{ OSM_LOG_ENTER(&(osm.log), __osm_updn_call); /* First auto detect root nodes - if required */ if ( ((updn_t*)ctx)->auto_detect_root_nodes ) @@ -927,16 +923,16 @@ int __osm_updn_call( void *ctx) { if ( ((updn_t*)ctx)->updn_ucast_reg_inputs.num_guids > 0) { osm_log (&(osm.log), OSM_LOG_DEBUG, - "__osm_updn_call : " - "activating UPDN algorithm.\n"); + "__osm_updn_call: " + "activating UPDN algorithm\n"); osm_subn_calc_up_down_min_hop_table( ((updn_t*)ctx)->updn_ucast_reg_inputs.num_guids, ((updn_t*)ctx)->updn_ucast_reg_inputs.guid_list , ((updn_t*)ctx) ); } else osm_log (&(osm.log), OSM_LOG_INFO, - "__osm_updn_call : " - "disable UPDN algorithm , no root nodes were found.\n"); + "__osm_updn_call: " + "disable UPDN algorithm, no root nodes were found\n"); OSM_LOG_EXIT(&(osm.log)); return 0; @@ -945,9 +941,10 @@ int __osm_updn_call( void *ctx) { /********************************************************************** **********************************************************************/ /* UPDN convert cl_list to guid array in updn struct */ -void __osm_updn_convert_list2array (IN updn_t * p_updn) { - uint32_t i = 0,max_num = 0; - uint64_t * p_guid; +void __osm_updn_convert_list2array(IN updn_t * p_updn) +{ + uint32_t i = 0, max_num = 0; + uint64_t *p_guid; OSM_LOG_ENTER(&(osm.log), __osm_updn_convert_list2array); p_updn->updn_ucast_reg_inputs.num_guids = cl_list_count( @@ -958,7 +955,6 @@ void __osm_updn_convert_list2array (IN updn_t * p_updn) { p_updn->updn_ucast_reg_inputs.num_guids*sizeof(uint64_t)); if (!cl_is_list_empty(p_updn->p_root_nodes)) { - ; while( (p_guid = (uint64_t*)cl_list_remove_head(p_updn->p_root_nodes)) ) { p_updn->updn_ucast_reg_inputs.guid_list[i] = *p_guid; @@ -966,10 +962,10 @@ void __osm_updn_convert_list2array (IN updn_t * p_updn) { i++; } max_num = i; - for (i=0;i < max_num ; i++ ) + for (i = 0; i < max_num; i++ ) osm_log (&(osm.log), OSM_LOG_DEBUG, - "__osm_updn_convert_list2array : " - "Map guid 0x%" PRIx64 " into UPDN array.\n", + "__osm_updn_convert_list2array: " + "Map guid 0x%" PRIx64 " into UPDN array\n", p_updn->updn_ucast_reg_inputs.guid_list[i]); } /* Since we need the template list for other sweeps, we wont destroy & free it */ @@ -980,7 +976,6 @@ void __osm_updn_convert_list2array (IN updn_t * p_updn) { **********************************************************************/ /* Registration function to ucast routing manager (instead of Min Hop Algorithm) */ - int osm_updn_reg_calc_min_hop_table( IN updn_t * p_updn, @@ -996,7 +991,7 @@ osm_updn_reg_calc_min_hop_table( __osm_updn_convert_list2array(p_updn); } osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_reg_calc_min_hop_table : " + "osm_updn_reg_calc_min_hop_table: " "assigning ucast fdb UI function with updn callback\n"); p_opt->pfn_ui_ucast_fdb_assign = __osm_updn_call; p_opt->ui_ucast_fdb_assign_ctx = (void *)p_updn; @@ -1010,13 +1005,13 @@ osm_updn_reg_calc_min_hop_table( int osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) { - osm_switch_t *p_next_sw,*p_sw; - osm_port_t *p_next_port,*p_port; + osm_switch_t *p_next_sw, *p_sw; + osm_port_t *p_next_port, *p_port; osm_physp_t *p_physp; uint32_t numCas = 0; uint32_t numSws = cl_qmap_count(&osm.subn.sw_guid_tbl); cl_qmap_t min_hop_hist; /* Histogram container */ - updn_hist_t *p_updn_hist,*p_up_ht; + updn_hist_t *p_updn_hist, *p_up_ht; uint8_t maxHops = 0; /* contain the max histogram index */ uint64_t *p_guid; cl_list_t *p_root_nodes_list = p_updn->p_root_nodes; @@ -1025,8 +1020,8 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) OSM_LOG_ENTER(&(osm.log), osm_updn_find_root_nodes_by_min_hop); osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "current number of ports in the subnet is %d.\n", + "osm_updn_find_root_nodes_by_min_hop: " + "current number of ports in the subnet is %d\n", cl_qmap_count(&osm.subn.port_guid_tbl)); /* Init the required vars */ cl_qmap_init( &min_hop_hist ); @@ -1041,8 +1036,8 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) /* Find the Maximum number of Cas for `histogram normalization */ osm_log (&(osm.log), OSM_LOG_VERBOSE, - "osm_updn_find_root_nodes_by_min_hop : " - "Find the number of CA and store them in cl_list.\n"); + "osm_updn_find_root_nodes_by_min_hop: " + "Find the number of CA and store them in cl_list\n"); p_next_port = (osm_port_t*)cl_qmap_head( &osm.subn.port_guid_tbl ); while( p_next_port != (osm_port_t*)cl_qmap_end( &osm.subn.port_guid_tbl ) ) { p_port = p_next_port; @@ -1059,25 +1054,25 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) */ cl_map_insert( &ca_by_lid_map, self_lid_ho, (void *)0x1); osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Inserting into array guid 0x%" PRIx64 " , Lid : 0x%x.\n", + "osm_updn_find_root_nodes_by_min_hop: " + "Inserting into array guid 0x%" PRIx64 ", Lid: 0x%x\n", cl_ntoh64(osm_port_get_guid(p_port)), self_lid_ho); } } osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Found %u CA , %u SW in the subnet .\n", numCas,numSws); + "osm_updn_find_root_nodes_by_min_hop: " + "Found %u CA, %u SW in the subnet\n", numCas, numSws); p_next_sw = (osm_switch_t*)cl_qmap_head( &osm.subn.sw_guid_tbl ); osm_log (&(osm.log), OSM_LOG_VERBOSE, - "osm_updn_find_root_nodes_by_min_hop : " - "Passing through all switches to collect Min Hop Info.\n"); + "osm_updn_find_root_nodes_by_min_hop: " + "Passing through all switches to collect Min Hop info\n"); while( p_next_sw != (osm_switch_t*)cl_qmap_end( &osm.subn.sw_guid_tbl ) ) { - uint16_t max_lid_ho,lid_ho; + uint16_t max_lid_ho, lid_ho; uint8_t hop_val; uint16_t numHopBarsOverThd1 = 0; uint16_t numHopBarsOverThd2 = 0; - double thd1,thd2; + double thd1, thd2; p_sw = p_next_sw; /* Roll to the next switch */ @@ -1089,9 +1084,9 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) /* Get base lid of switch by retrieving port 0 lid of node pointer */ self_lid_ho = cl_ntoh16( osm_node_get_base_lid( p_sw->p_node, 0 ) ); osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Passing through switch lid 0x%x.\n", self_lid_ho); - for (lid_ho=1 ; lid_ho <= max_lid_ho ; lid_ho++) + "osm_updn_find_root_nodes_by_min_hop: " + "Passing through switch lid 0x%x\n", self_lid_ho); + for (lid_ho = 1; lid_ho <= max_lid_ho; lid_ho++) { /* Skip lids which are not CAs - for the histogram purposes we care only about CAs */ @@ -1126,8 +1121,8 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) p_updn_hist->bar_value = 1; cl_qmap_insert(&min_hop_hist, (uint64_t)hop_val, &p_updn_hist->map_item); osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Creating new entry in histogram %u with bar value 1.\n", + "osm_updn_find_root_nodes_by_min_hop: " + "Creating new entry in histogram %u with bar value 1\n", hop_val); } else @@ -1135,8 +1130,8 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) /* Entry exist in the table , just increment the value */ p_updn_hist->bar_value++; osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Updating entry in histogram %u with bar value %d.\n", hop_val, + "osm_updn_find_root_nodes_by_min_hop: " + "Updating entry in histogram %u with bar value %d\n", hop_val, p_updn_hist->bar_value); } } @@ -1147,9 +1142,9 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) thd1 = numCas * 0.9; thd2 = numCas * 0.05; osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " + "osm_updn_find_root_nodes_by_min_hop: " "Pass over the histogram value and find only one root node above " - "thd1 = %f && thd2 = %f.\n", thd1, thd2); + "thd1 = %f && thd2 = %f\n", thd1, thd2); p_updn_hist = (updn_hist_t*) cl_qmap_head( &min_hop_hist ); while( p_updn_hist != (updn_hist_t*)cl_qmap_end( &min_hop_hist ) ) @@ -1161,18 +1156,18 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) if ( p_up_ht->bar_value > thd2 ) numHopBarsOverThd2++; osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Passing through histogram - Hop Index %u : " - "numHopBarsOverThd1 = %u , numHopBarsOverThd2 = %u.\n", + "osm_updn_find_root_nodes_by_min_hop: " + "Passing through histogram - Hop Index %u: " + "numHopBarsOverThd1 = %u, numHopBarsOverThd2 = %u\n", (uint16_t)cl_qmap_key((cl_map_item_t*)p_up_ht), numHopBarsOverThd1 , numHopBarsOverThd2); } /* destroy the qmap table and all its content - no longer needed */ osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Cleanup : delete histogram " - "UPDN - Root nodes fetching by auto detect.\n"); + "osm_updn_find_root_nodes_by_min_hop: " + "Cleanup: delete histogram " + "UPDN - Root nodes fetching by auto detect\n"); p_updn_hist = (updn_hist_t*) cl_qmap_head( &min_hop_hist ); while ( p_updn_hist != (updn_hist_t*)cl_qmap_end( &min_hop_hist ) ) { @@ -1187,8 +1182,8 @@ osm_updn_find_root_nodes_by_min_hop( OUT updn_t * p_updn ) p_guid = cl_malloc(sizeof(uint64_t)); *p_guid = cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)); osm_log (&(osm.log), OSM_LOG_DEBUG, - "osm_updn_find_root_nodes_by_min_hop : " - "Inserting guid 0x%" PRIx64 " as root node.\n", + "osm_updn_find_root_nodes_by_min_hop: " + "Inserting guid 0x%" PRIx64 " as root node\n", *p_guid); cl_list_insert_tail(p_root_nodes_list, p_guid); } diff --git a/trunk/ulp/opensm/user/opensm/osm_vl15intf.c b/trunk/ulp/opensm/user/opensm/osm_vl15intf.c index 3eb14c54..62cedd15 100644 --- a/trunk/ulp/opensm/user/opensm/osm_vl15intf.c +++ b/trunk/ulp/opensm/user/opensm/osm_vl15intf.c @@ -82,7 +82,7 @@ __osm_vl15_poller( if ( p_vl->thread_state == OSM_THREAD_STATE_NONE) { - cl_sig_mask_sigint(); + cl_sig_mask_sigint( ); p_vl->thread_state = OSM_THREAD_STATE_RUN; } @@ -113,7 +113,7 @@ __osm_vl15_poller( { osm_log( p_vl->p_log, OSM_LOG_DEBUG, "__osm_vl15_poller: " - "Servicing p_madw = %p.\n", p_madw ); + "Servicing p_madw = %p\n", p_madw ); } if( osm_log_is_active( p_vl->p_log, OSM_LOG_FRAMES ) ) @@ -156,61 +156,72 @@ __osm_vl15_poller( { uint32_t outstanding; cl_status_t cl_status; + osm_log( p_vl->p_log, OSM_LOG_ERROR, "__osm_vl15_poller: ERR 3E03: " - "MAD send failed (%s).\n", + "MAD send failed (%s)\n", ib_get_err_str( status ) ); /* The MAD was never successfully sent, so fix up the pre-incremented count values. */ + /* Decrement qp0_mads_sent and qp0_mads_outstanding_on_wire that was incremented in the code above. */ mads_sent = cl_atomic_dec( &p_vl->p_stats->qp0_mads_sent ); - if( p_madw->resp_expected == TRUE ) - cl_atomic_dec( &p_vl->p_stats->qp0_mads_outstanding_on_wire ); + if( p_madw->resp_expected == TRUE ) + cl_atomic_dec( &p_vl->p_stats->qp0_mads_outstanding_on_wire ); - /* - The following code is similar to the one in - __osm_sm_mad_ctrl_retire_trans_mad. We need to decrement the + /* + The following code is similar to the code in + __osm_sm_mad_ctrl_retire_trans_mad. We need to decrement the qp0_mads_outstanding counter, and if we reached 0 - need to call the cl_disp_post with OSM_SIGNAL_NO_PENDING_TRANSACTION (in order to wake up the state mgr). + There is one difference from the code in __osm_sm_mad_ctrl_retire_trans_mad. + This code is called on all mads, if osm_vendor_send() failed, unlike + __osm_sm_mad_ctrl_retire_trans_mad which is called only on mads where + resp_expected == TRUE. As a result, the qp0_mads_outstanding counter + should be decremented and handled accordingly only if this is a mad + with resp_expected == TRUE. */ - outstanding = cl_atomic_dec( &p_vl->p_stats->qp0_mads_outstanding ); + if ( p_madw->resp_expected == TRUE ) + { + outstanding = cl_atomic_dec( &p_vl->p_stats->qp0_mads_outstanding ); - osm_log( p_vl->p_log, OSM_LOG_DEBUG, - "__osm_vl15_poller: " - "%u QP0 MADs outstanding.\n", - p_vl->p_stats->qp0_mads_outstanding ); + osm_log( p_vl->p_log, OSM_LOG_DEBUG, + "__osm_vl15_poller: " + "%u QP0 MADs outstanding\n", + p_vl->p_stats->qp0_mads_outstanding ); - if( outstanding == 0 ) - { - /* - The wire is clean. - Signal the state manager. - */ - if( osm_log_is_active( p_vl->p_log, OSM_LOG_DEBUG ) ) + if( outstanding == 0 ) { - osm_log( p_vl->p_log, OSM_LOG_DEBUG, - "__osm_vl15_poller: " - "Posting Dispatcher message %s.\n", - osm_get_disp_msg_str( OSM_MSG_NO_SMPS_OUTSTANDING ) ); - } - - cl_status = cl_disp_post( p_vl->h_disp, - OSM_MSG_NO_SMPS_OUTSTANDING, - (void *)OSM_SIGNAL_NO_PENDING_TRANSACTIONS, - NULL, - NULL ); - - if( cl_status != CL_SUCCESS ) - { - osm_log( p_vl->p_log, OSM_LOG_ERROR, - "__osm_vl15_poller: ERR 3E06: " - "Dispatcher post message failed (%s).\n", - CL_STATUS_MSG( cl_status ) ); + /* + The wire is clean. + Signal the state manager. + */ + if( osm_log_is_active( p_vl->p_log, OSM_LOG_DEBUG ) ) + { + osm_log( p_vl->p_log, OSM_LOG_DEBUG, + "__osm_vl15_poller: " + "Posting Dispatcher message %s\n", + osm_get_disp_msg_str( OSM_MSG_NO_SMPS_OUTSTANDING ) ); + } + + cl_status = cl_disp_post( p_vl->h_disp, + OSM_MSG_NO_SMPS_OUTSTANDING, + (void *)OSM_SIGNAL_NO_PENDING_TRANSACTIONS, + NULL, + NULL ); + + if( cl_status != CL_SUCCESS ) + { + osm_log( p_vl->p_log, OSM_LOG_ERROR, + "__osm_vl15_poller: ERR 3E06: " + "Dispatcher post message failed (%s)\n", + CL_STATUS_MSG( cl_status ) ); + } } } } @@ -221,7 +232,7 @@ __osm_vl15_poller( osm_log( p_vl->p_log, OSM_LOG_DEBUG, "__osm_vl15_poller: " "%u QP0 MADs on wire, %u outstanding, %u unicasts sent, " - "%u total sent.\n", + "%u total sent\n", p_vl->p_stats->qp0_mads_outstanding_on_wire, p_vl->p_stats->qp0_mads_outstanding, p_vl->p_stats->qp0_unicasts_sent, @@ -250,7 +261,7 @@ __osm_vl15_poller( { osm_log( p_vl->p_log, OSM_LOG_ERROR, "__osm_vl15_poller: ERR 3E02: " - "Event wait failed (%s).\n", + "Event wait failed (%s)\n", CL_STATUS_MSG( status ) ); } } @@ -258,7 +269,7 @@ __osm_vl15_poller( /* since we abort immediately when the state != OSM_THREAD_STATE_RUN we might have some mads on the queues. After the thread exits - the vl15 destroy should put back these mads... + the vl15 destroy routine should put back these mads... */ OSM_LOG_EXIT( p_vl->p_log ); @@ -289,6 +300,7 @@ osm_vl15_destroy( IN struct _osm_mad_pool *p_pool) { osm_madw_t* p_madw; + OSM_LOG_ENTER( p_vl->p_log, osm_vl15_destroy ); /* @@ -321,15 +333,13 @@ osm_vl15_destroy( p_madw = (osm_madw_t*)cl_qlist_remove_head( &p_vl->ufifo); osm_mad_pool_put( p_pool, p_madw ); } - + cl_spinlock_release( &p_vl->lock ); - + cl_event_destroy( &p_vl->signal ); p_vl->state = OSM_VL15_STATE_INIT; cl_spinlock_destroy( &p_vl->lock ); - cl_disp_unregister( p_vl->h_disp ); - OSM_LOG_EXIT( p_vl->p_log ); } @@ -348,6 +358,7 @@ osm_vl15_init( ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_vl15_init ); p_vl->p_vend = p_vend; @@ -386,7 +397,7 @@ osm_vl15_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_vl15_init: ERR 3E01: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } @@ -396,7 +407,6 @@ osm_vl15_init( return( status ); } - /********************************************************************** **********************************************************************/ void @@ -423,7 +433,7 @@ osm_vl15_poll( { osm_log( p_vl->p_log, OSM_LOG_DEBUG, "osm_vl15_poll: " - "Signalling poller thread.\n" ); + "Signalling poller thread\n" ); } cl_event_signal( &p_vl->signal ); @@ -447,7 +457,7 @@ osm_vl15_post( { osm_log( p_vl->p_log, OSM_LOG_DEBUG, "osm_vl15_post: " - "Posting p_madw = 0x%p.\n", p_madw ); + "Posting p_madw = 0x%p\n", p_madw ); } /* @@ -469,7 +479,7 @@ osm_vl15_post( { osm_log( p_vl->p_log, OSM_LOG_DEBUG, "osm_vl15_post: " - "%u QP0 MADs on wire, %u QP0 MADs outstanding.\n", + "%u QP0 MADs on wire, %u QP0 MADs outstanding\n", p_vl->p_stats->qp0_mads_outstanding_on_wire, p_vl->p_stats->qp0_mads_outstanding ); } @@ -477,7 +487,6 @@ osm_vl15_post( osm_vl15_poll( p_vl ); OSM_LOG_EXIT( p_vl->p_log ); - } void @@ -486,6 +495,7 @@ osm_vl15_shutdown( IN osm_mad_pool_t* const p_mad_pool) { osm_madw_t* p_madw; + OSM_LOG_ENTER( p_vl->p_log, osm_vl15_shutdown ); /* we only should get here after the VL15 interface was initialized */ @@ -494,6 +504,8 @@ osm_vl15_shutdown( /* grap a lock on the object */ cl_spinlock_acquire( &p_vl->lock ); + cl_disp_unregister( p_vl->h_disp ); + /* go over all outstanding MADs and retire their transactions */ /* first we handle the list of response MADs */ @@ -504,11 +516,10 @@ osm_vl15_shutdown( { osm_log( p_vl->p_log, OSM_LOG_DEBUG, "osm_vl15_shutdown: " - "Releasing Response p_madw = %p.\n", p_madw ); + "Releasing Response p_madw = %p\n", p_madw ); } osm_mad_pool_put( p_mad_pool, p_madw ); - cl_atomic_dec( &p_vl->p_stats->qp0_mads_outstanding ); p_madw = (osm_madw_t*)cl_qlist_remove_head( &p_vl->ufifo ); } @@ -521,7 +532,7 @@ osm_vl15_shutdown( { osm_log( p_vl->p_log, OSM_LOG_DEBUG, "osm_vl15_shutdown: " - "Releasing Request p_madw = %p.\n", p_madw ); + "Releasing Request p_madw = %p\n", p_madw ); } osm_mad_pool_put( p_mad_pool, p_madw ); @@ -532,5 +543,6 @@ osm_vl15_shutdown( /* free the lock */ cl_spinlock_release( &p_vl->lock ); + OSM_LOG_EXIT( p_vl->p_log ); } diff --git a/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv.c b/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv.c index 1a541501..d93b74e3 100644 --- a/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv.c @@ -80,13 +80,13 @@ void osm_vla_rcv_destroy( IN osm_vla_rcv_t* const p_rcv ) { + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_vla_rcv_destroy ); - CL_ASSERT( p_rcv ); OSM_LOG_EXIT( p_rcv->p_log ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -98,6 +98,7 @@ osm_vla_rcv_init( IN cl_plock_t* const p_lock ) { ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( p_log, osm_vla_rcv_init ); osm_vla_rcv_construct( p_rcv ); @@ -114,7 +115,7 @@ osm_vla_rcv_init( /********************************************************************** **********************************************************************/ /* - * WE MIGHT ONLY RECEIVE A GET or SET responses + * WE MIGHT ONLY RECEIVE GET or SET responses */ void osm_vla_rcv_process( @@ -132,9 +133,10 @@ osm_vla_rcv_process( ib_net64_t node_guid; uint8_t port_num, block_num; + CL_ASSERT( p_rcv ); + OSM_LOG_ENTER( p_rcv->p_log, osm_vla_rcv_process ); - CL_ASSERT( p_rcv ); CL_ASSERT( p_madw ); p_smp = osm_madw_get_smp_ptr( p_madw ); @@ -158,7 +160,7 @@ osm_vla_rcv_process( "osm_vla_rcv_process: ERR 3F06: " "No Port object for port with GUID = 0x%" PRIx64 "\n\t\t\t\tfor parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), cl_ntoh64( p_smp->trans_id ) ); @@ -193,7 +195,7 @@ osm_vla_rcv_process( "osm_vla_rcv_process: " "Got GetResp(VLArb) block:%u port_num %u with GUID = 0x%" PRIx64 " for parent node GUID = 0x%" PRIx64 - ", TID = 0x%" PRIx64 ".\n", + ", TID = 0x%" PRIx64 "\n", block_num, port_num, cl_ntoh64( port_guid ), cl_ntoh64( node_guid ), @@ -210,7 +212,7 @@ osm_vla_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_vla_rcv_process: " - "Got invalid port number 0x%X.\n", + "Got invalid port number 0x%X\n", port_num ); } goto Exit; @@ -225,7 +227,7 @@ osm_vla_rcv_process( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_vla_rcv_process: " - "Got invalid block number 0x%X. \n", + "Got invalid block number 0x%X\n", block_num ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv_ctrl.c index 8f0d97d6..c78b6eee 100644 --- a/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_vl_arb_rcv_ctrl.c @@ -88,7 +88,6 @@ osm_vla_rcv_ctrl_destroy( cl_disp_unregister( p_ctrl->h_disp ); } - /********************************************************************** **********************************************************************/ ib_api_status_t @@ -105,7 +104,6 @@ osm_vla_rcv_ctrl_init( osm_vla_rcv_ctrl_construct( p_ctrl ); p_ctrl->p_log = p_log; - p_ctrl->p_rcv = p_rcv; p_ctrl->p_disp = p_disp; @@ -119,7 +117,7 @@ osm_vla_rcv_ctrl_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_vla_rcv_ctrl_init: ERR 4001: " - "Dispatcher registration failed.\n" ); + "Dispatcher registration failed\n" ); status = IB_INSUFFICIENT_RESOURCES; goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/st.c b/trunk/ulp/opensm/user/opensm/st.c index a214eae2..de8b8bd4 100644 --- a/trunk/ulp/opensm/user/opensm/st.c +++ b/trunk/ulp/opensm/user/opensm/st.c @@ -39,7 +39,6 @@ #endif /* HAVE_CONFIG_H */ #include -#include #include #include @@ -99,17 +98,11 @@ static struct st_hash_type type_strhash = { #define xcalloc calloc #define xrealloc realloc #define xfree free -#if 0 -void *xmalloc(long); -void *xcalloc(long, long); -void *xrealloc(void *, long); -void xfree(void *); -#endif static void rehash(st_table *); -#define alloc(type) (type*)xmalloc((unsigned)sizeof(type)) -#define Calloc(n,s) (char*)xcalloc((n),(s)) +#define alloc(type) (type*)xmalloc(sizeof(type)) +#define Calloc(n,s) (char*)xcalloc((n), (s)) #define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)(((void*)x),((void *)y)) == 0) @@ -197,7 +190,7 @@ stat_col() st_table* st_init_table_with_size(type, size) struct st_hash_type *type; - int size; + size_t size; { st_table *tbl; @@ -235,7 +228,7 @@ st_init_numtable(void) st_table* st_init_numtable_with_size(size) - int size; + size_t size; { return st_init_table_with_size(&type_numhash, size); } @@ -248,7 +241,7 @@ st_init_strtable(void) st_table* st_init_strtable_with_size(size) - int size; + size_t size; { return st_init_table_with_size(&type_strhash, size); } @@ -260,7 +253,7 @@ st_free_table(table) register st_table_entry *ptr, *next; int i; - for(i = 0; i < table->num_bins; i++) { + for (i = 0; i < table->num_bins; i++) { ptr = table->bins[i]; while (ptr != 0) { next = ptr->next; @@ -311,7 +304,8 @@ st_lookup(table, key, value) return 0; } else { - if (value != 0) *value = ptr->record; + if (value != 0) + *value = ptr->record; return 1; } } @@ -383,7 +377,7 @@ rehash(table) new_num_bins = new_size(old_num_bins+1); new_bins = (st_table_entry**)Calloc(new_num_bins, sizeof(st_table_entry*)); - for(i = 0; i < old_num_bins; i++) { + for (i = 0; i < old_num_bins; i++) { ptr = table->bins[i]; while (ptr != 0) { next = ptr->next; @@ -404,7 +398,7 @@ st_copy(old_table) { st_table *new_table; st_table_entry *ptr, *entry; - int i, num_bins = old_table->num_bins; + size_t i, num_bins = old_table->num_bins; new_table = alloc(st_table); if (new_table == 0) @@ -414,7 +408,7 @@ st_copy(old_table) *new_table = *old_table; new_table->bins = (st_table_entry**) - Calloc((unsigned)num_bins, sizeof(st_table_entry*)); + Calloc(num_bins, sizeof(st_table_entry*)); if (new_table->bins == 0) { @@ -422,7 +416,7 @@ st_copy(old_table) return 0; } - for(i = 0; i < num_bins; i++) { + for (i = 0; i < num_bins; i++) { new_table->bins[i] = 0; ptr = old_table->bins[i]; while (ptr != 0) { @@ -471,7 +465,7 @@ st_delete(table, key, value) return 1; } - for(; ptr->next != 0; ptr = ptr->next) { + for (; ptr->next != 0; ptr = ptr->next) { if (EQUAL(table, ptr->next->key, *key)) { tmp = ptr->next; @@ -506,7 +500,7 @@ st_delete_safe(table, key, value, never) return 0; } - for(; ptr != 0; ptr = ptr->next) { + for (; ptr != 0; ptr = ptr->next) { if ((ptr->key != never) && EQUAL(table, ptr->key, *key)) { table->num_entries--; @@ -521,7 +515,7 @@ st_delete_safe(table, key, value, never) } static int -delete_never( st_data_t key, st_data_t value, st_data_t never) +delete_never(st_data_t key, st_data_t value, st_data_t never) { if (value == never) return ST_DELETE; return ST_CONTINUE; @@ -548,9 +542,9 @@ st_foreach(table, func, arg) enum st_retval retval; int i; - for(i = 0; i < table->num_bins; i++) { + for (i = 0; i < table->num_bins; i++) { last = 0; - for(ptr = table->bins[i]; ptr != 0;) { + for (ptr = table->bins[i]; ptr != 0;) { retval = (*func)(ptr->key, ptr->record, arg); switch (retval) { case ST_CONTINUE: diff --git a/trunk/ulp/opensm/user/osmtest/SOURCES b/trunk/ulp/opensm/user/osmtest/SOURCES index b2a4ff37..ebd11c57 100644 --- a/trunk/ulp/opensm/user/osmtest/SOURCES +++ b/trunk/ulp/opensm/user/osmtest/SOURCES @@ -52,6 +52,7 @@ TARGETLIBS=\ #DO NOT TOUCH the order of search path , until ib_types.h merging process will be done INCLUDES= \ + $(OSM_HOME)\osmtest\include; \ $(OSM_HOME)\include; \ $(OSM_HOME); \ $(WINIBHOME)\inc; \ diff --git a/trunk/ulp/opensm/user/osmtest/error.h b/trunk/ulp/opensm/user/osmtest/error.h deleted file mode 100644 index 11e25593..00000000 --- a/trunk/ulp/opensm/user/osmtest/error.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - - -/* - * Abstract: - * Declaration of error code ranges for the various osmtest modules. - * - * Environment: - * Linux User Mode - * - * $Revision: 1.2 $ - */ - - -/* - osmtest object - 0x0100 - 0x01FF - - parser object - 0x0200 - 0x02FF - - osmtest object - 0x0300 - 0x03FF - -*/ diff --git a/trunk/ulp/opensm/user/osmtest/include/error.h b/trunk/ulp/opensm/user/osmtest/include/error.h new file mode 100644 index 00000000..b2760c8c --- /dev/null +++ b/trunk/ulp/opensm/user/osmtest/include/error.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +/* + * Abstract: + * Declaration of error code ranges for the various osmtest modules. + * + * Environment: + * Linux User Mode + * + * $Revision: 1.2 $ + */ + + +/* + osmtest object + 0x0100 - 0x01FF + + parser object + 0x0200 - 0x02FF + + osmtest object + 0x0300 - 0x03FF + +*/ diff --git a/trunk/ulp/opensm/user/osmtest/include/osmt_inform.h b/trunk/ulp/opensm/user/osmtest/include/osmt_inform.h new file mode 100644 index 00000000..22b369a8 --- /dev/null +++ b/trunk/ulp/opensm/user/osmtest/include/osmt_inform.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +#ifndef __OSMT_INFORM__ +#define __OSMT_INFORM__ + +#ifdef OSM_VENDOR_INTF_MTL +#include +#include +#include "osmt_mtl_regular_qp.h" +#endif + +typedef struct _osmt_qp_ctx +{ +#ifdef OSM_VENDOR_INTF_MTL + osmt_mtl_mad_res_t qp_bind_hndl; +#endif + uint8_t *p_send_buf; + uint8_t *p_recv_buf; +#ifdef OSM_VENDOR_INTF_MTL + IB_MGT_mad_hndl_t ib_mgt_qp0_handle; +#endif +} +osmt_qp_ctx_t; + +ib_api_status_t +osmt_bind_inform_qp( IN osmtest_t * const p_osmt, + OUT osmt_qp_ctx_t *p_qp_ctx); + +void +osmt_unbind_inform_qp( IN osmtest_t * const p_osmt, + IN osmt_qp_ctx_t *p_qp_ctx); + + +ib_api_status_t +osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, + IN osmt_qp_ctx_t *p_qp_ctx, + IN ib_inform_info_t *p_inform_info, + IN uint8_t reg_flag + ); + +ib_api_status_t +osmt_trap_wait( IN osmtest_t * const p_osmt, + IN osmt_qp_ctx_t *p_qp_ctx + ); + +ib_api_status_t +osmt_init_inform_info(IN osmtest_t * const p_osmt, + OUT ib_inform_info_t* p_ii); + +ib_api_status_t +osmt_init_inform_info_by_trap (IN osmtest_t * const p_osmt, + IN ib_net16_t trap_num, + OUT ib_inform_info_t* p_ii); + +#endif /* __OSMT_INFORM__ */ diff --git a/trunk/ulp/opensm/user/osmtest/include/osmt_mtl_regular_qp.h b/trunk/ulp/opensm/user/osmtest/include/osmt_mtl_regular_qp.h new file mode 100644 index 00000000..83e68f05 --- /dev/null +++ b/trunk/ulp/opensm/user/osmtest/include/osmt_mtl_regular_qp.h @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +/* + * mad.h - + * Header file for common special QP resources creation code. + * + * Creation date: + * + * Version: osmt_mtl_regular_qp.h,v 1.2 2003/03/20 16:05:10 eitan + * + * Authors: + * Elazar Raab + * + * Changes: + */ + +#ifndef H_MAD_H +#define H_MAD_H + +#include +#include +#include +#include + + +#if defined(MAD_IN) || defined(MAD_OUT) +#error MACROS MAD_IN and MAD_OUT are in use, do not override +#endif +#define MAD_IN +#define MAD_OUT + + + +/* HCA Constants */ +#define HCA_ID "mt21108_pci0" +#define GRH_LEN 40 +#define KNOWN_QP1_QKEY 0x80010000 + + +#define MAX_OUTS_SQ 2 /* Max. buffers posted for requests in SQ */ +#define MAX_OUTS_RQ 5 /* Max. buffers posted for responses in RQ */ + +#define MAX_POLL_CNT 300 +#define POLL_SLEEP 1 /* for usleep */ + +#define MAD_SIZE 256 /* MADs are always 256B */ +#define MAD_ATTR_OFFSET 16 +#define MAD_TID_OFFSET 8 + + + + +/* Verbs SQP resources handles */ +typedef struct { + VAPI_hca_id_t hca_id; /*id of HCA*/ + u_int8_t port_num; /* the port num to use */ + VAPI_hca_hndl_t hca_hndl; /*handle of HCA*/ + VAPI_qp_hndl_t qp_hndl; /*handle of QP I use*/ + VAPI_mr_hndl_t mr_hndl; /*handle of memory region*/ + VAPI_cq_hndl_t rq_cq_hndl, sq_cq_hndl; /*handle of send & receive completion Queues*/ + VAPI_pd_hndl_t pd_hndl; /*handle of Partition Domain*/ + /* VAPI_ud_av_hndl_t av_hndl;*/ + IB_lid_t slid; /*LID*/ + void *buf_ptr; /*mem buffer for outstanding pkts*/ + MT_size_t buf_size; /*size of mem buffer for outstanding pkts*/ + + u_int32_t max_outs_sq; /*max # of outstanding pkts in send queue*/ + u_int32_t max_outs_rq; /*max # of outstanding pkts in receive queue*/ + + IB_rkey_t l_key; /*my l_key for memory regions*/ + VAPI_qkey_t qkey; /*my qkey*/ + + EVAPI_compl_handler_hndl_t rq_cq_eventh, sq_cq_eventh; /* event handlers for polling */ + + bool is_sqp; /* relate to union below - my QP*/ + union { + VAPI_special_qp_t sqp_type; + VAPI_qp_num_t qp_num; + } qp_id; + void *wait_q; +} osmt_mtl_mad_res_t; + + +/* init an osmt_mtl_mad_res_t with all resources initialized (use functions below) */ +VAPI_ret_t osmt_mtl_init( + osmt_mtl_mad_res_t* res /*pointer to res (resources) struct*/ + ); +VAPI_ret_t osmt_mtl_init_opened_hca( + osmt_mtl_mad_res_t* res /*pointer to res (resources) struct*/ + ); + +/* Cleanup all resources of (which are valid) in res */ +VAPI_ret_t osmt_mtl_mad_cleanup( + osmt_mtl_mad_res_t *res /*pointer to res (resources) struct*/ + ); + + +/* create CQs and QP as given in res->is_sqp (if TRUE, get special QP) */ +VAPI_ret_t osmt_mtl_get_qp_resources( + osmt_mtl_mad_res_t *res /*pointer to res (resources) struct*/ +); + + +/* move QP to RTS state */ +VAPI_ret_t osmt_mtl_mad_qp_init( + osmt_mtl_mad_res_t *res /*max number of outstanding packets allowed in send queue*/ + ); + + +/* create and register res->buf_ptr */ +VAPI_ret_t osmt_mtl_mad_create_mr( + osmt_mtl_mad_res_t *res /*pointer to res (resources) struct*/ + ); + +VAPI_ret_t osmt_mtl_create_av( + osmt_mtl_mad_res_t* res, /* pointer to res (resources) struct*/ + int16_t dlid, /*destination lid */ + VAPI_ud_av_hndl_t *avh_p /* address vectr handle to update */ +); + +/* Send MAD to given dest QP*/ +VAPI_ret_t osmt_mtl_mad_send( + osmt_mtl_mad_res_t* res, /*pointer to res (resources) struct*/ + VAPI_wr_id_t id, /*wqe ID*/ + void* mad, /*mad buffer to send*/ + VAPI_qp_num_t dest_qp, /*destination QP*/ + IB_sl_t sl, /*Service Level*/ + u_int32_t dest_qkey, /*Destination QP KEY*/ + VAPI_ud_av_hndl_t avh /* address vectr handle to use */ +); + + +/* post buffers to RQ. returns num of buffers actually posted */ +int osmt_mtl_mad_post_recv_bufs( + osmt_mtl_mad_res_t* res, /*pointer to res (resources) struct*/ + void *buf_array, /*array of receive buffers*/ + u_int32_t num_o_bufs, /*number of receive buffers*/ + u_int32_t size, /* size of expected receive packet - MAD*/ + VAPI_wr_id_t start_id /* start id for receive buffers*/ +); + + +/* Poll given CQ for completion max_poll times (POLL_SLEEP [usec] delays). result in wc_desc_p. */ +#ifndef __KERNEL__ +VAPI_ret_t osmt_mtl_mad_poll4cqe( + VAPI_hca_hndl_t hca, /*handle for HCA*/ + VAPI_cq_hndl_t cq, /*handle for Completion Queue - Rcv/Send */ + VAPI_wc_desc_t *wc_desc_p, /*handle of cqe */ + u_int32_t max_poll, /*number of polling iterations*/ + u_int32_t poll_sleep, /*timeout for each polling */ + VAPI_ud_av_hndl_t *avh_p /* address vectopr handle to cleanup */ + ); +#endif + + +#endif diff --git a/trunk/ulp/opensm/user/osmtest/include/osmtest.h b/trunk/ulp/opensm/user/osmtest/include/osmtest.h new file mode 100644 index 00000000..4cfa8672 --- /dev/null +++ b/trunk/ulp/opensm/user/osmtest/include/osmtest.h @@ -0,0 +1,508 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +/* + * Abstract: + * Declaration of osmtest_t. + * This object represents the OSMTest Test object. + * + * Environment: + * Linux User Mode + * + * $Revision: 1.6 $ + */ + +#ifndef _OSMTEST_H_ +#define _OSMTEST_H_ + +#include +#include +#include +#include +#include +#include +#include "osmtest_base.h" +#include "osmtest_subnet.h" + +/****s* OpenSM: Subnet/osmtest_opt_t + * NAME + * osmtest_opt_t + * + * DESCRIPTION + * Subnet options structure. This structure contains the various + * site specific configuration parameters for osmtest. + * + * SYNOPSIS + */ +typedef struct _osmtest_opt +{ + uint32_t transaction_timeout; + boolean_t force_log_flush; + boolean_t create; + uint32_t retry_count; + uint32_t stress; + uint32_t mmode; + char file_name[OSMTEST_FILE_PATH_MAX]; + uint8_t flow; + uint8_t wait_time; + char *log_file; + boolean_t ignore_path_records; +} +osmtest_opt_t; + +/* + * FIELDS + * + * SEE ALSO + *********/ + +/****h* OSMTest/OSMTest + * NAME + * OSMTest + * + * DESCRIPTION + * The OSMTest object tests an SM/SA for conformance to a known + * set of data about an Infiniband subnet. + * + * AUTHOR + * Steve King, Intel + * + *********/ + + + +/****s* OSMTest/osmtest_t + * NAME + * osmtest_t + * + * DESCRIPTION + * OSMTest structure. + * + * This object should be treated as opaque and should + * be manipulated only through the provided functions. + * + * SYNOPSIS + */ +typedef struct _osmtest +{ + osm_log_t log; + struct _osm_vendor *p_vendor; + osm_bind_handle_t h_bind; + osm_mad_pool_t mad_pool; + + osmtest_opt_t opt; + ib_port_attr_t local_port; + subnet_t exp_subn; + cl_qpool_t node_pool; + cl_qpool_t port_pool; + cl_qpool_t link_pool; + + uint16_t max_lid; +} +osmtest_t; + +/* + * FIELDS + * log + * Log facility used by all OSMTest components. + * + * p_vendor + * Pointer to the vendor transport layer. + * + * h_bind + * The bind handle obtained by osm_vendor_sa_api/osmv_bind_sa + * + * mad_pool + * The mad pool provided for teh vendor layer to allocate mad wrappers in + * + * opt + * osmtest options structure + * + * local_port + * Port attributes for the port over which osmtest is running. + * + * exp_subn + * Subnet object representing the expected subnet + * + * node_pool + * Pool of objects for use in populating the subnet databases. + * + * port_pool + * Pool of objects for use in populating the subnet databases. + * + * link_pool + * Pool of objects for use in populating the subnet databases. + * + * SEE ALSO + *********/ + +/****s* OpenSM: Subnet/osmtest_req_context_t + * NAME + * osmtest_req_context_t + * + * DESCRIPTION + * Query context for ib_query callback function. + * + * SYNOPSIS + */ +typedef struct _osmtest_req_context +{ + osmtest_t *p_osmt; + osmv_query_res_t result; + +} +osmtest_req_context_t; + + +typedef struct _osmtest_mgrp_t +{ + cl_map_item_t map_item; + ib_member_rec_t mcmember_rec; +} osmtest_mgrp_t; + + +/* + * FIELDS + * + * SEE ALSO + *********/ + +/****f* OSMTest/osmtest_construct + * NAME + * osmtest_construct + * + * DESCRIPTION + * This function constructs an OSMTest object. + * + * SYNOPSIS + */ +void osmtest_construct( IN osmtest_t * const p_osmt ); + +/* + * PARAMETERS + * p_osmt + * [in] Pointer to a OSMTest object to construct. + * + * RETURN VALUE + * This function does not return a value. + * + * NOTES + * Allows calling osmtest_init, osmtest_destroy. + * + * Calling osmtest_construct is a prerequisite to calling any other + * method except osmtest_init. + * + * SEE ALSO + * SM object, osmtest_init, osmtest_destroy + *********/ + +/****f* OSMTest/osmtest_destroy + * NAME + * osmtest_destroy + * + * DESCRIPTION + * The osmtest_destroy function destroys an osmtest object, releasing + * all resources. + * + * SYNOPSIS + */ +void osmtest_destroy( IN osmtest_t * const p_osmt ); + +/* + * PARAMETERS + * p_osmt + * [in] Pointer to a OSMTest object to destroy. + * + * RETURN VALUE + * This function does not return a value. + * + * NOTES + * Performs any necessary cleanup of the specified OSMTest object. + * Further operations should not be attempted on the destroyed object. + * This function should only be called after a call to osmtest_construct or + * osmtest_init. + * + * SEE ALSO + * SM object, osmtest_construct, osmtest_init + *********/ + +/****f* OSMTest/osmtest_init + * NAME + * osmtest_init + * + * DESCRIPTION + * The osmtest_init function initializes a OSMTest object for use. + * + * SYNOPSIS + */ +ib_api_status_t osmtest_init( IN osmtest_t * const p_osmt, + IN const osmtest_opt_t * const p_opt, + IN const osm_log_level_t log_flags + ); + +/* + * PARAMETERS + * p_osmt + * [in] Pointer to an osmtest_t object to initialize. + * + * p_opt + * [in] Pointer to the options structure. + * + * log_flags + * [in] Log level flags to set. + * + * RETURN VALUES + * IB_SUCCESS if the OSMTest object was initialized successfully. + * + * NOTES + * Allows calling other OSMTest methods. + * + * SEE ALSO + * SM object, osmtest_construct, osmtest_destroy + *********/ + +/****f* OSMTest/osmtest_run + * NAME + * osmtest_run + * + * DESCRIPTION + * Runs the osmtest suite. + * + * SYNOPSIS + */ +ib_api_status_t osmtest_run( IN osmtest_t * const p_osmt ); + +/* + * PARAMETERS + * p_osmt + * [in] Pointer to an osmtest_t object. + * + * guid + * [in] Port GUID over which to run the test suite. + * + * RETURN VALUES + * IB_SUCCESS + * + * NOTES + * + * SEE ALSO + *********/ + +/****f* OSMTest/osmtest_bind + * NAME + * osmtest_bind + * + * DESCRIPTION + * Binds osmtest to a local port. + * + * SYNOPSIS + */ +ib_api_status_t osmtest_bind( IN osmtest_t * p_osmt, + IN uint16_t max_lid, + IN ib_net64_t guid OPTIONAL ); + +/* + * PARAMETERS + * p_osmt + * [in] Pointer to an osmtest_t object. + * + * max_lid + * [in] The maximal lid to query about (if RMPP is not supported) + * + * guid + * [in] Port GUID over which to run the test suite. + * If zero, the bind function will display a menu of local + * port guids and wait for user input. + * + * RETURN VALUES + * IB_SUCCESS + * + * NOTES + * + * SEE ALSO + *********/ + +/****f* OSMTest/osmtest_query_res_cb + * NAME + * osmtest_query_res_cb + * + * DESCRIPTION + * A Callback for the query to invoke on completion + * + * SYNOPSIS + */ +void +osmtest_query_res_cb( IN osmv_query_res_t * p_rec ); +/* + * PARAMETERS + * p_rec + * [in] Pointer to an ib_query_rec_t object used for the query. + * + * RETURN VALUES + * NONE + * + * NOTES + * + * SEE ALSO + *********/ + +/****f* OSMTest/ib_get_mad_status_str + * NAME + * ib_get_mad_status_str + * + * DESCRIPTION + * return the string representing the given mad status + * + * SYNOPSIS + */ +const char * +ib_get_mad_status_str( IN const ib_mad_t * const p_mad ); +/* + * PARAMETERS + * p_mad + * [in] Pointer to the mad payload + * + * RETURN VALUES + * NONE + * + * NOTES + * + * SEE ALSO + *********/ + +/****f* OSMTest/osmt_run_service_records_flow + * NAME + * osmt_run_service_records_flow + * + * DESCRIPTION + * Run the service record testing flow. + * + * SYNOPSIS + */ +ib_api_status_t osmt_run_service_records_flow( IN osmtest_t * const p_osmt ); +/* + * PARAMETERS + * p_osmt + * [in] Pointer to the osmtest obj + * + * RETURN VALUES + * IB_SUCCESS if PASS + * + * NOTES + * + * SEE ALSO + *********/ + +ib_api_status_t +osmt_run_inform_info_flow( IN osmtest_t * const p_osmt ); + +/****f* OSMTest/osmt_run_slvl_and_vlarb_records_flow + * NAME + * osmt_run_slvl_and_vlarb_records_flow + * + * DESCRIPTION + * Run the sl2vl and vlarb tables testing flow. + * + * SYNOPSIS + */ +ib_api_status_t +osmt_run_slvl_and_vlarb_records_flow( IN osmtest_t * const p_osmt ); +/* + * PARAMETERS + * p_osmt + * [in] Pointer to the osmtest obj + * + * RETURN VALUES + * IB_SUCCESS if PASS + * + * NOTES + * + * SEE ALSO + *********/ + + +/****f* OSMTest/osmt_run_mcast_flow + * NAME + * osmt_run_mcast_flow + * + * DESCRIPTION + * Run the multicast test flow + * + * SYNOPSIS + */ +ib_api_status_t + osmt_run_mcast_flow( IN osmtest_t * const p_osmt ); +/* + * PARAMETERS + * p_osmt + * [in] Pointer to the osmtest obj + * + * RETURN VALUES + * IB_SUCCESS if PASS + * + * NOTES + * + * SEE ALSO + *********/ + +/****f* OSMTest/osmt_run_trap64_65_flow + * NAME + * osmt_run_trap64_65_flow + * + * DESCRIPTION + * Run the trap 64/65 test flow. This test is ran with + * an outside tool. + * + * SYNOPSIS + */ +ib_api_status_t +osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt ); +/* + * PARAMETERS + * p_osmt + * [in] Pointer to the osmtest obj + * + * RETURN VALUES + * IB_SUCCESS if PASS + * + * NOTES + * + * SEE ALSO + *********/ + +ib_api_status_t +osmtest_get_all_recs( IN osmtest_t * const p_osmt, + IN ib_net16_t const attr_id, + IN size_t const attr_size, + IN OUT osmtest_req_context_t * const p_context ); +#endif /* _OSMTEST_H_ */ diff --git a/trunk/ulp/opensm/user/osmtest/include/osmtest_base.h b/trunk/ulp/opensm/user/osmtest/include/osmtest_base.h new file mode 100644 index 00000000..914896ec --- /dev/null +++ b/trunk/ulp/opensm/user/osmtest/include/osmtest_base.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +/* + * Abstract: + * Declaration of osmtest_t. + * This object represents the OSMTest Test object. + * + * Environment: + * Linux User Mode + * + * $Revision: 1.2 $ + */ +#ifndef _OSMTEST_BASE_H_ +#define _OSMTEST_BASE_H_ + +#ifndef __WIN__ +#include +#else +#include +#endif + +#define OSMTEST_MAX_LINE_LEN 120 +#ifdef WIN32 +#define OSMTEST_FILE_PATH_MAX 4096 +#else +#define OSMTEST_FILE_PATH_MAX PATH_MAX +#endif + +#define STRESS_SMALL_RMPP_THR 100000 +/* + Take long times when quering big clusters (over 40 nodes) , an average of : 0.25 sec for query + each query receives 1000 records +*/ +#define STRESS_LARGE_RMPP_THR 4000 +#define STRESS_LARGE_PR_RMPP_THR 20000 + +extern const char *const p_file; + +#endif /* _OSMTEST_BASE_H_ */ diff --git a/trunk/ulp/opensm/user/osmtest/include/osmtest_subnet.h b/trunk/ulp/opensm/user/osmtest/include/osmtest_subnet.h new file mode 100644 index 00000000..5dcc5d3b --- /dev/null +++ b/trunk/ulp/opensm/user/osmtest/include/osmtest_subnet.h @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +/* + * Abstract: + * Declaration of osmtest_t. + * This object represents the OSMTest Test object. + * + * Environment: + * Linux User Mode + * + * $Revision: 1.2 $ + */ + +#ifndef _OSMTEST_SUBNET_H_ +#define _OSMTEST_SUBNET_H_ + +#include +#include +#include +#include +#include + + +/****s* Subnet Database/generic_t +* NAME +* generic_t +* +* DESCRIPTION +* Subnet database object for fields common to all record types. +* All other database types must be castable to this type. +* +* SYNOPSIS +*/ +typedef struct _generic +{ + cl_map_item_t map_item; /* must be first element! */ + uint32_t count; /* must be second element! */ + +} +generic_t; + +/* +* FIELDS +* +* SEE ALSO +*********/ + +/****s* Subnet Database/node_t +* NAME +* node_t +* +* DESCRIPTION +* Subnet database object for nodes. +* Must be castable to generic_t. +* +* SYNOPSIS +*/ +typedef struct _node +{ + cl_map_item_t map_item; /* must be first element! */ + uint32_t count; /* must be second element! */ + ib_node_record_t rec; + ib_node_record_t comp; + +} +node_t; + +/* +* FIELDS +* map_item +* Provides linkage for the qmap container. +* +* rec +* NodeRecord for this node as read from the database file. +* +* comp +* NodeRecord indicating which fields should be compared against rec. +* Bits set in the comp NodeRecord indicate that bit in the rec structure +* should be compared against real-time data from the SA. +* +* count +* Utility counter used by the validation logic. Typically used to +* to indicate the number of times a matching node was received from +* the SA. +* +* SEE ALSO +*********/ + +static inline node_t * +node_new( void ) +{ + node_t *p_obj; + + p_obj = cl_zalloc( sizeof( *p_obj ) ); + return ( p_obj ); +} + +static inline void +node_delete( IN node_t * p_obj ) +{ + cl_free( p_obj ); +} + +/****s* Subnet Database/port_t +* NAME +* port_t +* +* DESCRIPTION +* Subnet database object for ports. +* Must be castable to generic_t. +* +* SYNOPSIS +*/ +typedef struct _port +{ + cl_map_item_t map_item; /* must be first element! */ + uint32_t count; /* must be second element! */ + /* Since there is no uniq identifier for all ports we + must be able to have such a key by the lid and port num */ + uint64_t port_id; + ib_portinfo_record_t rec; + ib_portinfo_record_t comp; +} +port_t; + +/* +* FIELDS +* +* map_item +* Provides linkage for the qmap container. +* +* rec +* PortInfoRecord for this port as read from the database file. +* +* comp +* PortInfoRecord indicating which fields should be compared against rec. +* Bits set in the comp NodeRecord indicate that bit in the rec structure +* should be compared against real-time data from the SA. +* +* count +* Utility counter used by the validation logic. Typically used to +* to indicate the number of times a matching node was received from +* the SA. +* +* SEE ALSO +*********/ + +static inline port_t * +port_new( void ) +{ + port_t *p_obj; + + p_obj = cl_zalloc( sizeof( *p_obj ) ); + return ( p_obj ); +} + +static inline void +port_delete( IN port_t * p_obj ) +{ + cl_free( p_obj ); +} + + +static inline uint64_t +port_gen_id( + IN ib_net16_t const lid, + IN uint8_t const port_num) +{ + return( lid << 8 | port_num ); +} + +static inline void +port_ext_id( IN uint64_t id, + IN ib_net16_t *p_lid, + IN uint8_t *p_port_num) +{ + CL_ASSERT( (id & 0xFF) < 0x100 ); + *p_port_num = (uint8_t)(id & 0xFF); + CL_ASSERT( ((id >> 8) & 0xFFFF) < 0x10000 ); + *p_lid = (uint16_t)((id >> 8) & 0xFFFF); +} + +static inline void +port_set_id( IN port_t * p_obj, + IN ib_net16_t const lid, + IN uint8_t const port_num) +{ + p_obj->port_id = port_gen_id(lid, port_num); +} + +static inline void +port_get_id( IN port_t * p_obj, + IN ib_net16_t *p_lid, + IN uint8_t *p_port_num) +{ + port_ext_id(p_obj->port_id, p_lid, p_port_num); +} + +/****s* Subnet Database/path_t +* NAME +* node_t +* +* DESCRIPTION +* Subnet database object for paths. +* Must be castable to generic_t. +* +* SYNOPSIS +*/ +typedef struct _path +{ + cl_map_item_t map_item; /* must be first element! */ + uint32_t count; /* must be second element! */ + ib_path_rec_t rec; + ib_path_rec_t comp; + +} +path_t; + +/* +* FIELDS +* map_item +* Provides linkage for the qmap container. +* +* rec +* PathRecord for this path as read from the database file. +* +* comp +* PathRecord indicating which fields should be compared against rec. +* Bits set in the comp PathRecord indicate that bit in the rec structure +* should be compared against real-time data from the SA. +* +* count +* Utility counter used by the validation logic. Typically used to +* to indicate the number of times a matching node was received from +* the SA. +* +* SEE ALSO +*********/ + +static inline path_t * +path_new( void ) +{ + path_t *p_obj; + + p_obj = cl_zalloc( sizeof( *p_obj ) ); + return ( p_obj ); +} + +static inline void +path_delete( IN path_t * p_obj ) +{ + cl_free( p_obj ); +} + +/****s* Subnet Database/subnet_t +* NAME +* subnet_t +* +* DESCRIPTION +* Subnet database object. +* +* SYNOPSIS +*/ +typedef struct _subnet +{ + cl_qmap_t node_lid_tbl; + cl_qmap_t node_guid_tbl; + cl_qmap_t mgrp_mlid_tbl; + /* cl_qmap_t port_lid_tbl; */ + /* cl_qmap_t port_guid_tbl; */ + cl_qmap_t port_key_tbl; + cl_qmap_t link_tbl; + cl_qmap_t path_tbl; + +} +subnet_t; + +/* +* FIELDS +* +* SEE ALSO +*********/ + +/****f* Subnet Database/subnet_init +* NAME +* subnet_init +* +* DESCRIPTION +* This function constructs an subnet database object. +* This function cannot fail. +* +* SYNOPSIS +*/ +void subnet_construct( IN subnet_t * const p_subn ); + +/* +* FIELDS +* +* SEE ALSO +*********/ + +/****f* Subnet Database/subnet_init +* NAME +* subnet_init +* +* DESCRIPTION +* This function initializes an subnet database object. +* +* SYNOPSIS +*/ +cl_status_t subnet_init( IN subnet_t * const p_subn ); + +/* +* FIELDS +* +* SEE ALSO +*********/ + +#endif diff --git a/trunk/ulp/opensm/user/osmtest/main.c b/trunk/ulp/opensm/user/osmtest/main.c index 6f7affb7..b78caaac 100644 --- a/trunk/ulp/opensm/user/osmtest/main.c +++ b/trunk/ulp/opensm/user/osmtest/main.c @@ -31,8 +31,6 @@ * $Id$ */ - - /* * Abstract: * Command line interface for osmtest. @@ -45,9 +43,6 @@ #include #include -#ifndef __WIN__ -#include -#endif #include #include "osmtest.h" @@ -161,8 +156,8 @@ show_usage( ) " --- -----------------\n" " -M1 - Short Multicast Flow (default) - single mode.\n" " -M2 - Short Multicast Flow - multiple mode.\n" - " -M3 - Long MultiCast Flow - single mode.\n" - " -M4 - Long MultiCast Flow - mutiple mode.\n" + " -M3 - Long Multicast Flow - single mode.\n" + " -M4 - Long Multicast Flow - multiple mode.\n" " Single mode - Osmtest is tested alone , with no other \n" " apps that interact vs. OpenSM MC.\n" " Multiple mode - Could be run with other apps using MC vs.\n" @@ -259,7 +254,7 @@ main( int argc, {"guid", 1, NULL, 'g'}, {"help", 0, NULL, 'h'}, {"stress", 1, NULL, 's'}, - {"MultiCast_Mode", 1, NULL, 'M'}, + {"Multicast_Mode", 1, NULL, 'M'}, {"timeout", 1, NULL, 't'}, {"verbose", 0, NULL, 'v'}, {"log_file", 1, NULL, 'l'}, @@ -287,7 +282,6 @@ main( int argc, { next_option = getopt_long_only( argc, argv, short_option, long_option, NULL ); - switch ( next_option ) { case 'c': @@ -376,7 +370,6 @@ main( int argc, guid = cl_hton64( strtoull( optarg, NULL, 16 )); printf( "\tGUID 0x%016" PRIx64 "\n", guid ); break; - case 't': /* * Specifies transaction timeout. @@ -436,7 +429,7 @@ main( int argc, * Perform stress test. */ opt.mmode = strtol( optarg, NULL, 0 ); - printf( "\tMultiCast test enabled: " ); + printf( "\tMulticast test enabled: " ); switch ( opt.mmode ) { case 1: @@ -512,7 +505,7 @@ main( int argc, status = osmtest_init( &osm_test, &opt, ( osm_log_level_t ) log_flags ); if( status != IB_SUCCESS ) { - printf( "\nError from osm_osmtest_init: %s.\n", + printf( "\nError from osmtest_init: %s.\n", ib_get_err_str( status ) ); goto Exit; } @@ -534,10 +527,6 @@ main( int argc, if (mem_track) cl_mem_display(); -#ifndef __WIN__ - complib_exit(); -#endif - Exit: return ( status ); } diff --git a/trunk/ulp/opensm/user/osmtest/osmt_inform.c b/trunk/ulp/opensm/user/osmtest/osmt_inform.c index 98414032..e03c4305 100644 --- a/trunk/ulp/opensm/user/osmtest/osmt_inform.c +++ b/trunk/ulp/opensm/user/osmtest/osmt_inform.c @@ -1,39 +1,37 @@ /* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * * $Id$ */ - #ifdef OSM_VENDOR_INTF_MTL - /* * Abstract: * Implementation of InformInfo testing flow.. @@ -57,7 +55,7 @@ #include #include -#include +#include #include "osmtest.h" #include "osmt_inform.h" @@ -75,6 +73,7 @@ osmt_bind_inform_qp( IN osmtest_t * const p_osmt, uint32_t port_num; VAPI_ret_t vapi_ret; IB_MGT_ret_t mgt_ret; + uint8_t hca_index; osm_log_t *p_log = &p_osmt->log; ib_api_status_t status = IB_SUCCESS; @@ -93,8 +92,13 @@ osmt_bind_inform_qp( IN osmtest_t * const p_osmt, port_guid ); mgt_ret = - osm_vendor_get_guid_ca_and_port( p_osmt->p_vendor, port_guid, - &hca_hndl,&hca_id[0], &port_num ); + osm_vendor_get_guid_ca_and_port( + p_osmt->p_vendor, + port_guid, + &hca_hndl, + &hca_id[0], + &hca_index, + &port_num ); if( mgt_ret != IB_MGT_OK ) { osm_log( p_log, OSM_LOG_ERROR, @@ -201,6 +205,7 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, static VAPI_wr_id_t wrid = 16198; osm_log_t *p_log = &p_osmt->log; ib_api_status_t status = IB_SUCCESS; + OSM_LOG_ENTER( &p_osmt->log, osmt_reg_unreg_inform_info ); /* init the MAD */ @@ -221,14 +226,14 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, { osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_reg_unreg_inform_info: " - "Subscribing InformInfo: Traps from lid:0x%X to 0x%X , trap num :0x%X.\n", + "Subscribing InformInfo: Traps from lid:0x%X to 0x%X, trap num :0x%X.\n", p_ii->lid_range_begin,p_ii->lid_range_end,p_ii->g_or_v.generic.trap_num); } else { osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_reg_unreg_inform_info: " - "Un Subscribing InformInfo: Traps from lid:0x%X to 0x%X.\n", + "UnSubscribing InformInfo: Traps from lid:0x%X to 0x%X.\n", p_ii->lid_range_begin, p_ii->lid_range_end); } @@ -241,8 +246,8 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, { p_ii->subscribe = 0; /* - * we need to set the QPN on the mad if we un-subsribe: - * o13-2.1.1 - QPN Field need to be set when un-subscribing. + * we need to set the QPN on the mad if we unsubscribe: + * o13-2.1.1 - QPN Field need to be set when unsubscribing. */ ib_inform_info_set_qpn(p_ii, cl_hton32(p_qp_ctx->qp_bind_hndl.qp_id.qp_num)); @@ -260,13 +265,13 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, wrid) != 1) { osm_log( p_log, OSM_LOG_ERROR, "osmt_reg_unreg_inform_info: ERR 0120: " - "Error posting recv bufs .\n"); + "Error posting recv bufs.\n"); status = IB_ERROR; goto Exit; } osm_log( p_log, OSM_LOG_DEBUG, "osmt_reg_unreg_inform_info: " - "Posted recv bufs .\n"); + "Posted recv bufs.\n"); vapi_ret = osmt_mtl_create_av(&p_qp_ctx->qp_bind_hndl, p_osmt->local_port.sm_lid, &avh); if (vapi_ret != VAPI_OK) @@ -364,7 +369,7 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, goto Exit; } - /* check to see if successful - by exmaine of the subscribe bit */ + /* check to see if successful - by examination of the subscribe bit */ p_sa_mad = (ib_sa_mad_t *)(p_qp_ctx->p_recv_buf + GRH_LEN); if (p_sa_mad->status != IB_SUCCESS) @@ -406,7 +411,6 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, status = IB_REMOTE_ERROR; } - Exit: OSM_LOG_EXIT( &p_osmt->log ); return status; @@ -414,7 +418,7 @@ osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, /* * Send a trap (Subn LID Route) Trap(Notice) through the regular - * connection QP connection (targetted at QP0) + * connection QP connection (targeted at QP0) * * Wait for the trap repress */ @@ -555,7 +559,7 @@ osmt_send_trap_wait_for_forward( IN osmtest_t * const p_osmt, goto Exit; } - /* check to see if successful - by exmaine of the subscribe bit */ + /* check to see if successful - by examination of the subscribe bit */ p_sa_mad = (ib_sa_mad_t *)(p_qp_ctx->p_recv_buf + GRH_LEN); if (p_sa_mad->method == IB_MAD_METHOD_REPORT) @@ -580,7 +584,7 @@ osmt_send_trap_wait_for_forward( IN osmtest_t * const p_osmt, { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_send_trap_wait_for_forward: ERR 1020" - "Receive an Un-Expected Method:%d.\n", + "Received an Unexpected Method:%d.\n", p_smp->method ); } @@ -590,11 +594,6 @@ osmt_send_trap_wait_for_forward( IN osmtest_t * const p_osmt, return status; } - - - - - /* * Wait for a trap on QPn * @@ -647,7 +646,7 @@ osmt_trap_wait( IN osmtest_t * const p_osmt, goto Exit; } - /* check to see if successful - by exmaine of the subscribe bit */ + /* check to see if successful - by examination of the subscribe bit */ p_sa_mad = (ib_sa_mad_t *)(p_qp_ctx->p_recv_buf + GRH_LEN); if (p_sa_mad->method == IB_MAD_METHOD_REPORT) @@ -672,7 +671,7 @@ osmt_trap_wait( IN osmtest_t * const p_osmt, { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_trap_wait: ERR 1020" - "Receive an Un-Expected Method:%d.\n", + "Received an Unexpected Method:%d.\n", p_smp->method ); } @@ -719,6 +718,7 @@ osmt_init_inform_info_by_trap (IN osmtest_t * const p_osmt, p_ii->g_or_v.generic.node_type_msb = 0xFF; /* ALL */ return IB_SUCCESS; } + /* * Run a complete inform info test flow: * - try to unregister inform info (should fail) @@ -747,7 +747,7 @@ osmt_run_inform_info_flow( IN osmtest_t * const p_osmt ) { /* init the inform info */ osmt_init_inform_info(p_osmt, &inform_info); - /* first try to un-subscribe */ + /* first try to unsubscribe */ status = osmt_reg_unreg_inform_info(p_osmt, &qp_ctx, &inform_info, @@ -794,7 +794,7 @@ osmt_run_inform_info_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - /* try to un-subscribe for cleanup */ + /* try to unsubscribe for cleanup */ status = osmt_reg_unreg_inform_info(p_osmt, &qp_ctx, &inform_info, @@ -820,14 +820,12 @@ osmt_run_inform_info_flow( IN osmtest_t * const p_osmt ) { } } - Exit: osmt_unbind_inform_qp( p_osmt, &qp_ctx); OSM_LOG_EXIT( &p_osmt->log ); return status; } - /* * Run a complete inform info test flow: * - try to unregister inform info (should fail) @@ -858,9 +856,6 @@ osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt) { cl_hton16(64), &inform_info); - - - /* send the inform info registration */ status = osmt_reg_unreg_inform_info(p_osmt, &qp_ctx, @@ -875,7 +870,7 @@ osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt) { if (osmt_mtl_mad_post_recv_bufs( &qp_ctx.qp_bind_hndl, qp_ctx.p_recv_buf, - 1, /* we need to reveive the report */ + 1, /* we need to receive the report */ GRH_LEN + MAD_BLOCK_SIZE, 1) != 1) { osm_log( &p_osmt->log, OSM_LOG_ERROR, @@ -894,7 +889,6 @@ osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt) { cl_hton16(65), &inform_info); - /* send the inform info registration */ status = osmt_reg_unreg_inform_info(p_osmt, &qp_ctx, @@ -924,7 +918,7 @@ osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt) { /* Sleep for x seconds in order to allow external script trap generation */ /* sleep (p_osmt->opt.wait_time); */ - /* wait for a trap on QPN */ + /* wait for a trap on QPN */ status = osmt_trap_wait(p_osmt, &qp_ctx); if (status != IB_SUCCESS) { @@ -935,8 +929,7 @@ osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt) { goto Exit; } - - /* try to un-subscribe for cleanup */ + /* try to unsubscribe for cleanup */ status = osmt_reg_unreg_inform_info(p_osmt, &qp_ctx, &inform_info, @@ -951,14 +944,10 @@ osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt) { goto Exit; } - Exit: osmt_unbind_inform_qp( p_osmt, &qp_ctx); OSM_LOG_EXIT( &p_osmt->log ); return status; } - - #endif /* OSM_VENDOR_INTF_MTL */ - diff --git a/trunk/ulp/opensm/user/osmtest/osmt_inform.h b/trunk/ulp/opensm/user/osmtest/osmt_inform.h deleted file mode 100644 index 866641bb..00000000 --- a/trunk/ulp/opensm/user/osmtest/osmt_inform.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - -#ifndef __OSMT_INFORM__ -#define __OSMT_INFORM__ - -#include -#include -#include "osmt_mtl_regular_qp.h" - -typedef struct _osmt_qp_ctx -{ - osmt_mtl_mad_res_t qp_bind_hndl; - uint8_t *p_send_buf; - uint8_t *p_recv_buf; - IB_MGT_mad_hndl_t ib_mgt_qp0_handle; -} -osmt_qp_ctx_t; - -ib_api_status_t -osmt_bind_inform_qp( IN osmtest_t * const p_osmt, - OUT osmt_qp_ctx_t *p_qp_ctx); - -void -osmt_unbind_inform_qp( IN osmtest_t * const p_osmt, - IN osmt_qp_ctx_t *p_qp_ctx); - - -ib_api_status_t -osmt_reg_unreg_inform_info( IN osmtest_t *p_osmt, - IN osmt_qp_ctx_t *p_qp_ctx, - IN ib_inform_info_t *p_inform_info, - IN uint8_t reg_flag - ); - -ib_api_status_t -osmt_trap_wait( IN osmtest_t * const p_osmt, - IN osmt_qp_ctx_t *p_qp_ctx - ); - -ib_api_status_t -osmt_init_inform_info(IN osmtest_t * const p_osmt, - OUT ib_inform_info_t* p_ii); - -ib_api_status_t -osmt_init_inform_info_by_trap (IN osmtest_t * const p_osmt, - IN ib_net16_t trap_num, - OUT ib_inform_info_t* p_ii); - -#endif // __OSMT_INFORM__ diff --git a/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.c b/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.c index 06347d98..0afcf5cf 100644 --- a/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.c +++ b/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.c @@ -1,33 +1,33 @@ /* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * * $Id$ */ @@ -51,14 +51,14 @@ * * Creation date: * - * Version: $Id: osmt_mtl_regular_qp.c,v 1.1 2003/03/20 16:41:48 eitan Exp $ + * Version: $Id: osmt_mtl_regular_qp.c 3941 2005-11-02 13:32:04Z halr $ * * Authors: * Eitan Zahavi * * Changes: */ -#include + #include #include #include @@ -85,7 +85,7 @@ VAPI_ret_t osmt_mtl_get_qp_resources(IN OUT osmt_mtl_mad_res_t *res) VAPI_cqe_num_t act_num; /* Get HCA LID */ - ret = VAPI_query_hca_port_prop(res->hca_hndl, res->port_num , &hca_port_info); VAPI_CHECK_RET; + ret = VAPI_query_hca_port_prop(res->hca_hndl, res->port_num, &hca_port_info); VAPI_CHECK_RET; res->slid = hca_port_info.lid; /* Get a PD */ @@ -309,6 +309,7 @@ VAPI_ret_t osmt_mtl_mad_cleanup(osmt_mtl_mad_res_t *res) #endif return VAPI_OK; } + VAPI_ret_t osmt_mtl_create_av(osmt_mtl_mad_res_t* res, int16_t dlid, VAPI_ud_av_hndl_t *avh_p) { VAPI_ud_av_t av; diff --git a/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.h b/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.h deleted file mode 100644 index 56afd0b7..00000000 --- a/trunk/ulp/opensm/user/osmtest/osmt_mtl_regular_qp.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - -/* - Mellanox Confidential and Proprietary - - * - * Copyright (C) Apr. 2001, Mellanox Technologies Ltd. ALL RIGHTS RESERVED. - * - * Except as specifically permitted herein, no portion of the information, - * including but not limited to object code and source code, may be reproduced, - * modified, distributed, republished or otherwise exploited in any form or by - * any means for any purpose without the prior written permission of Mellanox - * Technologies Ltd. Use of software subject to the terms and conditions - * detailed in the file "LICENSE.txt". - * - * End of legal section ...................................................... - * - * mad.h - - * Header file for common special QP resources creation code. - * - * Creation date: - * - * Version: $Id: osmt_mtl_regular_qp.h,v 1.2 2003/03/20 16:05:10 eitan Exp $ - * - * Authors: - * Elazar Raab - * - * Changes: - */ - -#ifndef H_MAD_H -#define H_MAD_H - -#include -#include -#include -#include - - -#if defined(MAD_IN) || defined(MAD_OUT) -#error MACROS MAD_IN and MAD_OUT are in use, do not override -#endif -#define MAD_IN -#define MAD_OUT - - - -/* HCA Constants */ -#define HCA_ID "mt21108_pci0" -#define GRH_LEN 40 -#define KNOWN_QP1_QKEY 0x80010000 - - -#define MAX_OUTS_SQ 2 /* Max. buffers posted for requests in SQ */ -#define MAX_OUTS_RQ 5 /* Max. buffers posted for responses in RQ */ - -#define MAX_POLL_CNT 300 -#define POLL_SLEEP 1 /* for usleep */ - -#define MAD_SIZE 256 /* MADs are always 256B */ -#define MAD_ATTR_OFFSET 16 -#define MAD_TID_OFFSET 8 - - - - -/* Verbs SQP resources handles */ -typedef struct { - VAPI_hca_id_t hca_id; /*id of HCA*/ - u_int8_t port_num; /* the port num to use */ - VAPI_hca_hndl_t hca_hndl; /*handle of HCA*/ - VAPI_qp_hndl_t qp_hndl; /*handle of QP I use*/ - VAPI_mr_hndl_t mr_hndl; /*handle of memory region*/ - VAPI_cq_hndl_t rq_cq_hndl, sq_cq_hndl; /*handle of send & receive completion Queues*/ - VAPI_pd_hndl_t pd_hndl; /*handle of Partition Domain*/ - /* VAPI_ud_av_hndl_t av_hndl;*/ - IB_lid_t slid; /*LID*/ - void *buf_ptr; /*mem buffer for outstanding pkts*/ - MT_size_t buf_size; /*size of mem buffer for outstanding pkts*/ - - u_int32_t max_outs_sq; /*max # of outstanding pkts in send queue*/ - u_int32_t max_outs_rq; /*max # of outstanding pkts in receive queue*/ - - IB_rkey_t l_key; /*my l_key for memory regions*/ - VAPI_qkey_t qkey; /*my qkey*/ - - EVAPI_compl_handler_hndl_t rq_cq_eventh, sq_cq_eventh; /* event handlers for polling */ - - bool is_sqp; /* relate to union below - my QP*/ - union { - VAPI_special_qp_t sqp_type; - VAPI_qp_num_t qp_num; - } qp_id; - void *wait_q; -} osmt_mtl_mad_res_t; - - -/* init an osmt_mtl_mad_res_t with all resources initialized (use functions below) */ -VAPI_ret_t osmt_mtl_init( - osmt_mtl_mad_res_t* res /*pointer to res (resources) struct*/ - ); -VAPI_ret_t osmt_mtl_init_opened_hca( - osmt_mtl_mad_res_t* res /*pointer to res (resources) struct*/ - ); - -/* Cleanup all resources of (which are valid) in res */ -VAPI_ret_t osmt_mtl_mad_cleanup( - osmt_mtl_mad_res_t *res /*pointer to res (resources) struct*/ - ); - - -/* create CQs and QP as given in res->is_sqp (if TRUE, get special QP) */ -VAPI_ret_t osmt_mtl_get_qp_resources( - osmt_mtl_mad_res_t *res /*pointer to res (resources) struct*/ -); - - -/* move QP to RTS state */ -VAPI_ret_t osmt_mtl_mad_qp_init( - osmt_mtl_mad_res_t *res /*max number of outstanding packets allowed in send queue*/ - ); - - -/* create and register res->buf_ptr */ -VAPI_ret_t osmt_mtl_mad_create_mr( - osmt_mtl_mad_res_t *res /*pointer to res (resources) struct*/ - ); - -VAPI_ret_t osmt_mtl_create_av( - osmt_mtl_mad_res_t* res, /* pointer to res (resources) struct*/ - int16_t dlid, /*destination lid */ - VAPI_ud_av_hndl_t *avh_p /* address vectr handle to update */ -); - -/* Send MAD to given dest QP*/ -VAPI_ret_t osmt_mtl_mad_send( - osmt_mtl_mad_res_t* res, /*pointer to res (resources) struct*/ - VAPI_wr_id_t id, /*wqe ID*/ - void* mad, /*mad buffer to send*/ - VAPI_qp_num_t dest_qp, /*destination QP*/ - IB_sl_t sl, /*Service Level*/ - u_int32_t dest_qkey, /*Destination QP KEY*/ - VAPI_ud_av_hndl_t avh /* address vectr handle to use */ -); - - -/* post buffers to RQ. returns num of buffers actually posted */ -int osmt_mtl_mad_post_recv_bufs( - osmt_mtl_mad_res_t* res, /*pointer to res (resources) struct*/ - void *buf_array, /*array of receive buffers*/ - u_int32_t num_o_bufs, /*number of receive buffers*/ - u_int32_t size, /* size of expected receive packet - MAD*/ - VAPI_wr_id_t start_id /* start id for receive buffers*/ -); - - -/* Poll given CQ for completion max_poll times (POLL_SLEEP [usec] delays). result in wc_desc_p. */ -#ifndef __KERNEL__ -VAPI_ret_t osmt_mtl_mad_poll4cqe( - VAPI_hca_hndl_t hca, /*handle for HCA*/ - VAPI_cq_hndl_t cq, /*handle for Completion Queue - Rcv/Send */ - VAPI_wc_desc_t *wc_desc_p, /*handle of cqe */ - u_int32_t max_poll, /*number of polling iterations*/ - u_int32_t poll_sleep, /*timeout for each polling */ - VAPI_ud_av_hndl_t *avh_p /* address vectopr handle to cleanup */ - ); -#endif - - -#endif diff --git a/trunk/ulp/opensm/user/osmtest/osmt_multicast.c b/trunk/ulp/opensm/user/osmtest/osmt_multicast.c index c0ebdeff..0ef59e12 100644 --- a/trunk/ulp/opensm/user/osmtest/osmt_multicast.c +++ b/trunk/ulp/opensm/user/osmtest/osmt_multicast.c @@ -1,47 +1,48 @@ /* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * * $Id$ */ /* * Abstract: - * Implementation of Multicast Member testing flow.. + * Implementation of Multicast Member testing flow.. * * Environment: - * Linux User Mode + * Linux User Mode * * $Revision: 1.2 $ */ /* next error code: 16A */ + #ifndef __WIN__ #include #endif @@ -50,11 +51,8 @@ #include #include #include +#include #include "osmtest.h" -#ifdef OSM_VENDOR_INTF_MTL -#include "osmt_inform.h" -#endif - static cl_status_t @@ -66,7 +64,6 @@ __match_mgids( ib_gid_t* p_mgid_list_item = (ib_gid_t*)p_object; int32_t count; - count = cl_memcmp( p_mgid_context, p_mgid_list_item, @@ -94,7 +91,6 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { cl_map_item_t *p_item,*p_next_item; osmtest_mgrp_t *p_mgrp; - OSM_LOG_ENTER( &p_osmt->log, osmt_query_mcast ); /* * Do a blocking query for all Multicast Records in the subnet. @@ -127,7 +123,7 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_query_mcast: ERR 0203: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -137,8 +133,7 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_query_mcast: ERR 0264: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); - + "ib_query failed (%s)\n", ib_get_err_str( status ) ); if( status == IB_REMOTE_ERROR ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, @@ -169,7 +164,7 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { num_recs = context.result.result_cnt; osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_query_mcast: " - "Received %u records.\n", num_recs ); + "Received %u records\n", num_recs ); for( i = 0; i < num_recs; i++ ) { @@ -180,10 +175,10 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { if( p_mgids_res != cl_list_end( p_mgids_list ) ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_query_mcast: ERR 0203: " - "MCG MGIDS are the same - invalid MGID : 0x% " - PRIx64 " 0x% " PRIx64 "\n" , - cl_ntoh64(p_rec->mgid.unicast.prefix) , + "osmt_query_mcast: ERR 0265: " + "MCG MGIDs are the same - invalid MGID : 0x%016" PRIx64 " 0x%016" + PRIx64 "\n", + cl_ntoh64(p_rec->mgid.unicast.prefix), cl_ntoh64(p_rec->mgid.unicast.interface_id)); status = IB_ERROR; goto Exit; @@ -193,18 +188,18 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { cl_status = cl_list_insert_head(p_mgids_list,&(p_rec->mgid)); if (cl_status) { - osm_log( &p_osmt->log , OSM_LOG_ERROR, + osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_query_mcast: ERR 0205: " - "Could not add MGID to cl_list.\n"); + "Could not add MGID to cl_list\n"); status = IB_ERROR; goto Exit; } p_mgrp = (osmtest_mgrp_t*)cl_malloc( sizeof(*p_mgrp) ); if (!p_mgrp) { - osm_log( &p_osmt->log , OSM_LOG_ERROR, + osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_query_mcast: ERR 0204: " - "Could not allocate MCG new.\n"); + "Could not allocate new MCG\n"); status = IB_ERROR; goto Exit; } @@ -213,8 +208,6 @@ osmt_query_mcast( IN osmtest_t * const p_osmt ) { cl_ntoh16(p_rec->mlid),&p_mgrp->map_item); } - - Exit: if( context.result.p_result_madw != NULL ) { @@ -251,7 +244,6 @@ osmt_send_mcast_request( IN osmtest_t * const p_osmt, cl_memclr( &context, sizeof( context ) ); cl_memclr( p_res, sizeof(ib_sa_mad_t ) ); - context.p_osmt = p_osmt; user.p_attr = p_mc_req; @@ -303,8 +295,8 @@ osmt_send_mcast_request( IN osmtest_t * const p_osmt, if ( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_send_mcast_request: ERR 0205: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_send_mcast_request: ERR 0206: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -321,7 +313,7 @@ osmt_send_mcast_request( IN osmtest_t * const p_osmt, { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_send_mcast_request: " - "Remote error = %s.\n", + "Remote error = %s\n", ib_get_mad_status_str( osm_madw_get_mad_ptr ( context.result.p_result_madw ) ) ); } @@ -342,7 +334,6 @@ osmt_send_mcast_request( IN osmtest_t * const p_osmt, } - void osmt_init_mc_query_rec(IN osmtest_t * const p_osmt, IN OUT ib_member_rec_t *p_mc_req) { @@ -350,7 +341,7 @@ osmt_init_mc_query_rec(IN osmtest_t * const p_osmt, cl_memclr(p_mc_req,sizeof(ib_member_rec_t)); /* we leave the MGID to the user */ - cl_memcpy(&p_mc_req->port_gid.unicast.interface_id , + cl_memcpy(&p_mc_req->port_gid.unicast.interface_id, &p_osmt->local_port.port_guid, sizeof(p_osmt->local_port.port_guid) ); @@ -432,7 +423,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { ib_node_record_t *p_rec; uint32_t num_recs = 0,i; uint8_t mtu_phys = 0,rate_phys = 0; - + cl_map_t test_created_mlids; /* List of all mlids created in this test */ + ib_member_rec_t* p_recvd_rec; static ib_gid_t good_mgid = { { @@ -474,25 +466,20 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { }, }; static ib_gid_t osm_link_local_mgid = { - { - 0xFF, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01 - }, + { + 0xFF, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01 + }, }; -#ifdef OSM_VENDOR_INTF_MTL - ib_inform_info_t inform_info; - osmt_qp_ctx_t qp_ctx; -#endif - OSM_LOG_ENTER( &p_osmt->log, osmt_run_mcast_flow ); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "GetTable of all current MCG ...\n" + "GetTable of all current MCGs...\n" ); status = osmt_query_mcast( p_osmt ); if (status != IB_SUCCESS) @@ -504,27 +491,30 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { } + /* Initialize the test_created_mgrps map */ + cl_map_construct(&test_created_mlids); + cl_map_init(&test_created_mlids, 1000); + p_mgrp_mlid_tbl = &p_osmt->exp_subn.mgrp_mlid_tbl; osmt_init_mc_query_rec(p_osmt, &mc_req_rec); - p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad); - /* Only when we are on single mode check flow - do the count comparison , otherwise skip */ - if (p_osmt->opt.mmode == 1 || p_osmt->opt.mmode == 3) + /* Only when we are on single mode check flow - do the count comparison, otherwise skip */ + if (p_osmt->opt.mmode == 1 || p_osmt->opt.mmode == 3) { start_cnt = cl_qmap_count(p_mgrp_mlid_tbl); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow (start): " - "Number of MC Records found at SA DB is %d.\n",start_cnt); + "Number of MC Records found in SA DB is %d\n",start_cnt); } - /* This flow is being added due to bug discovered using Infinicon stack - - The bug was initializing MCast with MTU & RATE min values that does - not match the subnet capability , even though that OpenSM - reposnds with the correct value it does not store it in the MCG. + /* This flow is being added due to bug discovered using SilverStorm stack - + The bug was initializing MCast with MTU & RATE min values that do + not match the subnet capability, even though that OpenSM + reponds with the correct value it does not store it in the MCG. We want the check a join request to already existing group (ipoib) - without using MTU or RATE then getting respond from OpenSM with + without using MTU or RATE then getting response from OpenSM with the correct values then join again with them and get IB_SUCCESS all the way */ @@ -540,8 +530,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { IPoIBIsFound=1; } - else - mcg_outside_test_cnt++; + else + mcg_outside_test_cnt++; p_mgrp = (osmtest_mgrp_t*)cl_qmap_next( &p_mgrp->map_item ); } @@ -551,8 +541,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* o15-0.2.4 - Check a join request to already created MCG */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Found IPoIB MC Group , so we run Infinicon Bug Flow ...\n"); - /* Try to join first like IPoIB of Infinicon */ + "Found IPoIB MC Group, so we run SilverStorm Bug Flow...\n"); + /* Try to join first like IPoIB of SilverStorm */ cl_memcpy(&mc_req_rec.mgid,&osm_ipoib_good_mgid,sizeof(ib_gid_t)); /* Request Join */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); @@ -566,11 +556,12 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { &mc_req_rec, comp_mask, &res_sa_mad ); + osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Sent Join request with :\n\t\tport_gid=0x%016"PRIx64 - ":0x%016" PRIx64 " , mgid=0x%016" PRIx64 ":0x%016" PRIx64 - "\n\t\tjoin state= 0x%x, response is : %s\n" , + "Sent Join request with :\n\t\tport_gid=0x%016"PRIx64 + ":0x%016" PRIx64 ", mgid=0x%016" PRIx64 ":0x%016" PRIx64 + "\n\t\tjoin state= 0x%x, response is : %s\n", cl_ntoh64(mc_req_rec.port_gid.unicast.prefix), cl_ntoh64(mc_req_rec.port_gid.unicast.interface_id), cl_ntoh64(mc_req_rec.mgid.unicast.prefix), @@ -583,19 +574,19 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* Prepare the mc_req_rec for the rest of the flow */ osmt_init_mc_query_rec(p_osmt, &mc_req_rec); /* - We simulate the same situation as in Infinicon - a response with the + We simulate the same situation as in SilverStorm - a response with the exact RATE & MTU as the SA responded with. Actually the query has included some more fields but we know that problem was genereated by the RATE */ osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Received attributes of MCG : \n\t\tMTU=0x%02X , RATE=0x%02X\n" - ,p_mc_res->mtu,p_mc_res->rate); + "Received attributes of MCG : \n\t\tMTU=0x%02X, RATE=0x%02X\n" + , p_mc_res->mtu,p_mc_res->rate); mc_req_rec.mtu = p_mc_res->mtu ; mc_req_rec.rate = p_mc_res->rate ; - /* Set mtu & rate phhysible that will allow check the + /* Set feasible mtu & rate that will allow check the exact statement of OpenSM */ mtu_phys = p_mc_res->mtu ; rate_phys = p_mc_res->rate ; @@ -614,20 +605,20 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Sending attributes of MCG : \n\t\tMTU=0x%02X , RATE=0x%02X\n" - ,mc_req_rec.mtu,mc_req_rec.rate); + "Sending attributes of MCG : \n\t\tMTU=0x%02X, RATE=0x%02X\n" + , mc_req_rec.mtu,mc_req_rec.rate); status = osmt_send_mcast_request( p_osmt, 0xff, /* User Defined query */ &mc_req_rec, comp_mask, &res_sa_mad ); osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Sent Join request using response values , response is : %s\n" - ,ib_get_err_str(status)); + "Sent Join request using response values, response is : %s\n" + , ib_get_err_str(status)); if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 02ee : " + "osmt_run_mcast_flow: ERR 02ef: " "Query as Full Member of already existing ipoib group 0x%016" PRIx64 ":0x%016" PRIx64 " has failed\n", cl_ntoh64(mc_req_rec.mgid.unicast.prefix), @@ -635,7 +626,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - else + else { mtu_phys = 0 ; rate_phys = 0 ; @@ -648,7 +639,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Get with invalid mlid ...\n" + "Checking Get with invalid mlid...\n" ); /* Request Get */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); @@ -664,7 +655,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow : ERR 2E0 " - "Succceed SubnAdmGet with invalid mlid 0x%x.\n", + "SubnAdmGet with invalid mlid 0x%x succeeded\n", cl_ntoh16(mc_req_rec.mlid)); status = IB_ERROR; goto Exit; @@ -678,9 +669,9 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking Get with invalid port guid (0x0) but valid interface ID : 0x%" - PRIx64 " ...\n", + PRIx64 "...\n", cl_ntoh64(mc_req_rec.port_gid.unicast.interface_id)); - + /* Request Get */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); cl_memclr(&mc_req_rec.port_gid.unicast.interface_id,sizeof(ib_net64_t)); @@ -695,7 +686,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow : ERR 2E4 " - "Succceed SubnAdmGet with invalid port guid .\n"); + "SubnAdmGet with invalid port guid succeeded\n"); status = IB_ERROR; goto Exit; } @@ -745,17 +736,18 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02eg: " + "Expectedd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with insufficiant comp mask - sl (15.0.1.3)...\n" + "Checking Join with insufficient comp mask - sl (15.0.1.3)...\n" ); osm_log( &p_osmt->log, OSM_LOG_ERROR, @@ -791,11 +783,12 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02eh: " + "Expectedd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } @@ -809,13 +802,14 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with insufficiant comp mask - flow label (o15.0.1.3)...\n" + "Checking Join with insufficient comp mask - flow label (o15.0.1.3)...\n" ); osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: " " Expecting Errors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" ); + /* Request Join */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); @@ -843,16 +837,15 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ei: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } - - osmt_init_mc_query_rec(p_osmt, &mc_req_rec); p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad); @@ -890,27 +883,27 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "osmt_run_mcast_flow: " " Expected Errors: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" ); + if (status != IB_REMOTE_ERROR || (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ej: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } - - osmt_init_mc_query_rec(p_osmt, &mc_req_rec); p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with insufficiant comp mask - tclass qkey (o15.0.1.3)...\n" + "Checking Join with insufficient comp mask - tclass qkey (o15.0.1.3)...\n" ); osm_log( &p_osmt->log, OSM_LOG_ERROR, @@ -942,26 +935,25 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "osmt_run_mcast_flow: " " Expected Errors: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" ); + if (status != IB_REMOTE_ERROR || (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ek: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } -#if 0 - /* CURRENTLY NOT SUPPORTED !!!! "Unrealizable" condition not available by OSM */ - /* o15.0.1.8: */ /* - Request join with irrelevant RATE : get a ERR_INSUFFICIANT_COMPONENTS */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic rate (o15.0.1.8)...\n" + "Checking Join with unrealistic rate (o15.0.1.8)...\n" ); /* impossible requested rate */ @@ -989,17 +981,18 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0207: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } /* Check Valid value which is unreasonable now */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic rate 30GB (o15.0.1.8)...\n" + "Checking Join with unrealistic rate 30GB (o15.0.1.8)...\n" ); /* impossible requested rate */ @@ -1026,20 +1019,19 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_REMOTE_ERROR || res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0207: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 0208: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } - - /* Check Valid value which is unreasonable now */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with less then min rate 2.5GB (o15.0.1.8)...\n" + "Checking Join with less than min rate 2.5GB (o15.0.1.8)...\n" ); /* impossible requested rate */ @@ -1067,22 +1059,18 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02ab: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } - - - - - /* Checking above max value of MTU which is impossible */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic mtu (o15.0.1.8)...\n" + "Checking Join with unrealistic mtu (o15.0.1.8)...\n" ); /* impossible requested mtu */ @@ -1099,7 +1087,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { IB_MCR_COMPMASK_TCLASS | /* all above are required */ IB_MCR_COMPMASK_MTU_SEL | IB_MCR_COMPMASK_MTU; - status = osmt_send_mcast_request( p_osmt, 1, &mc_req_rec, comp_mask, @@ -1107,22 +1094,23 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_REMOTE_ERROR || res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0207: " - "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ac: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic mtu (o15.0.1.8)...\n" + "Checking Join with unrealistic mtu (o15.0.1.8)...\n" ); /* Checking above max value of MTU which is impossible */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic mtu : \n\t\tless then 256 -" + "Checking Join with unrealistic mtu : \n\t\tless than 256 -" " min (o15.0.1.8)...\n" ); @@ -1148,20 +1136,20 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_REMOTE_ERROR || res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0207: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ad: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic mtu (o15.0.1.8)...\n" + "Checking Join with unrealistic mtu (o15.0.1.8)...\n" ); - /* impossible requested mtu */ mc_req_rec.mtu = 0x6 | IB_PATH_SELECTOR_GREATER_THAN << 6; @@ -1184,21 +1172,24 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_REMOTE_ERROR || res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0207: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ae: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } +#if 0 + /* Currently PacketLifeTime isn't checked in opensm */ /* Check PacketLifeTime as 0 */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Create with un-realistic packet life value less than 0 (o15.0.1.8)...\n" + "Checking Create with unrealistic packet life value less than 0 (o15.0.1.8)...\n" ); - /* impossible requested rate */ + /* impossible requested packet life */ mc_req_rec.pkt_life = 0 | IB_PATH_SELECTOR_LESS_THAN << 6; comp_mask = @@ -1220,14 +1211,14 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_REMOTE_ERROR || res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0207: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02af: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_REQ_INVALID got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } - #endif /* o15.0.1.4: */ @@ -1252,7 +1243,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* Request Join */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1278,11 +1268,12 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ag: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } @@ -1293,32 +1284,29 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02aa: " - "Could not get all MC Records in subnet , got:%s/%s.\n", + "Could not get all MC Records in subnet, got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } - /* Only when we are on single mode check flow - do the count comparison , otherwise skip */ - if (p_osmt->opt.mmode == 1 || p_osmt->opt.mmode == 3) + /* Only when we are on single mode check flow - do the count comparison, otherwise skip */ + if (p_osmt->opt.mmode == 1 || p_osmt->opt.mmode == 3) { middle_cnt = cl_qmap_count(&p_osmt->exp_subn.mgrp_mlid_tbl); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow (post false create): " - "Number of MC Records found at SA DB is %d.\n",middle_cnt); + "Number of MC Records found in SA DB is %d\n", middle_cnt); if (middle_cnt != start_cnt) { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 02ab: " + osm_log( &p_osmt->log, OSM_LOG_INFO, + "osmt_run_mcast_flow: " "Got different number of records stored in SA DB (before any creation)\n" - "Instead of %d got %d.\n",start_cnt,middle_cnt); - status=IB_ERROR; - goto Exit; + "Instead of %d got %d\n", start_cnt, middle_cnt); } } - osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking Create given MGID=0 skip Qkey and Pkey (o15.0.1.4)...\n" @@ -1338,7 +1326,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* Request Join */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1360,15 +1347,17 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "osmt_run_mcast_flow: " " Expected Errors: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" ); + if (status != IB_REMOTE_ERROR || (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02ai: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } @@ -1378,7 +1367,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Create given MGID=0 skip Tclass (o15.0.1.4)...\n" + "Checking Create given MGID=0 skip TClass (o15.0.1.4)...\n" ); osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: " @@ -1394,7 +1383,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* Request Join */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1422,22 +1410,22 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { (( ib_net16_t ) (res_sa_mad.status & IB_SMP_STATUS_MASK )) != IB_SA_MAD_STATUS_INSUF_COMPS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0206: " - "Expecetd REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s.\n", + "osmt_run_mcast_flow: ERR 02aj: " + "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); + status = IB_ERROR; goto Exit; } - osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking Create given MGID=0 valid Set several options :\n\t\t" - "First above min RATE , Second less then max RATE \n\t\t" - "Third above min MTU , Second less then max MTU \n\t\t" - "Fifth exact MTU & RATE physible , Sixth exact RATE physible\n\t\t" - "Seventh exact MTU physible (o15.0.1.4)...\n" + "First above min RATE, Second less than max RATE\n\t\t" + "Third above min MTU, Second less than max MTU\n\t\t" + "Fifth exact MTU & RATE feasible, Sixth exact RATE feasible\n\t\t" + "Seventh exact MTU feasible (o15.0.1.4)...\n" ); /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ @@ -1465,14 +1453,26 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0208: " - "Fail to create MGC for MGID=0 with higher then minimum RATE.\n", + "osmt_run_mcast_flow: ERR 02ak: " + "Failed to create MGC for MGID=0 with higher than minimum RATE\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ mc_req_rec.rate = @@ -1498,14 +1498,25 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 020ab: " - "Fail to create MGC for MGID=0 with less then highest RATE.\n", + "osmt_run_mcast_flow: ERR 021: " + "Failed to create MGC for MGID=0 with less than highest RATE\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ @@ -1533,19 +1544,29 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0238: " - "Fail to create MGC for MGID=0 with less then highest MTU.\n", + "Failed to create MGC for MGID=0 with less than highest MTU\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } - /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ mc_req_rec.mtu = IB_MTU_LEN_256 | IB_PATH_SELECTOR_GREATER_THAN << 6; - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1566,20 +1587,31 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0239: " - "Fail to create MGC for MGID=0 with higher then lowest MTU.\n", + "Failed to create MGC for MGID=0 with higher than lowest MTU\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ - /* Using Exact physible MTU & RATE */ + /* Using Exact feasible MTU & RATE */ mc_req_rec.mtu = mtu_phys; mc_req_rec.rate = rate_phys; - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1598,23 +1630,35 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { &mc_req_rec, comp_mask, &res_sa_mad ); + if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0240: " - "Fail to create MGC for MGID=0 with exact MTU & RATE.\n", + "Failed to create MGC for MGID=0 with exact MTU & RATE\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ - /* Using Exact physible RATE */ + /* Using Exact feasible RATE */ mc_req_rec.rate = rate_phys; - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1635,20 +1679,30 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0241: " - "Fail to create MGC for MGID=0 with exact RATE.\n", + "Failed to create MGC for MGID=0 with exact RATE\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); - /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ - /* Using Exact physible MTU */ + /* Good Flow - mgid is 0 while giving all required fields for join : P_Key, Q_Key, SL, FlowLabel, Tclass */ + /* Using Exact feasible MTU */ mc_req_rec.mtu = mtu_phys; - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1668,16 +1722,25 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0240: " - "Fail to create MGC for MGID=0 with exact MTU.\n", + "osmt_run_mcast_flow: ERR 0242: " + "Failed to create MGC for MGID=0 with exact MTU\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } - - + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); /* o15.0.1.5: */ /* - Check the returned MGID is valid. (p 804) */ @@ -1685,7 +1748,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "osmt_run_mcast_flow: " "Validating resulting MGID (o15.0.1.5)...\n" ); - /* prefix 0xFF1 Scope 0xA01B */ + /* prefix 0xFF1 Scope 0xA01B */ /* Since we did not directly specified SCOPE in comp mask we should get the comp mask that is link-local scope */ if ( (p_mc_res->mgid.multicast.header[0] != 0xFF) || @@ -1720,7 +1783,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { mc_req_rec.pkt_life = 0 | IB_PATH_SELECTOR_GREATER_THAN << 6; - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -1741,16 +1803,29 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0208: " - "Fail to create MGC for MGID=0.\n", + "osmt_run_mcast_flow: ERR 0210: " + "Failed to create MGC for MGID=0\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + /* o15.0.1.6: */ /* - Create a new MCG with valid requested MGID. */ + osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking Create given MGID=0x%016" PRIx64 " : " @@ -1766,8 +1841,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0210: " - "Fail to create MGC for MGID=0x%016" PRIx64 " : " + "osmt_run_mcast_flow: ERR 0211: " + "Failed to create MGC for MGID=0x%016" PRIx64 " : " "0x%016" PRIx64 " (o15.0.1.6)...\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad)), @@ -1776,18 +1851,30 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Validating resulting MGID (o15.0.1.6)...\n" ); - /* prefix 0xFF1 Scope 0xA01B */ + /* prefix 0xFF1 Scope 0xA01B */ if ( (p_mc_res->mgid.multicast.header[0] != 0xFF) || (p_mc_res->mgid.multicast.header[1] != 0x12) || /* HACK hardcoded scope = 0x02 */ (p_mc_res->mgid.multicast.raw_group_id[0] != 0xA0) || (p_mc_res->mgid.multicast.raw_group_id[1] != 0x1C) ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0211: " + "osmt_run_mcast_flow: ERR 0212: " "Validating MGID failed. MGID:0x%016" PRIx64 "\n", p_mc_res->mgid ); @@ -1814,11 +1901,12 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "osmt_run_mcast_flow: " " Expected Errors: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" ); + if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0212: " - "Fail to recognize MGID error for MGID=0xFA......\n", + "osmt_run_mcast_flow: ERR 0213: " + "Failed to recognize MGID error for MGID=0xFA......\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -1852,8 +1940,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0213: " - "Fail to recognize MGID error for A01B with link-local bit (status %s) (rem status %s)\n", + "osmt_run_mcast_flow: ERR 0214: " + "Failed to recognize MGID error for A01B with link-local bit (status %s) (rem status %s)\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -1868,8 +1956,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "Checking BAD MGID PREFIX=0xEF... (o15.0.1.6)...\n" ); - - osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: " " Expecting Errors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" @@ -1891,8 +1977,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0212: " - "Fail to recognize MGID PREFIX error for MGID=0xEF....\n", + "osmt_run_mcast_flow: ERR 0215: " + "Failed to recognize MGID PREFIX error for MGID=0xEF....\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -1900,14 +1986,11 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - - - /* Change the scope to reserved - get back VALID REQ */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking local scope with full member \n\t\tand valid mgid 0x%016" + "Checking local scope with full member \n\t\tand valid mgid 0x%016" PRIx64 ":0x%016" PRIx64 " ... (o15.0.1.6)...\n", cl_ntoh64(mc_req_rec.mgid.unicast.prefix), cl_ntoh64(mc_req_rec.mgid.unicast.interface_id)); @@ -1923,9 +2006,9 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0210: " - "Fail to create MGC for MGID=0x%016" PRIx64 " : " - "0x%016" PRIx64 ".\n", + "osmt_run_mcast_flow: ERR 0216: " + "Failed to create MGC for MGID=0x%016" PRIx64 " : " + "0x%016" PRIx64 "\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ), cl_ntoh64(good_mgid.unicast.prefix), @@ -1933,6 +2016,17 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); /* Change the flags to invalid value 0x2 - get back INVALID REQ */ @@ -1946,19 +2040,15 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { " Expecting Errors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" ); - mc_req_rec.mgid = good_mgid; mc_req_rec.mgid.raw[1] = 0x22; - - status = osmt_send_mcast_request( p_osmt, 1, &mc_req_rec, comp_mask, &res_sa_mad ); - osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: " " Expected Errors: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" @@ -1967,8 +2057,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0214: " - "Fail to recognize create with invalid flags value 0x2\n", + "osmt_run_mcast_flow: ERR 0217: " + "Failed to recognize create with invalid flags value 0x2\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -1976,7 +2066,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - /* Change the MGID to link local MGID - get back VALID REQ */ osm_log( &p_osmt->log, OSM_LOG_INFO, @@ -1985,6 +2074,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { ); mc_req_rec.mgid = osm_link_local_mgid; + status = osmt_send_mcast_request( p_osmt, 1, &mc_req_rec, comp_mask, @@ -1992,21 +2082,32 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0210: " - "Fail to create MGC for MGID=0xFF02:0:0:0:0:0:0:1.\n", + "osmt_run_mcast_flow: ERR 0218: " + "Failed to create MGC for MGID=0xFF02:0:0:0:0:0:0:1\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } - + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); /* o15.0.1.7 - implicitlly checked during the prev steps. */ /* o15.0.1.8 - implicitlly checked during the prev steps. */ /* o15.0.1.9 */ /* - Create MCG with Invalid JoinState.FullMember != 1 : get ERR_REQ_INVALID */ + osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking new MGID with invalid join state (o15.0.1.9)...\n" @@ -2031,8 +2132,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0214: " - "Fail to recognize create with JoinState != FullMember\n", + "osmt_run_mcast_flow: ERR 0219: " + "Failed to recognize create with JoinState != FullMember\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2040,16 +2141,14 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - - /* Lets try a valid join scope state */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking new MGID with invalid join state (o15.0.1.9)...\n" + "Checking new MGID with valid join state (o15.0.1.9)...\n" ); mc_req_rec.mgid = good_mgid; - mc_req_rec.scope_state = 0x23; /* link-local scope , non member and full member */ + mc_req_rec.scope_state = 0x23; /* link-local scope, non member and full member */ status = osmt_send_mcast_request( p_osmt, 1, &mc_req_rec, @@ -2059,16 +2158,14 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0210: " - "Fail to create MGC with valid join state 0x3.\n", + "osmt_run_mcast_flow: ERR 0220: " + "Failed to create MGC with valid join state 0x3\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } - - /* Lets try another invalid join scope state */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " @@ -2083,7 +2180,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { mc_req_rec.mgid = good_mgid; mc_req_rec.mgid.raw[12] = 0xFC; - mc_req_rec.scope_state = 0x24; /* link-local scope , send only member */ + mc_req_rec.scope_state = 0x24; /* link-local scope, send only member */ status = osmt_send_mcast_request( p_osmt, 1, &mc_req_rec, @@ -2096,8 +2193,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0214: " - "Fail to recognize create with JoinState != FullMember\n", + "osmt_run_mcast_flow: ERR 0221: " + "Failed to recognize create with JoinState != FullMember\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2113,8 +2210,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { mc_req_rec.mgid = good_mgid; mc_req_rec.mgid.raw[12] = 0xFB; - cl_memcpy(&special_mgid , &mc_req_rec.mgid ,sizeof(ib_gid_t)); - mc_req_rec.scope_state = 0x2F; /* link-local scope , Full member with all other bits turned on */ + cl_memcpy(&special_mgid, &mc_req_rec.mgid, sizeof(ib_gid_t)); + mc_req_rec.scope_state = 0x2F; /* link-local scope, Full member with all other bits turned on */ status = osmt_send_mcast_request( p_osmt, 1, &mc_req_rec, @@ -2124,21 +2221,33 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0210: " - "Fail to create MGC with valid join state 0xF\n", + "osmt_run_mcast_flow: ERR 0222: " + "Failed to create MGC with valid join state 0xF\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, + "osmt_run_mcast_flow: " + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); + /* o15.0.1.10 - can't check on a single client .-- obsolete - - checked by Infinicon bug o15-0.2.4 , never the less recheck */ + checked by SilverStorm bug o15-0.2.4, never the less recheck */ /* o15-0.2.4 - Check a join request to already created MCG */ p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Check o15-0.2.4 statement ...\n"); + "Check o15-0.2.4 statement...\n"); /* Try to join */ cl_memcpy(&mc_req_rec.mgid,&p_mc_res->mgid,sizeof(ib_gid_t)); /* Request Join */ @@ -2156,12 +2265,11 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02cc: " - "Fail to join MGC with valid req , returned status = %s\n", + "Failed to join MGC with valid req, returned status = %s\n", ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )); goto Exit; } - /* o15.0.1.11: */ /* - Try to join into a MGID that exists with JoinState=SendOnlyMember - */ /* see that it updates JoinState. What is the routing change? */ @@ -2180,8 +2288,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0215: " - "Fail to update existing MGID\n", + "osmt_run_mcast_flow: ERR 02cd: " + "Failed to update existing MGID\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2196,7 +2304,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (p_mc_res->scope_state != 0x23) /* scope is LSB */ { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0216: " + "osmt_run_mcast_flow: ERR 02ce: " "Validating JoinState update failed. Expected 0x23 got: 0x%02X\n", p_mc_res->scope_state ); @@ -2204,7 +2312,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - /* Try delete current join state then update it with another value */ + /* Try delete current join state then update it with another value */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking JoinState update request should return 0x22 (o15.0.1.11)...\n" @@ -2218,20 +2326,18 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* but the FullMember bit should be gone */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Partially delete JoinState (o15.0.1.14)...\n" + "Checking Partially delete JoinState (o15.0.1.14)...\n" ); mc_req_rec.scope_state = 0x22; status = osmt_send_mcast_request( p_osmt, 0, &mc_req_rec, comp_mask, &res_sa_mad ); - - if ((status != IB_SUCCESS) || (p_mc_res->scope_state != 0x21)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0218: " - "Fail to partially update JoinState : %s/%s\n", + "osmt_run_mcast_flow: ERR 02cf: " + "Failed to partially update JoinState : %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2250,8 +2356,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0215: " - "Fail to update existing MCG\n", + "osmt_run_mcast_flow: ERR 02cg: " + "Failed to update existing MCG\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2266,7 +2372,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (p_mc_res->scope_state != 0x25) /* scope is MSB */ { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0216: " + "osmt_run_mcast_flow: ERR 02ch: " "Validating JoinState update failed. Expected 0x25 got: 0x%02X\n", p_mc_res->scope_state ); @@ -2283,8 +2389,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0215: " - "Fail to update existing MGID\n", + "osmt_run_mcast_flow: ERR 02ci: " + "Failed to update existing MGID\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2299,7 +2405,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (p_mc_res->scope_state != 0x25) /* scope is LSB */ { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0216: " + "osmt_run_mcast_flow: ERR 02cj: " "Validating JoinState update failed. Expected 0x25 got: 0x%02X\n", p_mc_res->scope_state ); @@ -2317,23 +2423,22 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0215: " - "Fail to update existing MGID\n", + "osmt_run_mcast_flow: ERR 02ck: " + "Failed to update existing MGID\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); goto Exit; } - osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Validating Join State update with Non Member\n\t\t" - "to an existing 0x5 state MCG (o15.0.1.11)...\n"); + "to an existing 0x5 state MCG (o15.0.1.11)...\n"); if (p_mc_res->scope_state != 0x27) /* scope is LSB */ { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0216: " + "osmt_run_mcast_flow: ERR 02cl: " "Validating JoinState update failed. Expected 0x27 got: 0x%02X\n", p_mc_res->scope_state ); @@ -2390,8 +2495,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0217: " - "Fail to catch BAD RATE joining an exiting MGID: %s/%s\n", + "osmt_run_mcast_flow: ERR 02cm: " + "Failed to catch BAD RATE joining an exiting MGID: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2437,8 +2542,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0217: " - "Fail to catch BAD RATE (higher them max) joining an exiting MGID: %s/%s\n", + "osmt_run_mcast_flow: ERR 02cn: " + "Failed to catch BAD RATE (higher them max) joining an exiting MGID: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2449,7 +2554,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* Try another MTU that does not exist in any MCG */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking BAD MTU (less then min) when connecting " + "Checking BAD MTU (less than min) when connecting " "to existing MGID (o15.0.1.13)...\n" ); osm_log( &p_osmt->log, OSM_LOG_ERROR, @@ -2484,8 +2589,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 02cd: " - "Fail to catch BAD RATE (less them min) joining an exiting MGID: %s/%s\n", + "osmt_run_mcast_flow: ERR 02co: " + "Failed to catch BAD RATE (less them min) joining an exiting MGID: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2493,11 +2598,9 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - - - /* o15.0.1.14: */ /* - Try partial delete - actually updating the join state. check it. */ + osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " "Checking partial JoinState delete request - removing NonMember (o15.0.1.14)...\n" @@ -2518,8 +2621,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { IB_MCR_COMPMASK_TCLASS | /* all above are required */ IB_MCR_COMPMASK_RATE_SEL | IB_MCR_COMPMASK_RATE; - - /* link-local scope, non member (so we should not be able to delete) */ /* but the FullMember bit should be gone */ mc_req_rec.scope_state = 0x22; @@ -2532,7 +2633,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0218: " + "osmt_run_mcast_flow: ERR 02cp: " "Fail to partially update JoinState during delete: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) @@ -2548,7 +2649,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (p_mc_res->scope_state != 0x25) /* scope is MSB - now only the non member & send only member have left */ { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0219: " + "osmt_run_mcast_flow: ERR 02cq: " "Validating JoinState update failed. Expected 0x25 got: 0x%02X\n", p_mc_res->scope_state ); @@ -2556,8 +2657,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - - /* Now use the same scope_state and delete all JoinState - leave multicast group since state is 0x0 */ mc_req_rec.scope_state = 0x25; @@ -2569,8 +2668,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0218: " - "Fail to update JoinState during delete: %s/%s\n", + "osmt_run_mcast_flow: ERR 02cr: " + "Failed to update JoinState during delete: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2586,7 +2685,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (p_mc_res->scope_state != 0x25) /* scope is MSB - now only 0x0 so port is removed from MCG */ { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0219: " + "osmt_run_mcast_flow: ERR 02cs: " "Validating JoinState update failed. Expected 0x25 got: 0x%02X\n", p_mc_res->scope_state ); @@ -2615,7 +2714,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_REMOTE_ERROR) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0221: " + "osmt_run_mcast_flow: ERR 02ct: " "Succeeded Joining Deleted Group: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) @@ -2624,8 +2723,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } - - /* - Try deletion of the IPoIB MCG and get: ERR_REQ_INVALID */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " @@ -2653,8 +2750,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if ((status != IB_REMOTE_ERROR) || (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0222: " - "Fail to catch BAD delete from IPoIB: %s/%s\n", + "osmt_run_mcast_flow: ERR 02cu: " + "Failed to catch BAD delete from IPoIB: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2693,8 +2790,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0210: " - "Fail to create MGC for 0x%016" PRIx64 " : " + "osmt_run_mcast_flow: ERR 02cv: " + "Failed to create MGC for 0x%016" PRIx64 " : " "0x%016" PRIx64 ".\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ), @@ -2703,58 +2800,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } -#ifdef OSM_VENDOR_INTF_MTL - - /* - Register by InformInfo flow to receive trap 67 on MCG delete. */ - /* bind the QP */ - osm_log( &p_osmt->log, OSM_LOG_INFO, - "osmt_run_mcast_flow: " - "Setting InformInfo for Trap 67 (o15.0.1.14)...\n" - ); - status = osmt_bind_inform_qp( p_osmt, &qp_ctx); - if (status != IB_SUCCESS) - { - goto Exit; - } - - /* init the inform info */ - osmt_init_inform_info(p_osmt, &inform_info); - - /* limit to trap 67 from SM */ - inform_info.lid_range_begin = cl_ntoh16(p_osmt->local_port.sm_lid); - inform_info.lid_range_end = cl_ntoh16(p_osmt->local_port.sm_lid); - inform_info.g_or_v.generic.trap_num = cl_hton16(67); - - /* send the inform info registration */ - status = osmt_reg_unreg_inform_info(p_osmt, - &qp_ctx, - &inform_info, - 1); - if (status != IB_SUCCESS) - { - goto Exit; - } - - - /*--------------------- PREP -------------------------*/ - if (osmt_mtl_mad_post_recv_bufs( - &qp_ctx.qp_bind_hndl, - qp_ctx.p_recv_buf, - 1, /* we need to reveive the report */ - GRH_LEN + MAD_BLOCK_SIZE, - 1) != 1) { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0127: " - "Error posting recv bufs .\n"); - status = IB_ERROR; - goto Exit; - } - osm_log( &p_osmt->log, OSM_LOG_DEBUG, - "osmt_run_mcast_flow: " - "Posted recv bufs .\n"); - -#endif /* OSM_VENDOR_INTF_MTL */ - /* - Try delete with valid join state */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " @@ -2771,22 +2816,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { goto Exit; } -#ifdef OSM_VENDOR_INTF_MTL - - /* - Wait for trap 67. */ - status = osmt_trap_wait( p_osmt, &qp_ctx); - - /* cleanup */ - osmt_unbind_inform_qp( p_osmt, &qp_ctx); - - if (status != IB_SUCCESS) - { - goto Exit; - } - -#endif - - /* o15.0.1.15: */ /* - Try deletion of the IPoIB MCG and get: ERR_REQ_INVALID */ osm_log( &p_osmt->log, OSM_LOG_INFO, @@ -2816,7 +2845,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0223: " - "Fail to catch BAD delete from IPoIB: %s/%s\n", + "Failed to catch BAD delete from IPoIB: %s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2829,17 +2858,15 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osmt_init_mc_query_rec(p_osmt, &mc_req_rec); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Join with un-realistic mtu : \n" - "\t\tFirst create new MCG then try to join it \n" - "\t\twith unrealistic MTU greater then 4096 (o15.0.1.8)...\n" + "Checking Join with unrealistic mtu : \n" + "\t\tFirst create new MCG than try to join it \n" + "\t\twith unrealistic MTU greater than 4096 (o15.0.1.8)...\n" ); /* First create new mgrp */ ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); mc_req_rec.mtu = IB_MTU_LEN_1024 | IB_PATH_SELECTOR_EXACTLY << 6; cl_memclr(&mc_req_rec.mgid,sizeof(ib_gid_t)); - - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -2856,15 +2883,12 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { &mc_req_rec, comp_mask, &res_sa_mad ); - - - p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad); if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 02ea " - "Failed to create new mgrp.\n"); + "osmt_run_mcast_flow: ERR 02eb: " + "Failed to create new mgrp\n"); goto Exit; } cl_memcpy(&tmp_mgid,&p_mc_res->mgid,sizeof(ib_gid_t)); @@ -2872,7 +2896,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /* tmp_mtu = p_mc_res->mtu & 0x3F; */ - /* impossible requested mtu always greater then exist in MCG */ + /* impossible requested mtu always greater than exist in MCG */ osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: " " Expecting Errors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" @@ -2880,7 +2904,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { mc_req_rec.mtu = IB_MTU_LEN_4096 | IB_PATH_SELECTOR_GREATER_THAN << 6; cl_memcpy(&mc_req_rec.mgid,&tmp_mgid,sizeof(ib_gid_t)); ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); - comp_mask = IB_MCR_COMPMASK_GID | IB_MCR_COMPMASK_PORT_GID | @@ -2900,7 +2923,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02e4: " - "Expecetd REMOTE ERROR got:%s/%s.\n", + "Expected REMOTE ERROR got:%s/%s\n", ib_get_err_str( status ), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ) ); @@ -2913,13 +2936,13 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { cnt = cl_qmap_count(&p_osmt->exp_subn.mgrp_mlid_tbl); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow (Before checking Max MCG creation): " - "Number of MC Records found at SA DB is %d.\n",cnt); + "Number of MC Records found in SA DB is %d\n",cnt); /**************************************************************************/ /* Checking join on behalf of remote port gid */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Proxy Join ...\n" + "Checking Proxy Join...\n" ); osmt_init_mc_query_rec(p_osmt, &mc_req_rec); cl_memclr( &context, sizeof( context ) ); @@ -2933,7 +2956,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 0007: " + "osmt_run_mcast_flow: ERR 02e5: " "osmtest_get_all_recs failed on getting all node records(%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -2945,7 +2968,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { num_recs = context.result.result_cnt; osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_run_mcast_flow: " - "Received %u records.\n", num_recs ); + "Received %u records\n", num_recs ); for( i = 0; i < num_recs; i++ ) { @@ -2988,8 +3011,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02b4: " - "Could not join on behalf of remote port 0x%016" PRIx64 - " remote status: %s.\n", + "Could not join on behalf of remote port 0x%016" PRIx64 + " remote status: %s\n", cl_ntoh64(remote_port_guid), ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )); status = IB_ERROR; @@ -3014,8 +3037,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02a9: " - "Succeed deletion of remote port guid with local one MGID : " - "0x%016" PRIx64 " : 0x%016" PRIx64 " , Got : %s/%s\n", + "Successful deletion of remote port guid with local one MGID : " + "0x%016" PRIx64 " : 0x%016" PRIx64 ", Got : %s/%s\n", cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix), cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id), ib_get_err_str( status ), @@ -3038,9 +3061,9 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 02ab: " + "osmt_run_mcast_flow: ERR 02b0: " "Failed to delete mgid with remote port guid MGID : " - "0x%016" PRIx64 " : 0x%016" PRIx64 " , Got : %s/%s\n", + "0x%016" PRIx64 " : 0x%016" PRIx64 ", Got : %s/%s\n", cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix), cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id), ib_get_err_str( status ), @@ -3050,10 +3073,9 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { } else { - osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Could not check proxy join since could not found remote port , different from local port.\n"); + "Could not check proxy join since could not found remote port, different from local port\n"); } @@ -3062,11 +3084,11 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /**************************************************************************/ if (p_osmt->opt.mmode > 2) { - /* Check invalid Join with max mlid which is more then the + /* Check invalid Join with max mlid which is more than the Mellanox switches support 0xC000+0x1000 = 0xd000 */ osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Creation of Maximum avaliable Groups (MulticastFDBCap) ...\n" + "Checking Creation of Maximum avaliable Groups (MulticastFDBCap)...\n" ); tmp_mlid = cl_ntoh16(max_mlid) - cnt; @@ -3082,8 +3104,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { IB_PATH_SELECTOR_GREATER_THAN << 6; mc_req_rec.mlid = max_mlid; cl_memclr(&mc_req_rec.mgid,sizeof(ib_gid_t)); - - comp_mask = IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID | @@ -3099,8 +3119,6 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { comp_mask, &res_sa_mad ); - - p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad); if (status != IB_SUCCESS) { @@ -3110,7 +3128,7 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow : ERR 2E1 " - "Succceed Join with greater mlid then switches support (MulticastFDBCap) 0x%04X.\n", + "Successful Join with greater mlid than switches support (MulticastFDBCap) 0x%04X\n", cur_mlid); status = IB_ERROR; osm_dump_mc_record( &p_osmt->log, p_mc_res, OSM_LOG_VERBOSE ); @@ -3124,9 +3142,17 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { else { cur_mlid = cl_ntoh16(p_mc_res->mlid); + /* Save the mlid created in test_created_mlids map */ + p_recvd_rec = (ib_member_rec_t*)ib_sa_mad_get_payload_ptr( &res_sa_mad ); osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_run_mcast_flow : " - "Added to new MCGroup with Mlid 0x04%x\n",cur_mlid); + "Created MGID:0x%016" PRIx64 " : " + "0x%016" PRIx64 " MLID:0x%04X\n", + cl_ntoh64( p_recvd_rec->mgid.unicast.prefix ), + cl_ntoh64( p_recvd_rec->mgid.unicast.interface_id ), + cl_ntoh16( p_recvd_rec->mlid )); + cl_map_insert(&test_created_mlids, + cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec ); } tmp_mlid--; } @@ -3136,13 +3162,12 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { /**************************************************************************/ /* o15.0.1.16: */ /* - Try GetTable with PortGUID wildcarded and get back some groups. */ + status = osmt_query_mcast( p_osmt); cnt = cl_qmap_count(&p_osmt->exp_subn.mgrp_mlid_tbl); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow (Before Deletion of all MCG): " - "Number of MC Records found at SA DB is %d.\n",cnt); - - + "Number of MC Records found in SA DB is %d\n",cnt); /* Delete all MCG that are not of IPoIB */ osm_log( &p_osmt->log, OSM_LOG_INFO, @@ -3158,11 +3183,9 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { if (cl_memcmp(&osm_ipoib_good_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(osm_ipoib_good_mgid)) && cl_memcmp(&osm_ts_ipoib_good_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(osm_ts_ipoib_good_mgid))) { - osmt_init_mc_query_rec(p_osmt, &mc_req_rec); mc_req_rec.mgid = p_mgrp->mcmember_rec.mgid; - /* o15-0.1.4 - need to specify the oppsite state for a valid delete */ if (!cl_memcmp(&special_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(special_mgid))) { @@ -3179,8 +3202,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_run_mcast_flow : " - "Sending request to delete MGID : 0x%016" PRIx64 - " : 0x%016" PRIx64 ", scope_state : 0x%02X.\n", + "Sending request to delete MGID : 0x%016" PRIx64 + " : 0x%016" PRIx64 ", scope_state : 0x%02X\n", cl_ntoh64(mc_req_rec.mgid.unicast.prefix), cl_ntoh64(mc_req_rec.mgid.unicast.interface_id), mc_req_rec.scope_state); @@ -3192,8 +3215,8 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02FF: " - "Fail to delete MGID : 0x%016" PRIx64 " : 0x%016" PRIx64 - " ,\n\t\t it is not our MCG , Status : %s/%s\n", + "Failed to delete MGID : 0x%016" PRIx64 " : 0x%016" PRIx64 + " ,\n\t\t it is not our MCG, Status : %s/%s\n", cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix), cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id), ib_get_err_str( status ), @@ -3213,34 +3236,64 @@ osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) { "GetTable of all records has failed!\n"); goto Exit; } - /* Only when we are on single mode check flow - do the count comparison , otherwise skip */ + + /* If we are in single mode check flow - need to make sure all the multicast groups + that are left are not ones created during the flow. + */ if (p_osmt->opt.mmode == 1 || p_osmt->opt.mmode == 3) { end_cnt = cl_qmap_count(&p_osmt->exp_subn.mgrp_mlid_tbl); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow (After Deletion of all MCG): " - "Number of MC Records found at SA DB is %d.\n",end_cnt); - /* In a single mode we should treat the MCG as ours , if there are groups - that could not be deleted it means that an outside source has used MC (porbably - not from our port as well) , thus we cannot assure (in a single mode) that our - comparison Start vs End count is valid */ - if (end_cnt != start_cnt && fail_to_delete_mcg == 0) + "Number of MC Records found in SA DB is %d\n",end_cnt); + /* when we comapre num of MCG we should consider an outside source which create other MCGs */ + if ((end_cnt-fail_to_delete_mcg) != (start_cnt - mcg_outside_test_cnt)) { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_mcast_flow: ERR 02ab: " - "Got different number of records stored in SA DB at Start got \n\t\t" - " %d , at End got %d\n", - start_cnt,end_cnt); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "At start got %d MCG external groups (not IPoIB) , at end got %d MCG that could not be deleted \n\t\t" - " (registered from different port or different pkey)\n",mcg_outside_test_cnt,fail_to_delete_mcg); + "Got different number of records stored in SA DB\n\t\t" + "at Start got %d, at End got %d (IPoIB groups only)\n", + (start_cnt-mcg_outside_test_cnt),(end_cnt-fail_to_delete_mcg)); + } + p_mgrp_mlid_tbl = &p_osmt->exp_subn.mgrp_mlid_tbl; + p_mgrp = (osmtest_mgrp_t*)cl_qmap_head( p_mgrp_mlid_tbl ); + while( p_mgrp != (osmtest_mgrp_t*)cl_qmap_end( p_mgrp_mlid_tbl ) ) + { + uint16_t mlid = (uint16_t)cl_qmap_key((cl_map_item_t*)p_mgrp); + osm_log( &p_osmt->log, OSM_LOG_INFO, + "osmt_run_mcast_flow: " + "Found MLID:0x%04X\n", + mlid); + /* Check if the mlid is in the test_created_mlids. If TRUE, then we + didn't delete a MCgroup that was created in this flow. */ + if ( cl_map_get (&test_created_mlids, mlid) != NULL ) + { + /* This means that we still have an mgrp that we created!! */ + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_mcast_flow: ERR 02FG: " + "Wasn't able to erase mgrp with MGID:0x%016" PRIx64 " : 0x%016" + PRIx64 " MLID:0x%04X\n", + cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix), + cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id), + mlid ); status=IB_ERROR; goto Exit; } + else + { + osm_log( &p_osmt->log, OSM_LOG_INFO, + "osmt_run_mcast_flow: " + "Still exists MGID:0x%016" PRIx64 " : 0x%016" + PRIx64 "\n", + cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix), + cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id) ); + } + p_mgrp = (osmtest_mgrp_t*)cl_qmap_next( &p_mgrp->map_item ); + } } Exit: OSM_LOG_EXIT( &p_osmt->log ); return status; } + diff --git a/trunk/ulp/opensm/user/osmtest/osmt_service.c b/trunk/ulp/opensm/user/osmtest/osmt_service.c index fe4f6015..ec075d52 100644 --- a/trunk/ulp/opensm/user/osmtest/osmt_service.c +++ b/trunk/ulp/opensm/user/osmtest/osmt_service.c @@ -1,33 +1,33 @@ /* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * * $Id$ */ @@ -47,18 +47,19 @@ */ /* next error code: 16A */ + #ifndef __WIN__ #include +#else +#include #endif #include #include -#include #include #include #include #include "osmtest.h" - ib_api_status_t osmt_register_service( IN osmtest_t * const p_osmt, IN ib_net64_t service_id, @@ -77,7 +78,7 @@ osmt_register_service( IN osmtest_t * const p_osmt, osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_register_service: " - "Registering Service: name:%s id:0x%" PRIx64 ".\n", + "Registering service: name: %s id: 0x%" PRIx64 "\n", service_name, cl_ntoh64(service_id)); cl_memclr( &req, sizeof( req ) ); @@ -137,8 +138,8 @@ osmt_register_service( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_register_service: ERR 0303: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_register_service: ERR 4A01: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -147,14 +148,14 @@ osmt_register_service( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_register_service: ERR 0364: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_register_service: ERR 4A02: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); if( status == IB_REMOTE_ERROR ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_register_service: " - "Remote error = %s.\n", + "Remote error = %s\n", ib_get_mad_status_str( osm_madw_get_mad_ptr ( context.result. p_result_madw ) ) ); @@ -173,7 +174,6 @@ osmt_register_service( IN osmtest_t * const p_osmt, return status; } - ib_api_status_t osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt, IN ib_net64_t service_id, @@ -193,7 +193,7 @@ osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt, osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_register_service_with_full_key: " - "Registering Service: name:%s id:0x%" PRIx64 ".\n", + "Registering service: name: %s id: 0x%" PRIx64 "\n", service_name, cl_ntoh64(service_id)); cl_memclr( &req, sizeof( req ) ); @@ -254,8 +254,8 @@ osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_register_service_with_full_key: ERR 0303: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_register_service_with_full_key: ERR 4A03: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -264,12 +264,12 @@ osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt, /* Check service key on context to see if match */ p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 ); osm_log( &p_osmt->log, OSM_LOG_VERBOSE, - "Comparing service key ...\n" - "return key is :\n"); - for (i=0;i<=15;i++) + "Comparing service key...\n" + "return key is:\n"); + for (i = 0; i <= 15; i++) { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, - "service_key sent[%u]=%u , service_key returned[%u]=%u\n", + "service_key sent[%u] = %u, service_key returned[%u] = %u\n", i,service_key[i],i,p_rec->service_key[i]); } /* since c15-0.1.14 not supported all key association queries should bring in return zero in service key */ @@ -278,7 +278,7 @@ osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt, status = IB_REMOTE_ERROR; osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_register_service_with_full_key:" - "Data mismatch in service_key .\n" + "Data mismatch in service_key\n" ); goto Exit; } @@ -286,14 +286,14 @@ osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_register_service_with_full_key: ERR 0364: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_register_service_with_full_key: ERR 4A04: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); if( status == IB_REMOTE_ERROR ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_register_service_with_full_key: " - "Remote error = %s.\n", + "Remote error = %s\n", ib_get_mad_status_str( osm_madw_get_mad_ptr ( context.result. p_result_madw ) ) ); @@ -318,7 +318,7 @@ osmt_register_service_with_data( IN osmtest_t * const p_osmt, IN ib_net16_t service_pkey, IN ib_net32_t service_lease, IN uint8_t service_key_lsb, - IN uint8_t *service_data8, + IN uint8_t *service_data8, IN ib_net16_t *service_data16, IN ib_net32_t *service_data32, IN ib_net64_t *service_data64, @@ -331,12 +331,11 @@ osmt_register_service_with_data( IN osmtest_t * const p_osmt, ib_api_status_t status; /* ib_service_record_t* p_rec; */ - OSM_LOG_ENTER( p_log, osmt_register_service_with_data ); osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_register_service_with_data: " - "Registering Service: name:%s id:0x%" PRIx64 ".\n", + "Registering service: name: %s id: 0x%" PRIx64 "\n", service_name, cl_ntoh64(service_id)); cl_memclr( &req, sizeof( req ) ); @@ -425,8 +424,8 @@ osmt_register_service_with_data( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_register_service_with_data: ERR 0303: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_register_service_with_data: ERR 4A05: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -435,14 +434,14 @@ osmt_register_service_with_data( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_register_service_with_data: ERR 0364: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_register_service_with_data: ERR 4A06: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); if( status == IB_REMOTE_ERROR ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_register_service_with_data: " - "Remote error = %s.\n", + "Remote error = %s\n", ib_get_mad_status_str( osm_madw_get_mad_ptr ( context.result. p_result_madw ) ) ); @@ -453,7 +452,7 @@ osmt_register_service_with_data( IN osmtest_t * const p_osmt, /* Check data on context to see if match */ p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 ); osm_log( &p_osmt->log, OSM_LOG_VERBOSE, - "Comparing service data ...\n"); + "Comparing service data...\n"); if (cl_memcmp(service_data8,p_rec->service_data8,16*sizeof(uint8_t)) != 0 || cl_memcmp(service_data16,p_rec->service_data16,8*sizeof(uint16_t)) != 0 || cl_memcmp(service_data32,p_rec->service_data32,4*sizeof(uint32_t)) != 0 || @@ -463,7 +462,7 @@ osmt_register_service_with_data( IN osmtest_t * const p_osmt, status = IB_REMOTE_ERROR; osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_register_service_with_data: " - "Data mismatch in service_data8 ." + "Data mismatch in service_data8\n" ); goto Exit; } @@ -484,8 +483,7 @@ osmt_get_service_by_id_and_name ( IN osmtest_t * const p_osmt, IN uint32_t rec_num, IN ib_net64_t sid, IN char *sr_name, - OUT ib_service_record_t *p_out_rec - ) { + OUT ib_service_record_t *p_out_rec) { ib_api_status_t status = IB_SUCCESS; osmtest_req_context_t context; @@ -494,13 +492,12 @@ osmt_get_service_by_id_and_name ( IN osmtest_t * const p_osmt, uint32_t num_recs = 0; osmv_user_query_t user; - OSM_LOG_ENTER( &p_osmt->log, osmt_get_service_by_id ); if( osm_log_is_active( &p_osmt->log, OSM_LOG_VERBOSE ) ) osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_id_and_name: " - "Getting Service Record by id 0x%016" PRIx64 " and name : %s\n", + "Getting service record: id: 0x%016" PRIx64 " and name: %s\n", cl_ntoh64(sid),sr_name); /* @@ -510,26 +507,29 @@ osmt_get_service_by_id_and_name ( IN osmtest_t * const p_osmt, * * The query structures are locals. */ - cl_memclr( &svc_rec, sizeof( svc_rec ) ); cl_memclr( &req, sizeof( req ) ); cl_memclr( &context, sizeof( context ) ); - cl_memclr( &user, sizeof( user ) ); - /* set the new service record fields */ - cl_memclr(svc_rec.service_name, sizeof(svc_rec.service_name)); - cl_memcpy(svc_rec.service_name, sr_name, - (strlen(sr_name)+1)*sizeof(char)); - svc_rec.service_id = sid; - /* prepare the data used for this query */ + context.p_osmt = p_osmt; + + /* prepare the data used for this query */ req.query_type = OSMV_QUERY_USER_DEFINED; req.timeout_ms = p_osmt->opt.transaction_timeout; req.retry_cnt = p_osmt->opt.retry_count; req.flags = OSM_SA_FLAGS_SYNC; req.query_context = &context; req.pfn_query_cb = osmtest_query_res_cb; - req.p_query_input = &user; req.sm_key = 0; + cl_memclr( &svc_rec, sizeof( svc_rec ) ); + cl_memclr( &user, sizeof( user ) ); + /* set the new service record fields */ + cl_memclr(svc_rec.service_name, sizeof(svc_rec.service_name)); + cl_memcpy(svc_rec.service_name, sr_name, + (strlen(sr_name)+1)*sizeof(char)); + svc_rec.service_id = sid; + req.p_query_input = &user; + user.method = IB_MAD_METHOD_GET; user.attr_id = IB_MAD_ATTR_SERVICE_RECORD; user.comp_mask = IB_SR_COMPMASK_SID | IB_SR_COMPMASK_SNAME; @@ -537,66 +537,77 @@ osmt_get_service_by_id_and_name ( IN osmtest_t * const p_osmt, user.p_attr = &svc_rec; status = osmv_query_sa( p_osmt->h_bind, &req ); - if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_id_and_name: ERR 0365: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_get_service_by_id_and_name: ERR 4A07: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } status = context.result.status; + num_recs = context.result.result_cnt; if( status != IB_SUCCESS ) { - num_recs = 0; - if (status != IB_INVALID_PARAMETER) - { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_id_and_name: ERR 0370: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); - } + char mad_stat_err[256]; + + /* If the failure is due to IB_SA_MAD_STATUS_NO_RECORDS and rec_num is 0, + then this is fine */ if( status == IB_REMOTE_ERROR ) + strcpy(mad_stat_err, ib_get_mad_status_str( + osm_madw_get_mad_ptr(context.result.p_result_madw) ) ); + else + strcpy(mad_stat_err, ib_get_err_str(status) ); + if( status == IB_REMOTE_ERROR && + !strcmp(mad_stat_err, "IB_SA_MAD_STATUS_NO_RECORDS") && + rec_num == 0 ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_service_by_id_and_name: " - "Remote error = %s.\n", - ib_get_mad_status_str( osm_madw_get_mad_ptr - ( context.result. - p_result_madw ) ) ); - } - goto Exit; + "IS EXPECTED ERROR ^^^^\n"); + status = IB_SUCCESS; } else { - num_recs = context.result.result_cnt; + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_get_service_by_id_and_name: ERR 4A08: " + "Query failed: %s (%s)\n", + ib_get_err_str(status), + mad_stat_err ); + goto Exit; + } } - if ( num_recs != rec_num ) + if ( rec_num && num_recs != rec_num ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_service_by_id_and_name: " - "Unmatched record number , Expeceted : %d , Got : %d.\n", - rec_num , num_recs); + "Unmatched number of records: expected: %d, received: %d\n", + rec_num, num_recs); status = IB_REMOTE_ERROR; goto Exit; } p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 ); + *p_out_rec = *p_rec; + + if (num_recs) + { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_id_and_name: " - "Found Service Record by Name:%s ID::0x%016" PRIx64 ".\n", + "Found service record: name: %s id: 0x%016" PRIx64 "\n", p_rec->service_name, cl_ntoh64(p_rec->service_id)); osm_dump_service_record(&p_osmt->log, p_rec, OSM_LOG_DEBUG); - *p_out_rec = *p_rec; + } Exit: osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_id_and_name: " - "Expected num of records is : %d , Found number of records : %d\n", - rec_num,num_recs); + "Expected and found %d records\n", + rec_num ); + if( context.result.p_result_madw != NULL ) { osm_mad_pool_put( &p_osmt->mad_pool, context.result.p_result_madw ); @@ -611,8 +622,7 @@ ib_api_status_t osmt_get_service_by_id ( IN osmtest_t * const p_osmt, IN uint32_t rec_num, IN ib_net64_t sid, - OUT ib_service_record_t *p_out_rec - ) { + OUT ib_service_record_t *p_out_rec) { ib_api_status_t status = IB_SUCCESS; osmtest_req_context_t context; @@ -621,13 +631,12 @@ osmt_get_service_by_id ( IN osmtest_t * const p_osmt, uint32_t num_recs = 0; osmv_user_query_t user; - OSM_LOG_ENTER( &p_osmt->log, osmt_get_service_by_id ); if( osm_log_is_active( &p_osmt->log, OSM_LOG_VERBOSE ) ) osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_id: " - "Getting Service Record by id 0x%016" PRIx64 "\n", + "Getting service record: id: 0x%016" PRIx64 "\n", cl_ntoh64(sid)); /* @@ -637,23 +646,26 @@ osmt_get_service_by_id ( IN osmtest_t * const p_osmt, * * The query structures are locals. */ - cl_memclr( &svc_rec, sizeof( svc_rec ) ); cl_memclr( &req, sizeof( req ) ); cl_memclr( &context, sizeof( context ) ); - cl_memclr( &user, sizeof( user ) ); - /* set the new service record fields */ - svc_rec.service_id = sid; - /* prepare the data used for this query */ + context.p_osmt = p_osmt; + + /* prepare the data used for this query */ req.query_type = OSMV_QUERY_USER_DEFINED; req.timeout_ms = p_osmt->opt.transaction_timeout; req.retry_cnt = p_osmt->opt.retry_count; req.flags = OSM_SA_FLAGS_SYNC; req.query_context = &context; req.pfn_query_cb = osmtest_query_res_cb; - req.p_query_input = &user; req.sm_key = 0; + cl_memclr( &svc_rec, sizeof( svc_rec ) ); + cl_memclr( &user, sizeof( user ) ); + /* set the new service record fields */ + svc_rec.service_id = sid; + req.p_query_input = &user; + user.method = IB_MAD_METHOD_GET; user.attr_id = IB_MAD_ATTR_SERVICE_RECORD; user.comp_mask = IB_SR_COMPMASK_SID; @@ -661,66 +673,78 @@ osmt_get_service_by_id ( IN osmtest_t * const p_osmt, user.p_attr = &svc_rec; status = osmv_query_sa( p_osmt->h_bind, &req ); - if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_id: ERR 0365: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_get_service_by_id: ERR 4A09: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } status = context.result.status; + num_recs = context.result.result_cnt; if( status != IB_SUCCESS ) { - num_recs = 0; - if (status != IB_INVALID_PARAMETER) - { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_id: ERR 0370: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); - } + char mad_stat_err[256]; + + /* If the failure is due to IB_SA_MAD_STATUS_NO_RECORDS and rec_num is 0, + then this is fine */ if( status == IB_REMOTE_ERROR ) + strcpy(mad_stat_err, ib_get_mad_status_str( + osm_madw_get_mad_ptr(context.result.p_result_madw) ) ); + else + strcpy(mad_stat_err, ib_get_err_str(status) ); + + if( status == IB_REMOTE_ERROR && + !strcmp(mad_stat_err, "IB_SA_MAD_STATUS_NO_RECORDS") && + rec_num == 0 ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_service_by_id: " - "Remote error = %s.\n", - ib_get_mad_status_str( osm_madw_get_mad_ptr - ( context.result. - p_result_madw ) ) ); - } - goto Exit; + "IS EXPECTED ERROR ^^^^\n"); + status = IB_SUCCESS; } else { - num_recs = context.result.result_cnt; + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_get_service_by_id: ERR 4A0A: " + "Query failed: %s (%s)\n", + ib_get_err_str(status), + mad_stat_err ); + goto Exit; + } } - if ( num_recs != rec_num ) + if ( rec_num && num_recs != rec_num ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_id: " - "Unmatched record number , Expeceted : %d , Got : %d.\n", - rec_num , num_recs); + "osmt_get_service_by_id: ERR 4A0B: " + "Unmatched number of records: expected: %d received: %d\n", + rec_num, num_recs); status = IB_REMOTE_ERROR; goto Exit; } p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 ); + *p_out_rec = *p_rec; + + if (num_recs) + { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_id: " - "Found Service Record by Name:%s ID::0x%016" PRIx64 ".\n", + "Found service record: name: %s id: 0x%016" PRIx64 "\n", p_rec->service_name, cl_ntoh64(p_rec->service_id)); osm_dump_service_record(&p_osmt->log, p_rec, OSM_LOG_DEBUG); - *p_out_rec = *p_rec; + } Exit: osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_id: " - "Expected num of records is : %d , Found number of records : %d\n", - rec_num,num_recs); + "Expected and found %d records\n", + rec_num ); + if( context.result.p_result_madw != NULL ) { osm_mad_pool_put( &p_osmt->mad_pool, context.result.p_result_madw ); @@ -736,30 +760,31 @@ osmt_get_service_by_name_and_key ( IN osmtest_t * const p_osmt, IN char * sr_name, IN uint32_t rec_num, IN uint8_t *skey, - OUT ib_service_record_t *p_out_rec - ) { + OUT ib_service_record_t *p_out_rec) { ib_api_status_t status = IB_SUCCESS; osmtest_req_context_t context; osmv_query_req_t req; ib_service_record_t svc_rec,*p_rec; - uint32_t num_recs = 0; + uint32_t num_recs = 0, i; osmv_user_query_t user; - OSM_LOG_ENTER( &p_osmt->log, osmt_get_service_by_name_and_key ); if( osm_log_is_active( &p_osmt->log, OSM_LOG_VERBOSE ) ) { - uint8_t i; + char buf_service_key[33]; + + sprintf(buf_service_key, + "0x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + skey[0], skey[1], skey[2], skey[3], skey[4], skey[5], skey[6], skey[7], + skey[8], skey[9], skey[10], skey[11], skey[12], skey[13], skey[14], + skey[15]); + osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_name_and_key: " - "Getting Service Record by Name and Key :%s.\n", - sr_name); - for (i=0 ; i<=15 ; i++) - osm_log( &p_osmt->log, OSM_LOG_VERBOSE, - "Service Key[%u] = %u\n", - i,skey[i]); + "Getting service record: name: %s and key: %s\n", + sr_name, buf_service_key ); } /* @@ -769,93 +794,109 @@ osmt_get_service_by_name_and_key ( IN osmtest_t * const p_osmt, * * The query structures are locals. */ - cl_memclr( &svc_rec, sizeof( svc_rec ) ); cl_memclr( &req, sizeof( req ) ); cl_memclr( &context, sizeof( context ) ); - cl_memclr( &user, sizeof( user ) ); - /* set the new service record fields */ - cl_memclr(svc_rec.service_name, sizeof(svc_rec.service_name)); - cl_memcpy(svc_rec.service_name, sr_name, - (strlen(sr_name)+1)*sizeof(char)); - /* prepare the data used for this query */ context.p_osmt = p_osmt; + + /* prepare the data used for this query */ req.query_type = OSMV_QUERY_USER_DEFINED; req.timeout_ms = p_osmt->opt.transaction_timeout; req.retry_cnt = p_osmt->opt.retry_count; req.flags = OSM_SA_FLAGS_SYNC; req.query_context = &context; req.pfn_query_cb = osmtest_query_res_cb; - req.p_query_input = &user; req.sm_key = 0; + cl_memclr( &svc_rec, sizeof( svc_rec ) ); + cl_memclr( &user, sizeof( user ) ); + /* set the new service record fields */ + cl_memclr(svc_rec.service_name, sizeof(svc_rec.service_name)); + cl_memcpy(svc_rec.service_name, sr_name, + (strlen(sr_name)+1)*sizeof(char)); + for (i = 0; i <= 15; i++) + svc_rec.service_key[i] = skey[i]; + + req.p_query_input = &user; + user.method = IB_MAD_METHOD_GET; user.attr_id = IB_MAD_ATTR_SERVICE_RECORD; user.comp_mask = IB_SR_COMPMASK_SNAME | IB_SR_COMPMASK_SKEY; user.attr_offset = ib_get_attr_offset( sizeof( ib_service_record_t ) ); user.p_attr = &svc_rec; - status = osmv_query_sa( p_osmt->h_bind, &req ); - if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_name_and_key: ERR 0365: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_get_service_by_name_and_key: ERR 4A0C: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } status = context.result.status; + num_recs = context.result.result_cnt; if( status != IB_SUCCESS ) { - num_recs = 0; - if (status != IB_INVALID_PARAMETER) - { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_name_and_key: ERR 0370: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); - } + char mad_stat_err[256]; + + /* If the failure is due to IB_SA_MAD_STATUS_NO_RECORDS and rec_num is 0, + then this is fine */ if( status == IB_REMOTE_ERROR ) + strcpy(mad_stat_err, ib_get_mad_status_str( + osm_madw_get_mad_ptr(context.result.p_result_madw) ) ); + else + strcpy(mad_stat_err, ib_get_err_str(status) ); + + if( status == IB_REMOTE_ERROR && + !strcmp(mad_stat_err, "IB_SA_MAD_STATUS_NO_RECORDS") && + rec_num == 0 ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_service_by_name_and_key: " - "Remote error = %s.\n", - ib_get_mad_status_str( osm_madw_get_mad_ptr - ( context.result. - p_result_madw ) ) ); - } - goto Exit; + "IS EXPECTED ERROR ^^^^\n"); + status = IB_SUCCESS; } else { - num_recs = context.result.result_cnt; + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_get_service_by_name_and_key: ERR 4A0D: " + "Query failed:%s (%s)\n", + ib_get_err_str(status), + mad_stat_err ); + goto Exit; + } } - if ( num_recs != rec_num ) + if ( rec_num && num_recs != rec_num ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_service_by_name_and_key: " - "Unmatched record number , Expeceted : %d , Got : %d.\n", - rec_num , num_recs); + "Unmatched number of records: expected: %d, received: %d\n", + rec_num, num_recs); status = IB_REMOTE_ERROR; goto Exit; } p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 ); + *p_out_rec = *p_rec; + + if ( num_recs ) + { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_name_and_key: " - "Found Service Record by Name:%s ID::0x%016" PRIx64 ".\n", + "Found service record: name: %s id: 0x%016" PRIx64 "\n", sr_name, cl_ntoh64(p_rec->service_id)); osm_dump_service_record(&p_osmt->log, p_rec, OSM_LOG_DEBUG); - *p_out_rec = *p_rec; + } Exit: osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_name_and_key: " - "Expected num of records is : %d , Found number of records : %d\n", - rec_num,num_recs); + "Expected and found %d records\n", + rec_num ); + if( context.result.p_result_madw != NULL ) { osm_mad_pool_put( &p_osmt->mad_pool, context.result.p_result_madw ); @@ -870,8 +911,7 @@ ib_api_status_t osmt_get_service_by_name( IN osmtest_t * const p_osmt, IN char * sr_name, IN uint32_t rec_num, - OUT ib_service_record_t *p_out_rec - ) { + OUT ib_service_record_t *p_out_rec) { ib_api_status_t status = IB_SUCCESS; osmtest_req_context_t context; @@ -883,12 +923,10 @@ osmt_get_service_by_name( IN osmtest_t * const p_osmt, OSM_LOG_ENTER( &p_osmt->log, osmt_get_service_by_name ); if( osm_log_is_active( &p_osmt->log, OSM_LOG_VERBOSE ) ) - { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_name: " - "Getting Service Record by Name:%s.\n", + "Getting service record: name: %s\n", sr_name); - } /* * Do a blocking query for this record in the subnet. @@ -902,79 +940,91 @@ osmt_get_service_by_name( IN osmtest_t * const p_osmt, context.p_osmt = p_osmt; + /* prepare the data used for this query */ req.query_type = OSMV_QUERY_SVC_REC_BY_NAME; req.timeout_ms = p_osmt->opt.transaction_timeout; req.retry_cnt = p_osmt->opt.retry_count; req.flags = OSM_SA_FLAGS_SYNC; req.query_context = &context; req.pfn_query_cb = osmtest_query_res_cb; + req.sm_key = 0; + cl_memclr(service_name, sizeof(service_name)); cl_memcpy(service_name, sr_name, (strlen(sr_name)+1)*sizeof(char)); req.p_query_input = service_name; - req.sm_key = 0; status = osmv_query_sa( p_osmt->h_bind, &req ); - if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_name: ERR 0365: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_get_service_by_name: ERR 4A0E: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } status = context.result.status; + num_recs = context.result.result_cnt; if( status != IB_SUCCESS ) { - /* The context struct is not init OR result with illegal number of records */ - num_recs = 0; - if (status != IB_INVALID_PARAMETER) - { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_name: ERR 0370: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); - } + char mad_stat_err[256]; + + /* If the failure is due to IB_SA_MAD_STATUS_NO_RECORDS and rec_num is 0, + then this is fine */ if( status == IB_REMOTE_ERROR ) + strcpy(mad_stat_err, ib_get_mad_status_str( + osm_madw_get_mad_ptr(context.result.p_result_madw) ) ); + else + strcpy(mad_stat_err, ib_get_err_str(status) ); + + if( status == IB_REMOTE_ERROR && + !strcmp(mad_stat_err, "IB_SA_MAD_STATUS_NO_RECORDS") && + rec_num == 0 ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_service_by_name: " - "Remote error = %s.\n", - ib_get_mad_status_str( osm_madw_get_mad_ptr - ( context.result. - p_result_madw ) ) ); - } - goto Exit; + "IS EXPECTED ERROR ^^^^\n"); + status = IB_SUCCESS; } else { - num_recs = context.result.result_cnt; + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_get_service_by_name: ERR 4A0F: " + "Query failed: %s (%s)\n", + ib_get_err_str(status), + mad_stat_err ); + goto Exit; + } } - if ( num_recs != rec_num ) + if ( rec_num && num_recs != rec_num ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_service_by_name: " - "Unmatched record number , Expeceted : %d , Got : %u.\n", - rec_num , num_recs); + "osmt_get_service_by_name: ERR 4A10: " + "Unmatched number of records: expected: %d, received: %d\n", + rec_num, num_recs); status = IB_REMOTE_ERROR; goto Exit; } p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 ); + *p_out_rec = *p_rec; + + if (num_recs) + { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_name: " - "Found Service Record by Name:%s ID::0x%016" PRIx64 ".\n", + "Found service record: name: %s id: 0x%016" PRIx64 "\n", sr_name, cl_ntoh64(p_rec->service_id)); osm_dump_service_record(&p_osmt->log, p_rec, OSM_LOG_DEBUG); - *p_out_rec = *p_rec; + } Exit: osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_service_by_name: " - "Expected num of records is : %d , Found number of records : %u\n", - rec_num,num_recs); + "Expected and found %d records\n", + rec_num ); if( context.result.p_result_madw != NULL ) { @@ -986,6 +1036,7 @@ osmt_get_service_by_name( IN osmtest_t * const p_osmt, return status; } +#ifdef VENDOR_RMPP_SUPPORT ib_api_status_t osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, IN ib_svc_name_t * const p_valid_service_names_arr, @@ -999,9 +1050,10 @@ osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, uint8_t *p_checked_names; OSM_LOG_ENTER(&p_osmt->log, osmt_get_all_services_and_check_names ); + /* Prepare tracker for the checked names */ p_checked_names = (uint8_t*)cl_malloc(sizeof(uint8_t)*num_of_valid_names); - for (j=0 ; jlog, OSM_LOG_VERBOSE, "osmt_get_all_services_and_check_names: " - "Getting All Service Records\n"); + "Getting all service records\n"); } /* * Do a blocking query for this record in the subnet. @@ -1033,12 +1085,11 @@ osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, req.sm_key = 0; status = osmv_query_sa( p_osmt->h_bind, &req ); - if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_all_services_and_check_names: ERR 0371: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_get_all_services_and_check_names: ERR 4A12: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -1049,14 +1100,14 @@ osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, if (status != IB_INVALID_PARAMETER) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_all_services_and_check_names: ERR 0372: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_get_all_services_and_check_names: ERR 4A13: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); } if( status == IB_REMOTE_ERROR ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmt_get_all_services_and_check_names: " - "Remote error = %s.\n", + "Remote error = %s\n", ib_get_mad_status_str( osm_madw_get_mad_ptr ( context.result. p_result_madw ) ) ); @@ -1067,28 +1118,29 @@ osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, num_recs = context.result.result_cnt; osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_all_services_and_check_names: " - "Received %u records.\n", num_recs ); + "Received %u records\n", num_recs ); for( i = 0; i < num_recs; i++ ) { p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, i ); osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_all_services_and_check_names: " - "Found Service Record by Name:%s ID::0x%016" PRIx64 ".\n", + "Found service record: name: %s id: 0x%016" PRIx64 "\n", p_rec->service_name, cl_ntoh64(p_rec->service_id)); osm_dump_service_record(&p_osmt->log, p_rec, OSM_LOG_VERBOSE); for ( j = 0; j < num_of_valid_names; j++) { - /* If the service names exist in the record , mark it as checked (1) */ + /* If the service names exist in the record, mark it as checked (1) */ osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_all_services_and_check_names: " - "-I- Comparing source name : >%s< , with record name : >%s< , idx : %d\n", - p_valid_service_names_arr[j],p_rec->service_name , p_checked_names[j]); - if ( strcmp(p_valid_service_names_arr[j],p_rec->service_name) == 0 ) + "-I- Comparing source name : >%s<, with record name : >%s<, idx : %d\n", + p_valid_service_names_arr[j],p_rec->service_name, p_checked_names[j]); + if ( strcmp(p_valid_service_names_arr[j], + p_rec->service_name) == 0 ) { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, "osmt_get_all_services_and_check_names: " - "-I- The service %s is Valid\n",p_valid_service_names_arr[j]); + "-I- The service %s is valid\n", p_valid_service_names_arr[j]); p_checked_names[j] = 1; break; } @@ -1099,8 +1151,8 @@ osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, if (p_checked_names[j] == 0) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_get_all_services_and_check_names: ERR 0377: " - "Missing Valid Service Name:%s\n",p_valid_service_names_arr[j]); + "osmt_get_all_services_and_check_names: ERR 4A14: " + "Missing valid service: name: %s\n", p_valid_service_names_arr[j]); status = IB_ERROR; goto Exit; } @@ -1116,11 +1168,12 @@ osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt, OSM_LOG_EXIT( &p_osmt->log ); return status; } +#endif ib_api_status_t osmt_delete_service_by_name(IN osmtest_t * const p_osmt, - IN uint8_t IsServiceExist , - IN char * sr_name , IN uint32_t rec_num) { + IN uint8_t IsServiceExist, + IN char * sr_name, IN uint32_t rec_num) { osmv_query_req_t req; osmv_user_query_t user; osmtest_req_context_t context; @@ -1131,7 +1184,7 @@ osmt_delete_service_by_name(IN osmtest_t * const p_osmt, osm_log( &p_osmt->log, OSM_LOG_INFO, "osmt_delete_service_by_name: " - "Trying to Delete Service: Name:%s.\n", + "Trying to Delete service name: %s\n", sr_name); cl_memclr( &svc_rec, sizeof( svc_rec ) ); @@ -1139,17 +1192,10 @@ osmt_delete_service_by_name(IN osmtest_t * const p_osmt, status = osmt_get_service_by_name(p_osmt, sr_name,rec_num, &svc_rec); if (status != IB_SUCCESS) { - if (IsServiceExist) osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_delete_service_by_name: ERR 001 " - "Nothing to delete - fail to find service by name: %s \n", sr_name); - else - { - osm_log( &p_osmt->log, OSM_LOG_INFO, - "osmt_delete_service_by_name: " - "Record Should not exist , i.e BAD flow\n"); - status = IB_SUCCESS; - } + "osmt_delete_service_by_name: ERR 4A15: " + "Failed to get service: name: %s\n", + sr_name ); goto ExitNoDel; } @@ -1166,7 +1212,7 @@ osmt_delete_service_by_name(IN osmtest_t * const p_osmt, context.p_osmt = p_osmt; req.timeout_ms = p_osmt->opt.transaction_timeout; req.query_context = &context; - req.query_type = OSMV_QUERY_USER_DEFINED; /* basicallya don't care here */ + req.query_type = OSMV_QUERY_USER_DEFINED; /* basically a don't care here */ req.pfn_query_cb = osmtest_query_res_cb; req.p_query_input = &user; req.flags = OSM_SA_FLAGS_SYNC; @@ -1182,29 +1228,57 @@ osmt_delete_service_by_name(IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_delete_service_by_name: ERR 0373: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_delete_service_by_name: ERR 4A16: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } status = context.result.status; - + if ( IsServiceExist ) + { + /* If IsServiceExist = 1 then we should succeed here */ if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_delete_service_by_name: ERR 0374: " - "ib_query failed (%s).\n", ib_get_err_str( status ) ); + "osmt_delete_service_by_name: ERR 4A17: " + "ib_query failed (%s)\n", ib_get_err_str( status ) ); if( status == IB_REMOTE_ERROR ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_delete_service_by_name: " - "Remote error = %s.\n", + "osmt_delete_service_by_name: ERR 4A18: " + "Remote error = %s\n", ib_get_mad_status_str( osm_madw_get_mad_ptr ( context.result. p_result_madw ) ) ); } - goto Exit; + } + } + else + { + /* If IsServiceExist = 0 then we should fail here */ + if ( status == IB_SUCCESS ) + { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_delete_service_by_name: ERR 4A19: " + "Succeeded to delete service: %s which " + "shouldn't exist", + sr_name ); + status = IB_ERROR; + } + else + { + /* The deletion should have failed, since the service_name + shouldn't exist. */ + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: " + "IS EXPECTED ERROR ^^^^\n"); + osm_log( &p_osmt->log, OSM_LOG_INFO, + "osmt_delete_service_by_name: " + "Failed to delete service_name: %s\n", + sr_name ); + status = IB_SUCCESS; + } } Exit: @@ -1253,16 +1327,20 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { OSM_LOG_ENTER( &p_osmt->log, osmt_run_service_records_flow); /* Init Service names */ - for (i=0 ; i<=6 ; i++ ) { - uint64_t rand1 = rand()-(uint64_t)i; - id[i] = abs((int)(pid - rand1)); + for (i = 0; i <= 6; i++) { +#ifdef __WIN__ + uint64_t rand_val = rand()-(uint64_t)i; +#else + uint64_t rand_val = random()-(uint64_t)i; +#endif + id[i] = abs((int)(pid - rand_val)); /* Just to be unique any place on any host */ sprintf((char*)(service_name[i]), - "osmt.srvc.%" PRIu64 ".%" PRIu64 ,rand1,pid); - /*printf("-I- Service Name is : %s , ID is : 0x%" PRIx64 "\n",service_name[i],id[i]);*/ + "osmt.srvc.%" PRIu64 ".%" PRIu64, rand_val,pid); + /*printf("-I- Service Name is : %s, ID is : 0x%" PRIx64 "\n",service_name[i],id[i]);*/ } status = osmt_register_service( - p_osmt , + p_osmt, cl_ntoh64(id[0]), /* IN ib_net64_t service_id, */ IB_DEFAULT_PKEY,/* IN ib_net16_t service_pkey, */ 0xFFFFFFFF, /* IN ib_net32_t service_lease, */ @@ -1275,7 +1353,7 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { } status = osmt_register_service( - p_osmt , + p_osmt, cl_ntoh64(id[1]), /* IN ib_net64_t service_id, */ IB_DEFAULT_PKEY,/* IN ib_net16_t service_pkey, */ cl_hton32(0x00000004), /* IN ib_net32_t service_lease, */ @@ -1288,7 +1366,7 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { } status = osmt_register_service( - p_osmt , + p_osmt, cl_ntoh64(id[2]), /* IN ib_net64_t service_id, */ 0, /* IN ib_net16_t service_pkey, */ 0xFFFFFFFF, /* IN ib_net32_t service_lease, */ @@ -1303,7 +1381,7 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { /* Generate 2 instances of service record with consecutive data */ for (instance = 0 ; instance < 2 ; instance++) { - /* First Clear all arrays */ + /* First, clear all arrays */ cl_memclr (service_data8,16*sizeof(uint8_t)); cl_memclr (service_data16,8*sizeof(uint16_t)); cl_memclr (service_data32,4*sizeof(uint32_t)); @@ -1313,7 +1391,7 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { service_data32[instance]=cl_hton32(instance+3); service_data64[instance]=cl_hton64(instance+4); status = osmt_register_service_with_data( - p_osmt , + p_osmt, cl_ntoh64(id[3]), /* IN ib_net64_t service_id, */ IB_DEFAULT_PKEY, /* IN ib_net16_t service_pkey, */ cl_ntoh32(10), /* IN ib_net32_t service_lease, */ @@ -1332,11 +1410,11 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { /* Trying to create service with zero key */ cl_memclr (service_key,16*sizeof(uint8_t)); status = osmt_register_service_with_full_key( - p_osmt , + p_osmt, cl_ntoh64(id[5]), /* IN ib_net64_t service_id, */ 0, /* IN ib_net16_t service_pkey, */ 0xFFFFFFFF, /* IN ib_net32_t service_lease, */ - service_key, /* full service_key , */ + service_key, /* full service_key, */ (char*)service_name[5] /* IN char *service_name */ ); @@ -1346,15 +1424,15 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { } /* Now update it with Unique key and different service name */ - for (i=0;i <= 15;i++) { - service_key[i]=i + 1; + for (i = 0; i <= 15; i++) { + service_key[i] = i + 1; } status = osmt_register_service_with_full_key( - p_osmt , + p_osmt, cl_ntoh64(id[5]), /* IN ib_net64_t service_id, */ 0, /* IN ib_net16_t service_pkey, */ 0xFFFFFFFF, /* IN ib_net32_t service_lease, */ - service_key, /* full service_key , */ + service_key, /* full service_key, */ (char*)service_name[6] /* IN char *service_name */ ); if (status != IB_SUCCESS) @@ -1365,228 +1443,358 @@ osmt_run_service_records_flow( IN osmtest_t * const p_osmt ) { /* Let OpenSM handle it */ usleep(100); + /* Make sure service_name[0] exists */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[0],1, &srv_rec); + (char*)service_name[0], 1, &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A1A: " + "Fail to find service: name: %s\n", + (char*)service_name[0] ); + status = IB_ERROR; goto Exit; } + /* Make sure service_name[1] exists */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[1],1, &srv_rec); + (char*)service_name[1], 1, &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A1B: " + "Fail to find service: name: %s\n", + (char*)service_name[1] ); + status = IB_ERROR; goto Exit; } + /* Make sure service_name[2] exists */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[2],1, &srv_rec); + (char*)service_name[2], 1, &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A1C: " + "Fail to find service: name: %s\n", + (char*)service_name[2] ); + status = IB_ERROR; goto Exit; } - /* Try to get osmt.srvc.4 b4 (there should be 1 records ) and after 10 sec - It should be deleted */ + /* Make sure service_name[3] exists. */ + /* After 10 seconds the service should not exist: service_lease = 10 */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[3],1, &srv_rec); + (char*)service_name[3], 1, &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A1D: " + "Fail to find service: name: %s\n", + (char*)service_name[3] ); + status = IB_ERROR; goto Exit; } + sleep(10); + status = osmt_get_service_by_name(p_osmt, - (char*)service_name[3],0, &srv_rec); - if (status == IB_SUCCESS) + (char*)service_name[3], 0, &srv_rec); + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A1E: " + "Found service: name: %s that should have been " + "deleted due to service lease expiring\n", + (char*)service_name[3] ); + status = IB_ERROR; goto Exit; } - /* Check that for the current Service ID only one record exists */ - status = osmt_get_service_by_id(p_osmt, 1, cl_ntoh64(id[5]),&srv_rec); + + /* Check that for service: id[5] only one record exists */ + status = osmt_get_service_by_id(p_osmt, 1, cl_ntoh64(id[5]), &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A1F: " + "Found number of records != 1 for " + "service: id: 0x%016" PRIx64 "\n", + id[5] ); + status = IB_ERROR; goto Exit; } - /* Bad Flow of Get with invalid Service ID */ - status = osmt_get_service_by_id(p_osmt, 0,cl_ntoh64(id[7]),&srv_rec); - if (status == IB_SUCCESS) + /* Bad Flow of Get with invalid Service ID: id[7] */ + status = osmt_get_service_by_id(p_osmt, 0, cl_ntoh64(id[7]), &srv_rec); + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A20: " + "Found service: id: 0x%016 " PRIx64 + "that is invalid\n", + id[7] ); + status = IB_ERROR; goto Exit; } - /* Check that for correct name and ID we get record set b4 */ - status = osmt_get_service_by_id_and_name(p_osmt , 1 , cl_ntoh64(id[0]), + + /* Check by both id and service name: id[0], service_name[0] */ + status = osmt_get_service_by_id_and_name(p_osmt, 1, cl_ntoh64(id[0]), (char*)service_name[0], &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A21: " + "Fail to find service: id: 0x%016 " PRIx64 + "name: %s\n", + id[0], + (char*)service_name[0] ); + status = IB_ERROR; goto Exit; } - status = osmt_get_service_by_id_and_name(p_osmt , 1 , cl_ntoh64(id[5]), + + /* Check by both id and service name: id[5], service_name[6] */ + status = osmt_get_service_by_id_and_name(p_osmt, 1, cl_ntoh64(id[5]), (char*)service_name[6], &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A22: " + "Fail to find service: id: 0x%016 " PRIx64 + "name: %s\n", + id[5], + (char*)service_name[6] ); + status = IB_ERROR; goto Exit; } - /* Bad Flow of Get with valid name and invalid ID */ - status = osmt_get_service_by_id_and_name(p_osmt , 0 , cl_ntoh64(id[0]), + /* Bad Flow of Get with invalid name(service_name[3]) and valid ID(id[0]) */ + status = osmt_get_service_by_id_and_name(p_osmt, 0, cl_ntoh64(id[0]), (char*)service_name[3], &srv_rec); - if (status == IB_SUCCESS) + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A23: " + "Found service: id: 0x%016" PRIx64 + "name: %s which is an invalid service\n", + id[0], + (char*)service_name[3] ); + status = IB_ERROR; goto Exit; } - /* Bad Flow of Get with unmatched name (exists but not with the following ID) and valid ID */ - status = osmt_get_service_by_id_and_name(p_osmt , 0 , cl_ntoh64(id[3]), + + /* Bad Flow of Get with unmatched name(service_name[5]) and id(id[3]) (both valid) */ + status = osmt_get_service_by_id_and_name(p_osmt, 0, cl_ntoh64(id[3]), (char*)service_name[5], &srv_rec); - if (status == IB_SUCCESS) + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A24: " + "Found service: id: 0x%016" PRIx64 + "name: %s which is an invalid service\n", + id[3], + (char*)service_name[5] ); + status = IB_ERROR; goto Exit; } + /* Bad Flow of Get with service name that doesn't exist (service_name[4]) */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[4],0, &srv_rec); - if (status == IB_SUCCESS) + (char*)service_name[4], 0, &srv_rec); + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A25: " + "Found service: name: %s that shouldn't exist\n", + (char*)service_name[4] ); + status = IB_ERROR; goto Exit; } - /* Bad Flow : Check that getting osmt.srvc.6 brings no records since another service has been updated with the same ID - osmt.srvc.7 */ + + /* Bad Flow : Check that getting service_name[5] brings no records since another service + has been updated with the same ID (service_name[6] */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[5],0, &srv_rec); - if (status == IB_SUCCESS) + (char*)service_name[5], 0, &srv_rec); + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A26: " + "Found service: name: %s which is an " + "invalid service\n", + (char*)service_name[5] ); + status = IB_ERROR; goto Exit; } - /* Check that getting osmt.srvc.7 by name ONLY is valid since we do not support key&name association , also trusted queries */ + + /* Check that getting service_name[6] by name ONLY is valid, + since we do not support key&name association, also trusted queries */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[6],1, &srv_rec); + (char*)service_name[6], 1, &srv_rec); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A27: " + "Fail to find service: name: %s\n", + (char*)service_name[6] ); + status = IB_ERROR; goto Exit; } /* Test Service Key */ cl_memclr(service_key,16*sizeof(uint8_t)); - status = osmt_get_service_by_name_and_key (p_osmt , + + /* Check for service_name[5] with service_key=0 - the service shouldn't + exist with this name. */ + status = osmt_get_service_by_name_and_key (p_osmt, (char*)service_name[5], 0, service_key,&srv_rec); - if (status == IB_SUCCESS) + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A28: " + "Found service: name: %s key:0 which is an " + "invalid service (wrong name)\n", + (char*)service_name[5] ); + status = IB_ERROR; goto Exit; } - else - { - status = IB_SUCCESS; - } - status = osmt_get_service_by_name_and_key (p_osmt , + + /* Check for service_name[6] with service_key=0 - the service should + exist with different key. */ + status = osmt_get_service_by_name_and_key (p_osmt, (char*)service_name[6], 0, service_key,&srv_rec); - if (status == IB_SUCCESS) + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A29: " + "Found service: name: %s key: 0 which is an " + "invalid service (wrong service_key)\n", + (char*)service_name[6] ); + status = IB_ERROR; goto Exit; } - else - { - status = IB_SUCCESS; - } - for (i=0;i <= 15;i++) + /* check for service_name[6] with the correct service_key */ + for (i = 0; i <= 15; i++) service_key[i]=i + 1; - status = osmt_get_service_by_name_and_key (p_osmt , + status = osmt_get_service_by_name_and_key (p_osmt, (char*)service_name[6], - 0, service_key,&srv_rec); - if (status == IB_SUCCESS) + 1, service_key, &srv_rec); + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A2A: " + "Fail to find service: name: %s with " + "correct service key\n", + (char*)service_name[6] ); + status = IB_ERROR; goto Exit; } - else - { - status = IB_SUCCESS; - } #ifdef VENDOR_RMPP_SUPPORT - - + /* These ar the only service_names which are valid */ cl_memcpy(&service_valid_names[0],&service_name[0],sizeof(uint8_t)*64); cl_memcpy(&service_valid_names[1],&service_name[2],sizeof(uint8_t)*64); cl_memcpy(&service_valid_names[2],&service_name[6],sizeof(uint8_t)*64); - - status = osmt_get_all_services_and_check_names(p_osmt,service_valid_names,3, &num_recs); + status = osmt_get_all_services_and_check_names(p_osmt,service_valid_names, 3, &num_recs); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A2B: " + "Fail to find all services that should exist\n" ); + status = IB_ERROR; goto Exit; } - - #endif - status = osmt_delete_service_by_name(p_osmt,1, - (char*)service_name[0],1); + + /* Delete service_name[0] */ + status = osmt_delete_service_by_name(p_osmt, 1, + (char*)service_name[0], 1); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A2C: " + "Fail to delete service: name: %s\n", + (char*)service_name[0] ); + status = IB_ERROR; goto Exit; } + /* Make sure deletion of service_name[0] succeeded */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[0],1, &srv_rec); - if (status == IB_SUCCESS) + (char*)service_name[0], 0, &srv_rec); + if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_service_records_flow: ERR 001 " - "Expected not to find osmt.srvc.1 \n"); + "osmt_run_service_records_flow: ERR 4A2D: " + "Found service: name: %s that was deleted\n", + (char*)service_name[0] ); status = IB_ERROR; goto Exit; } - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_service_records_flow: " - "IS EXPECTED ERR ^^^^\n"); - - sleep(3); + /* Make sure service_name[1] doesn't exist (expired service lease) */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[1],1, &srv_rec); - if (status == IB_SUCCESS) + (char*)service_name[1], 0, &srv_rec); + if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_service_records_flow: ERR 001 " - "Expected not to find osmt.srvc.2 \n"); + "osmt_run_service_records_flow: ERR 4A2E: " + "Found service: name: %s that should have expired\n", + (char*)service_name[1] ); status = IB_ERROR; goto Exit; } - else - { - osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_service_records_flow: " - "IS EXPECTED ERR ^^^^\n"); - status = IB_SUCCESS; - } + /* Make sure service_name[2] exists */ status = osmt_get_service_by_name(p_osmt, - (char*)service_name[2],1, &srv_rec); + (char*)service_name[2], 1, &srv_rec); if (status != IB_SUCCESS) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmt_run_service_records_flow: ERR 001 " - "Expected to find service osmt.srvc.3\n" ); + "osmt_run_service_records_flow: ERR 4A2F: " + "Fail to find service: name: %s\n", + (char*)service_name[2] ); + status = IB_ERROR; goto Exit; } - status = osmt_delete_service_by_name(p_osmt,1, - (char*)service_name[6],1); + + /* Bad Flow - try to delete non-existent service_name[5] */ + status = osmt_delete_service_by_name(p_osmt, 0, + (char*)service_name[5], 0); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A30: " + "Succeed to delete non-existent service: name: %s\n", + (char*)service_name[5] ); + status = IB_ERROR; goto Exit; } - /* Bad Flow */ - status = osmt_delete_service_by_name(p_osmt,0, - (char*)service_name[5],1); - if (status == IB_SUCCESS) + /* Delete service_name[2] */ + status = osmt_delete_service_by_name(p_osmt, 1, + (char*)service_name[2], 1); + if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A31: " + "Fail to delete service: name: %s\n", + (char*)service_name[2] ); + status = IB_ERROR; goto Exit; } - status = osmt_delete_service_by_name(p_osmt,1, - (char*)service_name[2],1); + /* Delete service_name[6] */ + status = osmt_delete_service_by_name(p_osmt, 1, + (char*)service_name[6], 1); if (status != IB_SUCCESS) { + osm_log( &p_osmt->log, OSM_LOG_ERROR, + "osmt_run_service_records_flow: ERR 4A32: " + "Failed to delete service name: %s\n", + (char*)service_name[6] ); goto Exit; } diff --git a/trunk/ulp/opensm/user/osmtest/osmt_slvl_vl_arb.c b/trunk/ulp/opensm/user/osmtest/osmt_slvl_vl_arb.c index 89707c22..3d58f144 100644 --- a/trunk/ulp/opensm/user/osmtest/osmt_slvl_vl_arb.c +++ b/trunk/ulp/opensm/user/osmtest/osmt_slvl_vl_arb.c @@ -1,38 +1,36 @@ /* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * * $Id$ */ -#ifdef OSM_VENDOR_INTF_MTL - /* * Abstract: * Implementation of SLtoVL and VL Arbitration testing flow.. @@ -46,7 +44,9 @@ /* next error code: 16A */ +#ifndef __WIN__ #include +#endif #include #include #include @@ -114,7 +114,7 @@ osmt_query_vl_arb( osm_log( &p_osmt->log, OSM_LOG_DEBUG, "osmt_query_vl_arb: " "Getting VL_Arbitration Table for port with LID 0x%X Num:0x%X.\n", - cl_ntoh16( lid ) , + cl_ntoh16( lid ), port_num); } @@ -129,7 +129,6 @@ osmt_query_vl_arb( cl_memclr( &user, sizeof( user ) ); cl_memclr( &context, sizeof( context ) ); - context.p_osmt = p_osmt; record.lid = lid; @@ -279,7 +278,7 @@ osmtest_write_slvl_map_table( IN osmtest_t * const p_osmt, IN FILE * fh, IN const ib_slvl_table_record_t * const p_rec ) { - int result,i; + int result, i; cl_status_t status = IB_SUCCESS; OSM_LOG_ENTER( &p_osmt->log, osmtest_write_port_info ); @@ -294,10 +293,12 @@ osmtest_write_slvl_map_table( IN osmtest_t * const p_osmt, p_rec->out_port_num ); fprintf( fh, "SL:"); - for (i = 0; i<16; i++) fprintf( fh,"| %-2u ", i); + for (i = 0; i < 16; i++) + fprintf( fh,"| %-2u ", i); fprintf( fh, "|\nVL:"); - for (i = 0; i<16; i++) fprintf( fh,"| 0x%01X ",ib_slvl_table_get( &p_rec->slvl_tbl, i)); + for (i = 0; i < 16; i++) + fprintf( fh,"| 0x%01X ",ib_slvl_table_get( &p_rec->slvl_tbl, (uint8_t)i)); fprintf( fh,"|\nEND\n\n"); /* Exit: */ @@ -329,7 +330,7 @@ osmt_query_slvl_map( osm_log( &p_osmt->log, OSM_LOG_DEBUG, "osmt_query_slvl_map: " "Getting SLtoVL Map Table for out-port with LID 0x%X Num:0x%X from In-Port:0x%X.\n", - cl_ntoh16( lid ) , + cl_ntoh16( lid ), out_port_num, in_port_num); } @@ -539,5 +540,4 @@ osmt_run_slvl_and_vlarb_records_flow( IN osmtest_t * const p_osmt ) { return status; } -#endif /* OSM_VENDOR_INTF_MTL */ diff --git a/trunk/ulp/opensm/user/osmtest/osmtest.c b/trunk/ulp/opensm/user/osmtest/osmtest.c index ef8ee085..8ea5ae38 100644 --- a/trunk/ulp/opensm/user/osmtest/osmtest.c +++ b/trunk/ulp/opensm/user/osmtest/osmtest.c @@ -1,33 +1,33 @@ /* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * * $Id$ */ @@ -44,6 +44,7 @@ * * $Revision: 1.10 $ */ + #ifdef __WIN__ #pragma warning(disable : 4996) #endif @@ -52,14 +53,18 @@ #include #include +#ifdef __WIN__ #include +#include +#else +#include +#include +#endif #include #include #include "osmtest.h" -#include - -#ifdef LINUX +#ifndef __WIN__ #define strnicmp strncasecmp #endif @@ -184,19 +189,19 @@ const osmtest_token_t token_array[] = { {OSMTEST_TOKEN_CAP_MASK, 15, "CAPABILITY_MASK"}, {OSMTEST_TOKEN_DIAG_CODE, 9, "DIAG_CODE"}, {OSMTEST_TOKEN_MKEY_LEASE_PER, 18, "m_key_lease_period"}, - {OSMTEST_TOKEN_LOC_PORT_NUM, 14 , "local_port_num"}, - {OSMTEST_TOKEN_LINK_WID_EN, 18 , "link_width_enabled"}, - {OSMTEST_TOKEN_LINK_WID_SUP, 20 , "link_width_supported"}, - {OSMTEST_TOKEN_LINK_WID_ACT, 17 , "link_width_active"}, - {OSMTEST_TOKEN_LINK_SPEED_SUP, 20 , "link_speed_supported"}, - {OSMTEST_TOKEN_PORT_STATE, 10 , "port_state"}, - {OSMTEST_TOKEN_STATE_INFO2, 10 , "state_info2"}, - {OSMTEST_TOKEN_MKEY_PROT_BITS, 3 , "mpb"}, - {OSMTEST_TOKEN_LMC, 3 , "lmc"}, - {OSMTEST_TOKEN_LINK_SPEED, 10 , "link_speed"}, - {OSMTEST_TOKEN_MTU_SMSL, 8 , "mtu_smsl"}, - {OSMTEST_TOKEN_VL_CAP, 6 , "vl_cap"}, - {OSMTEST_TOKEN_VL_HIGH_LIMIT, 13 , "vl_high_limit"}, + {OSMTEST_TOKEN_LOC_PORT_NUM, 14, "local_port_num"}, + {OSMTEST_TOKEN_LINK_WID_EN, 18, "link_width_enabled"}, + {OSMTEST_TOKEN_LINK_WID_SUP, 20, "link_width_supported"}, + {OSMTEST_TOKEN_LINK_WID_ACT, 17, "link_width_active"}, + {OSMTEST_TOKEN_LINK_SPEED_SUP, 20, "link_speed_supported"}, + {OSMTEST_TOKEN_PORT_STATE, 10, "port_state"}, + {OSMTEST_TOKEN_STATE_INFO2, 10, "state_info2"}, + {OSMTEST_TOKEN_MKEY_PROT_BITS, 3, "mpb"}, + {OSMTEST_TOKEN_LMC, 3, "lmc"}, + {OSMTEST_TOKEN_LINK_SPEED, 10, "link_speed"}, + {OSMTEST_TOKEN_MTU_SMSL, 8, "mtu_smsl"}, + {OSMTEST_TOKEN_VL_CAP, 6, "vl_cap"}, + {OSMTEST_TOKEN_VL_HIGH_LIMIT, 13, "vl_high_limit"}, {OSMTEST_TOKEN_VL_ARB_HIGH_CAP, 15, "vl_arb_high_cap"}, {OSMTEST_TOKEN_VL_ARB_LOW_CAP, 14, "vl_arb_low_cap"}, {OSMTEST_TOKEN_MTU_CAP, 7, "mtu_cap"}, @@ -402,11 +407,13 @@ subnet_construct( IN subnet_t * const p_subn ) cl_qmap_init( &p_subn->link_tbl ); cl_qmap_init( &p_subn->node_lid_tbl ); cl_qmap_init( &p_subn->node_guid_tbl ); + cl_qmap_init( &p_subn->mgrp_mlid_tbl ); + /* NO WAY TO HAVE UNIQUE PORT BY LID OR GUID */ /* cl_qmap_init( &p_subn->port_lid_tbl ); */ /* cl_qmap_init( &p_subn->port_guid_tbl ); */ + /* port key is a lid and num pair */ - cl_qmap_init( &p_subn->mgrp_mlid_tbl ); cl_qmap_init( &p_subn->port_key_tbl ); cl_qmap_init( &p_subn->path_tbl ); } @@ -438,12 +445,12 @@ osmtest_construct( IN osmtest_t * const p_osmt ) void osmtest_destroy( IN osmtest_t * const p_osmt ) { - cl_map_item_t *p_next_item,*p_item; - - /* Currently there is a problem with IBAL exit flow - memory overrun , so we bypass the vendor deletion - Since it's already will be cleaned by the Windows OS . */ -#ifndef WIN32 - if( p_osmt->p_vendor ) + cl_map_item_t *p_item,*p_next_item; + + /* Currently there is a problem with IBAL exit flow - memory overrun , so we bypass the vendor deletion + Since it's already will be cleaned by the Windows OS . */ +#ifndef __WIN__ + if( p_osmt->p_vendor ) { osm_vendor_delete( &p_osmt->p_vendor ); } @@ -452,7 +459,6 @@ osmtest_destroy( IN osmtest_t * const p_osmt ) cl_qpool_destroy( &p_osmt->port_pool ); cl_qpool_destroy( &p_osmt->node_pool ); - /* destroy the qmap tables */ p_next_item = cl_qmap_head( &p_osmt->exp_subn.link_tbl ); while( p_next_item != cl_qmap_end( &p_osmt->exp_subn.link_tbl ) ) @@ -499,8 +505,6 @@ osmtest_destroy( IN osmtest_t * const p_osmt ) cl_free( p_item ); } - - osm_log_destroy( &p_osmt->log ); } @@ -521,7 +525,8 @@ osmtest_init( IN osmtest_t * const p_osmt, 0x0001, p_opt->log_file, TRUE ); if( status != IB_SUCCESS ) return ( status ); - /* but we do not want any extra staff here */ + + /* but we do not want any extra stuff here */ osm_log_set_level( &p_osmt->log, log_flags ); osm_log( &p_osmt->log, OSM_LOG_FUNCS, @@ -751,11 +756,13 @@ osmtest_validate_sa_class_port_info( IN osmtest_t * const p_osmt) ); Exit: - // if( context.result.p_result_madw != NULL ) - //{ - // osm_mad_pool_put( &p_osmt->mad_pool, context.result.p_result_madw ); - // context.result.p_result_madw = NULL; - //} + /* + if( context.result.p_result_madw != NULL ) + { + osm_mad_pool_put( &p_osmt->mad_pool, context.result.p_result_madw ); + context.result.p_result_madw = NULL; + } + */ OSM_LOG_EXIT( &p_osmt->log ); return ( status ); @@ -794,7 +801,6 @@ osmtest_get_node_rec( IN osmtest_t * const p_osmt, cl_memclr( &user, sizeof( user ) ); cl_memclr( &record, sizeof( record ) ); - record.node_info.node_guid = node_guid; p_context->p_osmt = p_osmt; @@ -812,7 +818,6 @@ osmtest_get_node_rec( IN osmtest_t * const p_osmt, req.p_query_input = &user; req.sm_key = 0; - status = osmv_query_sa( p_osmt->h_bind, &req ); if( status != IB_SUCCESS ) @@ -902,7 +907,6 @@ osmtest_get_node_rec_by_lid( IN osmtest_t * const p_osmt, req.p_query_input = &user; req.sm_key = 0; - status = osmv_query_sa( p_osmt->h_bind, &req ); if( status != IB_SUCCESS ) @@ -990,7 +994,7 @@ osmtest_get_path_rec_by_guid_pair( IN osmtest_t * const p_osmt, if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_get_path_rec_by_guid_pair: ERR 0064: " + "osmtest_get_path_rec_by_guid_pair: ERR 0066: " "ib_query failed (%s).\n", ib_get_err_str( status ) ); if( status == IB_REMOTE_ERROR ) @@ -1005,7 +1009,6 @@ osmtest_get_path_rec_by_guid_pair( IN osmtest_t * const p_osmt, goto Exit; } - Exit: OSM_LOG_EXIT( &p_osmt->log ); @@ -1014,7 +1017,6 @@ osmtest_get_path_rec_by_guid_pair( IN osmtest_t * const p_osmt, /********************************************************************** **********************************************************************/ - ib_api_status_t osmtest_get_port_rec( IN osmtest_t * const p_osmt, IN ib_net16_t const lid, @@ -1117,7 +1119,7 @@ osmtest_get_port_rec_by_num( IN osmtest_t * const p_osmt, osm_log( &p_osmt->log, OSM_LOG_DEBUG, "osmtest_get_port_rec_by_num: " "Getting PortRecord for port with LID 0x%X Num:0x%X.\n", - cl_ntoh16( lid ) , + cl_ntoh16( lid ), port_num); } @@ -1382,6 +1384,8 @@ osmtest_stress_path_recs_large( IN osmtest_t * const p_osmt, return ( status ); } +/********************************************************************** + **********************************************************************/ ib_api_status_t osmtest_stress_path_recs_by_guid ( IN osmtest_t * const p_osmt, OUT uint32_t * const p_num_recs, @@ -1423,22 +1427,22 @@ osmtest_stress_path_recs_by_guid ( IN osmtest_t * const p_osmt, cl_ntoh64(p_src_node->rec.node_info.port_guid),p_src_node->rec.node_info.node_type, cl_ntoh64(p_dst_node->rec.node_info.port_guid),p_dst_node->rec.node_info.node_type); - if (p_src_node->rec.node_info.node_type == IB_NODE_TYPE_CA - && p_dst_node->rec.node_info.node_type == IB_NODE_TYPE_CA) + if (p_src_node->rec.node_info.node_type == IB_NODE_TYPE_CA + && p_dst_node->rec.node_info.node_type == IB_NODE_TYPE_CA) { - status = osmtest_get_path_rec_by_guid_pair(p_osmt , + status = osmtest_get_path_rec_by_guid_pair(p_osmt, p_src_node->rec.node_info.port_guid, p_dst_node->rec.node_info.port_guid, &context); - /* In a case of TIMEOUT you still can try sending but cant count , maybe its a temporary issue */ + /* In a case of TIMEOUT you still can try sending but cant count, maybe its a temporary issue */ if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_stress_path_recs_by_guid: ERR 0008: " + "osmtest_stress_path_recs_by_guid: ERR 0009: " "osmtest_get_path_rec_by_guid_pair failed (%s)\n", ib_get_err_str( status ) ); - if (status != IB_TIMEOUT) + if (status != IB_TIMEOUT) goto Exit; } else @@ -1476,7 +1480,6 @@ osmtest_stress_path_recs_by_guid ( IN osmtest_t * const p_osmt, p_src_node = ( node_t * ) cl_qmap_next( &p_src_node->map_item ); } - Exit: OSM_LOG_EXIT( &p_osmt->log ); return ( status ); @@ -1502,14 +1505,14 @@ osmtest_stress_port_recs_small( IN osmtest_t * const p_osmt, /* * Do a blocking query for our own PortRecord in the subnet. */ - status = osmtest_get_port_rec( p_osmt, - cl_ntoh16(p_osmt->local_port.lid), + status = osmtest_get_port_rec( p_osmt, + cl_ntoh16(p_osmt->local_port.lid), &context ); if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_stress_port_recs_small: ERR 0009: " + "osmtest_stress_port_recs_small: ERR 0010: " "osmtest_get_all_recs failed (%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -1573,7 +1576,7 @@ osmtest_wrong_sm_key_ignored( IN osmtest_t * const p_osmt) osm_log( &p_osmt->log, OSM_LOG_INFO, "osmtest_wrong_sm_key_ignored: " "Try PortRecord for port with LID 0x%X Num:0x%X.\n", - cl_ntoh16( p_osmt->local_port.sm_lid ) , + cl_ntoh16( p_osmt->local_port.sm_lid ), port_num); } @@ -1606,11 +1609,11 @@ osmtest_wrong_sm_key_ignored( IN osmtest_t * const p_osmt) status = osmv_query_sa( p_osmt->h_bind, &req ); - /* since we use a wrong sm_key we should geta timeout */ + /* since we use a wrong sm_key we should get a timeout */ if( status != IB_TIMEOUT ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_wrong_sm_key_ignored: ERR 0010: " + "osmtest_wrong_sm_key_ignored: ERR 0011: " "Did not get a timeout but got (%s).\n", ib_get_err_str( status ) ); goto Exit; } @@ -1776,7 +1779,6 @@ osmtest_write_path_info( IN osmtest_t * const p_osmt, return ( status ); } - /********************************************************************** **********************************************************************/ static ib_api_status_t @@ -1876,8 +1878,6 @@ osmtest_write_link( IN osmtest_t * const p_osmt, return ( status ); } - - /********************************************************************** **********************************************************************/ static ib_api_status_t @@ -1954,7 +1954,6 @@ osmtest_write_all_link_recs( IN osmtest_t * const p_osmt, OSM_LOG_EXIT( &p_osmt->log ); return ( status ); } - #endif /********************************************************************** @@ -2021,7 +2020,6 @@ osmtest_get_path_rec_by_lid_pair( IN osmtest_t * const p_osmt, goto Exit; } - Exit: OSM_LOG_EXIT( &p_osmt->log ); @@ -2104,7 +2102,6 @@ osmtest_write_all_node_recs( IN osmtest_t * const p_osmt, return ( status ); } - /********************************************************************** * ASSUMES RMPP **********************************************************************/ @@ -2664,12 +2661,12 @@ osmtest_stress_large_rmpp_pr( IN osmtest_t * const p_osmt ) } printf("-I- End time is : %09ld:%06ld [sec:usec]\n", end_tv.tv_sec, (long)end_tv.tv_usec); - printf("-I- Quering %" PRId64 " Path Record queries CA to CA (rmpp) \n\ttook %04ld:%06ld [sec:usec]\n",num_queries, + printf("-I- Querying %" PRId64 " Path Record queries CA to CA (rmpp) \n\ttook %04ld:%06ld [sec:usec]\n",num_queries, sec_diff,usec_diff); if (num_recs == 0) ratio = 0; else - ratio = (float) (num_queries / num_recs); + ratio = (float)(num_queries / num_recs); printf( "-I- Queries to Record Ratio is %" PRIu64 " records, %" PRIu64 " queries : %.2f \n", num_recs, num_queries, ratio); print_freq = 0; @@ -2688,14 +2685,15 @@ osmtest_stress_large_rmpp_pr( IN osmtest_t * const p_osmt ) usec_diff = 1000000 - (start_tv.tv_usec - end_tv.tv_usec); } - printf("-I- Quering %" PRId64 " Path Record queries (rmpp) took %04ld:%06ld [sec:usec]\n",num_queries, + printf("-I- Querying %" PRId64 " Path Record queries (rmpp) took %04ld:%06ld [sec:usec]\n",num_queries, sec_diff,usec_diff); OSM_LOG_EXIT( &p_osmt->log ); return ( status ); } - +/********************************************************************** + **********************************************************************/ static ib_api_status_t osmtest_stress_large_rmpp( IN osmtest_t * const p_osmt ) { @@ -2706,11 +2704,10 @@ osmtest_stress_large_rmpp( IN osmtest_t * const p_osmt ) uint32_t delta_queries; uint32_t print_freq = 0; struct timeval start_tv,end_tv; - struct timezone tz; long sec_diff,usec_diff; OSM_LOG_ENTER( &p_osmt->log, osmtest_stress_large_rmpp ); - gettimeofday( &start_tv, &tz ); + gettimeofday( &start_tv, NULL ); printf("-I- Start time is : %09ld:%06ld [sec:usec]\n",start_tv.tv_sec, (long)start_tv.tv_usec); while( num_queries < STRESS_LARGE_RMPP_THR ) @@ -2740,7 +2737,7 @@ osmtest_stress_large_rmpp( IN osmtest_t * const p_osmt ) if( print_freq > 100000 ) { - gettimeofday( &end_tv, &tz ); + gettimeofday( &end_tv, NULL ); if (end_tv.tv_usec > start_tv.tv_usec) { sec_diff = end_tv.tv_sec-start_tv.tv_sec; usec_diff = end_tv.tv_usec-start_tv.tv_usec; @@ -2750,7 +2747,7 @@ osmtest_stress_large_rmpp( IN osmtest_t * const p_osmt ) } printf("-I- End time is : %09ld:%06ld [sec:usec]\n", end_tv.tv_sec, (long)end_tv.tv_usec); - printf("-I- Quering %" PRId64 " large mixed queries (rmpp) took %04ld:%06ld [sec:usec]\n",num_queries, + printf("-I- Querying %" PRId64 " large mixed queries (rmpp) took %04ld:%06ld [sec:usec]\n",num_queries, sec_diff,usec_diff); printf( "%" PRIu64 " records, %" PRIu64 " queries\n", num_recs, num_queries ); @@ -2759,7 +2756,7 @@ osmtest_stress_large_rmpp( IN osmtest_t * const p_osmt ) } Exit: - gettimeofday( &end_tv, &tz ); + gettimeofday( &end_tv, NULL ); printf("-I- End time is : %09ld:%06ld [sec:usec]\n", end_tv.tv_sec, (long)end_tv.tv_usec); if (end_tv.tv_usec > start_tv.tv_usec) { @@ -2770,7 +2767,7 @@ osmtest_stress_large_rmpp( IN osmtest_t * const p_osmt ) usec_diff = 1000000 - (start_tv.tv_usec - end_tv.tv_usec); } - printf("-I- Quering %" PRId64 " large mixed queries (rmpp) took %04ld:%06ld [sec:usec]\n",num_queries, + printf("-I- Querying %" PRId64 " large mixed queries (rmpp) took %04ld:%06ld [sec:usec]\n",num_queries, sec_diff,usec_diff); OSM_LOG_EXIT( &p_osmt->log ); @@ -2790,11 +2787,10 @@ osmtest_stress_small_rmpp( IN osmtest_t * const p_osmt ) uint32_t print_freq = 0; int num_timeouts = 0; struct timeval start_tv,end_tv; - struct timezone tz; long sec_diff,usec_diff; OSM_LOG_ENTER( &p_osmt->log, osmtest_stress_small_rmpp ); - gettimeofday( &start_tv, &tz ); + gettimeofday( &start_tv, NULL ); printf("-I- Start time is : %09ld:%06ld [sec:usec]\n",start_tv.tv_sec, (long)start_tv.tv_usec); while( (num_queries < STRESS_SMALL_RMPP_THR) && (num_timeouts < 100) ) { @@ -2810,7 +2806,7 @@ osmtest_stress_small_rmpp( IN osmtest_t * const p_osmt ) print_freq += delta_recs; if( print_freq > 5000 ) { - gettimeofday( &end_tv, &tz ); + gettimeofday( &end_tv, NULL ); printf( "%" PRIu64 " records, %" PRIu64 " queries\n", num_recs, num_queries ); if (end_tv.tv_usec > start_tv.tv_usec) { @@ -2822,12 +2818,12 @@ osmtest_stress_small_rmpp( IN osmtest_t * const p_osmt ) } printf("-I- End time is : %09ld:%06ld [sec:usec]\n", end_tv.tv_sec, (long)end_tv.tv_usec); - printf("-I- Quering %" PRId64 " port_info queries (single mad) took %04ld:%06ld [sec:usec]\n",num_queries, + printf("-I- Querying %" PRId64 " port_info queries (single mad) took %04ld:%06ld [sec:usec]\n",num_queries, sec_diff,usec_diff); print_freq = 0; } } - gettimeofday( &end_tv, &tz ); + gettimeofday( &end_tv, NULL ); printf("-I- End time is : %09ld:%06ld [sec:usec]\n", end_tv.tv_sec, (long)end_tv.tv_usec); if (end_tv.tv_usec > start_tv.tv_usec) { @@ -2838,9 +2834,9 @@ osmtest_stress_small_rmpp( IN osmtest_t * const p_osmt ) usec_diff = 1000000 - (start_tv.tv_usec - end_tv.tv_usec); } - printf("-I- Quering %" PRId64 " port_info queries (single mad) took %04ld:%06ld [sec:usec]\n",num_queries, + printf("-I- Querying %" PRId64 " port_info queries (single mad) took %04ld:%06ld [sec:usec]\n",num_queries, sec_diff,usec_diff); - if (num_timeouts > 50) + if (num_timeouts > 50) { status = IB_TIMEOUT; } @@ -2870,7 +2866,6 @@ osmtest_prepare_db_generic( IN osmtest_t * const p_osmt, OSM_LOG_EXIT( &p_osmt->log ); } - /********************************************************************** **********************************************************************/ static void @@ -2995,7 +2990,6 @@ osmtest_check_missing_paths( IN osmtest_t * const p_osmt ) return ( status ); } - /********************************************************************** **********************************************************************/ inline uint32_t @@ -3040,7 +3034,6 @@ osmtest_validate_path_data( IN osmtest_t * const p_osmt, cl_ntoh16( p_rec->slid ), cl_ntoh16( p_rec->dlid ) ); } - /* * Has this record already been returned? */ @@ -3088,7 +3081,7 @@ osmtest_validate_path_data( IN osmtest_t * const p_osmt, p_rec->sgid.unicast.interface_id ) ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_validate_path_data: ERR 0011: " + "osmtest_validate_path_data: ERR 0057: " "SGID mismatch on path SLID 0x%X to DLID 0x%X.\n" "\t\t\t\tExpected 0x%016" PRIx64 " 0x%016" PRIx64 ",\n" "\t\t\t\tReceived 0x%016" PRIx64 " 0x%016" PRIx64 ".\n", @@ -3333,7 +3326,6 @@ osmtest_validate_node_data( IN osmtest_t * const p_osmt, return ( status ); } - /********************************************************************** **********************************************************************/ static ib_api_status_t @@ -3369,7 +3361,6 @@ osmtest_validate_node_rec( IN osmtest_t * const p_osmt, return ( status ); } - /********************************************************************** **********************************************************************/ static ib_api_status_t @@ -3446,7 +3437,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.subnet_prefix & p_port->rec.port_info.subnet_prefix ) != ( p_port->comp.port_info.subnet_prefix & p_rec->port_info.subnet_prefix ) ) { @@ -3460,7 +3450,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.base_lid & p_port->rec.port_info.base_lid ) != ( p_port->comp.port_info.base_lid & p_rec->port_info.base_lid ) ) { @@ -3474,7 +3463,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.master_sm_base_lid & p_port->rec.port_info.master_sm_base_lid ) != ( p_port->comp.port_info.master_sm_base_lid & p_rec->port_info.master_sm_base_lid ) ) { @@ -3488,7 +3476,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.capability_mask & p_port->rec.port_info.capability_mask ) != ( p_port->comp.port_info.capability_mask & p_rec->port_info.capability_mask ) ) { @@ -3502,7 +3489,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.diag_code & p_port->rec.port_info.diag_code ) != ( p_port->comp.port_info.diag_code & p_rec->port_info.diag_code ) ) { @@ -3516,7 +3502,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.m_key_lease_period & p_port->rec.port_info.m_key_lease_period ) != ( p_port->comp.port_info.m_key_lease_period & p_rec->port_info.m_key_lease_period ) ) { @@ -3530,7 +3515,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.local_port_num & p_port->rec.port_info.local_port_num ) != ( p_port->comp.port_info.local_port_num & p_rec->port_info.local_port_num ) ) { @@ -3544,7 +3528,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.link_width_enabled & p_port->rec.port_info.link_width_enabled ) != ( p_port->comp.port_info.link_width_enabled & p_rec->port_info.link_width_enabled ) ) { @@ -3558,7 +3541,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.link_width_supported & p_port->rec.port_info.link_width_supported ) != ( p_port->comp.port_info.link_width_supported & p_rec->port_info.link_width_supported ) ) { @@ -3572,7 +3554,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.link_width_active & p_port->rec.port_info.link_width_active ) != ( p_port->comp.port_info.link_width_active & p_rec->port_info.link_width_active ) ) { @@ -3586,7 +3567,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.link_speed & p_port->rec.port_info.link_speed ) != ( p_port->comp.port_info.link_speed & p_rec->port_info.link_speed ) ) { @@ -3600,12 +3580,11 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.state_info1 & p_port->rec.port_info.state_info1 ) != ( p_port->comp.port_info.state_info1 & p_rec->port_info.state_info1 ) ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_validate_port_data: ERR 0057: " + "osmtest_validate_port_data: ERR 0055: " "Field mismatch port LID 0x%X Num:0x%X.\n" "\t\t\t\tExpected state_info1 0x%X, received 0x%X.\n", cl_ntoh16( p_rec->lid ), p_rec->port_num, @@ -3614,7 +3593,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.state_info2 & p_port->rec.port_info.state_info2 ) != ( p_port->comp.port_info.state_info2 & p_rec->port_info.state_info2 ) ) { @@ -3628,7 +3606,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.mkey_lmc & p_port->rec.port_info.mkey_lmc ) != ( p_port->comp.port_info.mkey_lmc & p_rec->port_info.mkey_lmc ) ) { @@ -3642,7 +3619,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.link_speed & p_port->rec.port_info.link_speed ) != ( p_port->comp.port_info.link_speed & p_rec->port_info.link_speed ) ) { @@ -3656,7 +3632,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.mtu_smsl & p_port->rec.port_info.mtu_smsl ) != ( p_port->comp.port_info.mtu_smsl & p_rec->port_info.mtu_smsl ) ) { @@ -3670,7 +3645,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.vl_cap & p_port->rec.port_info.vl_cap ) != ( p_port->comp.port_info.vl_cap & p_rec->port_info.vl_cap ) ) { @@ -3684,7 +3658,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.vl_high_limit & p_port->rec.port_info.vl_high_limit ) != ( p_port->comp.port_info.vl_high_limit & p_rec->port_info.vl_high_limit ) ) { @@ -3698,7 +3671,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.vl_arb_high_cap & p_port->rec.port_info.vl_arb_high_cap ) != ( p_port->comp.port_info.vl_arb_high_cap & p_rec->port_info.vl_arb_high_cap ) ) { @@ -3712,7 +3684,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.vl_arb_low_cap & p_port->rec.port_info.vl_arb_low_cap ) != ( p_port->comp.port_info.vl_arb_low_cap & p_rec->port_info.vl_arb_low_cap ) ) { @@ -3726,7 +3697,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.mtu_cap & p_port->rec.port_info.mtu_cap ) != ( p_port->comp.port_info.mtu_cap & p_rec->port_info.mtu_cap ) ) { @@ -3740,7 +3710,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - /* this is a dynamic attribute if( ( p_port->comp.port_info.vl_stall_life & p_port->rec.port_info.vl_stall_life ) != ( p_port->comp.port_info.vl_stall_life & p_rec->port_info.vl_stall_life ) ) @@ -3769,7 +3738,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.m_key_violations & p_port->rec.port_info.m_key_violations ) != ( p_port->comp.port_info.m_key_violations & p_rec->port_info.m_key_violations ) ) { @@ -3783,7 +3751,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.p_key_violations & p_port->rec.port_info.p_key_violations ) != ( p_port->comp.port_info.p_key_violations & p_rec->port_info.p_key_violations ) ) { @@ -3797,7 +3764,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.q_key_violations & p_port->rec.port_info.q_key_violations ) != ( p_port->comp.port_info.q_key_violations & p_rec->port_info.q_key_violations ) ) { @@ -3811,7 +3777,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.guid_cap & p_port->rec.port_info.guid_cap ) != ( p_port->comp.port_info.guid_cap & p_rec->port_info.guid_cap ) ) { @@ -3825,7 +3790,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.subnet_timeout & p_port->rec.port_info.subnet_timeout ) != ( p_port->comp.port_info.subnet_timeout & p_rec->port_info.subnet_timeout ) ) { @@ -3840,7 +3804,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.resp_time_value & p_port->rec.port_info.resp_time_value ) != ( p_port->comp.port_info.resp_time_value & p_rec->port_info.resp_time_value ) ) { @@ -3854,7 +3817,6 @@ osmtest_validate_port_data( IN osmtest_t * const p_osmt, goto Exit; } - if( ( p_port->comp.port_info.error_threshold & p_port->rec.port_info.error_threshold ) != ( p_port->comp.port_info.error_threshold & p_rec->port_info.error_threshold ) ) { @@ -3886,7 +3848,8 @@ osmtest_validate_port_rec( IN osmtest_t * const p_osmt, OSM_LOG_ENTER( &p_osmt->log, osmtest_validate_port_rec ); /* - * Find proper port record in the database. (we use by guid - since lid is not unique) + * Find proper port record in the database. + * (we use by guid - since lid is not unique) */ p_tbl = &p_osmt->exp_subn.port_key_tbl; p_port = ( port_t * ) cl_qmap_get( p_tbl, port_gen_id( p_rec->lid, p_rec->port_num)); @@ -4412,10 +4375,9 @@ osmtest_validate_single_path_rec_guid_pair( IN osmtest_t * const p_osmt, num_recs = context.result.result_cnt; osm_log( &p_osmt->log, OSM_LOG_VERBOSE, - "osmtest_validate_single_path_rec_guid_pair: " - "Got: %u records\n", + "osmtest_validate_single_path_rec_guid_pair: %u records\n", num_recs); - + for( i = 0; i < num_recs; i++ ) { p_rec = osmv_get_query_path_rec( context.result.p_result_madw, i ); @@ -4482,7 +4444,7 @@ osmtest_validate_single_path_recs( IN osmtest_t * const p_osmt ) cl_status_t status = IB_SUCCESS; const cl_qmap_t *p_path_tbl; /* We skip node to node path record validation since it might contains - UNEXISTANT PATHS , i.e when using UPDN */ + NONEXISTENT PATHS, i.e. when using UPDN */ osmv_guid_pair_t guid_pair; uint16_t cnt; @@ -4551,8 +4513,6 @@ osmtest_validate_single_path_recs( IN osmtest_t * const p_osmt ) p_path = ( path_t * ) cl_qmap_next( &p_path->map_item ); } - - if( osm_log_is_active( &p_osmt->log, OSM_LOG_VERBOSE ) ) { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, @@ -4669,7 +4629,6 @@ osmtest_validate_single_port_recs( IN osmtest_t * const p_osmt ) p_port = ( port_t * ) cl_qmap_next( &p_port->map_item ); } - if( osm_log_is_active( &p_osmt->log, OSM_LOG_VERBOSE ) ) { osm_log( &p_osmt->log, OSM_LOG_VERBOSE, @@ -4677,7 +4636,6 @@ osmtest_validate_single_port_recs( IN osmtest_t * const p_osmt ) "Total of %u port records validated.\n", cnt ); } - status = osmtest_check_missing_ports( p_osmt ); if( status != IB_SUCCESS ) { @@ -4732,7 +4690,6 @@ osmtest_validate_against_db( IN osmtest_t * const p_osmt ) goto Exit; } - Exit: OSM_LOG_EXIT( &p_osmt->log ); return ( status ); @@ -4752,7 +4709,7 @@ str_get_token( IN char *const p_str ) { if( strnicmp( p_str, p_tok->str, p_tok->str_size ) == 0 ) return ( p_tok ); - + p_tok = &token_array[++index]; } @@ -5835,7 +5792,7 @@ osmtest_create_db( IN osmtest_t * const p_osmt ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, "osmtest_create_db: ERR 00130: " - "Unable to open inventory file (%s).\n" ,p_osmt->opt.file_name); + "Unable to open inventory file (%s).\n", p_osmt->opt.file_name); status = IB_ERROR; goto Exit; } @@ -6046,7 +6003,7 @@ osmtest_bind( IN osmtest_t * p_osmt, if( p_osmt->h_bind == OSM_BIND_INVALID_HANDLE ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_bind: ERR 00137: " "Unable to bind to SA\n" ); + "osmtest_bind: ERR 00137: " "Unable to bind to SA\n" ); status = IB_ERROR; goto Exit; } @@ -6121,7 +6078,7 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00143: " + "osmtest_run: ERR 00142: " "Database creation failed (%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -6131,7 +6088,7 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00142: " + "osmtest_run: ERR 00143: " "Large RMPP stress test failed (%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -6139,7 +6096,7 @@ osmtest_run( IN osmtest_t * const p_osmt ) break; default: osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00143: " + "osmtest_run: ERR 00144: " "Unknown stress test value %u.\n", p_osmt->opt.stress ); break; @@ -6157,7 +6114,7 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00143: " + "osmtest_run: ERR 00145: " "Database creation failed (%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -6167,8 +6124,8 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00144: " - "SA validation again database failure (%s)\n", + "osmtest_run: ERR 00146: " + "SA validation database failure again (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -6180,7 +6137,7 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00145: " + "osmtest_run: ERR 00147: " "Try wrong SM_Key failed (%s)\n", ib_get_err_str( status ) ); goto Exit; @@ -6193,25 +6150,33 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00146: " + "osmtest_run: ERR 00148: " "Service Flow failed (%s)\n", ib_get_err_str( status ) ); goto Exit; } } -#ifdef OSM_VENDOR_INTF_MTL /* only available for now on mVAPI */ if (!p_osmt->opt.flow || p_osmt->opt.flow == 4) { +#ifdef OSM_VENDOR_INTF_MTL status = osmt_run_inform_info_flow( p_osmt ); + if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00147: " - "Inform Info Flow Failed: (%s)\n", + "osmtest_run: ERR 00149: " + "Inform Info Flow failed: (%s)\n", ib_get_err_str( status ) ); goto Exit; } +#else + osm_log (&p_osmt->log, OSM_LOG_INFO, + "osmtest_run: The event forwarding flow " + "is not implemented yet!\n"); + status = IB_SUCCESS; + goto Exit; +#endif } /* @@ -6224,8 +6189,8 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00148: " - "Fail to get SLtoVL and VL Arbitration Tables (%s)\n", + "osmtest_run: ERR 00150: " + "Failed to get SLtoVL and VL Arbitration Tables (%s)\n", ib_get_err_str( status ) ); goto Exit; } @@ -6233,18 +6198,24 @@ osmtest_run( IN osmtest_t * const p_osmt ) if (p_osmt->opt.flow == 8) { +#ifdef OSM_VENDOR_INTF_MTL status = osmt_run_trap64_65_flow( p_osmt ); if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00150: " - "Trap 64/65 Flow Failed: (%s)\n", + "osmtest_run: ERR 00151: " + "Trap 64/65 Flow failed: (%s)\n", ib_get_err_str( status ) ); goto Exit; } - } - +#else + osm_log (&p_osmt->log, OSM_LOG_INFO, + "osmtest_run: The event forwarding flow " + "is not implemented yet!\n"); + status = IB_SUCCESS; + goto Exit; #endif + } if (!p_osmt->opt.flow || p_osmt->opt.flow == 6) { @@ -6252,8 +6223,8 @@ osmtest_run( IN osmtest_t * const p_osmt ) if( status != IB_SUCCESS ) { osm_log( &p_osmt->log, OSM_LOG_ERROR, - "osmtest_run: ERR 00149: " - "Multicast Flow Failed: (%s)\n", + "osmtest_run: ERR 00152: " + "Multicast Flow failed: (%s)\n", ib_get_err_str( status ) ); goto Exit; } diff --git a/trunk/ulp/opensm/user/osmtest/osmtest.h b/trunk/ulp/opensm/user/osmtest/osmtest.h deleted file mode 100644 index 005f0e28..00000000 --- a/trunk/ulp/opensm/user/osmtest/osmtest.h +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - - - -/* - * Abstract: - * Declaration of osmtest_t. - * This object represents the OSMTest Test object. - * - * Environment: - * Linux User Mode - * - * $Revision: 1.6 $ - */ - -#ifndef _OSMTEST_H_ -#define _OSMTEST_H_ - -#include -#include -#include -#include "osmtest_base.h" -#include "osmtest_subnet.h" -#include -#include -#include - -/****s* OpenSM: Subnet/osmtest_opt_t - * NAME - * osmtest_opt_t - * - * DESCRIPTION - * Subnet options structure. This structure contains the various - * site specific configuration parameters for osmtest. - * - * SYNOPSIS - */ -typedef struct _osmtest_opt -{ - uint32_t transaction_timeout; - boolean_t force_log_flush; - boolean_t create; - uint32_t retry_count; - uint32_t stress; - uint32_t mmode; - char file_name[OSMTEST_FILE_PATH_MAX]; - uint8_t flow; - uint8_t wait_time; - char *log_file; - boolean_t ignore_path_records; -} -osmtest_opt_t; - -/* - * FIELDS - * - * SEE ALSO - *********/ - -/****h* OSMTest/OSMTest - * NAME - * OSMTest - * - * DESCRIPTION - * The OSMTest object tests an SM/SA for conformance to a known - * set of data about an Infiniband subnet. - * - * AUTHOR - * Steve King, Intel - * - *********/ - - - -/****s* OSMTest/osmtest_t - * NAME - * osmtest_t - * - * DESCRIPTION - * OSMTest structure. - * - * This object should be treated as opaque and should - * be manipulated only through the provided functions. - * - * SYNOPSIS - */ -typedef struct _osmtest -{ - osm_log_t log; - struct _osm_vendor *p_vendor; - osm_bind_handle_t h_bind; - osm_mad_pool_t mad_pool; - - osmtest_opt_t opt; - ib_port_attr_t local_port; - subnet_t exp_subn; - cl_qpool_t node_pool; - cl_qpool_t port_pool; - cl_qpool_t link_pool; - - uint16_t max_lid; -} -osmtest_t; - -/* - * FIELDS - * log - * Log facility used by all OSMTest components. - * - * p_vendor - * Pointer to the vendor transport layer. - * - * h_bind - * The bind handle obtained by osm_vendor_sa_api/osmv_bind_sa - * - * mad_pool - * The mad pool provided for teh vendor layer to allocate mad wrappers in - * - * opt - * osmtest options structure - * - * local_port - * Port attributes for the port over which osmtest is running. - * - * exp_subn - * Subnet object representing the expected subnet - * - * node_pool - * Pool of objects for use in populating the subnet databases. - * - * port_pool - * Pool of objects for use in populating the subnet databases. - * - * link_pool - * Pool of objects for use in populating the subnet databases. - * - * SEE ALSO - *********/ - -/****s* OpenSM: Subnet/osmtest_req_context_t - * NAME - * osmtest_req_context_t - * - * DESCRIPTION - * Query context for ib_query callback function. - * - * SYNOPSIS - */ -typedef struct _osmtest_req_context -{ - osmtest_t *p_osmt; - osmv_query_res_t result; - -} -osmtest_req_context_t; - - - - -typedef struct _osmtest_mgrp_t -{ - cl_map_item_t map_item; - ib_member_rec_t mcmember_rec; -} osmtest_mgrp_t; - - - - - - - - - -/* - * FIELDS - * - * SEE ALSO - *********/ - -/****f* OSMTest/osmtest_construct - * NAME - * osmtest_construct - * - * DESCRIPTION - * This function constructs an OSMTest object. - * - * SYNOPSIS - */ -void osmtest_construct( IN osmtest_t * const p_osmt ); - -/* - * PARAMETERS - * p_osmt - * [in] Pointer to a OSMTest object to construct. - * - * RETURN VALUE - * This function does not return a value. - * - * NOTES - * Allows calling osmtest_init, osmtest_destroy. - * - * Calling osmtest_construct is a prerequisite to calling any other - * method except osmtest_init. - * - * SEE ALSO - * SM object, osmtest_init, osmtest_destroy - *********/ - -/****f* OSMTest/osmtest_destroy - * NAME - * osmtest_destroy - * - * DESCRIPTION - * The osmtest_destroy function destroys an osmtest object, releasing - * all resources. - * - * SYNOPSIS - */ -void osmtest_destroy( IN osmtest_t * const p_osmt ); - -/* - * PARAMETERS - * p_osmt - * [in] Pointer to a OSMTest object to destroy. - * - * RETURN VALUE - * This function does not return a value. - * - * NOTES - * Performs any necessary cleanup of the specified OSMTest object. - * Further operations should not be attempted on the destroyed object. - * This function should only be called after a call to osmtest_construct or - * osmtest_init. - * - * SEE ALSO - * SM object, osmtest_construct, osmtest_init - *********/ - -/****f* OSMTest/osmtest_init - * NAME - * osmtest_init - * - * DESCRIPTION - * The osmtest_init function initializes a OSMTest object for use. - * - * SYNOPSIS - */ -ib_api_status_t osmtest_init( IN osmtest_t * const p_osmt, - IN const osmtest_opt_t * const p_opt, - IN const osm_log_level_t log_flags - ); - -/* - * PARAMETERS - * p_osmt - * [in] Pointer to an osmtest_t object to initialize. - * - * p_opt - * [in] Pointer to the options structure. - * - * log_flags - * [in] Log level flags to set. - * - * RETURN VALUES - * IB_SUCCESS if the OSMTest object was initialized successfully. - * - * NOTES - * Allows calling other OSMTest methods. - * - * SEE ALSO - * SM object, osmtest_construct, osmtest_destroy - *********/ - -/****f* OSMTest/osmtest_run - * NAME - * osmtest_run - * - * DESCRIPTION - * Runs the osmtest suite. - * - * SYNOPSIS - */ -ib_api_status_t osmtest_run( IN osmtest_t * const p_osmt ); - -/* - * PARAMETERS - * p_osmt - * [in] Pointer to an osmtest_t object. - * - * guid - * [in] Port GUID over which to run the test suite. - * - * RETURN VALUES - * IB_SUCCESS - * - * NOTES - * - * SEE ALSO - *********/ - -/****f* OSMTest/osmtest_bind - * NAME - * osmtest_bind - * - * DESCRIPTION - * Binds osmtest to a local port. - * - * SYNOPSIS - */ -ib_api_status_t osmtest_bind( IN osmtest_t * p_osmt, - IN uint16_t max_lid, - IN ib_net64_t guid OPTIONAL ); - -/* - * PARAMETERS - * p_osmt - * [in] Pointer to an osmtest_t object. - * - * max_lid - * [in] The maximal lid to query about (if RMPP is not supported) - * - * guid - * [in] Port GUID over which to run the test suite. - * If zero, the bind function will display a menu of local - * port guids and wait for user input. - * - * RETURN VALUES - * IB_SUCCESS - * - * NOTES - * - * SEE ALSO - *********/ - -/****f* OSMTest/osmtest_query_res_cb - * NAME - * osmtest_query_res_cb - * - * DESCRIPTION - * A Callback for the query to invoke on completion - * - * SYNOPSIS - */ -void -osmtest_query_res_cb( IN osmv_query_res_t * p_rec ); -/* - * PARAMETERS - * p_rec - * [in] Pointer to an ib_query_rec_t object used for the query. - * - * RETURN VALUES - * NONE - * - * NOTES - * - * SEE ALSO - *********/ - -/****f* OSMTest/ib_get_mad_status_str - * NAME - * ib_get_mad_status_str - * - * DESCRIPTION - * return the string representing the given mad status - * - * SYNOPSIS - */ -const char * -ib_get_mad_status_str( IN const ib_mad_t * const p_mad ); -/* - * PARAMETERS - * p_mad - * [in] Pointer to the mad payload - * - * RETURN VALUES - * NONE - * - * NOTES - * - * SEE ALSO - *********/ - -/****f* OSMTest/osmt_run_service_records_flow - * NAME - * osmt_run_service_records_flow - * - * DESCRIPTION - * Run the service record testing flow. - * - * SYNOPSIS - */ -ib_api_status_t osmt_run_service_records_flow( IN osmtest_t * const p_osmt ); -/* - * PARAMETERS - * p_osmt - * [in] Pointer to the osmtest obj - * - * RETURN VALUES - * IB_SUCCESS if PASS - * - * NOTES - * - * SEE ALSO - *********/ - -ib_api_status_t -osmt_run_inform_info_flow( IN osmtest_t * const p_osmt ); - -/****f* OSMTest/osmt_run_slvl_and_vlarb_records_flow - * NAME - * osmt_run_slvl_and_vlarb_records_flow - * - * DESCRIPTION - * Run the sl2vl and vlarb tables testing flow. - * - * SYNOPSIS - */ -ib_api_status_t -osmt_run_slvl_and_vlarb_records_flow( IN osmtest_t * const p_osmt ); -/* - * PARAMETERS - * p_osmt - * [in] Pointer to the osmtest obj - * - * RETURN VALUES - * IB_SUCCESS if PASS - * - * NOTES - * - * SEE ALSO - *********/ - - -/****f* OSMTest/osmt_run_mcast_flow - * NAME - * osmt_run_mcast_flow - * - * DESCRIPTION - * Run the multicast test flow - * - * SYNOPSIS - */ -ib_api_status_t - osmt_run_mcast_flow( IN osmtest_t * const p_osmt ); -/* - * PARAMETERS - * p_osmt - * [in] Pointer to the osmtest obj - * - * RETURN VALUES - * IB_SUCCESS if PASS - * - * NOTES - * - * SEE ALSO - *********/ - -/****f* OSMTest/osmt_run_trap64_65_flow - * NAME - * osmt_run_trap64_65_flow - * - * DESCRIPTION - * Run the trap 64/65 test flow. This test is ran with - * an outside tool. - * - * SYNOPSIS - */ -ib_api_status_t -osmt_run_trap64_65_flow( IN osmtest_t * const p_osmt ); -/* - * PARAMETERS - * p_osmt - * [in] Pointer to the osmtest obj - * - * RETURN VALUES - * IB_SUCCESS if PASS - * - * NOTES - * - * SEE ALSO - *********/ - -ib_api_status_t -osmtest_get_all_recs( IN osmtest_t * const p_osmt, - IN ib_net16_t const attr_id, - IN size_t const attr_size, - IN OUT osmtest_req_context_t * const p_context ); -#endif /* _OSMTEST_H_ */ diff --git a/trunk/ulp/opensm/user/osmtest/osmtest_base.h b/trunk/ulp/opensm/user/osmtest/osmtest_base.h deleted file mode 100644 index c2874197..00000000 --- a/trunk/ulp/opensm/user/osmtest/osmtest_base.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - - - -/* - * Abstract: - * Declaration of osmtest_t. - * This object represents the OSMTest Test object. - * - * Environment: - * Linux User Mode - * - * $Revision: 1.2 $ - */ -#ifndef _OSMTEST_BASE_H_ -#define _OSMTEST_BASE_H_ - -#ifndef __WIN__ -#include -#else -#include -#endif - -#define OSMTEST_MAX_LINE_LEN 120 -#ifdef WIN32 -#define OSMTEST_FILE_PATH_MAX 4096 -#else -#define OSMTEST_FILE_PATH_MAX PATH_MAX -#endif -#define STRESS_SMALL_RMPP_THR 100000 -/* - Take long times when quering big clusters (over 40 nodes) , an average of : 0.25 sec for query - each query receives 1000 records -*/ -#define STRESS_LARGE_RMPP_THR 4000 -#define STRESS_LARGE_PR_RMPP_THR 20000 -extern const char *const p_file; - -#endif /* _OSMTEST_BASE_H_ */ diff --git a/trunk/ulp/opensm/user/osmtest/osmtest_subnet.h b/trunk/ulp/opensm/user/osmtest/osmtest_subnet.h deleted file mode 100644 index 1bb7e89e..00000000 --- a/trunk/ulp/opensm/user/osmtest/osmtest_subnet.h +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved. - * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. - * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - - - -/* - * Abstract: - * Declaration of osmtest_t. - * This object represents the OSMTest Test object. - * - * Environment: - * Linux User Mode - * - * $Revision: 1.2 $ - */ - -#ifndef _OSMTEST_SUBNET_H_ -#define _OSMTEST_SUBNET_H_ - -#include -#include -#include -#include -#include - - -/****s* Subnet Database/generic_t -* NAME -* generic_t -* -* DESCRIPTION -* Subnet database object for fields common to all record types. -* All other database types must be castable to this type. -* -* SYNOPSIS -*/ -typedef struct _generic -{ - cl_map_item_t map_item; /* must be first element! */ - uint32_t count; /* must be second element! */ - -} -generic_t; - -/* -* FIELDS -* -* SEE ALSO -*********/ - -/****s* Subnet Database/node_t -* NAME -* node_t -* -* DESCRIPTION -* Subnet database object for nodes. -* Must be castable to generic_t. -* -* SYNOPSIS -*/ -typedef struct _node -{ - cl_map_item_t map_item; /* must be first element! */ - uint32_t count; /* must be second element! */ - ib_node_record_t rec; - ib_node_record_t comp; - -} -node_t; - -/* -* FIELDS -* map_item -* Provides linkage for the qmap container. -* -* rec -* NodeRecord for this node as read from the database file. -* -* comp -* NodeRecord indicating which fields should be compared against rec. -* Bits set in the comp NodeRecord indicate that bit in the rec structure -* should be compared against real-time data from the SA. -* -* count -* Utility counter used by the validation logic. Typically used to -* to indicate the number of times a matching node was received from -* the SA. -* -* SEE ALSO -*********/ - -static inline node_t * -node_new( void ) -{ - node_t *p_obj; - - p_obj = cl_zalloc( sizeof( *p_obj ) ); - return ( p_obj ); -} - -static inline void -node_delete( IN node_t * p_obj ) -{ - cl_free( p_obj ); -} - -/****s* Subnet Database/port_t -* NAME -* port_t -* -* DESCRIPTION -* Subnet database object for ports. -* Must be castable to generic_t. -* -* SYNOPSIS -*/ -typedef struct _port -{ - cl_map_item_t map_item; /* must be first element! */ - uint32_t count; /* must be second element! */ - /* Since there is no uniq identifier for all ports we - must be able to have such a key by the lid and port num */ - uint64_t port_id; - ib_portinfo_record_t rec; - ib_portinfo_record_t comp; -} -port_t; - -/* -* FIELDS -* -* map_item -* Provides linkage for the qmap container. -* -* rec -* PortInfoRecord for this port as read from the database file. -* -* comp -* PortInfoRecord indicating which fields should be compared against rec. -* Bits set in the comp NodeRecord indicate that bit in the rec structure -* should be compared against real-time data from the SA. -* -* count -* Utility counter used by the validation logic. Typically used to -* to indicate the number of times a matching node was received from -* the SA. -* -* SEE ALSO -*********/ - -static inline port_t * -port_new( void ) -{ - port_t *p_obj; - - p_obj = cl_zalloc( sizeof( *p_obj ) ); - return ( p_obj ); -} - -static inline void -port_delete( IN port_t * p_obj ) -{ - cl_free( p_obj ); -} - - -static inline uint64_t -port_gen_id( - IN ib_net16_t const lid, - IN uint8_t const port_num) -{ - return( lid << 8 | port_num ); -} - -static inline void -port_ext_id( IN uint64_t id, - IN ib_net16_t *p_lid, - IN uint8_t *p_port_num) -{ - CL_ASSERT( (id & 0xFF) < 0x100 ); - *p_port_num = (uint8_t)(id & 0xFF); - CL_ASSERT( ((id >> 8) & 0xFFFF) < 0x10000 ); - *p_lid = (uint16_t)((id >> 8) & 0xFFFF); -} - -static inline void -port_set_id( IN port_t * p_obj, - IN ib_net16_t const lid, - IN uint8_t const port_num) -{ - p_obj->port_id = port_gen_id(lid, port_num); -} - -static inline void -port_get_id( IN port_t * p_obj, - IN ib_net16_t *p_lid, - IN uint8_t *p_port_num) -{ - port_ext_id(p_obj->port_id, p_lid, p_port_num); -} - -/****s* Subnet Database/path_t -* NAME -* node_t -* -* DESCRIPTION -* Subnet database object for paths. -* Must be castable to generic_t. -* -* SYNOPSIS -*/ -typedef struct _path -{ - cl_map_item_t map_item; /* must be first element! */ - uint32_t count; /* must be second element! */ - ib_path_rec_t rec; - ib_path_rec_t comp; - -} -path_t; - -/* -* FIELDS -* map_item -* Provides linkage for the qmap container. -* -* rec -* PathRecord for this path as read from the database file. -* -* comp -* PathRecord indicating which fields should be compared against rec. -* Bits set in the comp PathRecord indicate that bit in the rec structure -* should be compared against real-time data from the SA. -* -* count -* Utility counter used by the validation logic. Typically used to -* to indicate the number of times a matching node was received from -* the SA. -* -* SEE ALSO -*********/ - -static inline path_t * -path_new( void ) -{ - path_t *p_obj; - - p_obj = cl_zalloc( sizeof( *p_obj ) ); - return ( p_obj ); -} - -static inline void -path_delete( IN path_t * p_obj ) -{ - cl_free( p_obj ); -} - -/****s* Subnet Database/subnet_t -* NAME -* subnet_t -* -* DESCRIPTION -* Subnet database object. -* -* SYNOPSIS -*/ -typedef struct _subnet -{ - cl_qmap_t node_lid_tbl; - cl_qmap_t node_guid_tbl; - cl_qmap_t mgrp_mlid_tbl; -#if 0 - cl_qmap_t port_lid_tbl; - cl_qmap_t port_guid_tbl; -#endif - cl_qmap_t port_key_tbl; - cl_qmap_t link_tbl; - cl_qmap_t path_tbl; - -} -subnet_t; - -/* -* FIELDS -* -* SEE ALSO -*********/ - -/****f* Subnet Database/subnet_init -* NAME -* subnet_init -* -* DESCRIPTION -* This function constructs an subnet database object. -* This function cannot fail. -* -* SYNOPSIS -*/ -void subnet_construct( IN subnet_t * const p_subn ); - -/* -* FIELDS -* -* SEE ALSO -*********/ - -/****f* Subnet Database/subnet_init -* NAME -* subnet_init -* -* DESCRIPTION -* This function initializes an subnet database object. -* -* SYNOPSIS -*/ -cl_status_t subnet_init( IN subnet_t * const p_subn ); - -/* -* FIELDS -* -* SEE ALSO -*********/ - -#endif