DPDK usage discussions
 help / color / mirror / Atom feed
From: "Richardson, Bruce" <bruce.richardson@intel.com>
To: Take Ceara <dumitru.ceara@gmail.com>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] Ring PMD - Should mbufs be copied instead of just being added to the ring?
Date: Mon, 18 Jul 2016 16:41:12 +0000	[thread overview]
Message-ID: <59AF69C657FD0841A61C55336867B5B035AA709F@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <CAKKV4w_wjqWV0wRRM9BCUOP+HLxnTo0M0F=hGpNSNkWMW_SPaQ@mail.gmail.com>



> -----Original Message-----
> From: Take Ceara [mailto:dumitru.ceara@gmail.com]
> Sent: Monday, July 18, 2016 4:26 PM
> To: users@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-users] Ring PMD - Should mbufs be copied instead of just
> being added to the ring?
> 
> Hi,
> 
> I noticed that the Ring PMD directly enqueues the mbufs transmitted with
> rte_eth_tx_burst (eth_ring_tx).
> 
> I understand that this is the fastest way however, in some cases, the
> receive side might rewrite part of the packet payload (e.g., change some
> of the L2-3 headers). If the sender is still using the original packet
> (e.g., having it cloned) the packet will be essentially corrupted.
> 
> I really like the fact that the Ring based interfaces are mostly
> transparent to the applications as they can just use the general
> rte_eth_tx_burst/rx_burst but in the rewriting case we need to handle
> sending (or receiving) in a special way and manually create an mbuf chain
> copy of the original.
> 
> Would it be an option to add a flag argument to rte_eth_from_rings to
> specify whether the Ring PMD driver should enqueue the original or
> actually send a copy of the original packet?
> 
> Thanks,
> Dumitru Ceara

Hi,

that's a good point. However, my thinking is that any copying should probably be controlled via the refcnt field of the mbuf. If an mbuf has a refcnt of 1, then no copy should be needed. For packets with a refcnt of 2, yes, a copy may be necessary.

/Bruce

      reply	other threads:[~2016-07-18 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 15:25 Take Ceara
2016-07-18 16:41 ` Richardson, Bruce [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=59AF69C657FD0841A61C55336867B5B035AA709F@IRSMSX103.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dumitru.ceara@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).