From patchwork Sun Apr 18 16:10:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 93360 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 o3IG5NFv005475 for ; Sun, 18 Apr 2010 16:10:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753568Ab0DRQKM (ORCPT ); Sun, 18 Apr 2010 12:10:12 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:52311 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753126Ab0DRQKL (ORCPT ); Sun, 18 Apr 2010 12:10:11 -0400 Received: by wyb39 with SMTP id 39so2047738wyb.19 for ; Sun, 18 Apr 2010 09:10:09 -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=eRMq+gAgv5cu+I9GvDShoC+MjpxXohA0kXQmxsp1QhI=; b=rdW2oynhNhc1xWgt7Cp3PPsW4cwG1VGBQpwHndNbzKd3pnEB249UaKaqIq9j6JqcpJ otKNQwed1VHt2wv1WhQTPNOIl6gFcR+lf5vg63rLPHphaec/cJAXP39lpcWq/OaHzpOe bTsqswMYeGD5wZWzE4G7IzzV4Us+34t4QERJ8= 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=TMBStcn4eZW7KxQLoBiz8rJad/zzNNSlqg/Ozd9N0dbOgjCXVwJaaIvKmyhekG8atC ObHZGPYQbaWhFftMfjbm1mj8iFkc8q05PTEg4MVZ+/OEhMrLrdbTAPov9+jGIv3ED7XS 0CoJ7Ui1kJZcIojZ4zbYgv0k6w0luBEJSERy8= Received: by 10.216.174.21 with SMTP id w21mr5564980wel.60.1271607009191; Sun, 18 Apr 2010 09:10:09 -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 z34sm40583979wbv.8.2010.04.18.09.10.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Apr 2010 09:10:08 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 15D3411DF6; Sun, 18 Apr 2010 19:10:28 +0300 (IDT) Date: Sun, 18 Apr 2010 19:10:28 +0300 From: Sasha Khapyorsky To: Ira Weiny Cc: "linux-rdma@vger.kernel.org" , Hal Rosenstock Subject: [PATCH] libibnetdisc: remove not needed num_smps_outstanding counter Message-ID: <20100418161028.GL11943@me> References: <20100218124933.c018a23d.weiny2@llnl.gov> <20100413163836.GM10830@me> <20100413133826.00a8afc5.weiny2@llnl.gov> <20100413134446.72eb336a.weiny2@llnl.gov> <20100414102335.GT10830@me> <0EEE4F40-F1DD-46A6-B756-3C46DA06B403@llnl.gov> <20100416120505.GB11943@me> <20100418154950.GI11943@me> <20100418155636.GJ11943@me> <20100418160357.GK11943@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100418160357.GK11943@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]); Sun, 18 Apr 2010 16:10:14 +0000 (UTC) diff --git a/infiniband-diags/libibnetdisc/src/internal.h b/infiniband-diags/libibnetdisc/src/internal.h index 57034f9..571b2f4 100644 --- a/infiniband-diags/libibnetdisc/src/internal.h +++ b/infiniband-diags/libibnetdisc/src/internal.h @@ -80,7 +80,6 @@ struct smp_engine { ibnd_smp_t *smp_queue_tail; void *user_data; cl_qmap_t smps_on_wire; - int num_smps_outstanding; int max_smps_on_wire; unsigned total_smps; }; diff --git a/infiniband-diags/libibnetdisc/src/query_smp.c b/infiniband-diags/libibnetdisc/src/query_smp.c index d38c2ef..7234844 100644 --- a/infiniband-diags/libibnetdisc/src/query_smp.c +++ b/infiniband-diags/libibnetdisc/src/query_smp.c @@ -100,7 +100,6 @@ static int process_smp_queue(smp_engine_t * engine) free(smp); return rc; } - engine->num_smps_outstanding++; cl_qmap_insert(&engine->smps_on_wire, (uint32_t) smp->rpc.trid, (cl_map_item_t *) smp); engine->total_smps++; @@ -171,7 +170,6 @@ static int process_one_recv(smp_engine_t * engine) return -1; } - engine->num_smps_outstanding--; rc = process_smp_queue(engine); if (rc) goto error; @@ -199,7 +197,6 @@ void smp_engine_init(smp_engine_t * engine, struct ibmad_port *ibmad_port, engine->ibmad_port = ibmad_port; engine->user_data = user_data; cl_qmap_init(&engine->smps_on_wire); - engine->num_smps_outstanding = 0; engine->max_smps_on_wire = max_smps_on_wire; } @@ -224,16 +221,13 @@ void smp_engine_destroy(smp_engine_t * engine) cl_qmap_remove_item(&engine->smps_on_wire, item); free(item); } - - engine->num_smps_outstanding = 0; } int process_mads(smp_engine_t * engine) { - int rc = 0; - while (engine->num_smps_outstanding > 0) - while (!cl_is_qmap_empty(&engine->smps_on_wire)) - if ((rc = process_one_recv(engine)) != 0) - return rc; + int rc; + while (!cl_is_qmap_empty(&engine->smps_on_wire)) + if ((rc = process_one_recv(engine)) != 0) + return rc; return 0; }