On 08-Jun-18 12:54 AM, Dan Gora wrote:
Add an inline accessor function to return the starting address of
the private data area in the supplied mbuf.
If the user did not allocate space for a private data area in the
mbuf's memory pool, then return NULL.
This allows applications to easily access the private data area
between the struct rte_mbuf and the data buffer in the specified mbuf
without creating private macros or accessor functions.
Signed-off-by: Dan Gora <d...@adax.com>
---
<...>
+static inline void *
+rte_mbuf_to_priv(struct rte_mbuf *md)
+{
+ if (md->priv_size == 0)
+ return NULL;
+
+ return RTE_PTR_ADD(md, sizeof(struct rte_mbuf));
+}
Hi Dan,
New API's should be marked as __rte_experimental for at least one release.
+
/**
* Returns TRUE if given mbuf is cloned by mbuf indirection, or FALSE
* otherwise.
--
Thanks,
Anatoly