[ofa-general] Re: [PATCH] opensm/osm_perfmgr_db.c: In bad_node_port, allow queries on enhanced SP0

Sasha Khapyorsky sashak at voltaire.com
Wed Feb 4 11:15:32 PST 2009


On 07:57 Tue 03 Feb     , Hal Rosenstock wrote:
> 
> Patch to osm_perfmgr_db.c to only error port 0 queries when not enhanced
> SP0.

This:

+       osm_node = osm_get_node_by_guid(pm->subn, cl_hton64(node->node_guid));
+       if (!osm_node)
+               return (PERFMGR_EVENT_DB_GUIDNOTFOUND);
+       if ((!(osm_node_get_type(osm_node) == IB_NODE_TYPE_SWITCH) ||
+           !osm_node->sw ||
+           !ib_switch_info_is_enhanced_port0(&osm_node->sw->switch_info)) &&
+          (port == 0))
+               return (PERFMGR_EVENT_DB_PORTNOTFOUND);

(osm_get_node_by_guid()) is expensive operation. If you only need to
determine port 0 type - store it as part of struct monitored_node
structure. Another (even more universal) approach would be to keep there
a reference to related osm_node object.

Sasha



More information about the general mailing list