public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
To: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] opensm: on MAD error call back print DR PATH or LID of request MAD
Date: Tue, 13 Dec 2011 21:09:18 -0800	[thread overview]
Message-ID: <20111213210918.9cf79850.weiny2@llnl.gov> (raw)


In addition print transaction ID of all DR PATH dumps to make sure we know
which MAD's they refer to.

Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
---
 opensm/osm_helper.c      |    5 +++--
 opensm/osm_sm_mad_ctrl.c |    7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_helper.c b/opensm/osm_helper.c
index f9f3d9d..b6591c4 100644
--- a/opensm/osm_helper.c
+++ b/opensm/osm_helper.c
@@ -2059,8 +2059,9 @@ void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
 		char buf[BUF_SIZE];
 		unsigned n;
 
-		n = sprintf(buf, "Received SMP on a %u hop path: "
-			    "Initial path = ", p_smp->hop_count);
+		n = sprintf(buf, "Received SMP (TID 0x%" PRIx64 ") on a %u hop path: "
+			    "Initial path = ",
+			    cl_ntoh64(p_smp->trans_id), p_smp->hop_count);
 		n += sprint_uint8_arr(buf + n, sizeof(buf) - n,
 				      p_smp->initial_path,
 				      p_smp->hop_count + 1);
diff --git a/opensm/osm_sm_mad_ctrl.c b/opensm/osm_sm_mad_ctrl.c
index ee92c66..6abf8b8 100644
--- a/opensm/osm_sm_mad_ctrl.c
+++ b/opensm/osm_sm_mad_ctrl.c
@@ -721,6 +721,13 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN osm_madw_t * p_madw)
 		ib_get_sm_attr_str(p_smp->attr_id), cl_ntoh32(p_smp->attr_mod),
 		cl_ntoh64(p_smp->trans_id));
 
+	if (p_smp->mgmt_class == IB_MCLASS_SUBN_DIR) {
+		osm_dump_smp_dr_path(p_ctrl->p_log, p_smp, OSM_LOG_ERROR);
+	} else {
+		OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "LID %u\n",
+			cl_ntoh16(p_madw->mad_addr.dest_lid));
+	}
+
 	/*
 	   If this was a SubnSet MAD, then this error might indicate a problem
 	   in configuring the subnet. In this case - need to mark that there was
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2011-12-14  5:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  5:09 Ira Weiny [this message]
     [not found] ` <20111213210918.9cf79850.weiny2-i2BcT+NCU+M@public.gmane.org>
2011-12-15  2:21   ` [PATCH] opensm: on MAD error call back print DR PATH or LID of request MAD Hal Rosenstock
     [not found]     ` <4EE959A8.3000409-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-12-15  3:18       ` Ira Weiny
     [not found]         ` <20111214191840.a3a80cf3.weiny2-i2BcT+NCU+M@public.gmane.org>
2011-12-15 14:15           ` Hal Rosenstock
     [not found]             ` <4EEA00ED.2080609-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-12-15 17:40               ` Ira Weiny
     [not found]                 ` <20111215094006.8aa8f198.weiny2-i2BcT+NCU+M@public.gmane.org>
2011-12-15 22:20                   ` Hal Rosenstock
     [not found]                     ` <4EEA72A5.8080602-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-12-15 22:54                       ` Ira Weiny
     [not found]                         ` <20111215145430.20f6adee.weiny2-i2BcT+NCU+M@public.gmane.org>
2011-12-16 13:03                           ` Hal Rosenstock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111213210918.9cf79850.weiny2@llnl.gov \
    --to=weiny2-i2bct+ncu+m@public.gmane.org \
    --cc=alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox