[ofa-general] [PATCH 2/4 v2] opensm/osm_state_mgr.c rescan subnet configuration after SIGHUP

Eli Dorfman (Voltaire) dorfman.eli at gmail.com
Wed Feb 4 23:43:04 PST 2009


Sasha Khapyorsky wrote:
> Hi Eli,
> 
> On 16:11 Tue 03 Feb     , Eli Dorfman (Voltaire) wrote:
>>  rescan configuration as first step on every heavy sweep
>>  this is a must in case of priority change (increase) for standby SM
>>
>> Signed-off-by: Eli Dorfman <elid at voltaire.com>
>> ---
>>  opensm/opensm/osm_state_mgr.c |   11 ++++++-----
>>  1 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
>> index fc7ceb9..622867b 100644
>> --- a/opensm/opensm/osm_state_mgr.c
>> +++ b/opensm/opensm/osm_state_mgr.c
>> @@ -1042,6 +1042,12 @@ static void do_sweep(osm_sm_t * sm)
>>  	ib_api_status_t status;
>>  	osm_remote_sm_t *p_remote_sm;
>>  
>> +	if (sm->p_subn->force_heavy_sweep && 
>> +	    osm_subn_rescan_conf_files(sm->p_subn) < 0) {
>> +		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 331A: "
>> +			"osm_subn_rescan_conf_file failed\n");
>> +	}
>> +
>>  	if (sm->p_subn->sm_state != IB_SMINFO_STATE_MASTER &&
>>  	    sm->p_subn->sm_state != IB_SMINFO_STATE_DISCOVERING)
>>  		return;
>> @@ -1131,11 +1137,6 @@ _repeat_discovery:
>>  	sm->p_subn->force_reroute = FALSE;
>>  	sm->p_subn->subnet_initialization_error = FALSE;
>>  
>> -	/* rescan configuration updates */
>> -	if (osm_subn_rescan_conf_files(sm->p_subn) < 0)
>> -		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 331A: "
>> -			"osm_subn_rescan_conf_file failed\n");
>> -
>>  	if (sm->p_subn->sm_state != IB_SMINFO_STATE_MASTER)
>>  		sm->p_subn->need_update = 1;
> 
> 'force_heavy_sweep' flag can be raised during light sweep too. In this
> case you will miss config rescanning before incoming heavy sweep. I
> guess the patch should similar to (not tested):
> 
> 
> diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
> index aecfac6..f5d3837 100644
> --- a/opensm/opensm/osm_state_mgr.c
> +++ b/opensm/opensm/osm_state_mgr.c
> @@ -1041,11 +1041,14 @@ static void do_sweep(osm_sm_t * sm)
>  {
>  	ib_api_status_t status;
>  	osm_remote_AM_t *p_remote_sm;
> +	unsigned config_parsed = 0;
>  
> -	if (sm->p_subn->force_heavy_sweep &&
> -	    osm_subn_rescan_conf_files(sm->p_subn) < 0) {
> -		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 331A: "
> -			"osm_subn_rescan_conf_file failed\n");
> +	if (sm->p_subn->force_heavy_sweep) {
> +		if (osm_subn_rescan_conf_files(sm->p_subn) < 0)
> +			OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 331A: "
> +				"osm_subn_rescan_conf_file failed\n");
> +		else
> +			config_parsed = 1;
>  	}
>  
>  	if (sm->p_subn->sm_state != IB_SMINFO_STATE_MASTER &&
> @@ -1137,6 +1140,11 @@ _repeat_discovery:
>  	sm->p_subn->force_reroute = FALSE;
>  	sm->p_subn->subnet_initialization_error = FALSE;
>  
> +	/* rescan configuration updates */
> +	if (!config_parsed && osm_subn_rescan_conf_files(sm->p_subn) < 0)
> +		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 331A: "
> +			"osm_subn_rescan_conf_file failed\n");
> +
>  	if (sm->p_subn->sm_state != IB_SMINFO_STATE_MASTER)
>  		sm->p_subn->need_update = 1;
> 

ok. Please apply the fixed patch.

Thanks,
Eli




More information about the general mailing list