<div dir="ltr">Darn it - typo: the pointer to the start of the data room in a mbuf was incorrectly described earlier.<br>I should have written: rte_pktmbuf_mtod(mbuf, ....); // provide a pointer to the start of the data room.<br><br><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">From: <strong class="gmail_sendername" dir="auto">fwefew 4t4tg</strong> <span dir="auto"><<a href="mailto:7532yahoo@gmail.com">7532yahoo@gmail.com</a>></span><br>Date: Tue, Feb 1, 2022 at 1:16 PM<br>Subject: mbuf memory layout<br>To: <<a href="mailto:users@dpdk.org">users@dpdk.org</a>><br></div><br><br><div dir="ltr">I create a mempool thusly with 0 bytes private size and 1024 bytes data room size:<br><br>rte_mempool *pool = rte_pktmbuf_pool_create("test", 1024, 0, 0, 1024, 0);<br><br>from which I allocate 1 mbuf.<div><br>which of the following three memory layouts best describes mbufs I allocate from this <br>pool? I can't tell if it's the 2nd or 3rd one. I believe the first one is wrong:<br><br><pre style="margin-top:0px;margin-bottom:0px;padding:0px;overflow:hidden;line-height:1.2em;color:rgb(0,0,0)">
mbuf - RTE_PKTMBUF_HEADROOM not in data room
+--------------------------------+
|+------------------------------+|
||struct rte_mbuf ||
|+------------------------------+|
||RTE_PKTMBUF_HEADROOM bytes ||
|+------------------------------+| Data room starts here which will hold
||1024 bytes of data room size || L2/3/4 headers and actual payload. A
|+------------------------------+| pointer to the start of this field is
| . | given by rte_pktmbuf(mbuf, ...)
| . |
| . |
+--------------------------------+
mbuf - RTE_PKTMBUF_HEADROOM adds to data room size:
+--------------------------------+
|+------------------------------+|
||struct rte_mbuf ||
|+------------------------------+|Data room starts here which will hold
||1024 bytes + RTE_PKTMBUF_HEAD\||L2/3/4 headers and actual payload. A
||ROOM bytes ||pointer to the start of this field is
|| ||given by rte_pktmbuf(mbuf, ...)
|| ||
|+------------------------------+|
| . |
| . |
| . |
+--------------------------------+
mbuf - RTE_PKTMBUF_HEADROOM included in data room size
+--------------------------------+
|+------------------------------+|
||struct rte_mbuf ||
|+------------------------------+|Data room starts here which will hold
||1024 bytes of data room size ||L2/3/4 headers and actual payload. Since
|| ||data room size was >= RTE_PKTMBUF_HEADROOM
|| ||size the data room size of 1024 was valid
|+------------------------------+|and that's all that is reserved for the
| |data room
| |
| |
| |
+--------------------------------+ </pre><br><br></div></div>
</div></div>