DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Mike Playle <mplayle@solarflare.com>
Cc: <users@dpdk.org>
Subject: Re: [dpdk-users] Compatibly adding metadata to mbufs?
Date: Fri, 18 Nov 2016 09:43:49 -0800	[thread overview]
Message-ID: <20161118094349.29c0361c@samsung9> (raw)
In-Reply-To: <c657cfd4-57ef-3512-f906-165e254c9ed2@solarflare.com>

On Fri, 18 Nov 2016 16:46:29 +0000
Mike Playle <mplayle@solarflare.com> wrote:

> Hello,
> 
> I've recently started looking into DPDK.
> 
> We're interested in adding our own metadata to DPDK's mbuf structures
> by setting the 'priv_size' parameter to rte_pktmbuf_pool_create().  An
> example application which does this is Open vSwitch, and we would like
> to do something similar.
> 
> When initialising a PMD, rte_eth_rx_queue_setup() takes a pointer to a
> mempool which is used to allocate receive buffers; packets returned
> from rte_eth_rx_burst() will be stored in mbufs allocated from this
> pool. This means that we can easily alter their layout to add our own
> metadata region.
> 
> However it's not clear that this will work in all cases. For instance,
> the "rings-based" PMD doesn't appear to work like this.  Instead the
> sender's mbufs are passed directly to the receiver. This means that if
> we connect to Open vSwitch instead of a physical NIC, we will have no
> control over the layout of the mbufs we receive, and so we can't
> guarantee to be able to store our metadata.
> 
> Conversely, any mbufs that we send back to Open vSwitch will have to
> be allocated from its pool rather than ours, otherwise it will be
> unable to store its own metadata.
> 
> Do we have to copy the packet data to/from our own mbufs to ensure
> compatibility here? We'd like to avoid copies as far as possible.
> 
> Or am I misunderstanding something about how metadata works?
> 
> Regards,
> 
> Mike Playle
> Solarflare Communications

Don't overload mbuf with metadata. It guarantees that you won't
be able to stay current with upstream, and use distro packages.

Standard practice is to use the prepend area in the mbuf.
Look at FD.io project and some of the examples

      reply	other threads:[~2016-11-18 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 16:46 Mike Playle
2016-11-18 17:43 ` 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=20161118094349.29c0361c@samsung9 \
    --to=stephen@networkplumber.org \
    --cc=mplayle@solarflare.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).