mem: get physical address of any pointer
authorDamien Millescamps <damien.millescamps@6wind.com>
Wed, 12 Jun 2013 05:50:20 +0000 (07:50 +0200)
committerDavid Marchand <david.marchand@6wind.com>
Wed, 26 Feb 2014 10:07:27 +0000 (11:07 +0100)
commit57c24af85d9eaa81549a212169605b4e2468a29f
treee0ebdef47f93dbac64b094541ba177f17532532d
parent3314648f83c3dc06d7d9af8ea866277cc6296604
mem: get physical address of any pointer

Extract rte_mem_virt2phy() from get_physaddr().

rte_mem_virt2phy() permits to obtain the physical address of any
virtual address mapped to the current process calling this function.
Note that this function is very slow and shouldn't be called
after initialization to avoid a performance bottleneck.

The memory must be locked with mlock(). The function rte_mem_lock_page()
is a mlock() helper that lock the whole page.

A better name would be rte_mem_virt2phys but rte_mem_virt2phy is more
consistent with rte_mempool_virt2phy.

Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/linuxapp/eal/eal_memory.c