From 9a9f7f8d3a198bdb000dfb9472f1efac4b6f1010 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 25 Apr 2014 13:59:48 +0200 Subject: [PATCH] mem: get dummy physical address in case of --no-huge with bsd The bsdapp part was missing in commit 57c24af85d9eaa81549a212169605b4e2468a29f. This commit adds a dummy rte_mem_virt2phy() to fix the compilation of DPDK under BSD. This function is only used when the debug option "--no-huge" is given, to get the physical address of mempools in memory. As a result, it seems acceptable for now to implement a dummy function to fix the compilation as the usual case (using contigmem module) works properly. Signed-off-by: Olivier Matz Acked-by: Neil Horman --- lib/librte_eal/bsdapp/eal/eal_memory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c index 7d2d269e9a..65aabf2f23 100644 --- a/lib/librte_eal/bsdapp/eal/eal_memory.c +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c @@ -47,6 +47,18 @@ #define PAGE_SIZE (sysconf(_SC_PAGESIZE)) +/* + * Get physical address of any mapped virtual address in the current process. + */ +phys_addr_t +rte_mem_virt2phy(const void *virtaddr) +{ + /* XXX not implemented. This function is only used by + * rte_mempool_virt2phy() when hugepages are disabled. */ + (void)virtaddr; + return RTE_BAD_PHYS_ADDR; +} + static int rte_eal_contigmem_init(void) { -- 2.20.1