* [dpdk-users] Ring PMD - Should mbufs be copied instead of just being added to the ring?
@ 2016-07-18 15:25 Take Ceara
2016-07-18 16:41 ` Richardson, Bruce
0 siblings, 1 reply; 2+ messages in thread
From: Take Ceara @ 2016-07-18 15:25 UTC (permalink / raw)
To: users; +Cc: Bruce Richardson
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-users] Ring PMD - Should mbufs be copied instead of just being added to the ring?
2016-07-18 15:25 [dpdk-users] Ring PMD - Should mbufs be copied instead of just being added to the ring? Take Ceara
@ 2016-07-18 16:41 ` Richardson, Bruce
0 siblings, 0 replies; 2+ messages in thread
From: Richardson, Bruce @ 2016-07-18 16:41 UTC (permalink / raw)
To: Take Ceara, users
> -----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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-18 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18 15:25 [dpdk-users] Ring PMD - Should mbufs be copied instead of just being added to the ring? Take Ceara
2016-07-18 16:41 ` Richardson, Bruce
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).