DPDK usage discussions
 help / color / mirror / Atom feed
From: fwefew 4t4tg <7532yahoo@gmail.com>
To: users@dpdk.org
Subject: mbuf memory layout
Date: Tue, 1 Feb 2022 13:16:13 -0500	[thread overview]
Message-ID: <CA+Tq66UcCXfy9GtkprhH17MCtet0_qud557QZ-MrFtWQ47-N1Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2379 bytes --]

I create a mempool thusly with 0 bytes private size and 1024 bytes data
room size:

rte_mempool *pool = rte_pktmbuf_pool_create("test", 1024, 0, 0, 1024, 0);

from which I allocate 1 mbuf.

which of the following three memory layouts best describes mbufs I allocate
from this
pool? I can't tell if it's the 2nd or 3rd one. I believe the first one is
wrong:


 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
 |                                |
 |                                |
 |                                |
 +--------------------------------+

[-- Attachment #2: Type: text/html, Size: 4155 bytes --]

             reply	other threads:[~2022-02-01 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 18:16 fwefew 4t4tg [this message]
2022-02-01 18:19 ` Fwd: " fwefew 4t4tg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+Tq66UcCXfy9GtkprhH17MCtet0_qud557QZ-MrFtWQ47-N1Q@mail.gmail.com \
    --to=7532yahoo@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).