DPDK usage discussions
 help / color / mirror / Atom feed
* dynamic and variable mbuf size
@ 2024-03-15  7:47 Jakob Wieckowski
  2024-03-15  9:38 ` Dmitry Kozlyuk
  0 siblings, 1 reply; 2+ messages in thread
From: Jakob Wieckowski @ 2024-03-15  7:47 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/html, Size: 825 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dynamic and variable mbuf size
  2024-03-15  7:47 dynamic and variable mbuf size Jakob Wieckowski
@ 2024-03-15  9:38 ` Dmitry Kozlyuk
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Kozlyuk @ 2024-03-15  9:38 UTC (permalink / raw)
  To: Jakob Wieckowski; +Cc: users

2024-03-15 08:47 (UTC+0100), Jakob Wieckowski:
> Hello DPDK Users,
> 
> I have a question regarding the size of mbufs.
> The mbuf are contained in the mempol and the mempool is a fixed size object.
> 
> Could the mbuf be implemented dynamically with a variable size in the
> mempool area ?
> 
> In the header of the mbuf you could specify the size of the payload data
> and thus could expand the size of the mbufs.
> 
> From my understanding, you just have to keep an eye on the mempool memory
> size so that it doesn't go beyond the limit of the allocated area.
> 
> Would this be generally possible?

Hi,

If mbufs could be allocated of any size,
mempool would be a general-purpose allocator,
but there is a tradeoff between generality and performance,
and rte_mempool pursuits the latter.
The size of an mbuf data may only be adjusted,
but only up to the size specified at mempool creation.

There are solutions for some use cases:
- using multiple mempools for objects of different size
  - some NICs can split packets allocating segments from different mempools
  - mbufs can be chained
- rte_pktmbuf_attach_extbuf() + custom allocator
- "memarea" proposed library [1] (looks very similar to what you describe)

What is you usage scenario?

[1]: http://inbox.dpdk.org/dev/20230720092254.54157-1-fengchengwen@huawei.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-15  9:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15  7:47 dynamic and variable mbuf size Jakob Wieckowski
2024-03-15  9:38 ` Dmitry Kozlyuk

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).