From patchwork Fri Oct 16 11:53:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 54242 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GBqNWY001103 for ; Fri, 16 Oct 2009 11:52:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751720AbZJPLwB (ORCPT ); Fri, 16 Oct 2009 07:52:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753842AbZJPLwB (ORCPT ); Fri, 16 Oct 2009 07:52:01 -0400 Received: from mail-fx0-f218.google.com ([209.85.220.218]:39124 "EHLO mail-fx0-f218.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751720AbZJPLwA (ORCPT ); Fri, 16 Oct 2009 07:52:00 -0400 Received: by fxm18 with SMTP id 18so2300114fxm.37 for ; Fri, 16 Oct 2009 04:51:24 -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=dnM9ZXXYCKPAVpm7nL6aWgCLIsuH8p1oxLP/lYvfg4o=; b=qFnIekqEQ4w0chILPAXQD5o4J0Y4hH3UFvHXj5NQIeSKtbFUA7wi4uwZ5pEo87adqM X6cwKemBovS6ckrATXwjwlCJ/MGvWkbSqqEnxfsymcGd6azC3FxljLv2evOE9yGnbyfP oLwZyI+NsKJuyG0JQh8aTiioO63wgyaPAhfg4= 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=P67UEZXE/+vOy/1BOQ8NHBlw+KzCKud+dm4QCatFK+c5VOYnb3Jb1/PznndwPI7QYw Gsv4OipODwoYroGCtUwsOTd16jitoqmCQ79OCe3VFb60ANqmkr0PJ6GmrUw7L3qqvoCF Egpp6CVBNrIOVXu4i23+wJLGBB1sFHyZRRPV0= Received: by 10.103.50.22 with SMTP id c22mr574850muk.54.1255693884125; Fri, 16 Oct 2009 04:51:24 -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 u9sm2485863muf.1.2009.10.16.04.51.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Oct 2009 04:51:23 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 4237D12563; Fri, 16 Oct 2009 13:53:26 +0200 (IST) Date: Fri, 16 Oct 2009 13:53:26 +0200 From: Sasha Khapyorsky To: linux-rdma Cc: Dale Purdy , Hal Rosenstock Subject: [PATCH] opensm: fix LFT allocation size Message-ID: <20091016115326.GN20210@me> References: <20091016002810.GA16243@sgi.com> <20091016105811.GM20210@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091016105811.GM20210@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 diff --git a/opensm/opensm/osm_switch.c b/opensm/opensm/osm_switch.c index ed0bc66..67e3ede 100644 --- a/opensm/opensm/osm_switch.c +++ b/opensm/opensm/osm_switch.c @@ -497,8 +497,7 @@ static int alloc_lft(IN osm_switch_t * p_sw, uint16_t lids) uint16_t lft_size; /* Ensure LFT is in units of LFT block size */ - lft_size = (lids + IB_SMP_DATA_SIZE - 1) / IB_SMP_DATA_SIZE * IB_SMP_DATA_SIZE; - + lft_size = (lids / IB_SMP_DATA_SIZE + 1) * IB_SMP_DATA_SIZE; if (lft_size > p_sw->lft_size) { uint8_t *new_lft = realloc(p_sw->lft, lft_size); if (!new_lft)