From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4523D5A80 for ; Fri, 16 Jan 2015 12:01:14 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 16 Jan 2015 03:01:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,410,1418112000"; d="scan'208";a="638278704" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.34]) by orsmga001.jf.intel.com with SMTP; 16 Jan 2015 03:01:07 -0800 Received: by (sSMTP sendmail emulation); Fri, 16 Jan 2015 11:01:06 +0025 Date: Fri, 16 Jan 2015 11:01:06 +0000 From: Bruce Richardson To: "Jack,Xie Jie" Message-ID: <20150116110105.GC10516@bricha3-MOBL3> References: <25CC404E73236E4FB06CE423D5EE8B229B4F34@AZ10EXMBX22.hosting.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25CC404E73236E4FB06CE423D5EE8B229B4F34@AZ10EXMBX22.hosting.local> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] how does it count the number of contiguous physical pages in map_all_hugepages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2015 11:01:15 -0000 On Fri, Jan 16, 2015 at 05:32:08AM +0000, Jack,Xie Jie wrote: > Hi, > > I am learning DPDK recently, when I check l2fwd example, I am a little confused, please someone give me a clue. > > In function map_all_hugepages called in rte_eal_hugepage_init, > There are lines of source code like below to count the number of contiguous physical pages, > But I check the source code, I just cannot find where is hugepg_tbl[j].physaddr be set before, > how can here check the value of hugepg_tbl[j].physaddr. > > /* reserve a virtual area for next contiguous > * physical block: count the number of > * contiguous physical pages. */ > for (j = i+1; j < hpi->num_pages[0] ; j++) { > if (hugepg_tbl[j].physaddr != > hugepg_tbl[j-1].physaddr + hugepage_sz) > break; > } > > > Thanks ! > Jack See function "find_physaddrs" in "eal_memory.c". Regards, /Bruce