[ofa-general] Re: [PATCH] opensm/osm_inform.c: For traps 64-67, use GID in DataDetails in log messages

Sasha Khapyorsky sashak at voltaire.com
Wed Jun 17 09:46:24 PDT 2009


On 09:40 Wed 17 Jun     , Hal Rosenstock wrote:
> 
> Issuer GID and LID are uninteresting for SM generated notices
> 
> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
> ---
> diff --git a/opensm/opensm/osm_inform.c b/opensm/opensm/osm_inform.c
> index 990f1e0..43676c2 100644
> --- a/opensm/opensm/osm_inform.c
> +++ b/opensm/opensm/osm_inform.c
> @@ -561,15 +561,29 @@ ib_api_status_t osm_report_notice(IN osm_log_t * p_log, IN osm_subn_t * p_subn,
>  
>  	/* an official Event information log */
>  	if (ib_notice_is_generic(p_ntc))
> -		OSM_LOG(p_log, OSM_LOG_INFO,
> -			"Reporting Generic Notice type:%u num:%u (%s)"
> -			" from LID:%u GID:%s\n",
> -			ib_notice_get_type(p_ntc),
> -			cl_ntoh16(p_ntc->g_or_v.generic.trap_num),
> -			ib_get_trap_str(p_ntc->g_or_v.generic.trap_num),
> -			cl_ntoh16(p_ntc->issuer_lid),
> -			inet_ntop(AF_INET6, p_ntc->issuer_gid.raw, gid_str,
> -				  sizeof gid_str));
> +		if ((p_ntc->g_or_v.generic.trap_num == CL_HTON16(64)) ||
> +		    (p_ntc->g_or_v.generic.trap_num == CL_HTON16(65)) ||
> +		    (p_ntc->g_or_v.generic.trap_num == CL_HTON16(66)) ||
> +		    (p_ntc->g_or_v.generic.trap_num == CL_HTON16(67)))
> +			OSM_LOG(p_log, OSM_LOG_INFO,
> +				"Reporting Generic Notice type:%u num:%u (%s)"
> +				" GID:%s\n",
> +				ib_notice_get_type(p_ntc),
> +				cl_ntoh16(p_ntc->g_or_v.generic.trap_num),
> +				ib_get_trap_str(p_ntc->g_or_v.generic.trap_num),
> +				inet_ntop(AF_INET6,
> +					  p_ntc->data_details.ntc_64_67.gid.raw,
> +					  gid_str, sizeof gid_str));
> +		else
> +			OSM_LOG(p_log, OSM_LOG_INFO,
> +				"Reporting Generic Notice type:%u num:%u (%s)"
> +				" from LID:%u GID:%s\n",
> +				ib_notice_get_type(p_ntc),
> +				cl_ntoh16(p_ntc->g_or_v.generic.trap_num),
> +				ib_get_trap_str(p_ntc->g_or_v.generic.trap_num),
> +				cl_ntoh16(p_ntc->issuer_lid),
> +				inet_ntop(AF_INET6, p_ntc->issuer_gid.raw,
> +					  gid_str, sizeof gid_str));

Maybe, but it seems easier for me to have unified log here (which is
macro which will be filtered out when log level is lower) than add
additional "if/else".

Sasha



More information about the general mailing list