From patchwork Sat Apr 10 00:56:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 91835 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 o3A0tkwv013022 for ; Sat, 10 Apr 2010 00:56:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751200Ab0DJA4O (ORCPT ); Fri, 9 Apr 2010 20:56:14 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:36577 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135Ab0DJA4N (ORCPT ); Fri, 9 Apr 2010 20:56:13 -0400 Received: by bwz1 with SMTP id 1so2893063bwz.21 for ; Fri, 09 Apr 2010 17:56:12 -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=hAdhDokBptIR5CpRIdj96rbK+xt4DhoKMQgx2xdepPM=; b=SygdpDnysZfyP+Cbz+kyQPYvPNJKlHLTWvNbnR+oyTbkKv8RTfVVxZQaj//8zlM+9K 69ZTJbX6HZxwOWaVlOQm6qPe8dhgv1woN5WTJkQSK/kVPI8NXVo0OVpHArZJgH9DupEL kNP8OuZ230+/Na+J0Ab7U2OoTYdAtYYTorKjo= 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=Rgu9qQTzK2yb3irRukqYeqhhfah5QhbC6h5Iu9MD1MZ+DzTcmvc3YCIjmfEzx6z658 mO+5UeG6paBimbS8YKkFGkkRP3V/NSg7wXfnQmL6OuJjGmnYY2Nnlq858FMxz8EXBJ3Q p5k3B/c2AllvwguawHCkeAXfu+Z9J6j8EdhJs= Received: by 10.204.15.14 with SMTP id i14mr855376bka.123.1270860971941; Fri, 09 Apr 2010 17:56:11 -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 24sm14137005bkr.6.2010.04.09.17.56.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Apr 2010 17:56:11 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 4DD2A11F34; Sat, 10 Apr 2010 03:56:22 +0300 (IDT) Date: Sat, 10 Apr 2010 03:56:22 +0300 From: Sasha Khapyorsky To: Ira Weiny Cc: "linux-rdma@vger.kernel.org" , Hal Rosenstock Subject: [PATCH] libibnetdisc: restore show_progress functionality Message-ID: <20100410005622.GJ4808@me> References: <20100218124931.4d6ef34b.weiny2@llnl.gov> <20100410005245.GH4808@me> <20100410005536.GI4808@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100410005536.GI4808@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]); Sat, 10 Apr 2010 00:56:14 +0000 (UTC) diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 4780810..b438d4f 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -270,6 +270,18 @@ static void link_ports(ibnd_node_t * node, ibnd_port_t * port, remoteport->remoteport = port; } +static void dump_endnode(ib_portid_t * path, char *prompt, + ibnd_node_t * node, ibnd_port_t * port) +{ + char type[64]; + mad_dump_node_type(type, sizeof(type), &node->type, sizeof(int)); + printf("%s -> %s %s {%016" PRIx64 "} portnum %d lid %d-%d \"%s\"\n", + portid2str(path), prompt, type, node->guid, + node->type == IB_NODE_SWITCH ? 0 : port->portnum, + port->base_lid, port->base_lid + (1 << port->lmc) - 1, + node->nodedesc); +} + static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, uint8_t * mad, void *cb_data) { @@ -303,6 +315,10 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, } port->guid = port_guid; + if (show_progress) + dump_endnode(&smp->path, node_is_new ? "new" : "known", + node, port); + if (rem_node == NULL) /* this is the start node */ fabric->from_node = node; else {