From 28e3c8b286009206ff10ab4f810484a3e83b82df Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Mon, 14 Sep 2020 16:34:36 +0200
Subject: [PATCH] mempool: remove physical address aliases

Remove the deprecated unioned fields physaddr and phys_addr
from the structures rte_mempool_objhdr and rte_mempool_memhdr.
They are replaced with the fields iova which are at the same offsets.

Remove the deprecated macro MEMPOOL_F_NO_PHYS_CONTIG
which is an alias of the more recent MEMPOOL_F_NO_IOVA_CONTIG.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
---
 doc/guides/rel_notes/release_20_11.rst |  6 ++++++
 lib/librte_mempool/rte_mempool.h       | 13 ++-----------
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 2e85844f87..cd0c99a926 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -91,6 +91,12 @@ API Changes
   the structures ``rte_memseg`` and ``rte_memzone``.
   The field ``iova`` is remaining from the old unions.
 
+* mempool: Removed the unioned fields ``phys_addr`` and ``physaddr`` from
+  the structures ``rte_mempool_memhdr`` and ``rte_mempool_objhdr``.
+  The field ``iova`` is remaining from the old unions.
+  The flag name ``MEMPOOL_F_NO_PHYS_CONTIG`` is removed,
+  while the aliased flag ``MEMPOOL_F_NO_IOVA_CONTIG`` is kept.
+
 * mbuf: Removed the unioned field ``refcnt_atomic`` from
   the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``.
   The field ``refcnt`` is remaining from the old unions.
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 6ad7e31170..9ea7ff934c 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -138,11 +138,7 @@ struct rte_mempool_objsz {
 struct rte_mempool_objhdr {
 	STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
 	struct rte_mempool *mp;          /**< The mempool owning the object. */
-	RTE_STD_C11
-	union {
-		rte_iova_t iova;         /**< IO address of the object. */
-		phys_addr_t physaddr;    /**< deprecated - Physical address of the object. */
-	};
+	rte_iova_t iova;                 /**< IO address of the object. */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 	uint64_t cookie;                 /**< Debug cookie. */
 #endif
@@ -188,11 +184,7 @@ struct rte_mempool_memhdr {
 	STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
 	struct rte_mempool *mp;  /**< The mempool owning the chunk */
 	void *addr;              /**< Virtual address of the chunk */
-	RTE_STD_C11
-	union {
-		rte_iova_t iova;       /**< IO address of the chunk */
-		phys_addr_t phys_addr; /**< Physical address of the chunk */
-	};
+	rte_iova_t iova;         /**< IO address of the chunk */
 	size_t len;              /**< length of the chunk */
 	rte_mempool_memchunk_free_cb_t *free_cb; /**< Free callback */
 	void *opaque;            /**< Argument passed to the free callback */
@@ -269,7 +261,6 @@ struct rte_mempool {
 #define MEMPOOL_F_SC_GET         0x0008 /**< Default get is "single-consumer".*/
 #define MEMPOOL_F_POOL_CREATED   0x0010 /**< Internal: pool is created. */
 #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */
-#define MEMPOOL_F_NO_PHYS_CONTIG MEMPOOL_F_NO_IOVA_CONTIG /* deprecated */
 
 /**
  * @internal When debug is enabled, store some statistics.
-- 
2.39.5