Hi Hal When formating an SM generated report the ProducerType was using CL_NTOH32 which can not be used to format a 24bit network order number.
The propose fix also avoids the duplication of conversion to and from network order introduced by the previous use of ib_notice_set_prod_type that requires a network ordered argument. The fix introduces ib_notice_set_prod_type_ho which is similar but requires host order value. For completeness I also introduced the ib_notice_set_vend_id_ho. Eitan Signed-off-by: Eitan Zahavi <[EMAIL PROTECTED]> Index: include/iba/ib_types.h =================================================================== --- include/iba/ib_types.h (revision 8636) +++ include/iba/ib_types.h (working copy) @@ -6838,6 +6838,40 @@ ib_notice_set_prod_type( * ib_mad_notice_attr_t *********/ +/****f* IBA Base: Types/ib_notice_set_prod_type_ho +* NAME +* ib_notice_set_prod_type_ho +* +* DESCRIPTION +* Set the notice Producer Type of Generic Notice given Host Order +* +* SYNOPSIS +*/ +static inline void +ib_notice_set_prod_type_ho( + IN ib_mad_notice_attr_t *p_ntc, + IN uint32_t prod_type_val_ho) +{ + p_ntc->g_or_v.generic.prod_type_lsb = + cl_hton16( (uint16_t)(prod_type_val_ho & 0x0000ffff) ); + p_ntc->g_or_v.generic.prod_type_msb = + (uint8_t)( (prod_type_val_ho & 0x00ff0000) >> 16); +} +/* +* PARAMETERS +* p_ntc +* [in] Pointer to the notice MAD attribute +* +* prod_type +* [in] The producer Type code in host order +* +* RETURN VALUES +* None +* +* SEE ALSO +* ib_mad_notice_attr_t +*********/ + /****f* IBA Base: Types/ib_notice_get_vend_id * NAME * ib_notice_get_vend_id @@ -6901,6 +6935,40 @@ ib_notice_set_vend_id( * ib_mad_notice_attr_t *********/ +/****f* IBA Base: Types/ib_notice_set_vend_id_ho +* NAME +* ib_notice_set_vend_id_ho +* +* DESCRIPTION +* Set the notice Producer Type of Generic Notice given a host order value +* +* SYNOPSIS +*/ +static inline void +ib_notice_set_vend_id_ho( + IN ib_mad_notice_attr_t *p_ntc, + IN ib_net32_t vend_id_ho) +{ + p_ntc->g_or_v.vend.vend_id_lsb = + cl_hton16((uint16_t)(vend_id_ho & 0x0000ffff)); + p_ntc->g_or_v.vend.vend_id_msb = + (uint8_t)((vend_id_ho & 0x00ff0000) >> 16); +} +/* +* PARAMETERS +* p_ntc +* [in] Pointer to the notice MAD attribute +* +* vend_id_ho +* [in] The producer Type code in host order +* +* RETURN VALUES +* None +* +* SEE ALSO +* ib_mad_notice_attr_t +*********/ + #include <complib/cl_packon.h> typedef struct _ib_inform_info { Index: osmtest/osmt_inform.c =================================================================== --- osmtest/osmt_inform.c (revision 8636) +++ osmtest/osmt_inform.c (working copy) @@ -462,7 +462,7 @@ osmt_send_trap_wait_for_forward( IN osmt /* prepare the notice */ p_ntc->generic_type = 0x82;/* generic, type = 2 */ - ib_notice_set_prod_type(p_ntc, 1); + ib_notice_set_prod_type_ho(p_ntc, 1); p_ntc->g_or_v.generic.trap_num = cl_hton16(0x26); p_ntc->issuer_lid = cl_hton16(2); Index: opensm/osm_state_mgr.c =================================================================== --- opensm/osm_state_mgr.c (revision 8636) +++ opensm/osm_state_mgr.c (working copy) @@ -1709,7 +1709,7 @@ __osm_state_mgr_report_new_ports( /* details of the notice */ notice.generic_type = 0x83; /* is generic subn mgt type */ - ib_notice_set_prod_type( ¬ice, CL_HTON32( 4 ) ); /* A Class Manager generator */ + ib_notice_set_prod_type_ho( ¬ice, 4 ); /* A Class Manager generator */ /* endport becomes to be reachable */ notice.g_or_v.generic.trap_num = CL_HTON16( 64 ); /* The sm_base_lid is saved in network order already. */ Index: opensm/osm_multicast.c =================================================================== --- opensm/osm_multicast.c (revision 8636) +++ opensm/osm_multicast.c (working copy) @@ -329,7 +329,7 @@ osm_mgrp_send_delete_notice( /* details of the notice */ notice.generic_type = 0x83; /* is generic subn mgt type */ - ib_notice_set_prod_type(¬ice, CL_NTOH32(4)); /* A Class Manager generator */ + ib_notice_set_prod_type_ho(¬ice, 4); /* A Class Manager generator */ notice.g_or_v.generic.trap_num = CL_HTON16(67); /* delete of mcg */ /* The sm_base_lid is saved in network order already. */ notice.issuer_lid = p_subn->sm_base_lid; @@ -375,7 +375,7 @@ osm_mgrp_send_create_notice( /* details of the notice */ notice.generic_type = 0x83; /* Generic SubnMgt type */ - ib_notice_set_prod_type(¬ice, CL_HTON32(4)); /* A Class Manager generator */ + ib_notice_set_prod_type_ho(¬ice, 4); /* A Class Manager generator */ notice.g_or_v.generic.trap_num = CL_HTON16(66); /* create of mcg */ /* The sm_base_lid is saved in network order already. */ notice.issuer_lid = p_subn->sm_base_lid; Index: opensm/osm_drop_mgr.c =================================================================== --- opensm/osm_drop_mgr.c (revision 8636) +++ opensm/osm_drop_mgr.c (working copy) @@ -315,7 +315,7 @@ __osm_drop_mgr_remove_port( /* details of the notice */ notice.generic_type = 0x83; /* is generic subn mgt type */ - ib_notice_set_prod_type(¬ice, CL_HTON32(4)); /* A class manager generator */ + ib_notice_set_prod_type_ho(¬ice, 4); /* A class manager generator */ /* endport ceases to be reachable */ notice.g_or_v.generic.trap_num = CL_HTON16(65); /* The sm_base_lid is saved in network order already. */ _______________________________________________ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general