[PATCH v4 4/7] mbuf: add second dynamic field member
Shijith Thotton
sthotton at marvell.com
Fri Oct 7 21:30:26 CEST 2022
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 at marvell.com>
---
lib/mbuf/rte_mbuf_core.h | 6 +++++-
lib/mbuf/rte_mbuf_dyn.c | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
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)
--
2.25.1
More information about the dev
mailing list