From patchwork Wed Feb 20 11:52:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Ben Yosef X-Patchwork-Id: 2167281 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 7B8DEDF230 for ; Wed, 20 Feb 2013 11:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934855Ab3BTLw1 (ORCPT ); Wed, 20 Feb 2013 06:52:27 -0500 Received: from eu1sys200aog102.obsmtp.com ([207.126.144.113]:41674 "EHLO eu1sys200aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934842Ab3BTLw1 (ORCPT ); Wed, 20 Feb 2013 06:52:27 -0500 Received: from mtlsws123.lab.mtl.com ([82.166.227.17]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKUSS48B9yQ88++McCWVmeGeCNrLQoxjjG@postini.com; Wed, 20 Feb 2013 11:52:26 UTC Received: from r-ufm5-17.lab.mtl.com (r-ufm5-17.mtr.labs.mlnx [172.30.5.91]) by mtlsws123.lab.mtl.com (8.13.8/8.13.8) with ESMTP id r1KBqEEe029123; Wed, 20 Feb 2013 13:52:14 +0200 Received: from r-ufm5-17.lab.mtl.com (localhost [127.0.0.1]) by r-ufm5-17.lab.mtl.com (8.14.4/8.14.4) with ESMTP id r1KBqDAs020701; Wed, 20 Feb 2013 13:52:13 +0200 Received: (from danby@localhost) by r-ufm5-17.lab.mtl.com (8.14.4/8.14.4/Submit) id r1KBqAW3020698; Wed, 20 Feb 2013 13:52:10 +0200 Date: Wed, 20 Feb 2013 13:52:10 +0200 From: Dan Ben Yosef To: Ira Weiny Cc: linux-rdma@vger.kernel.org Subject: [PATCH] infiniband-diags/ibqueryerrors.c: changed the behavior when guid/DR-path not found Message-ID: <20130220115210.GB20018@r-ufm5-17.lab.mtl.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Dan Ben Yosef Date: Wed, 13 Feb 2013 11:05:42 +0200 Subject: [PATCH] infiniband-diags/ibqueryerrors.c: changed the behavior when guid/DR-path not found If we use G or D options and we can't find the guid (sm is down or the guid is wrong), we'll get an error instead of the result for all the ports in the fabric. Signed-off-by: Dan Ben Yosef --- src/ibqueryerrors.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c index 076327c..6320972 100644 --- a/src/ibqueryerrors.c +++ b/src/ibqueryerrors.c @@ -935,16 +935,18 @@ int main(int argc, char **argv) if (dr_path) { if ((resolved = resolve_portid_str(ibd_ca, ibd_ca_port, &portid, dr_path, - IB_DEST_DRPATH, NULL, ibmad_port)) < 0) - IBWARN("Failed to resolve %s; attempting full scan", - dr_path); + IB_DEST_DRPATH, NULL, ibmad_port)) < 0) { + IBWARN("Failed to resolve %s;",dr_path); + goto close_port; + } } else if (port_guid_str) { if ((resolved = resolve_portid_str(ibd_ca, ibd_ca_port, &portid, port_guid_str, IB_DEST_GUID, ibd_sm_id, - ibmad_port)) < 0) - IBWARN("Failed to resolve %s; attempting full scan", - port_guid_str); + ibmad_port)) < 0) { + IBWARN("Failed to resolve %s;",port_guid_str); + goto close_port; + } } if (load_cache_file) {