From patchwork Wed Feb 20 12:36:00 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: 2167391 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 68C31DF230 for ; Wed, 20 Feb 2013 12:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935303Ab3BTMgH (ORCPT ); Wed, 20 Feb 2013 07:36:07 -0500 Received: from eu1sys200aog115.obsmtp.com ([207.126.144.139]:43390 "EHLO eu1sys200aog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935253Ab3BTMgG (ORCPT ); Wed, 20 Feb 2013 07:36:06 -0500 Received: from mtlsws123.lab.mtl.com ([82.166.227.17]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUSTDMj9CuN/LJGhoBIhNrKxezBhp/a34@postini.com; Wed, 20 Feb 2013 12:36:06 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 r1KCa11e003974; Wed, 20 Feb 2013 14:36:01 +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 r1KCa1Gm023625; Wed, 20 Feb 2013 14:36:01 +0200 Received: (from danby@localhost) by r-ufm5-17.lab.mtl.com (8.14.4/8.14.4/Submit) id r1KCa0f8023622; Wed, 20 Feb 2013 14:36:00 +0200 Date: Wed, 20 Feb 2013 14:36:00 +0200 From: Dan Ben Yosef To: Ira Weiny Cc: linux-rdma@vger.kernel.org Subject: [PATCHv2] infiniband-diags/ibqueryerrors.c: changed the behavior when guid/DR-path not found Message-ID: <20130220123600.GD20018@r-ufm5-17.lab.mtl.com> References: <20130220115210.GB20018@r-ufm5-17.lab.mtl.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130220115210.GB20018@r-ufm5-17.lab.mtl.com> 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 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 --- Changes since v1: Fixed patch description 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) {