From patchwork Tue Apr 13 16:38:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 92214 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 o3DGbu7N019541 for ; Tue, 13 Apr 2010 16:38:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752995Ab0DMQi1 (ORCPT ); Tue, 13 Apr 2010 12:38:27 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:33398 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518Ab0DMQi1 (ORCPT ); Tue, 13 Apr 2010 12:38:27 -0400 Received: by wwb34 with SMTP id 34so133416wwb.19 for ; Tue, 13 Apr 2010 09:38:25 -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=Mzz4g+jQtPO3I9BZ7XrqRkCQyAvS5H9n+v6+s+1uYkE=; b=eLnMkCZz4KqyLse15kI2Xu3oKeWG4sP4x1GMTugZ45fKmHWMzPn1iegw7d7dMvOGdf SAfRPqhHViUC5g9aLg2FryUkE95dVMjIPEOTjYK9Ex4960w56oUiTxrRHS/If28twD6J GPNkSYoGATS5qDU3mYbS0WTy/hJ572wdCMMuc= 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=k5SBoKs9udT9GqGtLnLQS5p39PmOIOPAHsBUfGu74K55szG7IqmbctIjZKfxGl2AsN CEoFHina5rEIev9dxYotYMisgCw5pRzW9NHKwj6W8dEDx4zfVzmObeCsLJs/awnq0Tib aOulT0x+l01wBVGHvGFeqBaY4yYT2kgMmj2OQ= Received: by 10.216.88.21 with SMTP id z21mr3597008wee.162.1271176705564; Tue, 13 Apr 2010 09:38:25 -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 r29sm1871438wbv.21.2010.04.13.09.38.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Apr 2010 09:38:24 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 042D111F31; Tue, 13 Apr 2010 19:38:37 +0300 (IDT) Date: Tue, 13 Apr 2010 19:38:36 +0300 From: Sasha Khapyorsky To: Ira Weiny Cc: "linux-rdma@vger.kernel.org" , Hal Rosenstock Subject: [PATCH] libibnetdisc: fix outstanding SMPs countung Message-ID: <20100413163836.GM10830@me> References: <20100218124933.c018a23d.weiny2@llnl.gov> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100218124933.c018a23d.weiny2@llnl.gov> 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 16:38:31 +0000 (UTC) diff --git a/infiniband-diags/libibnetdisc/src/query_smp.c b/infiniband-diags/libibnetdisc/src/query_smp.c index b4322bc..08e3ef7 100644 --- a/infiniband-diags/libibnetdisc/src/query_smp.c +++ b/infiniband-diags/libibnetdisc/src/query_smp.c @@ -96,10 +96,12 @@ static int process_smp_queue(smp_engine_t * engine) if (!smp) return 0; - cl_qmap_insert(&engine->smps_on_wire, (uint32_t) smp->rpc.trid, - (cl_map_item_t *) smp); if ((rc = send_smp(smp, engine->ibmad_port)) != 0) 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++; } return 0; } @@ -133,8 +135,6 @@ 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); }