[dpdk-dev] how does it count the number of contiguous physical pages in map_all_hugepages

Jack,Xie Jie jack.xie at dragonipt.com
Fri Jan 16 06:32:08 CET 2015


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


More information about the dev mailing list