[openib-general] [PATCH 1/2]: OpenSM/osm_sa_informinfo.c: Fix InformInfoRecord searches
Hal Rosenstock
halr at voltaire.com
Wed Dec 20 11:03:30 PST 2006
OpenSM/osm_sa_informinfo.c: Fix InformInfoRecord searches
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
diff --git a/osm/opensm/osm_sa_informinfo.c b/osm/opensm/osm_sa_informinfo.c
index 06ea90c..374b61d 100644
--- a/osm/opensm/osm_sa_informinfo.c
+++ b/osm/opensm/osm_sa_informinfo.c
@@ -368,8 +368,6 @@ __osm_sa_inform_info_rec_by_comp_mask(
osm_port_t * p_subscriber_port;
osm_physp_t * p_subscriber_physp;
const osm_physp_t* p_req_physp;
- osm_infr_t* p_infr_rec = NULL;
- ib_inform_info_record_t inform_info_rec;
osm_iir_item_t* p_rec_item;
OSM_LOG_ENTER( p_rcv->p_log, __osm_sa_inform_info_rec_by_comp_mask );
@@ -378,72 +376,58 @@ __osm_sa_inform_info_rec_by_comp_mask(
comp_mask = p_ctxt->comp_mask;
p_req_physp = p_ctxt->p_req_physp;
- /* Both subscriber GID and enum specified */
- if ((comp_mask & IB_IIR_COMPMASK_SUBSCRIBERGID) &&
- (comp_mask & IB_IIR_COMPMASK_ENUM))
- {
- inform_info_rec.subscriber_gid = p_ctxt->subscriber_gid;
- inform_info_rec.subscriber_enum = p_ctxt->subscriber_enum;
- p_infr_rec = osm_infr_get_by_rid(p_rcv->p_subn, p_rcv->p_log, &inform_info_rec);
- goto Done;
- }
-
if (comp_mask & IB_IIR_COMPMASK_SUBSCRIBERGID)
{
- inform_info_rec.subscriber_gid = p_ctxt->subscriber_gid;
- p_infr_rec = osm_infr_get_by_gid(p_rcv->p_subn, p_rcv->p_log, &inform_info_rec);
- goto Done;
+ if (memcmp(&p_infr->inform_record.subscriber_gid,
+ &p_ctxt->subscriber_gid,
+ sizeof(p_infr->inform_record.subscriber_gid)))
+ goto Exit;
}
if (comp_mask & IB_IIR_COMPMASK_ENUM)
{
- inform_info_rec.subscriber_enum = p_ctxt->subscriber_enum;
- p_infr_rec = osm_infr_get_by_enum(p_rcv->p_subn, p_rcv->p_log, &inform_info_rec);
- goto Done;
+ if (p_infr->inform_record.subscriber_enum != p_ctxt->subscriber_enum)
+ goto Exit;
}
/* Implement any other needed search cases */
-Done:
- if (p_infr_rec)
+ /* Ensure pkey is shared before returning any records */
+ portguid = p_infr->inform_record.subscriber_gid.unicast.interface_id;
+ p_subscriber_port = osm_get_port_by_guid( p_rcv->p_subn, portguid );
+ if ( p_subscriber_port == NULL )
{
- /* Ensure pkey is shared before returning any records */
- portguid = p_infr_rec->inform_record.subscriber_gid.unicast.interface_id;
- p_subscriber_port = osm_get_port_by_guid( p_rcv->p_subn, portguid );
- if ( p_subscriber_port == NULL )
- {
- osm_log( p_rcv->p_log, OSM_LOG_ERROR,
- "__osm_sa_inform_info_rec_by_comp_mask: ERR 430D: "
- "Invalid subscriber port guid: 0x%016" PRIx64 "\n",
- cl_ntoh64(portguid) );
- goto Exit;
- }
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "__osm_sa_inform_info_rec_by_comp_mask: ERR 430D: "
+ "Invalid subscriber port guid: 0x%016" PRIx64 "\n",
+ cl_ntoh64(portguid) );
+ goto Exit;
+ }
- /* get the subscriber InformInfo physical port */
- p_subscriber_physp = osm_port_get_default_phys_ptr(p_subscriber_port);
- /* make sure that the requester and subscriber port can access each other
- according to the current partitioning. */
- if (! osm_physp_share_pkey( p_rcv->p_log, p_req_physp, p_subscriber_physp ))
- {
- osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
- "__osm_sa_inform_info_rec_by_comp_mask: "
- "requester and subscriber ports don't share pkey\n" );
- goto Exit;
- }
+ /* get the subscriber InformInfo physical port */
+ p_subscriber_physp = osm_port_get_default_phys_ptr(p_subscriber_port);
+ /* make sure that the requester and subscriber port can access each other
+ according to the current partitioning. */
+ if (! osm_physp_share_pkey( p_rcv->p_log, p_req_physp, p_subscriber_physp ))
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
+ "__osm_sa_inform_info_rec_by_comp_mask: "
+ "requester and subscriber ports don't share pkey\n" );
+ goto Exit;
+ }
- p_rec_item = (osm_iir_item_t*)cl_qlock_pool_get( &p_rcv->pool );
- if( p_rec_item == NULL )
- {
- osm_log( p_rcv->p_log, OSM_LOG_ERROR,
- "__osm_sa_inform_info_rec_by_comp_mask: ERR 430E: "
- "cl_qlock_pool_get failed\n" );
- goto Exit;
- }
-
- memcpy((void *)&p_rec_item->rec, (void *)&p_infr_rec->inform_record, sizeof(ib_inform_info_record_t));
- cl_qlist_insert_tail( p_ctxt->p_list, (cl_list_item_t*)&p_rec_item->pool_item );
+ p_rec_item = (osm_iir_item_t*)cl_qlock_pool_get( &p_rcv->pool );
+ if( p_rec_item == NULL )
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "__osm_sa_inform_info_rec_by_comp_mask: ERR 430E: "
+ "cl_qlock_pool_get failed\n" );
+ goto Exit;
}
+ memcpy((void *)&p_rec_item->rec, (void *)&p_infr->inform_record, sizeof(ib_inform_info_record_t));
+ cl_qlist_insert_tail( p_ctxt->p_list, (cl_list_item_t*)&p_rec_item->pool_item );
+
Exit:
OSM_LOG_EXIT( p_rcv->p_log );
}
More information about the general
mailing list