[dpdk-users] Compatibly adding metadata to mbufs?

Mike Playle mplayle at solarflare.com
Fri Nov 18 17:46:29 CET 2016


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?


Mike Playle
Solarflare Communications

More information about the users mailing list