From patchwork Mon Feb 4 05:33:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 2089141 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 21E7DDFE82 for ; Mon, 4 Feb 2013 05:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750834Ab3BDFdB (ORCPT ); Mon, 4 Feb 2013 00:33:01 -0500 Received: from prdiron-3.llnl.gov ([128.15.143.173]:33235 "EHLO prdiron-3.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714Ab3BDFdB (ORCPT ); Mon, 4 Feb 2013 00:33:01 -0500 X-Attachments: Received: from eris.llnl.gov (HELO trebuchet.chaos) ([128.115.7.7]) by prdiron-3.llnl.gov with SMTP; 03 Feb 2013 21:33:00 -0800 Date: Sun, 3 Feb 2013 21:33:00 -0800 From: Ira Weiny To: "linux-rdma@vger.kernel.org" Subject: [PATCH] infiniband-diags: ibroute: add MAD status to query failure message Message-Id: <20130203213300.a709c5004635e2f821679f64@llnl.gov> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.18.9; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Ira Weiny --- src/ibroute.c | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ibroute.c b/src/ibroute.c index a0c7de8..df48382 100644 --- a/src/ibroute.c +++ b/src/ibroute.c @@ -210,15 +210,20 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid, lastblock = endlid / IB_MLIDS_IN_BLOCK; for (block = startblock; block <= lastblock; block++) { for (j = 0; j < chunks; j++) { + int status; mod = (block - IB_MIN_MCAST_LID / IB_MLIDS_IN_BLOCK) | (j << 28); DEBUG("reading block %x chunk %d mod %x", block, j, mod); - if (!smp_query_via + if (!smp_query_status_via (mft + j, portid, IB_ATTR_MULTICASTFORWTBL, mod, 0, - srcport)) - return "multicast forwarding table get failed"; + &status, srcport)) { + fprintf(stderr, "SubnGet() failed" + "; MAD status 0x%x AM 0x%x\n", + status, mod); + return NULL; + } } i = block * IB_MLIDS_IN_BLOCK; @@ -356,10 +361,15 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid) startblock = startlid / IB_SMP_DATA_SIZE; endblock = ALIGN(endlid, IB_SMP_DATA_SIZE) / IB_SMP_DATA_SIZE; for (block = startblock; block <= endblock; block++) { + int status; DEBUG("reading block %d", block); - if (!smp_query_via(lft, portid, IB_ATTR_LINEARFORWTBL, block, - 0, srcport)) - return "linear forwarding table get failed"; + if (!smp_query_status_via(lft, portid, IB_ATTR_LINEARFORWTBL, block, + 0, &status, srcport)) { + fprintf(stderr, "SubnGet() failed" + "; MAD status 0x%x AM 0x%x\n", + status, block); + return NULL; + } i = block * IB_SMP_DATA_SIZE; e = i + IB_SMP_DATA_SIZE; if (i < startlid)