From patchwork Wed Oct 7 17:35:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 52316 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 n97HdfVq011791 for ; Wed, 7 Oct 2009 17:39:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbZJGRii (ORCPT ); Wed, 7 Oct 2009 13:38:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753662AbZJGRii (ORCPT ); Wed, 7 Oct 2009 13:38:38 -0400 Received: from nspiron-3.llnl.gov ([128.115.41.83]:34015 "EHLO smtp.llnl.gov" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753376AbZJGRih (ORCPT ); Wed, 7 Oct 2009 13:38:37 -0400 X-Attachments: None Received: from mail-2.llnl.gov ([128.115.41.181]) by smtp.llnl.gov with ESMTP; 07 Oct 2009 10:38:01 -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 n97Hc0YU031102; Wed, 7 Oct 2009 10:38:00 -0700 Date: Wed, 7 Oct 2009 10:35:25 -0700 From: Ira Weiny To: Sasha Khapyorsky Cc: "Eli Dorfman (Voltaire)" , "linux-rdma@vger.kernel.org" , Julia Volynsky Subject: Re: [ofa-general] [PATCH -- repost] infiniband-diags: Fix IB network discovery from switch node. Message-Id: <20091007103525.8982fc2f.weiny2@llnl.gov> In-Reply-To: <20090929164842.c1ab7d06.weiny2@llnl.gov> References: <4A9548AA.4020900@gmail.com> <20090923172451.fb20ab9b.weiny2@llnl.gov> <4AC232D5.2060806@gmail.com> <20090929164842.c1ab7d06.weiny2@llnl.gov> 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++) {