From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH RFC 06/11] mbuf: replace data pointer by an offset Date: Mon, 12 May 2014 10:13:16 -0700 Message-ID: <20140512101316.0c0d2824@nehalam.linuxnetplumber.net> References: <1399647038-15095-1-git-send-email-olivier.matz@6wind.com> <1399647038-15095-7-git-send-email-olivier.matz@6wind.com> <3144526.CGFdr4BbI8@xps13> <1FD9B82B8BF2CF418D9A1000154491D9740A92B8@ORSMSX102.amr.corp.intel.com> <20140512144108.GB21298@hmsreliant.think-freely.org> <5370E397.7000706@6wind.com> <20140512085924.20a29cad@nehalam.linuxnetplumber.net> <5370F326.8070206@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev-VfR2kkLFssw@public.gmane.org" To: Olivier MATZ Return-path: In-Reply-To: <5370F326.8070206-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Mon, 12 May 2014 18:13:26 +0200 Olivier MATZ wrote: > Hi Stephen, > > On 05/12/2014 05:59 PM, Stephen Hemminger wrote: > > There is one case which this case might make problematic. > > Right now it is possible to clone an mbuf and in the cloned mbuf > > use the associated data buffer as private meta data store. > > This is convenient (like skb->cb in Linux) and avoids addtional > > allocation. > > I don't get your point. Why using rte_pktmbuf_mtod(m, char *) > wouldn't work in your case? In cloned mbuf rte_pktmbuf_mtod(m, char *) points to the original data. RTE_MBUF_TO_BADDR(m) points to buffer in the mbuf which we use for metadata (timestamp).