Commit 516c3756 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

vtophys: add spdk_ prefix



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

Change-Id: I68ab24fbb48f419ba1d41b78d7c9958cf666b800
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 40c591ea
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
}
+1 −1
Original line number Diff line number Diff line
@@ -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.
+7 −7
Original line number Diff line number Diff line
@@ -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;
	}
+2 −2
Original line number Diff line number Diff line
@@ -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;

+2 −2
Original line number Diff line number Diff line
@@ -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);