diff --git a/include/spdk/vtophys.h b/include/spdk/vtophys.h index 4d6d57e5c..ebd8acf57 100644 --- a/include/spdk/vtophys.h +++ b/include/spdk/vtophys.h @@ -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 } diff --git a/lib/ioat/ioat_impl.h b/lib/ioat/ioat_impl.h index 084613c31..dea8c3f67 100644 --- a/lib/ioat/ioat_impl.h +++ b/lib/ioat/ioat_impl.h @@ -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. diff --git a/lib/memory/vtophys.c b/lib/memory/vtophys.c index 40972f7ce..5abab3c9b 100644 --- a/lib/memory/vtophys.c +++ b/lib/memory/vtophys.c @@ -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; } diff --git a/lib/nvme/nvme_impl.h b/lib/nvme/nvme_impl.h index 001b84d60..427de04b6 100644 --- a/lib/nvme/nvme_impl.h +++ b/lib/nvme/nvme_impl.h @@ -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; diff --git a/test/lib/memory/vtophys.c b/test/lib/memory/vtophys.c index 4ad509a0a..ed2890c01 100644 --- a/test/lib/memory/vtophys.c +++ b/test/lib/memory/vtophys.c @@ -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);