From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp121.ord1c.emailsrvr.com (smtp121.ord1c.emailsrvr.com [108.166.43.121]) by dpdk.org (Postfix) with ESMTP id C536758E4 for ; Fri, 29 May 2015 10:34:12 +0200 (CEST) Received: from smtp16.relay.ord1c.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp16.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 10AEC1803C0; Fri, 29 May 2015 04:34:12 -0400 (EDT) Received: by smtp16.relay.ord1c.emailsrvr.com (Authenticated sender: padam.singh-AT-inventum.net) with ESMTPSA id 5594A1803C5; Fri, 29 May 2015 04:34:10 -0400 (EDT) X-Sender-Id: padam.singh@inventum.net Received: from [172.16.1.66] ([UNAVAILABLE]. [103.25.205.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:25 (trex/5.4.2); Fri, 29 May 2015 08:34:12 GMT Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) From: Padam Jeet Singh In-Reply-To: <55673EB7.8020209@bisdn.de> Date: Fri, 29 May 2015 14:04:07 +0530 Message-Id: <337A89E6-D3A5-48C3-B695-E8D4652A0881@inventum.net> References: <57F6A61F-5629-4D11-A78C-397DBB4E8381@inventum.net> <20150528075244.469b8557@urahara> <55673EB7.8020209@bisdn.de> To: Marc Sune X-Mailer: Apple Mail (2.2070.6) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Packet Cloning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 08:34:13 -0000 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=E2=80=99t 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 wrote: >=20 >=20 >=20 > On 28/05/15 18:06, Matt Laswell wrote: >> Hey Kyle, >>=20 >> 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. >=20 > 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). >=20 > Marc >=20 > [1] http://dpdk.org/doc/api/rte__mbuf_8h.html >=20 >>=20 >=20 Padam J. Singh | VP Engg. | Inventum Technologies Private Limited www.inventum.net +91.9810146640 =20 Address: C-70, Phase II Extension, Noida 201305, UP, India =20 Tel : +91.120.4647000 =20 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.