From patchwork Sat Apr 10 00:57:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 91837 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 o3A0viKe015345 for ; Sat, 10 Apr 2010 00:57:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262Ab0DJA5n (ORCPT ); Fri, 9 Apr 2010 20:57:43 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:62343 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135Ab0DJA5n (ORCPT ); Fri, 9 Apr 2010 20:57:43 -0400 Received: by bwz1 with SMTP id 1so2893329bwz.21 for ; Fri, 09 Apr 2010 17:57:41 -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=0GyWjiganao2OLel0zficV/X2BKSU9I7GXCx/kvnG4k=; b=sXQyzPHiZtcFGHg8GwU5fTBxNF1n4K7s8qknOvMOx/+uPoKdo1lBqxW6aresK+m6W9 NbUPfC9lsIaqqbwj6BiNHLoD9hOSafaruIOgKXpivvtL/Ls7/76/KK4OtR2onRNgd7TT vvW2UULAG2iZlvHsaV3+sVAZsFbhFS9RPNbUA= 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=TcsFF5QR2AYYhfL+46vSL4U79Kw4Gx5+TJGZ4nnQHrhTJwxb7K1wEuP2VRODBWWTM8 xQLzpywsP8XUCvOby+HxLHxM7qa3mbJ6wC4l6bWqQP6+p4BeKzunv+wkEOppj8pr+M7x ORvzODIfNad/1ax+9miKGac/g4wdKUA68ug1s= Received: by 10.204.129.70 with SMTP id n6mr863646bks.152.1270861061635; Fri, 09 Apr 2010 17:57:41 -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 s17sm14132650bkd.16.2010.04.09.17.57.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Apr 2010 17:57:41 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 32BBA11F34; Sat, 10 Apr 2010 03:57:52 +0300 (IDT) Date: Sat, 10 Apr 2010 03:57:52 +0300 From: Sasha Khapyorsky To: Ira Weiny Cc: "linux-rdma@vger.kernel.org" , Hal Rosenstock Subject: [PATCH] libibnetdisc: keep total number of used SMPs Message-ID: <20100410005752.GL4808@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:57:44 +0000 (UTC) diff --git a/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h b/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h index 556014e..8c38c94 100644 --- a/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h +++ b/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h @@ -143,7 +143,8 @@ typedef struct ibnd_fabric { ibnd_node_t *nodes; /* NULL terminated list of all chassis found in the fabric */ ibnd_chassis_t *chassis; - int maxhops_discovered; + unsigned maxhops_discovered; + unsigned total_mads_used; /* internal use only */ ibnd_node_t *nodestbl[HTSZ]; diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 4012eff..65126dd 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -505,6 +505,8 @@ ibnd_fabric_t *ibnd_discover_fabric(struct ibmad_port * ibmad_port, if (process_mads(&engine) != 0) goto error; + fabric->total_mads_used = engine.total_smps; + if (group_nodes(fabric)) goto error; diff --git a/infiniband-diags/libibnetdisc/src/internal.h b/infiniband-diags/libibnetdisc/src/internal.h index 05e254d..d2d4826 100644 --- a/infiniband-diags/libibnetdisc/src/internal.h +++ b/infiniband-diags/libibnetdisc/src/internal.h @@ -82,6 +82,7 @@ struct smp_engine { cl_qmap_t smps_on_wire; int num_smps_outstanding; int max_smps_on_wire; + unsigned total_smps; }; void smp_engine_init(smp_engine_t * engine, struct ibmad_port *ibmad_port, diff --git a/infiniband-diags/libibnetdisc/src/query_smp.c b/infiniband-diags/libibnetdisc/src/query_smp.c index a6878b6..1ec9752 100644 --- a/infiniband-diags/libibnetdisc/src/query_smp.c +++ b/infiniband-diags/libibnetdisc/src/query_smp.c @@ -133,6 +133,7 @@ int issue_smp(smp_engine_t * engine, ib_portid_t * portid, portid->sl = 0; portid->qp = 0; + engine->total_smps++; engine->num_smps_outstanding++; queue_smp(engine, smp); return process_smp_queue(engine);