diff mbox series

[v4,4/7] mbuf: add second dynamic field member

Message ID 06eb658ad97daaf7c7a5d4c4077ce6fb552aaf7f.1665170500.git.sthotton@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series mbuf dynamic field expansion | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Shijith Thotton Oct. 7, 2022, 7:30 p.m. UTC
If IOVA as PA is disabled during build, mbuf physical address field is
undefined. This space is used to add the second dynamic field.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 lib/mbuf/rte_mbuf_core.h | 6 +++++-
 lib/mbuf/rte_mbuf_dyn.c  | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
index 91c2211b44..dc6c54015e 100644
--- a/lib/mbuf/rte_mbuf_core.h
+++ b/lib/mbuf/rte_mbuf_core.h
@@ -478,7 +478,11 @@  struct rte_mbuf {
 	 */
 	rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t));
 #else
-	uint64_t dummy;
+	/**
+	 * Reserved for dynamic field in builds where physical address
+	 * field is undefined.
+	 */
+	uint64_t dynfield2;
 #endif
 
 	/* next 8 bytes are initialised on RX descriptor rearm */
diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c
index 4ae79383b5..35839e938c 100644
--- a/lib/mbuf/rte_mbuf_dyn.c
+++ b/lib/mbuf/rte_mbuf_dyn.c
@@ -128,6 +128,9 @@  init_shared_mem(void)
 		 */
 		memset(shm, 0, sizeof(*shm));
 		mark_free(dynfield1);
+#if !RTE_IOVA_AS_PA
+		mark_free(dynfield2);
+#endif
 
 		/* init free_flags */
 		for (mask = RTE_MBUF_F_FIRST_FREE; mask <= RTE_MBUF_F_LAST_FREE; mask <<= 1)