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 submit a 
rte_mbuf_copy() patch that does a full deep copy.

Regards,
Padam


> On 28-May-2015, at 9:43 pm, Marc Sune <marc.sune at bisdn.de> wrote:
> 
> 
> 
> 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 make a copy of the original mbuf, but have your copy API
>> stop after it reaches some particular point.  Perhaps just the L2-L4
>> headers, perhaps a few hundred bytes into payload, or perhaps something
>> else entirely. This all gets very application dependent, of course.  How
>> much is "enough" is going to depend heavily on what you're trying to
>> accomplish.
> 
> mbufs can be chained in multiple segments. So you could first split into two 
> segments leaving the big chunk in the original mbuf (chunk2) and copy chunk1 
> into the new mbuf (check prepend, adj and trim).
> 
> Marc
> 
> [1] http://dpdk.org/doc/api/rte__mbuf_8h.html
> 
>> 
> 

Padam J. Singh | VP Engg. | Inventum Technologies Private Limited
www.inventum.net <http://www.inventum.net/>
+91.9810146640

Address:
C-70, Phase II Extension,
Noida 201305, UP,
India

Tel     : +91.120.4647000

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system manager. This 
message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and delete 
this e-mail from your system. If you are not the intended recipient you are 
notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited. No 
employee or agent is authorized to conclude any binding agreement on behalf of 
[Inventum Technologies Private Limited] with another party by email without 
express written confirmation by a whole-time Director of the Company who has 
been authorized vide a valid board resolution to the effect. Our company 
accepts no liability for the content of this email, or for the consequences of 
any actions taken on the basis of the information provided, unless that 
information is subsequently confirmed in writing. If you are not the intended 
recipient you are notified that disclosing, copying, distributing or taking any 
action in reliance on the contents of this information is strictly prohibited. 
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Employees of [Inventum 
Technologies Private Limited] are expressly required not to make defamatory 
statements and not to infringe or authorize any infringement of copyright or 
any other legal right by email communications. Any such communication is 
contrary to company policy and outside the scope of the employment of the 
individual concerned. The company will not accept any liability in respect of 
such communication, and the employee responsible will be personally liable for 
any damages or other liability arising.

Reply via email to