From patchwork Tue Apr 13 17:18:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 92219 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3DHHvHE031327 for ; Tue, 13 Apr 2010 17:18:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316Ab0DMRSQ (ORCPT ); Tue, 13 Apr 2010 13:18:16 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:46007 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932Ab0DMRSP (ORCPT ); Tue, 13 Apr 2010 13:18:15 -0400 Received: by wwb34 with SMTP id 34so165089wwb.19 for ; Tue, 13 Apr 2010 10:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=2yZkrYYvlpoMBwbFRGtdt13jwGL5HDurd7NXPPlEzV4=; b=cud7lai8x3eCmGPGvCJ9uSE8O/LWa4JLj4PoIDvoRqu/s9J7HzADceRN3cd2gEXhww xtZ3K1xAMXwsyY/ij4ijs2CjwyuICBgiA/udwyaDlehuYwRIyefptazT+MkMoMQXDqEK CiBOaP+hruJ3ytJSendllWAuLpUS39KBX5TnY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=PIgAG3W5Glv0cOgSPEP1GY+oayQoJvUUhTNwB+UMak2L4PokrLdPqBLPtoddKM3X6y vAw/ou5Ic6qEUCjggz2ImyxCzjfmPn099mroQMLTwLpdyclVLrFf2IFWTgvBAhY/hb0F DF/1ci8QyfWfXvAT5gzZb38kwDTu5H26+qtns= Received: by 10.216.164.193 with SMTP id c43mr3592474wel.178.1271179094090; Tue, 13 Apr 2010 10:18:14 -0700 (PDT) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id h31sm1729655wbh.1.2010.04.13.10.18.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Apr 2010 10:18:13 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id EE94E11F31; Tue, 13 Apr 2010 20:18:24 +0300 (IDT) Date: Tue, 13 Apr 2010 20:18:24 +0300 From: Sasha Khapyorsky To: Ira Weiny Cc: "linux-rdma@vger.kernel.org" , Hal Rosenstock Subject: Re: [PATCH v3 1/2] libibnetdisc: Convert to a multi-smp algorithm Message-ID: <20100413171824.GP10830@me> References: <20100218124933.c018a23d.weiny2@llnl.gov> <20100413104658.GA10830@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100413104658.GA10830@me> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Apr 2010 17:18:17 +0000 (UTC) diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 2ce15b7..1c7d6f2 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -339,19 +339,16 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, link_ports(node, port, rem_node, rem_node->ports[rem_port_num]); } - if (!node_is_new) - return 0; - - query_node_desc(engine, &smp->path, node); - - if (node->type == IB_NODE_SWITCH) - query_switch_info(engine, &smp->path, node); + if (node_is_new) { + query_node_desc(engine, &smp->path, node); - /* process all the ports on this node */ - for (i = (node->type == IB_NODE_SWITCH) ? 0 : 1; - i <= node->numports; i++) { - query_port_info(engine, &smp->path, node, i); - } + if (node->type == IB_NODE_SWITCH) { + query_switch_info(engine, &smp->path, node); + for (i = 0; i <= node->numports; i++) + query_port_info(engine, &smp->path, node, i); + } + } else if (node->type != IB_NODE_SWITCH) + query_port_info(engine, &smp->path, node, port_num); return 0; }