[dpdk-dev] Packet Cloning

2015-05-29 Thread Padam Jeet Singh
Thanks Marc, Matt, Kyle, and Stephen for your inputs! I have a possibly good solution of splitting the mbuf into parts to correctly mirror to multiple interfaces, else a fallback of copying the full payload into a new mbuf. Though the library doesn?t offer a standard method to copy, I can

[dpdk-dev] Packet Cloning

2015-05-28 Thread Marc Sune
On 28/05/15 18:06, Matt Laswell wrote: > Hey Kyle, > > That's one way you can handle it, though I suspect you'll end up with some > complexity elsewhere in your code to deal with remembering whether you > should look at the original data or the copied and modified data. Another > way is just to

[dpdk-dev] Packet Cloning

2015-05-28 Thread Padam Jeet Singh
Hello, Is there a function in DPDK to completely clone a pkt_mbuf including the segments? I am trying to build a packet mirroring application which sends packet out through two separate interfaces, but the packet payload needs to be altered before send. Thanks, Padam

[dpdk-dev] Packet Cloning

2015-05-28 Thread Kyle Larose
I'm fairly new to dpdk, so I may be completely out to lunch on this, but here's an idea to possibly improve performance compared to a straight copy of the entire packet. If this idea makes sense, perhaps it could be added to the mbuf library as an extension of the clone functionality? If you are

[dpdk-dev] Packet Cloning

2015-05-28 Thread Matt Laswell
Hey Kyle, That's one way you can handle it, though I suspect you'll end up with some complexity elsewhere in your code to deal with remembering whether you should look at the original data or the copied and modified data. Another way is just to make a copy of the original mbuf, but have your

[dpdk-dev] Packet Cloning

2015-05-28 Thread Matt Laswell
Since Padam is going to be altering payload, he likely cannot use that API. The rte_pktmbuf_clone() API doesn't make a copy of the payload. Instead, it gives you a second mbuf whose payload pointer points back to the contents of the first (and also increments the reference counter on the first so

[dpdk-dev] Packet Cloning

2015-05-28 Thread Stephen Hemminger
On Thu, 28 May 2015 17:15:42 +0530 Padam Jeet Singh wrote: > Hello, > > Is there a function in DPDK to completely clone a pkt_mbuf including the > segments? > > I am trying to build a packet mirroring application which sends packet out > through two separate interfaces, but the packet