[ofa-general] Re: [PATCH] opensm/opensm/osm_state_mgr.c: Add check for valid physical port before using pointer.

Sasha Khapyorsky sashak at voltaire.com
Tue Nov 18 04:30:00 PST 2008


Hi,

On 20:54 Wed 12 Nov     , Sasha Khapyorsky wrote:
> > 
> > I was wondering if it would return invalid ports ever.  It would be easy for it
> > to return only valid ports but perhaps that should be another function to
> > preserve functionality?

Looked at this. Another problematic place where this function is used is
osm_sa_link_record.c - there when "any" port becomes invalid (which is
possible case) it starts an endless recursion :(. So we will need to fix
the function behavior.

One option is to scan all ports and to return valid one. Another solution
would be to update locally stored in OpenSM NodeInfo on each receive
(something like below). Then osm_node_get_any_physp_ptr() will return a
port where this node was accessed last.

In this way it also could catch potential OtherLocalSetting changes (in
NodeInfo, such as SystemImageGUID, etc.).

Could anybody see any downsides with such approach?

Sasha


diff --git a/opossum/opensm/osm_node_info_rcv.c b/opensm/opensm/osm_node_info_rcv.c
index 20b16d1..7d41cab 100644
--- a/opensm/opensm/osm_node_info_rcv.c
+++ b/opensm/opensm/osm_node_info_rcv.c
@@ -785,6 +785,8 @@ __osm_ni_rcv_process_existing(IN osm_sm_t * sm,
 		break;
 	}
 
+	p_node->node_info = *p_ni;
+
 	__osm_ni_rcv_set_links(sm, p_node, port_num, p_ni_context);
 
 	OSM_LOG_EXIT(sm->p_log);



More information about the general mailing list