vtophys: add spdk_ prefix

vtophys() -> spdk_vtophys()
VTOPHYS_ERROR -> SPDK_VTOPHYS_ERROR

Change-Id: I68ab24fbb48f419ba1d41b78d7c9958cf666b800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-02-08 14:17:04 -07:00
parent 40c591eac8
commit 516c37562d
5 changed files with 14 additions and 14 deletions

View File

@ -40,9 +40,9 @@
extern "C" {
#endif
#define VTOPHYS_ERROR (0xFFFFFFFFFFFFFFFFULL)
#define SPDK_VTOPHYS_ERROR (0xFFFFFFFFFFFFFFFFULL)
uint64_t vtophys(void *buf);
uint64_t spdk_vtophys(void *buf);
#ifdef __cplusplus
}

View File

@ -52,7 +52,7 @@ ioat_zmalloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr)
/**
* Return the physical address for the specified virtual address.
*/
#define ioat_vtophys(buf) vtophys(buf)
#define ioat_vtophys(buf) spdk_vtophys(buf)
/**
* Delay us.

View File

@ -69,7 +69,7 @@ struct map_2mb {
};
/* Second-level map table indexed by bits [21..29] of the virtual address.
* Each entry contains the 2MB physical page frame number or VTOPHYS_ERROR for entries that haven't
* Each entry contains the 2MB physical page frame number or SPDK_VTOPHYS_ERROR for entries that haven't
* been retrieved yet.
*/
struct map_1gb {
@ -109,7 +109,7 @@ vtophys_get_map(uint64_t vfn_2mb)
if (!map_1gb) {
map_1gb = malloc(sizeof(struct map_1gb));
if (map_1gb) {
/* initialize all entries to all 0xFF (VTOPHYS_ERROR) */
/* initialize all entries to all 0xFF (SPDK_VTOPHYS_ERROR) */
memset(map_1gb, 0xFF, sizeof(struct map_1gb));
vtophys_map_128tb.map[idx_128tb] = map_1gb;
}
@ -157,7 +157,7 @@ vtophys_get_pfn_2mb(uint64_t vfn_2mb)
}
uint64_t
vtophys(void *buf)
spdk_vtophys(void *buf)
{
struct map_2mb *map_2mb;
uint64_t vfn_2mb, pfn_2mb;
@ -167,14 +167,14 @@ vtophys(void *buf)
map_2mb = vtophys_get_map(vfn_2mb);
if (!map_2mb) {
return VTOPHYS_ERROR;
return SPDK_VTOPHYS_ERROR;
}
pfn_2mb = map_2mb->pfn_2mb;
if (pfn_2mb == VTOPHYS_ERROR) {
if (pfn_2mb == SPDK_VTOPHYS_ERROR) {
pfn_2mb = vtophys_get_pfn_2mb(vfn_2mb);
if (pfn_2mb == VTOPHYS_ERROR) {
return VTOPHYS_ERROR;
if (pfn_2mb == SPDK_VTOPHYS_ERROR) {
return SPDK_VTOPHYS_ERROR;
}
map_2mb->pfn_2mb = pfn_2mb;
}

View File

@ -108,8 +108,8 @@ nvme_malloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr)
/**
* Return the physical address for the specified virtual address.
*/
#define nvme_vtophys(buf) vtophys(buf)
#define NVME_VTOPHYS_ERROR VTOPHYS_ERROR
#define nvme_vtophys(buf) spdk_vtophys(buf)
#define NVME_VTOPHYS_ERROR SPDK_VTOPHYS_ERROR
extern struct rte_mempool *request_mempool;

View File

@ -62,7 +62,7 @@ vtophys_negative_test(void)
if (p == NULL)
continue;
if (vtophys(p) != VTOPHYS_ERROR) {
if (spdk_vtophys(p) != SPDK_VTOPHYS_ERROR) {
rc = -1;
printf("Err: VA=%p is mapped to a huge_page,\n", p);
free(p);
@ -94,7 +94,7 @@ vtophys_positive_test(void)
if (p == NULL)
continue;
if (vtophys(p) == VTOPHYS_ERROR) {
if (spdk_vtophys(p) == SPDK_VTOPHYS_ERROR) {
rc = -1;
printf("Err: VA=%p is not mapped to a huge_page,\n", p);
rte_free(p);