From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <olivier.matz@6wind.com>
Received: from mail-we0-f181.google.com (mail-we0-f181.google.com
 [74.125.82.181]) by dpdk.org (Postfix) with ESMTP id D132FAFE0
 for <dev@dpdk.org>; Fri, 25 Apr 2014 14:00:19 +0200 (CEST)
Received: by mail-we0-f181.google.com with SMTP id q58so3536929wes.12
 for <dev@dpdk.org>; Fri, 25 Apr 2014 05:00:22 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=t277/Lvl7Yq7YvtwI4zOhKeRpS9SKiei30jXTkVZuPg=;
 b=MR2RP7Iq+VCA0F+cQwM/klYF03DRtiiY8o1D870CGZL4MqKm+obyWOEBrUJD0VBpxr
 mVKtqA4BIJnDf/hVVBDecnwCq+8ar0hUocygkSZz2aVyOgDkLDNDYhl7i5lkbsTH2xcS
 TaW0jw7qN2uTm+VboYAqfCIHUtbWPisa49O5aT1rZqR16Q6wlNL/pem3If6+CfZjiypV
 V6AE9U2KtgjD3TxXTxwDX+GR+emcANXVQaOsFmMYxRCKkH0mdj473AfGfUFg1oMd1S/l
 p1Ld71KHoAhIdihWuYwPZKSTMOGRf488rmJwngXL6C5j2cNqCd3oEvb7r27OSpa+AWoF
 hlJw==
X-Gm-Message-State: ALoCoQmegTvnUzqPLMqEFdKfx1T3+/egAllJr4yLo9Fpg0Foavc/rKOd9Ct2vJQb7JSSwyotddA9
X-Received: by 10.181.13.137 with SMTP id ey9mr3434114wid.54.1398427222697;
 Fri, 25 Apr 2014 05:00:22 -0700 (PDT)
Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237])
 by mx.google.com with ESMTPSA id q2sm5487386wix.5.2014.04.25.05.00.21
 for <multiple recipients>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Fri, 25 Apr 2014 05:00:21 -0700 (PDT)
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Date: Fri, 25 Apr 2014 13:59:48 +0200
Message-Id: <1398427188-14914-11-git-send-email-olivier.matz@6wind.com>
X-Mailer: git-send-email 1.9.2
In-Reply-To: <1398427188-14914-1-git-send-email-olivier.matz@6wind.com>
References: <1398427188-14914-1-git-send-email-olivier.matz@6wind.com>
Subject: [dpdk-dev] [PATCH 10/10] bsd/mem: get physical address of any
	pointer
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Apr 2014 12:00:20 -0000

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 <olivier.matz@6wind.com>
---
 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 7d2d269..65aabf2 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)
 {
-- 
1.9.2