From patchwork Tue Sep 29 23:48:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 50637 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8TNpD6B023615 for ; Tue, 29 Sep 2009 23:51:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752858AbZI2XvJ (ORCPT ); Tue, 29 Sep 2009 19:51:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752952AbZI2XvI (ORCPT ); Tue, 29 Sep 2009 19:51:08 -0400 Received: from nspiron-1.llnl.gov ([128.115.41.81]:13831 "EHLO nspiron-1.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752858AbZI2XvI (ORCPT ); Tue, 29 Sep 2009 19:51:08 -0400 X-Attachments: None Received: from mail-2.llnl.gov ([128.115.41.181]) by nspiron-1.llnl.gov with ESMTP; 29 Sep 2009 16:51:12 -0700 Received: from jeepcj7.llnl.gov (jeepcj7.llnl.gov [134.9.93.67]) by mail-2.llnl.gov (8.13.1/8.12.3/LLNL evision: 1.7 $) with SMTP id n8TNpBcN020017; Tue, 29 Sep 2009 16:51:11 -0700 Date: Tue, 29 Sep 2009 16:48:42 -0700 From: Ira Weiny To: "Eli Dorfman (Voltaire)" Cc: Sasha Khapyorsky , OpenIB , "linux-rdma@vger.kernel.org" , Julia Volynsky Subject: Re: [ofa-general] [PATCH] infiniband-diags: Fix IB network discovery from switch node. Message-Id: <20090929164842.c1ab7d06.weiny2@llnl.gov> In-Reply-To: <4AC232D5.2060806@gmail.com> References: <4A9548AA.4020900@gmail.com> <20090923172451.fb20ab9b.weiny2@llnl.gov> <4AC232D5.2060806@gmail.com> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.10.4; 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 diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 97e369c..96f72c5 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -506,7 +506,7 @@ static int get_remote_node(struct ibmad_port *ibmad_port, != IB_PORT_PHYS_STATE_LINKUP) return 1; /* positive == non-fatal error */ - if (extend_dpath(ibmad_port, fabric, path, portnum) < 0) + if (portnum > 0 && extend_dpath(ibmad_port, fabric, path, portnum) < 0) return -1; if (query_node(ibmad_port, fabric, &node_buf, &port_buf, path)) { @@ -600,15 +600,13 @@ ibnd_fabric_t *ibnd_discover_fabric(struct ibmad_port * ibmad_port, if (!port) goto error; - if (node->type != IB_NODE_SWITCH) { - rc = get_remote_node(ibmad_port, fabric, node, port, from, - mad_get_field(node->info, 0, - IB_NODE_LOCAL_PORT_F), 0); - if (rc < 0) - goto error; - if (rc > 0) /* non-fatal error, nothing more to be done */ - return ((ibnd_fabric_t *) fabric); - } + rc = get_remote_node(ibmad_port, fabric, node, port, from, + mad_get_field(node->info, 0, + IB_NODE_LOCAL_PORT_F), 0); + if (rc < 0) + goto error; + if (rc > 0) /* non-fatal error, nothing more to be done */ + return ((ibnd_fabric_t *) fabric); for (dist = 0; dist <= max_hops; dist++) {