[ofa-general] Re: [PATCH 2/2] opensm: setup routing engine when in use and delete when fail

Sasha Khapyorsky sashak at voltaire.com
Thu Mar 12 09:05:28 PDT 2009


On 17:37 Thu 12 Mar     , Eli Dorfman (Voltaire) wrote:
> 
> you are partially right - when opensm goes down it is not deleted.

This is what I meant.

> there are two RE list (prev and current).

Not in this patch series. Please don't mix patches.

> >> @@ -911,6 +930,19 @@ int osm_ucast_mgr_process(IN osm_ucast_mgr_t * const p_mgr)
> >>  		p_osm->routing_engine_used = OSM_ROUTING_ENGINE_TYPE_MINHOP;
> >>  	}
> >>  
> >> +	/* if for some reason different routing engine is used */
> >> +	/* cleanup unused routing engine */
> >> +	p_routing_eng = p_osm->routing_engine_list;
> >> +	while (p_routing_eng) {
> >> +		if (p_routing_eng->initialized &&
> >> +			p_osm->routing_engine_used != 
> >> +				osm_routing_engine_type(p_routing_eng->name) &&
> >> +			p_routing_eng->delete) 
> >> +			p_routing_eng->delete(p_routing_eng->context);
> >> +
> >> +		p_routing_eng = p_routing_eng->next;
> >> +	}
> >> +
> > 
> > How this section of code is useful?
> 
> This code is used to free memory allocated for RE that is not used anymore.
> If for example we configured routing_engine=X,Z
> and routing_engine_used was Z
> Now if we modify routing_engine=Y,Z

But we are not modifying routing engine list now.

> and opensm succeeds to setup Y
> Then we should free memory of RE(Z) that is not used now.

Ok. I see this may work even with static list. When one time OpenSM
falls back and second time first RE succeed. Got it.

Just address other comments and merge 1,2 into single patch.

Sasha



More information about the general mailing list