DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Wiles, Keith" <keith.wiles@intel.com>
Cc: Mike Shang <mshang5@gmail.com>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] manually construct mbuf
Date: Thu, 16 Mar 2017 09:09:23 -0700	[thread overview]
Message-ID: <20170316090923.31f26bfc@xeon-e3> (raw)
In-Reply-To: <1645CF06-8334-4E53-85DB-DE4D566B5D6E@intel.com>

On Thu, 16 Mar 2017 03:41:14 +0000
"Wiles, Keith" <keith.wiles@intel.com> wrote:

> > On Mar 16, 2017, at 11:28 AM, Mike Shang <mshang5@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.

Or teach your code how to use chained multi-segment mbuf's. That is the right way to handle larger data
without having to pin down large chunks of memory.

      reply	other threads:[~2017-03-16 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  3:28 Mike Shang
2017-03-16  3:41 ` Wiles, Keith
2017-03-16 16:09   ` Stephen Hemminger [this message]

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=20170316090923.31f26bfc@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=keith.wiles@intel.com \
    --cc=mshang5@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).