[dpdk-users] manually construct mbuf

Wiles, Keith keith.wiles at intel.com
Thu Mar 16 04:41:14 CET 2017

> On Mar 16, 2017, at 11:28 AM, Mike Shang <mshang5 at gmail.com> wrote:
> Is it possible to construct mbuf manually instead getting one from
> mempool ? I've got a situation that needs to handle a relatively small
> number of jumbo frames, we keep a mempool of objects of regular size and
> wanted to construct mbuf ourselves for jumbo frames as one segment using
> rte_malloc. I have searched the dpdk source code a bit but can't find such
> use case. Is it doable with dpdk ? Or it's recommended to keep a separate
> mempool for objects of larger size ?

You could try to construct your own mbuf, but when the system attempts to free the mbuf you would need to build a lot more then just the mbuf as the mempool pointer is hiding in the data/mbuf and it expects to point to a valid mempool.

What I would do is just allocate a couple jumbo mbuf in a new mempool allocation and use those mbufs when you want to send jumbo frames. Trying to create a special mbuf is not going to super simple, just create a new mempool with N number of mbufs.

> Thanks,
> Mike


More information about the users mailing list