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

Hal Rosenstock hnrose at comcast.net
Wed Jun 17 06:40:46 PDT 2009


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));
 	else
 		OSM_LOG(p_log, OSM_LOG_INFO,
 			"Reporting Vendor Notice type:%u vend:%u dev:%u"



More information about the general mailing list